ambient red green blueThe colour "red green blue" is 3 numbers (each ranging from 0 - 1), that together create a colour.
The ambient is used to model the surface's background colour, that is, the object's colour if it wasn't receiving light. The ambient light source in a scene may be defined, by default it is 1 1 1.
Every part of every object will receive the ambient defined for it's surface.
See example below.
diffuse red green blueThe diffuse light is the light received on a surface from a light source, including light reflected from other surfaces.
See example below.
specular red green blueSpecular light refers to surface "highlights".
See example below.
specpow exponentThe specpow controls the size of specular highlights: the larger the number the smaller the highlight.
See example below.
In the example below, very different colours are used for ambient, diffuse and
specular:
Figure 4-2
/*
surface_test.ray
rayshade file to show the difference between
ambient, diffuse and specular colours.
Stephen Peter, 4 september 1990
*/
eyep 20 -15 15
lookp 7 0 0.1
screen 300 200
light 1.4 extended 0.2 0 0 7
surface t1
ambient 0.5 0 0
diffuse 0 0.5 0
specular 0 0 0.5
specpow 22
reflect 0.2
box t1 5 -3 -0.1 15 3 0.1
cylinder t1 4 1 -3 0 1 3 1
Go to next section: Reflectivity.
Return to Contents.
THE END - Notes on Rayshade - 4 - Defining Surfaces