Sign in to follow this  
SteveDeFacto

Cubemap upside down.

Recommended Posts

SteveDeFacto    109
[attachment=2607:Untitled.jpg]

Not sure if you can tell form the image but the horizontal faces of my cube map are upside down. However, the up and down faces are correct. How can I fix this without flipping the image files upside down?

Share this post


Link to post
Share on other sites
bluntman    255
Not sure that you can. Image files are generally stored with the origin at the top left of the image, where as OpenGL treats the origin as the bottom left of the image.

Share this post


Link to post
Share on other sites
V-man    813
There is 2 ways. Fix the image or fix your texcoords.
The cubemaps in GL follow the Direct3D convention of left-handed. This means that the +z and -z faces are switched. I'm not sure if that is your problem.

Share this post


Link to post
Share on other sites
SteveDeFacto    109
[quote name='V-man' timestamp='1307113578' post='4819076']
There is 2 ways. Fix the image or fix your texcoords.
The cubemaps in GL follow the Direct3D convention of left-handed. This means that the +z and -z faces are switched. I'm not sure if that is your problem.
[/quote]

GL cube mapping is not the same as DirectX and I should know since I am converting my rendering pipeline from directx to opengl.

Share this post


Link to post
Share on other sites
SteveDeFacto    109
[quote name='mhagain' timestamp='1307115066' post='4819089']
TGAs? Check byte 17 of the header, if bit 0x20 is set you need to flip it when loading.
[/quote]

No, PNG but if I flip all images the top and bottom won't line up with the sides.

Share this post


Link to post
Share on other sites
dpadam450    2357
[quote][color="#1C2837"][size="2"]GL cube mapping is not the same as DirectX and I should know since I am converting my rendering pipeline from directx to opengl. [/quote][/size][/color]
[color="#1C2837"][size="2"]Huh? The coordinates for cube mapping are DX style as V-Man said so I don't know what you mean in your above statement by not being the same. Did you try loading them into opposite coordinates? Pretty sure this is your issue.[/size][/color]

Share this post


Link to post
Share on other sites
Yours3!f    1532
first I'd suggest playing around with the image files flipping them etc., if you get them right then you can write down which was flipped and set the texcoords accordingly. For me I think I had to flip all of them upside down, but I didn't bother dealing with the texcoords...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this