PDA

View Full Version : Render to texture in the wrong way



BuzzerMan
07-16-2010, 06:34 AM
Hello,
I've got an issue when I try to render to texture and then display this texture: I want to draw an entire scene to a texture used as render buffer and next display this texture on a screen quad on the back buffer to change the image ratio or size.
The problem is that the texture is rendered with its y-axis in the opposite way according to when a direct render is done. I checked the render is done in the opposite way by saving the raw texture data in a file and load it with an image viewer.

To fix it, I could change the quad's texture coordinates but I would want to know if it's the usual way or if I have made a mistake and asked a render in the other way with a state, any ideas? It's a bit strange that render into a texture makes the rendering don in the other way...

Thank you for any clue!

ZbuffeR
07-16-2010, 08:14 AM
Apparently you did a mistake somewhere.
OpenGL coordinates and textures start from bottom left, maybe you assumed differently ?

BuzzerMan
07-20-2010, 03:23 AM
Thank you for your response. I'll look around the texture coordinates.
I don't think I use differently texture coordinates for regular textures and for textures from rendering but I'll check it ;).