Hi,

I want to display a scene with a SkyBackground and some materials in the 
scene should reflect the Sky.
I´ve created a cubemap consisting of 6 faces and I create a 
CubeTextureChunk out of it:

inegz->read("textures/skybox/skybox_south.png");
iposz->read("textures/skybox/skybox_north.png");
inegy->read("textures/skybox/skybox_down.png");
iposy->read("textures/skybox/skybox_up.png");
inegx->read("textures/skybox/skybox_west.png");
iposx->read("textures/skybox/skybox_east.png");

cubeTexture = CubeTextureChunk::create();
beginEditCP(cubeTexture);
cubeTexture->setImage( inegz );
cubeTexture->setPosZImage( iposz );
cubeTexture->setPosYImage( iposy );
cubeTexture->setNegYImage( inegy );
cubeTexture->setPosXImage( iposx );
cubeTexture->setNegXImage( inegx );
endEditCP(cubeTexture);

Then I create a SkyBackground:

SkyBackgroundPtr skyBackground = SkyBackground::create();
beginEditCP(skyBackground);
skyBackground->setFrontTexture(HelperFunctions::CreateTexture(cubeTexture->getImage()));
skyBackground->setBackTexture(HelperFunctions::CreateTexture(cubeTexture->getPosZImage()));
skyBackground->setLeftTexture(HelperFunctions::CreateTexture(cubeTexture->getPosXImage()));
skyBackground->setRightTexture(HelperFunctions::CreateTexture(cubeTexture->getNegXImage()));
skyBackground->setTopTexture(HelperFunctions::CreateTexture(cubeTexture->getPosYImage()));
skyBackground->setBottomTexture(HelperFunctions::CreateTexture(cubeTexture->getNegYImage()));
endEditCP(skyBackground);

I also use the CubeTextureChunk inside a glsl shader as a samplerCube. 
The problem is, when I have a correct SkyBackground the "reflected" sky 
on scene objects which is computed in a pixel shader is not correct: the 
side faces of the reflected cube (PosX, NegX, PosZ, NegZ) are standing 
upside down.

When I edit the cube map images so it is right in the shader the problem 
is the same on the SkyBackground.

My question is: are there any differences in handling the faces of a 
cube texture in a SkyBackground and in a CubeTextureChunk, GLSL shader??

Thanks!

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users

Reply via email to