Convention of faces in OpenGL cubemapping

后端 未结 2 1362
我在风中等你
我在风中等你 2020-12-13 15:03

What is the convention OpenGL follows for cubemaps?

I followed this convention (found on a website) and used the correspondent GLenum to specify the 6 faces G

2条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-13 15:44

    but I always get wrong Y, so I have to invert Positive Y with Negative Y face. Why?

    Ah, yes, this is one of the most odd things about Cube Maps. Rest assured, you're not the only one to fall for it. You see:

    Cube Maps have been specified to follow the RenderMan specification (for whatever reason), and RenderMan assumes the images' origin being in the upper left, contrary to the usual OpenGL behaviour of having the image origin in the lower left. That's why things get swapped in the Y direction. It totally breaks with the usual OpenGL semantics and doesn't make sense at all. But now we're stuck with it.

    Take note that upper left, vs. lower left are defined in the context of identity transformation from model space to NDC space

提交回复
热议问题