Jump to content
  • Advertisement
Sign in to follow this  
Enalis

accumulating into an fbo?

This topic is 3591 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

I am using an fbo and glBlend functions to accumulate the lighting for my deferred renderer's lighting passes, however that's clearly not going to work for my multipass forward rendering approach. I know I can accumulate the lighting for a multipass solution into the glAccum buffer, using the appropriate gl calls, however I was wondering if I could accumulate the lighting into an fbo instead? I realized the reason it works with deferred rendering is because on the lighting passes I'm just rendering into a screen sized quad, but with the multipass I'm re-rendering the scene (which for < 5 lights seems to be faster). Thought? Thanks in advance!

Share this post


Link to post
Share on other sites
Advertisement
Quote:
Original post by V-man
Why isn`t it going to work?
Because you can't just render a full scene with additive blending enabled - parts of the scene which should be occluded will actually be accumulated instead.

Enalis - you should be able to fix this by first doing a 'depth pass', where you don't output to the color buffer, only output the scene to the depth buffer.

In the subsequent passes (the light accumulation passes) disable depth-writes, and set the depth-test to GL_EQUAL. This will ensure that any occluded geometry is not accumulated.

Share this post


Link to post
Share on other sites
Nice, i'm already doing a decal pass. I'll just make sure i'm writing to the depth buffer. Right now it's rendering into another fbo. Thanks!

Share this post


Link to post
Share on other sites
Quote:
Original post by Hodgman
Quote:
Original post by V-man
Why isn`t it going to work?
Because you can't just render a full scene with additive blending enabled - parts of the scene which should be occluded will actually be accumulated instead.

Enalis - you should be able to fix this by first doing a 'depth pass', where you don't output to the color buffer, only output the scene to the depth buffer.

In the subsequent passes (the light accumulation passes) disable depth-writes, and set the depth-test to GL_EQUAL. This will ensure that any occluded geometry is not accumulated.


Well, if the depth test is GL_EQUAL or GL_LEQUAL, it would just work fine.
In fact, always leave depth test at GL_LEQUAL.

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.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!