Prism - dispersion

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:

prism dispersion

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.

prisme dispersion

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”.

prisme dispersion

 

 

/////////////////////////////////// //
//
// REYNALD
// 2005
// unit: mm
//
//
///////////////////////////////////

#include “colors.inc”

///////////////////////////////////

#declare ior_violet = 1.790; // indice de réfraction du sapphire pour le violet (380nm)
#declare ior_red = 1.763; // indice de réfraction du sapphire pour le rouge (720nm)
#declare sapphire = material{
texture {
pigment { White filter 1 }
finish {
ambient .01
diffuse .05
reflection 0.1
//conserve_energy
}
}
interior{
ior (ior_violet + ior_red)/2 // Indice de réfraction moyen du sapphire
dispersion ior_violet/ior_red // rapport ior(500 nm) / ior(2350 nm) –> 1.012
dispersion_samples 50
media {
scattering {
1 , rgb 0.2*<0.1, 0.1, 0.1> // isotropic scattering
extinction 0.000001
}
}
}
}

// Photons /////////////////////////

global_settings {
max_trace_level 10
photons {
count 10000000
autostop 0
media 100
max_trace_level 10
}
}

/////////////////////////////////// //
// CAMERA - SOURCE
//

#declare px = 50; // Position of the screen along x

camera { // Camera in front of the screen
location <px-5,0,0>
look_at <px,0,0>
angle 20
}
/*
camera { // Camera for global view
location <20,5,-25>
look_at <30,0,0>
angle 60
}
*/
light_source { <0,-11.5,0> // Source
color 2*<1,1,1>
cylinder
//spotlight
radius 0.05
falloff 0.05
point_at <20,0,0>
//fade_distance 20
//fade_power 2
}

light_source { <-500,500,-500> 0.75*White
media_interaction off
media_attenuation off
photons { reflection off refraction off }
}

//
//
///////////////////////////////////

// Object ///////////////////////////

// Prisme ———————————————————-

#macro Prisme(base, ouverture, profondeur, matiere, a,b,c, anglex,angley,anglez)
prism {
linear_spline
0, profondeur, 3,
<-base/2,0>, <base/2,0>, <0,base/(2*tan(pi*ouverture/360))>

material { matiere }
photons {
target
reflection off
refraction on
collect off
}
rotate <-90,0,0>
translate <0,-base/(4*tan(pi*ouverture/360)),profondeur/2>
rotate <anglex,angley,anglez>
translate <a,b,c>
}
#end

object{Prisme(4,35,5,sapphire,20,0,0,0,0,10) hollow}

//—————————————————————-

cylinder { <px,0,0>, <px+1,0,0>, 5 // Screen
//pigment {checker White Green}
pigment {White}
}

plane {
y, -50
pigment {checker White Wheat scale 100 } // base checker
}

background {Quartz}

// Container ////////////////////////

#declare transparent_with_media = material{
texture {pigment { White filter 1 }}
interior{
media {
scattering {
1 , rgb 1*<0.1, 0.1, 0.1> // isotropic scattering
extinction 0.000001
}
samples 50,1000
}
//fade_distance 20
//fade_power 2
}
}
/*
box { <-100,-10,-100> <100,100,100>
material {transparent_with_media}
hollow
photons {pass_through}
}
*/

///////////////////////////////////

Leave a Reply

You must be logged in to post a comment.