PDA

View Full Version : Multi-Pass Per Object Glow?



PickleWorld
07-21-2005, 10:57 AM
Anyone have any good ideas/algorithms/papers/etc on how to implement an interactive (maybe multi pass) per-object glow while working with the following restrictions...

1) My main pass already uses all my texture units. So it either needs to use no texture units or be a multi-pass approach.
2) It must be a per-object glow (ie, objects may or may not have glow and each glow may or may not be a different color).
3) The glow needs to approximate the glows you see in standard ray tracers (ie a 3x3 blur is not going to cut it on a 1600x1200 display, it needs to be much wider).
4) It is a 3D app, so depth is important. Object glows should appear in front and/or behind other objects as would be expected by the viewer. This is the least important restriction. (I might be able to do without this one)

I am not sure there is a good solution out there, but I know I have not seen it all so I thought I would ask. Vertex programs, Fragment programs, extensions, etc are all not a problem as I have used them all before.

So far I have tried....

Rendering the glowing objects first and then ripping the image to texture with a glConvolutionFilter2D set up (tried 5x5). Then returning the texture (screen aligned quad) to the screen and re-rendering the scene over top of it. This was WAY to slow (ripping the texture with the filter is a time killer) and it did not produce a noticeable glow anyway.

Next I tried ripping the image to main memory... let me stop there, I will say no more on that.

Next I tried using automated mipmap generation (GL_GENERATE_MIPMAP) and while this is actually pretty fast, the repeated box filter at each mip map level produces some ugly artifacting at interactive speeds.

So... who has some ideas?

Mikkel Gjoel
07-21-2005, 11:29 AM
Originally posted by PickleWorld:
Anyone have any good ideas/algorithms/papers/etc on how to implement an interactive (maybe multi pass) per-object glow while working with the following restrictions...Take a look at the ati-papers on this subject. Available from the ati-website:
http://www2.ati.com/developer/ScenePostProcessing.pps

<edit a couple of more papers:>
http://www.daionet.gr.jp/~masa/archives/GDC2003_DSTEAL.ppt
http://download.developer.nvidia.com/dev...tProcessing.pdf (http://download.developer.nvidia.com/developer/SDK/Individual_Samples/DEMOS/Direct3D9/src/AntiAliasingWithPostProcessing/docs/AntiAliasingWithPostProcessing.pdf)
http://www.acm.uiuc.edu/siggraph/workshops/wjarosz_convolution_2001.pdf
http://www.gamasutra.com/features/20010209/evans_pfv.htm
http://www.gamasutra.com/features/20040526/james_01.shtml
- oh, and there's some in the GPU-gems 1 book (though not very good)
</edit>


Originally posted by PickleWorld:
4) It is a 3D app, so depth is important. Object glows should appear in front and/or behind other objects as would be expected by the viewer. This is the least important restriction. (I might be able to do without this one)Glow is a screenspace effect. One of the cool effects of glow is the color of background-objects leaking to foreground objects. You probably don't want to eliminate this effect.

\\hornet

CrazyButcher
07-21-2005, 11:35 AM
http://collective.valve-erc.com/index.php?go=tron1

http://collective.valve-erc.com/index.php?go=tron2

some basic tutorials, I dont find the original paper about the tron2.0 glow stuff but maybe it is in that other file.

Toni
07-22-2005, 03:52 AM
If i remember correctly the original tron2 glow effect was published in gpu gems 1 or game programming gems 4. I don't know if it is avaliable online tho

grisha
07-22-2005, 02:18 PM
It's in GPU Gems and also avalible online:
http://www.gamasutra.com/features/20040526/james_01.shtml