Hi,
i have a strange issue when i switch my camera to ortho mode (per GUI Editor)
the skybox "looses" textures (some sides are just black, which is my clearColor in beginScene())
http://benjaminhampe.be.ohost.de/Irrlic ... ox_test.7z
here the bottom tex is lost after pressing Ortho On/Off twice
- Can that be related to Near And Far Value of Camera, which are used by SkyBox to render, and maybe corrupted by Ortho-Mode?
[BUG] Skybox looses textures in ortho-mode
[BUG] Skybox looses textures in ortho-mode
Last edited by gerdb on Tue Jul 24, 2012 9:24 pm, edited 1 time in total.
-
- Admin
- Posts: 14143
- Joined: Wed Apr 19, 2006 9:20 pm
- Location: Oldenburg(Oldb), Germany
- Contact:
Re: [BUG] Skybox looses textures in ortho-mode
Yeah, near and far value could be a problem. The ortho cam is only seldomly used, so it's not well tested. I hope to have time for some test cases after 1.8 is out.
The GUI problem seems unrelated and thus should be moved to a different topic.
The GUI problem seems unrelated and thus should be moved to a different topic.
Re: [BUG] Skybox looses textures in ortho-mode
Hi,
I disabled the whole if else code in CSkyboxSceneNode::render(), leaving only the normal way to render the skybox, it works!
may i add that to my previous Skybox Patch?
i'll move my 2nd issue to a new topic
thx
I disabled the whole if else code in CSkyboxSceneNode::render(), leaving only the normal way to render the skybox, it works!
may i add that to my previous Skybox Patch?
Code: Select all
//! renders the node.
void CSkyBoxSceneNode::render()
{
video::IVideoDriver* driver = SceneManager->getVideoDriver();
scene::ICameraSceneNode* camera = SceneManager->getActiveCamera();
if (!camera || !driver)
return;
// if ( !camera->isOrthogonal() )
// {
// draw perspective skybox
core::matrix4 translate(AbsoluteTransformation);
translate.setTranslation(camera->getAbsolutePosition());
// Draw the sky box between the near and far clip plane
const f32 viewDistance = (camera->getNearValue() + camera->getFarValue()) * 0.5f;
core::matrix4 scale;
scale.setScale(core::vector3df(viewDistance, viewDistance, viewDistance));
driver->setTransform(video::ETS_WORLD, translate * scale);
for (s32 i=0; i<6; ++i)
{
driver->setMaterial(Material[i]);
driver->drawIndexedTriangleFan(&Vertices[i*4], 4, Indices, 2);
}
// }
// else
// {
// // draw orthogonal skybox,
// // simply choose one texture and draw it as 2d picture.
// // there could be better ways to do this, but currently I think this is ok.
//
// core::vector3df lookVect = camera->getTarget() - camera->getAbsolutePosition();
// lookVect.normalize();
// core::vector3df absVect( core::abs_(lookVect.X),
// core::abs_(lookVect.Y),
// core::abs_(lookVect.Z));
//
// int idx = 0;
//
// if ( absVect.X >= absVect.Y && absVect.X >= absVect.Z )
// {
// // x direction
// idx = lookVect.X > 0 ? 0 : 2;
// }
// else
// if ( absVect.Y >= absVect.X && absVect.Y >= absVect.Z )
// {
// // y direction
// idx = lookVect.Y > 0 ? 4 : 5;
// }
// else
// if ( absVect.Z >= absVect.X && absVect.Z >= absVect.Y )
// {
// // z direction
// idx = lookVect.Z > 0 ? 1 : 3;
// }
//
// video::ITexture* tex = Material[idx].getTexture(0);
//
// if ( tex )
// {
// core::rect<s32> rctDest(core::position2d<s32>(-1,0),
// core::dimension2di(driver->getCurrentRenderTargetSize()));
// core::rect<s32> rctSrc(core::position2d<s32>(0,0),
// core::dimension2di(tex->getSize()));
//
// driver->draw2DImage(tex, rctDest, rctSrc);
// }
// }
}
thx
Re: [BUG] Skybox looses textures in ortho-mode
Please do separate patches for separate issues.