Advertisement Jump to content
Sign in to follow this  

OpenGL Render to texture with OpenGL and DirectX

This topic is 3102 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to implement "render to texture" mechanism in an engine which runs with both OpenGL and Directx10 and I've got a problem with it:
To test my implementation, I render a scene in a texture, next this texture is displayed on a full-screen quad (with texcoord to 0 and 1 on vertices). With DirectX, the texture displayed is the way I expect whereas, with OpenGL, it's rendered in the opposite way according to the v-axis.
So I extract the raw values from the texture after the render, write them in a bitmap file and notice the same difference from those displayed on the texture: the OpenGL's one is reverted.

After a quick look to Ogre, I find that they have a method to know if textures require flipping present in render target classes.

So my question is: is it normal that render to texture is done in the opposite way with OpenGL? Or is it a state or a property somewhere to set the origin of the render?


Share this post

Link to post
Share on other sites
OpenGL sets the origin of the texture in the left bottom corner of the bitmap. I presume DirectX has the origin in the left top corner.

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using, you agree to our community Guidelines, Terms of Use, and Privacy Policy. is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!