programming question
category: general [glöplog]
Can somebody explain the technique to achieve the glow that we can see in many demos like FR-025, Fr-036: zeitmaschine, Outracks:blockbuster, etc.
Is it something like rendering the whole seen in a smaller target and blending it with the original?
Thanks
Is it something like rendering the whole seen in a smaller target and blending it with the original?
Thanks
I don't know the "academic way" of doing it but I basically do it that way if that can be of any help:
- small version of the scene in a texture
- bright-pass to keep only what will glow
- gaussian blur on the result (2 passes with separable filters)
- apply the result on your scene
You can also directly render the hilights only in a small rendertarget but I prefer the brightpass method on a complete scene using a glow threshold (mandatory if you want to support High Dynamic Range for instance)
- small version of the scene in a texture
- bright-pass to keep only what will glow
- gaussian blur on the result (2 passes with separable filters)
- apply the result on your scene
You can also directly render the hilights only in a small rendertarget but I prefer the brightpass method on a complete scene using a glow threshold (mandatory if you want to support High Dynamic Range for instance)
You can give a look @ ATI Render Monkey example shaders.
The best description of this effect is found in gamasutra / GPU Gems. http://www.gamasutra.com/features/20040526/james_01.shtml
It explains how they did it in the game Tron 2.0.
It explains how they did it in the game Tron 2.0.
Is the bright-pass something like an alpha test?
When you apply the result on the scene, you use bilinear filtering right?
When you apply the result on the scene, you use bilinear filtering right?
if you dont you get mosaik effect..
just write the base code for it and play around and it will all become very clear.
or test some in photoshop first..
just write the base code for it and play around and it will all become very clear.
or test some in photoshop first..
Ok thank you all for the advice.
The bright pass allows you to keep only the pixels with a given luminance (direct lights, specular highlights, etc).
It does not work exactly like that but to make it simple, it's like keeping the pixels for which R, G and B are above 128 for instance.
and yes you need filtering or else it will look really bad
It does not work exactly like that but to make it simple, it's like keeping the pixels for which R, G and B are above 128 for instance.
and yes you need filtering or else it will look really bad
if you render separately to the smaller render target you're going to get a lot of aliasing. better to render the full scene then downsample that to smaller render target. if you're small RT is a quarter res then you'll want to average the 16 pixels from the full size rt for each pixel of the small rt. you can do this fast with 4 bilinear samples.
If memory serves me correctly, chaos himself describes how this is accomplished in some assembly seminar. (Available on video somewhere near you...)
You could check out the tool Werkkzeug and load the example file of FR-025. Have a look on the operators how they are stacked. The ops should show your how the algorithm works in general.