Re: blackbody and daylight functions

Mitch Prater

Excellent question Chris - thanks for raising it!

The short, and I believe "standard" answer to such questions, is that if OSL doesn't currently provide functionality you desire, you can implement it yourself either using OSL shader code, or by adding that functionality to the language so that it can be incorporated into the OSL repository, or just within your own rendering system implementation if you prefer to not make that public.

The long answer is that color science and its application within lighting, shading, and rendering systems is a fascinating topic and obviously one that deserves a great deal of attention. OSL is fundamentally however, a programming language only. Questions of what color is, how it's controlled, represented, processed, displayed, and finally perceived is more within the purview of the CIE, Open Color IO, and the implementers of your rendering system. OSL in its current form represents color as a 3-tuple, so its ability to process color is constrained to quantities that can be represented by that data type (and the underlying assumptions about the orthogonality of those values). But, since shading is fundamentally a process of generating color, it's absolutely valid to raise the question of how much of the definition of color should be a part of the language and how to manage and implement it. As spectral representations of light make their way out of research and into production renderers, this topic deserves more discussion.

But I digress. The ability to specify a "daylight color" as a function of a temperature value certainly sounds useful. It does bring up the question as to what the atmospheric filtering consists of, and whether you'd want the ability to control that instead. The sun's output is actually constant, so its illumination on the ground is completely a function of the atmospheric conditions and the sun's path through it, so using a temperature value might not be the most useful physically-based control. Pixar had implemented just such an atmospheric light source many years ago. I seem to recall it having been presented at Siggraph, but I can't say for sure.


Join to automatically receive all group messages.