An attempt to recreate the nodes in blender using OSL
This is pretty similar to linearly mixing any two different things with a mix factor.
For an example, in math, if we want to mix two functions
The Texture coordinate node provides the:
- Object
- Normal
- UV
- Incident
- Reflection
We can use this formula to derive the reflection node using the incident node.
Took the cofiguration of the OpenColorIO on the luma line in https://git.blender.org/gitweb/gitweb.cgi/blender.git/blob_plain/HEAD:/release/datafiles/colormanagement/config.ocio.
This is the same as taking the dot product between R,G,B
and 0.2126,0.7152,0.0722
. This would yield us a result in a greyscale mode in which all the R,G,B channels are given the color $0.2126R + 0.7152G + 0.0722*B$.
This doesn't look like the Blender's Blackbody node but produces quite similar results.
According to the Stefan-Boltzmann law, hotter objects emit more high-frequency radiation compared to cooler objects. As blue light has a higher frequency than red light, hot objects tend to emit bluish light, warm objects emit white light (a combination of blue and red), and cool objects emit red light.
Used the algorithm by Tanner Helland