Spotlight BACKContentsNext
Lights and VRML 2
by by Jeff Sonstein, M.A.
In this column we'll be looking at lighting in VRML 2 and will not only examine the technical details of the lighting nodes but, more importantly, talk about ways to think about lighting in VRML Version 2.

The techno-babble stuff is important in order to understand what is possible and how concretely to accomplish things with VRML. The how is important, but in the end it should not consume our attention. Understanding what we are trying to accomplish and why is more important than any technical knowledge. That will be a lot of the focus of this article.

If the attention of the audience goes to the little guy behind the screen instead of to the magic trick, then no one in Oz will be impressed by the smoke and mirrors

What Lights Can Accomplish

There are basically three parts to any show, and VRML is a show. The three basics are of course: lights, camera, action. Make no mistake about it, these are not three disconnected issues. The best show in the world will be unappreciated if it is unlit. Behaviors of objects as the camera flies by will not be noticed if the lighting doesn't help prepare the audience to shift their attention to the right place. If the attention of the audience goes to the little guy behind the screen instead of to the magic trick, then no one in Oz will be impressed by the smoke and mirrors.

Lighting can accomplish a number of things, among the most important being:

  • establishing lines of viewing
  • focusing audience attention on:
    • what is coming up next
    • sequential objects and/or sets
    • a primary set-focus object
  • reinforcing mood
Let's look at these issues one at a time.
Shadows, Lines, and Lights
People don't view a scene by either grasping the whole all at once nor look at all the pieces one at a time. When people look at something they tend to scan what they are viewing in fairly predictable ways. Because of the way people scan the things they look at, people tend to notice things along lines which divide the viewing area into thirds on the horizontal and into thirds again on the vertical. Take a look at the entryway for the new vrmLab home scene.
Notice how the open door projects out of the picture and into your consciousness. Notice how the sign over the doors attracts your attention early on, even though it is unreadable at this distance. Notice how visible the dragon on the open door is despite the appearance of shadow.
Notice a few things about this screen snapshot. Notice how the open door projects out of the picture and into your consciousness. Notice how the sign over the doors attracts your attention early on, even though it is unreadable at this distance. Notice how visible the dragon on the open door is despite the appearance of shadow. Part of why each of these things is true is due to the 3D appearance of the geometry displayed and the camera shot chosen, but a big part is due to the lighting.
The lighting and the camera angle join to make the door seem to emerge from the scene. The light is not evenly distributed, and this differential lighting of the sides of the open door helps to reinforce your sense of it being a 3D object. The sign has transparent lettering, so you can see through to the other side. The uneven nature of the lighting makes what you can see through the lettering uneven, and this allows to your eye to notice the sign and the lettering. The dragon appears on both the open and closed doors, and both are visible but lit differently. The contrast between the strongly-lit closed door with dragon graphic and the seemingly shadowed open door with dragon graphic helps make the darker graphic more noticible.
Focusing Audience Attention
One of the big differences between Versions 1 and 2 of VRML is the dynamic nature of Version 2. In VRML 1 the author had no control over what happened next in a scene. If the user didn't move around in a VRML 1 scene then nothing happened next: Version 1 scenes were static. In VRML 2 the author has a lot of control over what happens next in a scene. VRML 2 scenes are dynamic, and this is both a blessing and a curse.
That the audience can climb down off the ride to examine something along the way makes VRML much more like a theme park than a video.

An author can make things happen in a scene: lights can turn on and off, things can move around in the scene, and the viewpoint of the audience can be shifted around. The audience can also make these same things happen in a Version 2 scene. This is one of the things which sets VRML apart from old-fashioned CAD-program structured walk-throughs and animations. This interactivity makes VRML at once both richer and more difficult to construct. That the audience can climb down off the ride to examine something along the way makes VRML much more like a theme park than a video.

One problem with this is that if everything in a scene is equally interesting, then unimportant elements may get as much audience attention as important ones. VRML 2 authors can use lighting as a way to draw the attention of the audience to what is scheduled to happen next, or to what the author wants the audience to pay attention to next. By using of differential lighting, you the author can draw the attention of the audience to an area of your set which you want them to investigate instead of forcing them through a lock-step structured walk-through. Lighting can entice the audience to go where you want them to be. Take a look at the opening shot from an early Version 2 experiment at the vrmLab.
When I used this as the opening shot there wasn't as much of a feeling of depth to the scene, and there was less of an draw to move through the scene to investigate its parts
The Temple set shown in the picture at the to the left contains those elements which I really want people to attend to: the globe to the left has a world map on it and can be spun, and both the monitor and the desklamp on the table to the right turn on and off. When I used this as the opening shot there wasn't as much of a feeling of depth to the scene, and there was less of an draw to move through the scene to investigate its parts. I wanted the audience to be drawn immediately into movement, so that the feeling of depth would be enhanced and so that they would get used to the idea that they could move towards and away from things. I decided to place the Temple as a set within a larger context. As you can see, I put the Temple at the end of a road and set up the lighting to draw the audience's attention there. I wrapped a TouchSensor around the spider on the right, so that the audience could click on something which would set off a flight or animation into the Temple.
In reality the road itself is also emitting a color, and the only lighting on the exterior is a simple array of DirectionalLight nodes

The lines of the road draw your attention to the Temple. The streetlamp globes use emissiveColor to seem to be emitting light on the road. In reality the road itself is also emitting a color, and the only lighting on the exterior is a simple array of DirectionalLight nodes. DirectionalLight nodes are cheap, in that they do not add as much processing overhead to a scene as other lighting nodes. The brightly-lit interior scene draws your attention, at least in part because it is lit differently than the rest of the scene. The uneven lighting of the interior set insures not only that your attention will be drawn there but also that you will notice that there are other objects inside the set. The idea is to use lighting to draw the attention of the audience to where I want them to explore next.

As you may imagine, the same ideas may be used to move audience focus from place to place. If you can grab theaudience's attention right away and get them to focus and move where you want them to, then you can chain these focus shifts to get them to move through a sequence of focus-objects or focus-sets. The Temple entices the audience to fly inside, and when they do they see a glowing world globe hanging in space. The glowing world globe on the left entices exploration, as does the brightly-lit tabletop to the right. Again differential lighting helps focus the audience, but this time from place to place in a scene. The glowing street lamp globes focus the audience on the Temple, the bright desk lamp moves their attention to the objects on the table to the right, and the glowing world globe draws them to explore to the left. Movement, perceptual focus, and relative object-importance can all be effected by lighting.

Reinforcing Audience Mood
Differential lighting can also be used to reinforce a particular mood in the audience. The screen snapshot above shows the entryway to the new vrmLab. I wanted ambient lighting in the scene which would 1) allow the audience to see what was going on 2) reveal to the audience details of the interior and entice them inside, and 3) establish a mildly gloomy feeling in the scene. I used an array of DirectionalLight nodes to set up standard three-point stage lighting for the overall scene. I used white signs on the rooms facing the courtyard to contrast with the dark walls and to draw the audience inside. I used an emissiveColor glowing globe near the roof of each room to draw the eye without the expense of "real" lighting and to help define the spaces. Rooms with a light in the middle and pools of deep darkness tend to be perceived as gloomy by an audience, and that is the mood I wanted to reinforce here.

we are not trying to be photorealistic here

The Technical Model

Like I said, the techno-babble details are important but should not consume our focus. Now it is time to look at some of those specification and implementation details. The first thing to remind yourself of when looking at what lighting will and will not do in VRML is that we are not trying to be photorealistic here. There are tools for photrealistic rendering of artificial scenes, and VRML isn't one of those tools. VRML cannot be realistic in how it deals with light, because VRML is designed to allow one to move through a scene in near realtime.

PoV-Ray is my favorite ray-tracing tool. PoV-Ray allows me to create 3D objects and scenes and lighting, and then to generate very real-seeming still pictures out of my scenes. Ray-tracers make stills which look real real, but they are incapable of being the basis for VRML browsers because of the way they deal with lighting. Ray-tracers do just that; they trace the path of each ray of light through the scene, with all the reflection and diffusion and shadowing and filling of shadows by bounced lighting which you see in a photograph of a real scene. This is way too complicated a lighting model to use when the viewer will be flying through a scene. A ray-tracing tool may generate one frame every hour, and someone flying through a VRML scene may need to be presented with five new frames a second to make the flying seem smooth.

What to Expect and What Not to Expect

The lighting model used in VRML trades simplicity for speed, and that is an okay tradeoff. The lighting nodes which are offered are simple: there are just three of them. The specification details of the three types of lighting nodes are also fairly simple.
You cannot expect realistic shadowing. Shadows are caused by geometry blocking the passage of light. Geometry doesn't cast shadows in VRML because it doesn't block the lighting. Shadows are given a sense of realism by being partially filled by light which has reflected off of other objects and has diffused throughout the nearby spaces. Some diffuse lighting within gives detail to a shadowed area in a photograph. Lights do not reflect off of VRML geometry and are not diffused around in the area. The absense of this diffuse or scattered lighting resulting from reflection means that if you just light one side of a wall the other side will seem to be absolutely black and featureless.

You cannot expect any ambient lighting to help out with providing shadow detail, you cannot expect fill or bounce lighting, and you cannot expect geometric boundaries for lighting. You will have to plan lighting carefully to simulate these details, but it is worth the effort for the payoff in audience experience.

Techno-babble Details

VRML just has three kinds of lighting nodes: DirectionalLight, SpotLight, and PointLight. DirectionalLight nodes seem to hit everything from the same angle and from a light source so far off the rays seem to be running parallel to each other. DirectionalLight nodes provide lighting like that from our Sun. DirectionalLight nodes are not supposed to be stopped by group boundaries. The specification for the DirectionalLight node looks like this:
DirectionalLight {
  exposedField SFFloat ambientIntensity  0
  exposedField SFColor color             1 1 1
  exposedField SFVec3f direction         0 0 -1
  exposedField SFFloat intensity         1
  exposedField SFBool  on                TRUE
}
I use an array of DirectionalLight nodes in pretty much every scene I set up, to establish the ambient lighting. Because I use almost the same thing every time, I have constructed an easily-reusable PROTO declaration which looks like this:
PROTO threePointLighting [ exposedField SFFloat keyBright  0.25
                           exposedField SFFloat sideBright 0.25
                           exposedField SFFloat fillBright 0.25 ] {
  Group {
    children [
      DirectionalLight {
        direction 0 -0.5 -0.5
        intensity IS keyBright
        color 1 1 1
      }
      DirectionalLight {
        direction -0.5 -0.5 0
        intensity IS sideBright
        color 1 1 1
      }
      DirectionalLight {
        direction 0.5 0 -0.5
        intensity IS fillBright
        color 0.8 0.8 0.8
      }
    ]
  }
}
As you can see, I just expose the intensity fields to manipulation by outside nodes. It would not be all that difficult to expand the exposed fields to include direction and color so that they can be changed dynamically during the playing-out of a scene. I haven't needed that functionality with this ambient lighting construct, so I leave this generally-useful PROTO alone most of the time.
SpotLight nodes cast a cone of light. The point of the cone is at location, the cone widens in direction, the cone extends out radius from location, and so on. The details in the specifications look like this:
SpotLight {
  exposedField SFFloat ambientIntensity  0 
  exposedField SFVec3f attenuation       1 0 0
  exposedField SFFloat beamWidth         1.570796
  exposedField SFColor color             1 1 1 
  exposedField SFFloat cutOffAngle       0.785398
  exposedField SFVec3f direction         0 0 -1
  exposedField SFFloat intensity         1  
  exposedField SFVec3f location          0 0 0  
  exposedField SFBool  on                TRUE
  exposedField SFFloat radius            100 
}
One of the problems of the SpotLight node is that it is not yet really supported by CosmoPC or any other PC browser plugin I know about. Another problem with the Spotlight node is that it is computationally expensive. VRML authors need to be careful to just use expensive lighting nodes like this to highlight particular areas or objects, and not to provide general scene lighting.

PointLight nodes cast a sphere of light. The center of the sphere is at location, the light covers a spherical area of radius size, and so on. The details in the specification look like this:

PointLight {
  exposedField SFFloat ambientIntensity  0 
  exposedField SFVec3f attenuation       1 0 0
  exposedField SFColor color             1 1 1 
  exposedField SFFloat intensity         1
  exposedField SFVec3f location          0 0 0
  exposedField SFBool  on                TRUE 
  exposedField SFFloat radius            100
}
The PointLight node is also computationally expensive. Use of this node should also be reserved for highlighting and attracting attention, and not for general scene lighting. I used one PointLight node to good effect in the experimental scene at the top of this document; it is inside the desklamp on the table to the right. This PointLight node served two purposes. To begin with, in the opening shot the desklamp differentially lights up the interior of the Temple and attracts the audience to enter. Once they have entered the Temple, the desklamp on the right and the globe on the left help define the space and the centers of focus inside.

Models for Thinking about Lighting

There are ways in which a VRML scene is like a photograph, ways it is like a video or movie, and ways it is more like a theme park. Each of these ways of thinking about VRML gives us useful design techniques, but none is a complete analysis without the others.
Ansel Adams invented a way of thinking about black-and-white photography called the Zone System

The Photographic Model

In some ways, planning out the composition of a VRML scene is like preparing to shoot a series of still pictures. , and it is a useful perspective to take when composing VRML scenes.
The Zone System
Ansel Adams invented a way of thinking about black-and-white photography called the Zone SystemOne basic idea of the Zone System is that a good photo will contain some areas of absolute white and some areas of absolute black and some areas containing each of the eight shades of grey in between. When a photo contains mostly areas towards the white end of things, then it will seem washed out and without depth. When a photo contains mostly areas towards the black, then it will seem murky and full of indistinct shapes. A good photo uses all ten zones in a balanced way to draw attention where desired and to form lines and add depth.
People will notice things in a shot which are placed along the imaginary lines which would cut a shot into thirds horizontally and along the imaginary lines which would cut it into thirds vertically

The Rule of Thirds
I spoke above about how people naturally scan a scene. The Rule of Thirds is about this scanning process. . The snapshot at the left has the vertical lines added, and the horizontal lines are formed by the top and bottom of the building. You can move back and forth between here and the picture above without lines added to compare how you perceive the two. The Rule of Thirds reinforces the presence of the open door and makes the fact that there are dragon pictures on the doors stand out on the vertical. The Rule of Thirds makes the fact that it is a wall we are facing on the horizontal, and combines with the absolute-whiteness of the sign over the door to make it stand out and be noticed immediately.

The Videographic Model

In some ways, planning out the composition of a VRML scene is like preparing to shoot a video or a motion picture. Unlike a still photo, a VRML scene allows movement and may be dynamic rather than static. One contribution the videographic perspective brings to thinking about VRML is that of planning both scenes and sets within the scenes. For example, the experimental scene with the Temple opens up with a wide shot of a road with a Temple at the end of the road. The totality of the scene is dealt with as two sets: and exterior wide shot and an interior shot of the Temple of Knowledge. Ambient lighting is established for the whole scene by using a DirectionalLight array, and a PointLight is placed inside the desklamp within the interior set.

The Theme Park Model

In some ways, planning out the composition of a VRML scene is more like designing a theme park than anything else. In a photograph, the audience cannot move. In a movie, the audience can only move at the rate and over the pathway set down for them. In a VRML scene, the audience can go anywhere they want to go and can do so at whatever pace they desire and in whatever order they choose. In a VRML scene, the audience is somewhat unpredictable.

You can play up to the dynamic nature of VRML by using dynamic lighting; at least you will be able to when the browser plugin writers get this part working right You can play up to the dynamic nature of VRML by using dynamic lighting; at least you will be able to when the browser plugin writers get this part working right. You can have your lighting shift s the audience moves through the space, you can give the audience direct controls to click on to turn lights on and off or up and down, and you can attract the audience from place to place and form their behaviors by using dynamic lighting. Think of it as a sideshow with a particularly unruly audience who you cannot keep from peeking behind the curtains.

Summary

We looked at the technical details of what lighting nodes are defined how in the specifications for VRML Version 2, but we didn't spend a whole lot of time on them. You can learn about the DirectionalLight, SpotLight, and PointLight nodes by reading the specs and by experimentation. What we looked at which is more important is how to think about lighting when planning out a VRML scene or set.

Lighting can be used to form lines of attention, to inform the audience where to look next, to set a mood, and to draw and reinforce behaviors by the audience. Lighting is an important element in planning a VRML scene.
Jeff Sonstein, M.A. is the Networks Administrator for New College of California, runs the consulting firm of Sonstein and Associates, and started the vrmLab in early 1995 as a virtual space for VRML experimentation. Jeff holds an M.A. in Social-Clinical Psychology, has been playing with computers since the early 1970s, and currently lives with his family in San Francisco.

BACKContentsNext
© 1996 Aereal, Inc. Please send suggestions to suggest@vrmlsite.com.