The Persistence of Ignorance

Menu Home

Automatic Light System for POV-Ray, Version 4d

  • Jaime Vives Piqueres: Wrote the first simplistic macros, test & demo scenes, compilation of spectral databases, package preparation & distribution.
  • Ive : Teaching Jaime some color science, writing the color space macros, demo and test scenes, compilation of spectral databases.
  • Philippe Debar : Donated and helped integrating, betatesting.


Back in 2002, I started to write an include file to automate the task of creating a light source, specifically the aspects about color, intensity and fading. I was tired of always having to find by trial and error the right combination of these factors for each light_source.

I had in mind a set of macros wich will allow to automatically calculate the color, intensity and fading based on a few fixed rules, as light must behave always the same on real world situations. I started then learning about light on the Internet, searching with google and surfing link after link. After some time, I ended up with some basic principles to apply as rules for POV-Ray light sources creation:

Example images:

There are some images to illustrate the purpose and behavior of the system, all created with the test and demo scenes included on the zip.

  • Indoor scenes:

    This is a shot from the scene demo_indoor1.pov. The whole scene uses materials with pigments converted from reflectance spectrums, and lights with colors obtained from emissive spectrums. The light sources were obtained with the help of the Lightsys macros, and it was rendered using CIE sRGB color space and a white point of 5000K.

    There is another indoor demo, which illustrates the header of this page.

  • Outdoor scenes:

    Thanks to the contribution by Phillipe Debar, Lightsys includes now a version of his, adapted by Ive as It can be used with the CIE macros to setup outdoor scenes very quickly.

    The scene demo_outdoor.pov uses again materials pigments converted from reflectance spectrums, and the light uses the SunColor returned by CIE_Skylight.

    This image uses CIE sRGB color space and a white point of 5500K.

  • Space scenes:

    Yeah, even for space scenes! The "line spectra" macros and databases can be useful to simulate the colors of elements on nebulae, and the Blackbody() macro is pretty handy to create realistic colors for known star types.

    There is another demo scene using the same starfield, but with a moon textured with lunar samples and lighted by an extraterrestrial sun spectrum.

    This image uses the CIE-RGB color space and a white point of 6500K.

There are some more demo scenes on the package, showing other posible uses for the Lightsys and CIE macros, as well for the auxiliar tools and spectral databases.


The zip archive contains both my Lightsys includes and the CIE XYZ Color Space includes by Ive, as well as the spectral databases, and the demo and test scenes: (397Kb)
03/22/15 : Updated to version 4d
  • corrected some pass-by-reference issue on
  • corrected erroneous data on which triggered a bug on the latest POV-Ray 3.7 development branch.
  • added some more ASTER spectrums

Unzip it somewhere and it will create a "LightsysIV" folder containing all the files. After reading the help files, you may want to copy all the ".inc" files to one of your POV-Ray library paths, or add one more path for the "LightsysIV" folder to your POVRAY.INI or .povrayrc (recommended).

Extras: (29Kb)
Additional material (reflective) spectrums sampled by Christoph Hormann. (10Kb)
Additional light (emissive) spectrums collected by users of SU2POV, a POV-Ray exporter for SketchUp. These were sent to me by SU2POV user Clipi, and I just translated them to the spline format used by Lightsys 4. It contains several ANSI luminaries and some real lamps from MAZDA. (1,5Kb)
Additional wide-gamut color spaces, with values taken from Bruce Lindbloom web site. Added after an interesting email exchange with Daniel Richard G., who made me aware that these color spaces existed. The zip includes an include file with two new color space systems, and a little demo scene to visualize the color space.

Comments and criticism are welcome, as usual.


For more than a year, I've been "researching" a lot on the web, collecting a huge amount of bookmarks more or less related to light, color, photography and other topics. From all that mess I've extracted a few introductory links, as a starting point for the curious. Look at the readme files and even the code comments for more links to concrete resources.

Light Measurement Handbook Gernot Hoffman: CIE Color Space Google Search

This site uses CMS Made Simple
© 1996-2016 Jaime Vives Piqueres

Creative Commons License