How to implement glow

Can somebody hint me to a good tutorial about that, or explain it to me?

Afaik glow is rendered by rendering glowing faces to a texture, blurring that texture, and rendering that texture into the scene. As I understand it, I somehow need to preserve each glow texture’s pixel’s depth value to properly render the glow texture into the scene, and I don’t know how to do that - or am I wrong?

I way I could think of not requiring depth values would be to render the entire scene to the glow texture (not just the glowing faces), with non glowing faces being black, and dotting out parts of glowing faces that are behind them. Am I on the right track here?

That’s it.
To have correct occlusion of the glow, you have different ways, with varying performance and complexity :

  • you can render only a quarter sized window of the scene for the glowing texture. then the full size scene (strong points : simple. usefull if resterisation is the bottleneck.)
  • you can copy the depth texture from normal scene and reuse that during the glow rendering (strong points : usefull if scene has high polycount)
  • you can take advantage of depth-only rendering in first pass, then draw glowing parts, then clear color, then draw normal scene (nice if you can benefit from this first pass, ie. with some shadowing/shading techniques)

In response to #3: I would have to copy the scene containing only glow to some glow buffer, blurring it in the process, before clearing the color and rendering the final scene, right?

render targets are needed for this afaik. a nice sample you can find here:

I know how to render to textures, I am using that already for other purposes, thanks.


And … do you happen to have some nice blur filter around that is not coded in assembly language? :slight_smile:

i got one, but gaussian blur. you probably want motion blur.

No, that’s perfect, thanks! I am not looking for motion blur.