Prism - dispersion in media
November 14th, 2005Media also collect colored photons. Parameters (photon –> count, media and media –> samples) have to be chosen carefully to see something and to avoid ouver-memory trouble.

Media also collect colored photons. Parameters (photon –> count, media and media –> samples) have to be chosen carefully to see something and to avoid ouver-memory trouble.

Actually refraction index (n) is not a constant. It depends on wavelength n(lambda). The consequence is a difference in refraction directions for any color in the spectrum. POV-ray simulates this effect with the dispersion function. In this example we use a sapphire prism, a small cylinder light and a white screen:

Since the light beem is very small, photons count need to be increased a lot, to avoid missing light spots just because of under-sampling reasons.
POV-ray considers a linear relationship between n (refraction index) and lambda (wavelength,… or color) through the visible spectrum (violet:380nm < lambda < red:720nm ). ior need to be the mean refraction value and dispersion the ratio between violet and red refraction values.
Image 1 shows the screen without dispersion. In image 2 dispersion has been activated using the default dispersion_sample value. In image 3 dispersion_sample has been fixed to 50.

The result using a “red light” (<1,0,0>) is shown in the first image below. The second image corresponds to a “green light” (<01,0>) and the last one is the dispersion of a <1,1,0> ” light”.

Once more we have a case similar to the beam reflected in a mirror. Attenuation fade_distance and fade_power have to be added in the light source block (image 2). The same attenuation added to the container interior do not affect the beam after refraction in the lens (image 3).

If we want to see the effect of the lens on a light beam we have to use photons. We add a hollow container with a scattering interior media and a light beam source. Also don’t forget to add “hollow” to the lens for the interior media to be effective. Image 1and 2 show the result using a cylinder light and a spotlight respectively.If we remove the container (interior media) to use atmospheric media we get the same result, already noticed in the case of mirror. Photons do not deposit in the atmosphere after refraction (image 3).

Index of Refraction (iro) is the physical parameter that determines how much light is bent at the boundary between twe different transparent interiors. Index of refraction is a characteristic of each material and it is actually a function of wavelength. This wavelength (color) dependancy will be discussed later, we first use a mean refraction value to demonstrate how to make lenses that are really effective using povray. The geometric effects of lenses on light rays is resumed in the Snell-Descartes law:
n1*sin(θ1) = n2*sin(θ2)
where n1, n2 are the refraction index of materials 1 and 2 and θ1, θ1 are the angles between the rays and the interface normal.In the example below we use a lens made of BK7 (which is a common glass), the mean refraction index is 1.52. In image 1 we see a checkered screen without lens, in image 2 we add the lens and image 3 is a side view of the same scene.
