SBT-raytracer 1.0

// sphere_refract.ray
// Test the refraction term
// Don't forget to increase the trace depth to >= 2!

camera
{
position = (5, 0, 0);
viewdir = (-1, 0, 0);
updir = (0, 0, 1);
}

directional_light
{
direction = (-1, -1, -0.2);
color = (1, 1, 1);
}


point_light
{
position = (-4, -4, -4);
color = (.95, .8, .8);
constant_attenuation_coeff= 0.2;
linear_attenuation_coeff = 0.3;
quadratic_attenuation_coeff = 0.1;
}

// Sphere acts as a lens
scale(.2, 1.5, 1.5, sphere {
material = {
diffuse = (0, 0.10, 0.09);
transmissive = (0.7, 0.7, 0.7);
index = 1.5;
}
} )

// Sphere acts as a lens
translate(-1, .75, -1.5,
scale(.1, .75, .75, sphere {
material = {
diffuse = (0, 0.0, 0.12);
transmissive = (0.9, 0.9, 0.9);
index = 1.2;
}
} ))

translate(-1.12, -.95, 1.1,
scale(.1, .95, .95, sphere {
material = {
diffuse = (0, 0.0, 0.12);
transmissive = (0.9, 0.9, 0.9);
index = .6;
}
} ))

translate(-1.05, 1.3, 1.03,
scale(.1, 1.2, 1.2, sphere {
material = {
diffuse = (0.08, 0.0, 0.0);
transmissive = (0.9, 0.9, 0.9);
index = .7;
}
} ))

// Add a couple of crossed cylinders behind the sphere to
// see the refractive effect.

// Note that the reason these are emissive is that otherwise
// you have problems if transparent shadows aren't implemented.
translate( -2, -1, -10,
scale( .2, .2, 20,
cylinder {
material = {
specular = (.3, .37, .3);
emissive = (0.8, 0.4, 0);
diffuse = (0.6, 0.6, 0.6);
shininess = 80.0;
}
} ) )


translate( 0, 0.5, 0,
rotate( 1, 0, 0, .6,
translate( -2, -1, -10,
scale( .2, .2, 20,
cylinder {
material = {
specular = (.3, .3, .3);
emissive = (0.8, 0.0, 0.4);
diffuse = (0.3, 0.3, 0.3);
shininess = 64.0;
}
} ) ) ) )

translate( 0, 1.5, 0,
rotate( -1, 0, -1, .6,
translate( -2, -1, -10,
scale( .2, .2, 20,
cylinder {
material = {
specular = (.3, .3, .3);
emissive = (0.4, 0.5, 0.4);
diffuse = (0.7, 0.7, 0.7);
shininess = 128.0;
}
} ) ) ) )

translate( -0.550, 0.3, -1.3,
rotate( -1, 0, -1, .6,
scale( .25, 5.8, .25,
box {
material = {
emissive = (0.3, 0.2, 0.3);
diffuse = (0.5, 0.2, 0.7);
specular = (0.3, 0.4, 0.8);
shininess = 128.0;
}
} ) ) )