Zulfiqar Malik
10-04-2005, 08:58 AM
I was experimenting different things and testing their behavior in opengl and d3d. Normal texture mapping works fine in opengl and d3d without any exceptions. Similarly i have found no exceptions regarding the usage of VBOs and d3d vertex buffers. However a problem arises in the following scenario.
When i render a particular geometry to a render target in d3d (and likewise to an FBO in opengl) and apply it on a geometry the RT texture maps properly in d3d but maps mirrored (vertically i.e. upside down) in opengl. Please note that otherwise the same texture when given data from a file appears properly in both, with the same texture coordinates. Also note that no other filtering options other than linear min and mag filters has been specified. I can't seem to figure out the problem. Because of this i have to invert the projection matrix along y in opengl (in case of render targets) so that the rendered image is consistent across both APIs. But inverting y axis of the projection matrix also inverts my culling option i.e. CW becomes CCW and vice versa. In short, its a pain and i want to get rid of it.
Also note that texture data, when supplied from file is done in exactly the same format for both APIs (i am using OpenIL for both), so there is no inconsistency from that end as well.
I'd be most grateful if someone would explain this behavior or refer to some documentation. I have tried reading FBO specification but could not find any relevant info. But that might be because the spec is absolutely huge :( . Thanks in advance.
When i render a particular geometry to a render target in d3d (and likewise to an FBO in opengl) and apply it on a geometry the RT texture maps properly in d3d but maps mirrored (vertically i.e. upside down) in opengl. Please note that otherwise the same texture when given data from a file appears properly in both, with the same texture coordinates. Also note that no other filtering options other than linear min and mag filters has been specified. I can't seem to figure out the problem. Because of this i have to invert the projection matrix along y in opengl (in case of render targets) so that the rendered image is consistent across both APIs. But inverting y axis of the projection matrix also inverts my culling option i.e. CW becomes CCW and vice versa. In short, its a pain and i want to get rid of it.
Also note that texture data, when supplied from file is done in exactly the same format for both APIs (i am using OpenIL for both), so there is no inconsistency from that end as well.
I'd be most grateful if someone would explain this behavior or refer to some documentation. I have tried reading FBO specification but could not find any relevant info. But that might be because the spec is absolutely huge :( . Thanks in advance.