I'm currently experimenting with creating small FBOs, with the intent of using them for UI layout. Each FBO is smaller than the size of the window. However I'm having trouble getting correct results when I render to these small FBOs.
If I change the window size to match the size of my FBO (in this case, 200x100), the result is as expected:
However, if I leave the window size larger, and try to render to this small FBO, the contents of the rendered texture get weird:
The texture is being blown up to several times its actual size. My orthogonal projection matrix is set to the FBO size, which I assumed to be correct since that is the only surface I am rendering to. I don't know what else there is that would need to be adjusted.
I just don't understand why the window size would have any impact on the result rendered to the FBO, since the FBO is completely separate from the window's backbuffer.
Do I need to do something special to projection matrices when rendering to a FBO size that doesn't match the window size?
Weird effect when FBO size doesn't match window size
2 replies to this topic
Members - Reputation: 371
Posted 11 March 2012 - 05:53 PM
Whats the viewport set to?
Okay, I knew it was going to be something dumb. I was about to reply that I wasn't using a viewport (I was thinking of a "viewport" projection matrix I use from CML for screen-to-world), then remembered that the default viewport size was the size of the window... doh! Thank you!