Sign in to follow this  
Nairou

Weird effect when FBO size doesn't match window size

Recommended Posts

Nairou    430
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:

[img]http://dl.dropbox.com/u/4349589/fbo1.jpg[/img]


However, if I leave the window size larger, and try to render to this small FBO, the contents of the rendered texture get weird:

[img]http://dl.dropbox.com/u/4349589/fbo2.jpg[/img]

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?

Share this post


Link to post
Share on other sites
Nairou    430
[quote name='NumberXaero' timestamp='1331509253' post='4921214']
Whats the viewport set to?
[/quote]

Okay, I [b]knew [/b]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!

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this