Jump to content

  • Log In with Google      Sign In   
  • Create Account


Weird effect when FBO size doesn't match window size


Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.

  • You cannot reply to this topic
2 replies to this topic

#1 Nairou   Members   -  Reputation: 418

Like
0Likes
Like

Posted 11 March 2012 - 05:25 PM

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:

Posted Image


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

Posted Image

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?

Sponsor:

#2 NumberXaero   Prime Members   -  Reputation: 1312

Like
1Likes
Like

Posted 11 March 2012 - 05:40 PM

Whats the viewport set to?

#3 Nairou   Members   -  Reputation: 418

Like
0Likes
Like

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!




Old topic!
Guest, the last post of this topic is over 60 days old and at this point you may not reply in this topic. If you wish to continue this conversation start a new topic.



PARTNERS