PDA

View Full Version : cubemaps upside down?



eirikhm
09-03-2003, 01:48 AM
I've just implemented cubemapping in my engine, and everything seems to work fine except that the maps are flipped verticaly. I've checked that the loading is working as it should, I bind the right stuff and so on. Anyone got a tip on this?

M/\dm/\n
09-03-2003, 02:26 AM
JPG?

eirikhm
09-03-2003, 02:33 AM
nay. tga. the loader is working fine, been using it for six months.

Nutty
09-03-2003, 02:50 AM
Does your TGA loader actually flip the image when required, or all the time?

Most programs save TGA's flipped, but ACDSee sometimes does it the other way.

Are you calculating the cubemap coords in a vertex program, or letting texgen do it?

eirikhm
09-03-2003, 02:53 AM
texgen is calculating (using refmap-ext)

the loader loads and sets all TGA images the right way. when i bind a texture to a quad it shows like it should, and the texture loading method is the same that I use when I load the cubemap files.

GPSnoopy
09-03-2003, 03:09 AM
Cube maps orientation is very weird, it's based on Renderman standard.

NVIDIA has some info on this in the SDK. But I dunno where exactly.

Humus
09-03-2003, 04:12 AM
Cube map orientation isn't weird IMO. It in fact seems the most intuitive to me.

Anyway, to check that indeed the cubemap is correctly loaded, map it onto a simple cube around in the origin and use texcoord = vertex.

GPSnoopy
09-03-2003, 04:36 AM
well, it's not that weird but it can be disorienting when using cubemaps for the first time.

I mean, if you check NVIDIA demos, almost each one uses a different orientation. Can be puzzling.
So, one advice: do not use NVIDIA demo file (dds) to check that your orientation is ok.

GPSnoopy
09-03-2003, 04:51 AM
Check this thread: http://www.opengl.org/discussion_boards/ubb/Forum3/HTML/004760.html

cass' post will help you. The NVIDIA doc is correct.

SeskaPeel
09-03-2003, 09:20 AM
When we load cube maps that were exported / generated from 3D Studio max, we were forced to flip them. Maybe you are having the same problem ...

SeskaPeel.

cass
09-03-2003, 06:22 PM
Just for the heck of it, I updated that ppt to show why the cube map orientation makes sense for right-handed coordinate systems where images are specified with their origin in the upper left corner.
http://www.r3.nu/~cass/nv/cubemap_image_orientation2.ppt

Thanks -
Cass