Jump to content
  • Advertisement
Sign in to follow this  
dc443

OpenGL GLSL Bloom implementations

This topic is 3733 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 have written a bloom fragment shader that works, but it it's doing a couple things that are not very efficient. I am using a 1/4 resolution texture to create the blur with, and I am rendering my scene twice, once at the 1/4 resolution for the blur step, and once at full resolution for the main image. I would like to somehow use the original full resolution render for the blur step, but I would need to downsample it, which means perhaps creating two levels of mipmaps. I don't know if this would be more or less of a performance hit than re-rendering stuff all over at 1/4 res, though. Also if I use the actual render I would need to do some kind of high pass filter whereas with the rendering twice I can pick and choose how I want to draw the bloomed objects and which objects get bloomed if at all. So that's extra processing and a potential quality difference. Ideas? Is there a function in openGL to quickly reduce the size of a texture?

Share this post


Link to post
Share on other sites
Advertisement
Also another thing I'm having trouble is with reducing the number of texture copies when rendering the blur.

I am not using FBOs. I have to copy the backbuffer to a texture and render to a quad to apply the horizontal blur, then copy it again, and then render to a quad using vertical blur, and then copy it once more to be multitextured with the final full res full screen quad. The full screen backbuffer is then also copied because I do some distortion effects with it, so that's unavoidable, and multitexturing the bloom texture is very little overhead.

I tried to combine the last copy step with multitexturing but what ended up happening was I was sampling the bloom texture once for each full resolution pixel, which resulted in actually decreasing performance, not to mention I lost the built-in linear interpolation for that blur step. This decreased performance and lowered visual quality.

I guess I can't really expect much better performance from bloom? Tis a shame.

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!