Render to Texture behaves weirdly - Printable Version
+- iDevGames Forums (http://www.idevgames.com/forums)
+-- Forum: Development Zone (/forum-3.html)
+--- Forum: Graphics & Audio Programming (/forum-9.html)
+--- Thread: Render to Texture behaves weirdly (/thread-10886.html)
Render to Texture behaves weirdly - ardowz - Jan 24, 2014 12:33 PM
I followed this guide:
And omitted the depth attachment since I'm only trying to create a gradient quad. (Note, I'm writing using OpenGL 2.1 since that is what the API is only capable of)
This is how I set up my framebuffer.
And this is How I used the texture
The Values are:
[outTex target] is GL_TEXTURE_RECTANGLE
[outTex width] this one can vary the same way [outTex height] is, for example's sake it's 800 and 600 respectively.
The question now is, Given this set up, Whenever I move the camera the quad in the main buffer will move as well. For example, If I view the quad in a different angle, the texture inside will rotate and clip because of the quad's vertices.
Any thoughts on preventing this? I want it to be static like an ordinary texture that will just stick to the quad.
This is how it starts:
If i zoom in it will start becoming an actual quad but I will start losing the other part of the gradient.
When I view the quad in a different angle this is what it looks like:
RE: Render to Texture behaves weirdly - OneSadCookie - Jan 28, 2014 05:49 PM
OpenGL state is not reset on BindFramebuffer, you must manually reset any state you don’t want to carry over.
RE: Render to Texture behaves weirdly - ardowz - Feb 17, 2014 04:50 PM
Thanks, I placed the draw after manipulation which was causing this.