Sign in to follow this  
Mathy

Glow on a wireframed triangle?

Recommended Posts

Mathy    104
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.

Share this post


Link to post
Share on other sites
dave    2187
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.

Share this post


Link to post
Share on other sites
szecs    2990
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.

Share this post


Link to post
Share on other sites
dave    2187
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.

Share this post


Link to post
Share on other sites
Emergent    982
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...

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this