Jump to content
  • Advertisement
Sign in to follow this  
BuzzerMan

OpenGL Render to texture with OpenGL and DirectX

This topic is 3014 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

Hello,
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?

Thanks!

Share this post


Link to post
Share on other sites
Advertisement
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 GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!