VRML supports three additional types of lights. They are:
When using a Directional Light the light rays are all parallel. This light has no defined location, only a direction. It is as if the light is far, far away from your world.
A Point Light is a light, placed in your world, which brightens everything around it, the light rays go in all directions from the light's location. Think of the sun for instance.
A Spot Light is a ... spotlight. This type of light creates a cone of light.
Further informationspecific to each type of light is provided in the links above. However if you're new to lighting in VRML then the following should be of some use to help you understand how it is done in VRML. Note: in all the figures bellow the headlight is turned off.
In theory when light rays hit an object the object may reflect the light rays depending on its color and the color of the light. Light reflection depends on the properties of the object being lit. Surely you have seen 3D realistic static images where this effect is present.
However computing light reflection on the fly is hard work. In order to display 3D worlds interactively some short cuts had to done in order for the action to be as smooth as possible. Therefore there is no reflected light in VRML, only direct light is available. This means that if an object is not in the path of the light rays from any of the lights placed in your world it will remain dark.
As a replacement for light reflectiont, the lights in VRML have a field called ambientIntensity. This field controls how much the light contributes to the overall world lighting. With high values for ambientIntensity the world will be a brighter place. Although a crude replacement it can add some realism to yuor world.
Another real world lighting effect is that the light gradually grows weaker with distance. In VRML this feature is implemented. With the field attenuation you can specify how the light drops off as distance increases.
Note that this field only exists for Point Light and Spot Light, it doesn't apply to Directional Light. This is because, as mentioned above, the Directional Light does not have a defined location in the world.
So how does one control lighting attenuation with Directional Light? This type of light only iluminates the objects which are placed within the group where the light is defined. On the other hand, the Point Light and Spot Light are independent of their position within the file, i.e. they're lighting effect is not restricted to the group in which they are defined.
So how does one create shadows? You could create them manually, for instance in the figure above the right sphere could be defined darker than the left sphere simulating shadowing, however this approach is not realistic for anything but very small models. The only approach to block light is to define the objects which are not supposed to be lit by a particular light outside the group where the light is defined, however, as mentioned before, grouping nodes only have effect on Directional Lights.
Basically there is no way out, you're stuck with a shadowless world, unless you're a real perfectionist you're up to some real hard work.
Consider the following figure. In it a Spot Light is aimed at the center of a cubic Box and the cube's face is inside the cone of light defined by the Spot light.
In VRML the light reflection of a flat surface is computed based on the average amount of light which reaches each vertex of the face. So in the first figure we had all vertices equally lit and the face is evenly lit. On the second figure none of the vertices were lit, therefore the face was dark.
The third figure has only one vertex lit, the top right one. Light along the right edge of the face is computed as the average between the top right vertex, which is lit, and the bottom right vertex, which is not lit, therefore the face becomes progressivelly darker as we move from the top right vertex to the bottom right vertex. Similar reasoning can be applied between the top right vertex and the top left vertex, as well as between the top right vertex and the bottom left vertex.
Now look at the next figure.
Color can be applied to lights as well as shapes. You can have blue lights, red lights, brown lights, just pick a color. However there is a detail that you should be aware of.
In the real world pointing a red light to a blue object wouldn't result in total darkness, but in the real world there is nothing like true red light, and true blue objects. All lights and objects in the so called real world have a mixture of colors. When we say that an object is blue we are saying that its stronger color is blue, and not that it doesn't contain any amount of any other color. In computer models true colors do exist though, so be aware.
One possible fixture to this 'problem' is to avoid defining true colors. For instance, instead of defining blue as 0 0 1 in the RGB model which means true blue, define blue as 0.3 0.3 1, i.e. all colors are present altough there is a predominant color. The following figure has a sphere defined with this later 'blue'.
In the following figure a Point light is placed above two Spheres. Note however that while the left sphere is lit correctly, the right one is not affected by the point light.