Glowing Points/Lines ?

Started by
7 comments, last by ET3D 16 years, 10 months ago
Hi guys, I'm rendering points and lines with D3DPT_POINTLIST and D3DPT_LINELIST and was wondering if I can give them a glowing appearance without too much trouble. Also, in general, what render states should I be setting for points/lines ? Do I need anything special to make them look good ? Thanks. [Edited by - Endemoniada on May 24, 2007 9:38:09 PM]
Advertisement
I'm not sure what rendering states for points and lines. But as far as giving points a glowing effect: That would be handled by a post processer and would consume too much gpu power. You would be better off to create the glow effect and render it to a texture or make in photoshop and save to texture then quad it to the screen.

I created a glow effect and the more the glow, the more the performance hit. And ouch, it hits pretty good. In more years this won't be a problem, but for now with the current shaders that users have, in my opinion, it is. Unless you're scene is pretty simple then perhaps it's OK for you.

A glow effect, that I know of, is created by rendering the original object to a texture. Then on a second pass, during pixel processing, scaning horizontally and bluring the image, then doing the same vertically. After bluring then you can quad the blurred image to screen. It's the equivelant of rendering three frames or more per frame of actual game play, depending on the size of the object being blurred.

HTH,

Devin
Depends on how clever a glow you want. For a simple one, you might want to try rendering them a couple of times with a little jitter and (ONE, ONE) blending.
As has been mentioned, the proper way to do this is post-processing but this can be quite expensive.

In addition to other suggestions, you could consider point sprites with a pre-blurred/glow texture applied to it.

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Hi,

I actually converted my game from sprites to points/lines because the sprites were too limiting. One thing that's important are the vertex colors, that way I can get nice color gradient lines with any colors I choose.

Instead of a glow I tried anti-aliasing the lines with D3DRS_ANTIALIASEDLINEENABLE but the diagonal lines ended up much thicker than the vertical and horizontal ones which looked really bad.

I definitely need something more than just plain line rendering, it simply looks poor the way it is now.

When you guys say post-processing do you mean HLSL ? I'm just starting to learn that. Does it really give a big performance hit ?

Thanks.
Quote:Original post by Endemoniada
I definitely need something more than just plain line rendering, it simply looks poor the way it is now.
It's not an incredibly easy problem to solve to be honest. I got very close once with a vertex shader that projected the 3D coordinates into 2D projection space and then increased the screen-space width scaled by perspective/depth. I never had time to finish it properly and there were a few cases it broke down on - but it struck me as having potential if you want to put the effort in...

Quote:Original post by Endemoniada
When you guys say post-processing do you mean HLSL ? I'm just starting to learn that. Does it really give a big performance hit ?
The general form of post processing has no requirement on HLSL, all it means is "render the image as normal, then process that 2D image with some effects" - things like glow, blur, sharpening and so on (lots of the standard 'filters' you'll see in photo manipulation packages fit in here). In real-time D3D you pretty much do need to use pixel shaders to do anything interesting.

Have a play with the PostProcess sample in the DirectX SDK to get an idea of what's possible. Dip into the FX files and set up wireframe rendering (FILLMODE = WIREFRAME inside the main rendering passes) to get something similar to what you're doing...

hth
Jack

<hr align="left" width="25%" />
Jack Hoxley <small>[</small><small> Forum FAQ | Revised FAQ | MVP Profile | Developer Journal ]</small>

Quote:Original post by Endemoniada
I actually converted my game from sprites to points/lines because the sprites were too limiting.

This makes me curious as to what exactly you're trying to do. Perhaps textured polygons are a better solution than points/lines.
Hey guys,

I'm not making a clone or copying this but it shows almost exatly what I'm trying to do:

http://wiebo.files.wordpress.com/2006/10/screente005.png

At first I thought the glow wouldn't be that difficult to achieve, thus my topic. But at this point, like I wrote above, I'd be happy to have just something a little more than plain aliased line segments; they actually don't look bad when I go from a darker color to a brighter color back to a darker color but still.

I'm going to start researching post-processing, I understand it all conceptually but haven't done anything like that in D3D. I'll check out the stuff Jack recommended.

Thanks.
Looks to me like the lines don't really glow, and only some elements glow. The glow on these could probably be simulated by an ellipse textured over them.

This topic is closed to new replies.

Advertisement