I intend to approach this project in a multi-step process. These steps can be broken down thusly: Step one will establish a colorspace based around light frequency, step two will used this new colorspace to calculate chromatic dispersion in refractions, and step three will use the colorspace to calculate chromatic dispersion in caustics.



The Problem

refraction

Developing a physically accurate chromatic dispersion shader for any platform faces a
number of technical challenges. At the outset, we run into the fact that the computer
has been designed to think of color as a vector consisting of three channels, such as
RGB, or HSV. The behavior of chromatic dispersion, however is based on the frequency of
a particular color of light, and thus the first step in this project must be to teach
the computer how to think in a frequency-based color space.

The second technical issue we run into is how to apply our new colorspace to a
refraction function in a shader. Several issues compound this problem. First, in
addition to the index of refraction being different for different materials, the amount
by which these materials disperse different wavelengths of light also varies. Second,
the relationship of wavelength to index of refraction is non-linear, which adds to the
complexity of using our new colorspace.

The third problem is applying the effect to caustics. All of the previous solutions
will need to be integrated into a caustics solution.

Finally, the entire process will need to be optimized for render costs and made artist-
friendly if it is to be considered a useful tool.


			


Step One: Thinking in Frequency-Based Colorspace

dispersion

A: Determine what the relationship is between H-channel values in HSV colorspace and
the corresponding frequency of light that color has in the real world. This
relationship may be non-linear or even meta-random, depending on how the original
developers of HSV colorspace chose to assign H channel values to colors.

B: Develop a function that remaps the Hue channel from HSV colorspace into the
frequency values of the light color they correspond to, and a corresponding function
that converts this back into HSV colorspace. These functions will act as the interface
between the computer's treatment of color, and the physically accurate frequency-based
equations that will be at the heart of the shader.


			


Step Two: Applying the New Colorspace to Refraction to Generate Chromatic Dispersion

computer graphics

A: Develop and implement a method for storing the non-linear relationship between
frequency and index of refraction in a given material. Ideally, it should also be easy
to edit or create the files in which the information is stored to allow the artist to
create custom effects.

B: Develop a basic function that takes the frequency values given by the function in
Step One and outputs the corresponding refractive index using the storage method
developed in Step Two part A.

C: Develop a method of rendering a variety of wavelengths, or Hue values, depending on
implementation, using the map of refractive index values. This should ideally be as
hands-off as possible for the artist, and should be optimized to minimize render costs
and potential sources of glitches and artifacts. The end result should be as accurate
a portrayal of chromatic dispersion as possible, with no further action required.


			


Step Three: Applying the New Colorspace to Caustics

sources

A: Using the basic framework developed in previous steps, develop a method of rendering
caustics using a variety of wavelengths, again using the map of refractive index
values. Once again, This should ideally be as hands-off as possible for the artist, and
should be optimized to minimize render costs and potential sources of glitches and
artifacts. The end result should be as accurate a portrayal of chromatic dispersion in
caustics as possible, with no further action required.