Volumetric lines PDF Print E-mail

Natively, OpenGL doesn't alllow us to render volumetric line and simple line are generally not hardware accelerated. Tristan Lorach (nvidia.com) already proposed an approach to render such volumetric lines. My solution is different : it's simpler but an artifact appear when viewing line along their axis.

I render volumetric line by using billboard constrain on an axis. On each line's extremity, I had a camera facing billboard again constrain by the line axis. 6 triangles are used for each lines (in TRIS_STRIP mode) and a fast GLSL shader : all tricks are performed in the vertex shader, the fragment shader contains only a texture access for the line appearance.

I let you discover these volumetric lines in the demo. You can easily understand the rendering algorithm and the use of the appearance texture by selecting the debug texture.


Download source and executable
Mac OS X port
by Jeshua Lacock. Thanks!

: now available on the Unity Asset Store, developed by Johannes Unterguggenberger (johannes.unterguggenberger 'at' gmail.com). Thanks!

Additional notes:
- A similar method to the one presented on this page have been published (after ;)) in ShaderX7 (Chapter 2.2).
- I am pleased to announce that this tech is used in an awesome iPhone game: PewPew!!!

Volumetric lines


Thin volumetric lines

Large volumetric lines


Another appearance

Another appearance (bis)
Last Updated on Sunday, 22 February 2015 15:51