I recently implemented dispersion in Photorealizer using some of the ideas I described in a previous post. I'm using the Sellmeier equation along with material-specific Sellmeier coefficients to determine the refractive index of the material at any given wavelength. Right now I'm only tracing three specific wavelengths, one for each of red, green, and blue. Because the sRGB primaries are not spectral colors, I simply chose nearby spectral colors, keeping things simple for now.
Here is a render of diamonds with dispersion. The color in this image comes entirely from dispersion.
|Diamonds with dispersion. Click to view full size.|
Here's the same render, before bloom was applied (my bloom is a post-process; the renderer applies it to the completed image):
|Same render as above, but without bloom.|
Here is a similar scene rendered with and without dispersion, for comparison. The color in these images comes entirely from dispersion as well. The effect of dispersion is a little more subtle in these images than in the ones above.
|No dispersion. Bloom.|
|Dispersion. No bloom.|
|No dispersion. No bloom.|
At some point I'd like to develop a more robust spectral rendering framework, so I can more accurately render dispersion, as well as interference, diffraction, and other wavelength-dependent effects for which three wavelengths (R, G, and B) are insufficient.
Here are a few earlier dispersion renders: