Sculpted Surface? ] Sculpted Tubular ] Sculpted Complex ] Lamp ] [ Lighting ] Spotlight ] Midi Media ] IFS Edit ] IFS_SOI ] Texture Coords ] Animations ] Animation Chat ] Two Animations ] Door ] Gestures ] Complex Avatar ] Heads ] Proximity Sensor ] Proximity VP unbind ] Switch Node ] Guided Tour ] Beam Slowly ] Stairs? ] Walk ] Duck Shoot ] Navigation Box ] URNs in URLs ] Play a mp3? ]


Let there be light! 

In VRML there are three or four different kinds of lights.

  1. Point Light
  2. Directional Light
  3. Spot Light

There is also the default head-light. It is a light that "shines" from the users viewpoint and illuminates whatever they turn and look at, like the head-lights on a car. If you want total control on how everything is illuminated, you can turn off the head-light by using the Navigation Information node.

A point light may be thought of like a plain light bulb hanging on a wire in the middle of a room. The light rays radiate in all directions from that central point. One point light can uniformly light up an entire room.

Directional Lights give you better control over how much light shines on what. Think of them as beams of parallel rays all shining in one direction. What I tend to do is make six of them. The one shining down from above is the brightest (intensity=1). Then I put one shining in from each side, these are lower intensity (0.6 to 0.8), you do not want too much light to wash out the scene, but you do want the walls lit up. I may make the light from the left or front stronger that that from the right side of back. This causes greater variation on how the lights play out on the scene. Lastly, I add one shining upwards to light up the ceiling. Usually I use a weak light for that, say with intensity of 0.3. 

Spot Lights are useful for illuminating individual items or key points you want someone to see. They shine in a radius of a cone

VRML lights are not like real life lights in several ways. They shine through geometry (like walls do not stop them), so you do not need a light in every room just one from each primary direction will do. 

For a surface to be nicely illuminated, it needs to have more points (vertices) than just the four corners. The light effect is just calculated on just the points and distributed across the surface, so if you have more points the "drop off" (attenuation) effect is more noticeable. This is why if you make a house of simple boxes the lights do not show up to well. Adding a few more points to the surface enhances the play of light on the object greatly. 

Lights only shine of their children or items in their group or sub groups in the scene graph hierarchy. So, your general scene lights should be at the top or outer level of  the scene tree. This is so if you have an house that is nicely lit and we combine it in a world with my house, that your lights do not effect my lighting. Imagine adding many house to a street, many streets into a city, etc... if my lights & your lights shone on everything the light pollution would be great and the browser would bog down trying to do all those lighting calculations.  A problem with earlier versions of some browsers (blaxxun Contact 4) was that they did not follow the VRML specification in this regard. This allowed many builders to take advantage of the "broken" lighting model and not think about where to group their lights in the scene. More recent versions of Contact do follow the specification, this has cause many of us to have to go back and move the lights to the top level of the scene graph.

Point Light

Directional light. 
Subtle difference, but see how this one is shining in one direction only (front to back)?

Here I have added five more directional lights each shining in one direction (up, down, east, west, front, back). You may want to make each at a slight angle to the principle axes (not all at 90 degrees). 

On the lights pointing from the sides and up, I have lowered the Intensity, maybe a different amount for each one. 

If you are going to add lights from every direction, remember to add a NavInfo node in order to turn off the headlight so the scene does not get too washed out. 

Here is an example WRL and SPZ file:


Back ] Home ] Up ] Next ]