PDA

View Full Version : Illuminating gl_lines



Dylan
12-13-2006, 02:06 AM
Hi,

is there a possibility to illuminate(highlighting) gl_lines? I think they need a normal vector, which i can generate in the vertex shader. They don't have to look realistic, but I think it can help to discern them and create some depth.

Doen anyone know a good approach to this problem?

ScottManDeath
12-13-2006, 03:30 AM
Why not use simple fog for depth cueing?

Mikkel Gjoel
12-13-2006, 04:55 AM
If you don't want to actually draw cylinders, you might want to take a look at drawing normalmapped billboards instead. This is not quite as easy as simply using GL_LINES, but it shouldn't be too difficult either :)

ZbuffeR
12-13-2006, 09:23 AM
Illuminated lines in good old fixed-path GL works already, nothing to do. Like for any geometry, provide normals and enable light.
You can try Dev-C++ template for freeglut.

skynet
12-14-2006, 03:55 AM
It would be good idea to compute a view-dependent normal in the vertex shader on the fly. Instead of providing a normal to the vertexshader, provide it with the direction of the line or line segment (at the position of the vertex).
Then, in the vertex shader compute a normal which points into the direction of the viewer but still remains to be orthogonal to the provided direction (compute V then orthogonalize it to D). This way you´re effectivly emulating a thin cylinder which should give good lighting.

Dylan
12-17-2006, 02:03 AM
Originally posted by skynet:
It would be good idea to compute a view-dependent normal in the vertex shader on the fly. Instead of providing a normal to the vertexshader, provide it with the direction of the line or line segment (at the position of the vertex).
Then, in the vertex shader compute a normal which points into the direction of the viewer but still remains to be orthogonal to the provided direction (compute V then orthogonalize it to D). This way you´re effectivly emulating a thin cylinder which should give good lighting. sounds, great do you have any more detailed information on this approach?