next up previous contents
Next: 11.7 Other Atmospheric Effects Up: 11 Natural Phenomena Previous: 11.5 Water

11.6 Light Points

OpenGL has direct support for rendering both aliased and antialiased points, but these simple facilities are usually insufficient for simulating small light sources, such as stars, beacons, runway lights, etc. In particular, the size of OpenGL points is not affected by perspective projections. To render more realistic looking small light sources it is necessary to change some combination of the size and brightness of the source as a function of distance from the eye.

The brightness attenuation a as a function of distance, d, can be approximated by using the same equation used in the OpenGL lighting equation
displaymath7837
Attenuation can be achieved by modulating the point size by the square root of the attenuation
displaymath7839
As the point size approaches the size of a single pixel the resolution of the raster display system will cause artifacts. To avoid this problem the point can be made semi-transparent once it crosses a particular size threshold. The alpha value is proportional to the ratio of the point area determined from the size attenuation computation to the area of the point being rendered
displaymath7841

More complex behavior such as defocusing, perspective distortion and directionality of light sources can be achieved by using an image of the light lobe as a texture map combined with billboarding to keep the light lobe oriented towards the viewer.



David Blythe
Thu Jul 17 21:24:28 PDT 1997