Glow on a wireframed triangle?

Started by
5 comments, last by Emergent 14 years, 1 month ago
Hi there. You guys at GameDev have helped me a lot so far, but I still need to know one thing. How can I add a glow effect to a triangle rendered in wire-frame mode? I've seen it done before. I've looked at different HLSL glow shaders, but they all require texture coordinates to work. I don't use textures, but materials.
Advertisement
A bloom pass operates on the current render target, i don't see why having the model drawn in wireframe would be an issue so long as the brightness pass picks up the wireframe.
How do I perform such a "Bloom pass" then? I am a beginner.
AFAIK bloom is just a blur effect.
You render the wireframe to a texture (with bloom color), and you apply post process blur to that texture (color will be the bloom color, apply blur to the alpha layer). Than compose that to the image somehow.
Wouldn't converting the wireframe into a texture be very unoptimized? Isn't there a smarter approach?
All this really means is that you change the render target from the default one to one you create yourself, draw your primary scene to this (the one that needs blooming). You use that as the source image for the bloom pass and then combine the bloom output with the source image to the back buffer.
Quote:Original post by Mathy
Wouldn't converting the wireframe into a texture be very unoptimized? Isn't there a smarter approach?


If you look on the nVidia developer site you'll find a number of demos that use this and related approaches. I don't know if it's the best use of hardware, but it is commonly done. On the plus side, it's relatively easy, and will look good.

Your other option is billboarding. Your could for instance render your lines as camera-facing quads with pre-blurred line textures (with, say, rounded ends) and e.g. additive blending. The downsides here are that (1) now where your lines overlap at vertices, you'll get brighter glow, in proportion to the number of edges sharing that vertex (one can imagine ways around that though, say by subtractively-blending circular billboards at the vertices to cancel this effect), and (2) wherever your quads intersect or are occluded by other objects, and this is handled by the z-buffer, you will get sharp rather than blurred edges.

It's conceivable that effects #1 and #2 are even desirable; I don't know...

This topic is closed to new replies.

Advertisement