Jump to content
  • Advertisement
Sign in to follow this  
VerMan

FBO texture displacement

This topic is 3160 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hi, i'm using FBOs to render to a float texture. I was using pbuffers before and the texture I was rendering seemed to be OK. However, I couldn't enable multitexturing and switched to FBOs (now that my graphics card supports it). The problem I'm experiencing with FBO is that when i render the texture, it is wrong rendered... there's a big displacement or offset to the bottom-left of let's say 20 pixels or so (visible when i render a big quad with the texture). So, the coordinates seem to be wrong, displaced... the exact same process was properly rendering the texture using pbuffer but with FBO looks like if i were doing:
glBegin(GL_POINTS);
glVertex2f(x-20,y-20)
glEnd();
Have you experienced similar problems using FBO class?

Share this post


Link to post
Share on other sites
Advertisement
only time I've ever had anyhting like this it was due to something being setup wrong. Texture height/width/projection matrix etc

Share this post


Link to post
Share on other sites
I've seen similar things happen on a machine with an Nvidia Ion chipset - FBOs appeared to be transformed incorrectly (compared to the same code running on desktop GPUs), but only slightly offset.

See if the same thing happens when you use a power-of-two texture size, like 512x512. That fixed the problem for me.

Share this post


Link to post
Share on other sites
I found the problem,
it seemed to be a scaling problem:

In my pbuffer implementation I had something like


pBuffer::Initialize(width,height);



that was missing in the FBO implementation, so simply adding:

fbo.bind();
glViewPort(0,0,TEXTURE_WIDTH,TEXTURE_HEIGHT);



solved the problem.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!