Alright, so here's my current workflow for rendering. I create a framebuffer object without a depth/stencil attachment and only a colour texture attachment. I bind the framebuffer and render all my textures onto it. I then copy the texture data from the render buffer texture onto another texture (although this part isn't really relevant because the problem occurs when rendering to the frame buffer). So the problem is that once the rendering goes past the window bounds, it stops drawing. So here's an image of what is currently rendered (sorry I have to post links, I don't have enough reputation to post images yet):
And here's an image of the actual texture data (provided by gDEBUgger).
As you can see, the part where it cuts off is where the window width is. Using glClear
also only covers the window size of the texture and nothing else.
I have tried using glDisable(GL_SCISSOR_TEST)
along with glViewport(0, 0, texture_width, texture_height)
but it's still cutting off the texture. Making the viewport smaller cuts off at the same point, making it larger just stretches the image and cuts off more of the texture.
I mean, it makes sense, why would you want to draw pixels off-screen when you can't even see them, that would be horrible for performance. In my case though, I need to do it. That's why I'm looking for a way to disable it or something like that.
Also note that I have disabled depth testing so it couldn't be that the depth clear doesn't go past the window bounds since I disabled it.
Anyone got any ideas?
Edit: Just in case anyone sees this thread in the future, just wanted to say what solved it for me. I just needed to set the viewport to the size of the texture AND scale the perspective matrix to the same size when rendering. In my case, I used my own matrix class. Here's an example:
glViewport(0, 0, texture_width, texture_height);
perspective_mat.identity();
perspective_mat.scale(1.0f / (texture_width / 2), -1.0f / (texture_height / 2));
perspective_mat.translate(-1.0f, 1.0f);
In case you are using fixed-pipeline stuff (no shaders, ect) then you can use the openGL matrix functions to scale and translate. :)