im wondering what the best method is for creating bloom effects.
at the moment Iam using a 2nd FBO to redraw the entire scene and making the objects that don’t glow transparent. then use vertical and horizontal blurs and get the texture and overlay this on my scene.
but this has slowed my fps down because i am rendering everything twice. :sorrow:
Is there a better way of doing this so that objects are only rendered once?
or else putting the FBO in a different thread but i don’t know if thats possible or if it would improve peformance.
I don’t know what professionals would advice, but for my little projects I usually do the same as you. But rendering the second image every two or three frames. This assumes that there are not many too differences between frames.
Pretty good review here:
Basically you render normally to a framebuffer texture.
Then start your postprocessing steps:
- Threshold and reduce.
- blur and upscale
- blur, combine and upscale
- blur combine and upscale
- add back to orignal image.
Nice thing about reducing is that a single blur effects more of the scene. Faster than bluring the orignal image many times.
Here is some sensory overload as an example: <object width=“425” height=“350”> <param name=“movie” value=“http://www.youtube.com/v/pmMmjMoXpgk”></param> <param name=“wmode” value=“transparent”></param> <embed src=“http://www.youtube.com/v/pmMmjMoXpgk” type=“application/x-shockwave-flash” wmode=“transparent” width=“425” height=“350”> </embed></object>
Probably good to do hdr at the same time as bloom.
Should slow things down, but no need to render the scene twice.