New Demo: Glow

Started by
24 comments, last by Genjix 18 years, 10 months ago
As posted on my webpage: This demo written in OpenGL is based on an article I read a while ago in my GPU GEMS book and which is also available on the gamasutra site, check it out here. To create the glow effect, basically every 3D model in the scene is assigned a set of two textures; a regular RGB image encoding the diffuse color and a LUMINANCE one specifying the glow areas. A better approach would be to code the luminance values into the alpha channel of the diffuse image; that way we get to use a single texture instead of two. I chose to stick with the first approach since it gives me the possibilty of modifying the glow path without separating the RGB and ALPHA values into separate textures before combining them again (I only have Paint on my computer, sigh!!!) During the first pass a GLSL fragment shader retrieves the diffuse color bound to texture unit 0 and then multiplies it by the luminance value stored in the second texture. The result is copied into a 256*256 texture that we call the glow source. Originally I intended to use FBOs to accomplish the rendering to texture but since we're dealing with relatively small targets, I decided to stick with glCopyTexSubImage2D. Now depending on the amount of glow that we aim for, another shader (or ARB program, the user can modify the Blur.xml file in the data folder to switch from one to the other) takes the glow source and blurs it N times in two separate steps: a horizontal pass to bleed the source color along the x axis followed by a vertical pass that distributes the color in the y axis direction. In both steps the resulting color is multiplied by 1.15 to accentuate the glow effect. After each pass, the result is stored into a secondary texture; this is our blur target. Finally, the scene is drawn with diffuse textures only before turning on additive blending and drawing a full screen quad with the blur target bound to it. One drawback of this technique is the aliasing effects betraying the small size of the blur and glow targets. Later I will try to provide support for non DX9.0 hardware since the blur could be accomplished without shaders. Demo binaries. Demo source and build files. Engine source. [Edited by - JavaCoolDude on May 27, 2005 4:19:06 PM]
Advertisement
Thats pretty neat.

What do you intend to do with all these neat effects you are creating?
I'm shooting to get some of those effects into the NVIDIA SDK.
I'm flying to their headquarters in CA tomorrow for a job interview.
Wish me luck, I feel pretty nervous about the whole thing.

/wuss out [crying]

[razz]
Wow, that must be pretty exciting. Good luck!
Fantastic!
Another neat one! Good luck with your interview! [smile]
Youve done it again, congrats :-)

cheers
-Dan
When General Patton died after World War 2 he went to the gates of Heaven to talk to St. Peter. The first thing he asked is if there were any Marines in heaven. St. Peter told him no, Marines are too rowdy for heaven. He then asked why Patton wanted to know. Patton told him he was sick of the Marines overshadowing the Army because they did more with less and were all hard-core sons of bitches. St. Peter reassured him there were no Marines so Patton went into Heaven. As he was checking out his new home he rounded a corner and saw someone in Marine Dress Blues. He ran back to St. Peter and yelled "You lied to me! There are Marines in heaven!" St. Peter said "Who him? That's just God. He wishes he were a Marine."
Thank you all for your support; it means a lot to me [inlove]
Aight, let me get 4 hours of sleep before I head out for the Airport.
Most impressive, and very inspiring. Good luck on the interview.
Your stuff amazes me. I know a lot of people seemed to be making this kind stuff (atleast commerically), but you work it all out and then release it to the public. My hat goes off to you, sir. *round of applause*

This topic is closed to new replies.

Advertisement