CS184 Lecture 29 summary

Lighting in VRML

VRML includes several kinds of light sources. Here is an example of a point light source in a world of spheres. This example and several that follow are taken from the online version of the VRML sourcebook. Notice that the area of the spheres illuminated by the light increases with distance from the sources (which is correct), but the brightness of the surface illuminated by the source does not decrease (it should fall off as 1/r2 ).

VRML is like many other simple rendering systems in that it does not incorporate all the properties of light (especially 1/r2 attenuation). This helps keep the relative brightnesses of a scene in a narrow range, which allows the scene to render on color displays with only 8 bits of range in each color. You should treat the intensities in VRML as relative numbers only, not real light intensities. They generally do the right thing locally, and lead to objects that look OK by themselves. But global values are far from accurate.

Here is the same light source and world but with some added ambient light. Notice that the dark parts of the spheres are not perfectly dark any more.

Here is a world with an animated light source which moves and changes color, simulating the sun. You can pick the angle of the source from the line of highest brightness on the cylinder surfaces, given that diffuse intensity is independent of the viewing angle.

Here is an example of a Vase with a varying amount of shininess (the exponent in halfway vector version of the Phong model). In VRML, the actual exponent is 128 * shininess, where shininess is a material property. A matte vase with no specular component, a slightly shiny vase with exponent 6, a shiny vase with exponent 10, and a very shiny vase with exponent 20. Here is a gold vase whose diffuse color is different from its specular color (exponent = 20).

A horn model also has different specular and diffuse colors (exponent = 80). This model highlights the sensitivity of appearance to the exact direction of light source and view.

VRML does not compute shadows. You can fake them (in an obvious way) by placing flat objects with the shape of the shadows onto the surfaces where the shadows are cast. Here is an example.

The VRML lighting model is available in the spec here.