Lighting in Lightwave
Amaan Akram--November 1999

Note: This tutorial was written for Lightwave 5.5, but can be applied to any 3D software.


Contents

1.      Preface

2.      Introduction

3.      Some Characteristics of Light

    • Color
    • Reflection & Refraction
    • Intensity Falloff

4.      Observing Light

    • Natural Light
5.      The Lightwave Lighting Engine

6.      Some tips on Lighting.

7.      Application

 

Preface

Lighting in Lightwave is a tutorial designed for application of lighting theory to computer graphics and requires a basic understanding of 3D principles. I will predominantly concentrate on natural lighting, but will mention a few things about artificial lighting as well. The overall thrust of my article will be to produce photo-realistic images by applying good lighting techniques and post-processing. In the first part of this article will explore the theory, and in the second part, I will take you through a step-by-step tutorial to produce a simple 3D scene lit by simulated sunlight. I will try to make the application part of this article as much software independent as possible so that you can try out the techniques mentioned in your choice of software.

Introduction

Design, modeling, surfacing, lighting, animation, rendering and post-processing—these are some of the aspects that we generally look at during the span of each project. For most of the people that I have come across, the greatest stress has been on modeling and it declines as we move on to other aspects. The most neglected aspect is that of proper lighting. Place a few lights here and there and then relying on the software’s rendering engine will only get you so far as to come up with a synthetic (in other words, pathetic) looking image. The goal for some of us is photo-realism, and that requires not good modeling, but good surfacing and good lighting. It is easy to get away with images that require artificial lighting because we are not that familiar with it when compared with natural lighting. Replicating sunlight inside your 3D software is hard. The audience, being familiar with sunlight, is very quick to point out any irregularities. Certainly, those who are in the business of replicating sunlight need to be extremely observant of how natural light reflects, refracts, changes color, and changes intensities in nature. Simulating natural light requires a lot of consideration regarding the position, intensity, and color of the light sources used.  

Some Characteristics of Light

Color

The color of light depends upon its source. White light is composed of all the possible colors that exist. A ray of white light changes color if it encounters an obstacle, which is not white and is not black. If it hits a white object, the same ray is reflected. If the object is black in color, all the light, no matter what color it was originally, is absorbed by the object and nothing is reflected. So basically when you look at a totally black object, you see the color black because no light enters your eye from that direction. To prove this thing, I ask you to close your eyes for one second. Which color did you see?

In Fig. 1 below you can see a white incident ray of light, which is reflected off a blue floor. The floor absorbs all the colors in the incident ray except blue, and reflects it. Note that the light is reflected at the same angle at which it was incident relative to the floor.  

Fig. 1

Any object that is in the path of the reflected blue ray will be lit by blue light only, provided that the white light is not incident on the same object. If it is, the object will have a blue tinge.  This blue tinge is caused by radiosity, a phenomenon that is not implemented in most 3D software because of the tremendous mathematical complexity of radiosity algorithms.

Reflection & Refraction

 Figure 1 shows perfect reflection which is impossible in the real world. Perfect reflection is possible only if the reflecting object is absolutely smooth. In reality, what happens is that not all of the original incident ray is reflected in the same direction. Some of it is reflected off at odd angles to the floor [Fig. 2]. This in turn reduces the intensity of the reflected ray even more.


Fig. 2

The same thing happens when light is refracted. Light is not just bent I one direction, but the incident light is divided into several components and refracted at different angles owing to the imperfection in the refracting surface.

Both these irregular reflections and refractions lead to blurred reflections and refractions. This also leads to the fact that the reflected light serves as a point light source (as in the case of Fig. 2), rather than a single direction light source (as in the case of Fig. 1). In Fig. 2, the reflected light ends up lighting up much more of its surroundings than in the case of Fig. 1.

One more point to note that the intensity of the reflected light declines in an exponential manner. You will read more about intensity fall-offs in the next section.

Basic reflection is supported by current-day 3D software. Any object having reflection properties defined will bounce an incident ray. The number of times the ray bounces is controlled by the Ray Recursion Limit which you can set in most 3D software.

Intensity Falloff

A Light ray’s intensity falls off with the square of the distance from the source of the ray. In many of today’s 3D software, falloff calculations for lights are done on a linear scale. There are some that directly support exponential, or inverse-square falloff. In the case of exponential falloff [Fig.4], the light intensity decreases a lot more as you move away from the light source than in the case of linear falloff [Fig. 4].


Fig. 3


Fig. 4

3D Studio Max directly supports exponential falloff, whereas in Lightwave 3D 5.6 you can use Gaffer, a plugin from Worley Laboratories, or Realitools Volume 2 from Dynamic Realities to get exponential falloff. Later on in the article, I will show you a post-processing technique that can get you almost the same results as those you get with exponential falloff. (If you have Lightwave [6], it already has support for exponential fall-off lights)

That was a very brief look at some of the characteristics of light that one should know before getting involved in lighting. Now we shall see how these characteristics affect natural light.

Observing Light

I will begin this section with a look on Natural Light, and will then briefly mention a few points on artificial lighting.

Natural Light  

Natural Lighting, or real world lighting, comes in a myriad of forms. It would perhaps take you an incredibly long amount of time to study each and every aspect of natural light, but for this article, I will limit myself to the basics.

Outdoors, the sun during the day is the primary source of light. The light is slightly yellow in color, but a closer look at your surroundings will point out that yellow colored light is not the only color that is affecting your surroundings. While the sun’s light is the primary light, one could say that there are at most an infinite number of secondary light sources emitting light in all sorts of colors that are found outdoors. In describing the characteristics of light above, I mentioned how light of one color changes to another color when it encounters an obstacle that is different from the color of incident ray of light. I also mentioned that some light is scattered when it is reflected or refracted. Now consider the world outside of your room. There are trees that are brown and green, grass that is totally green, pavement is gray [though not always] and so on. So an actual sample of outdoor light would be composed of many colors, but the most active color would be that of sunlight.  Even when there is not much in the surroundings, there will still be some ambient light. Even in the Sahara, shadows are not completely black. The dust particles in the atmosphere (even the atmosphere itself) reflect light.

Every leaf, every brick, even every human is in essence acting like a secondary light source! However, these secondary light sources are extremely dependent upon their color and the intensity of the light that they are reflecting.  If the color of the reflecting object is dark, then it will not reflect a lot of light. Most will be absorbed. And coupled with exponential falloff, the range of the reflected light is reduced even further. But if the color of the reflecting object is bright, say a white wall, then it will have considerable effect on the light distribution in its surroundings. In Fig. 5 below, the light from the yellow wall spreads a lot more on the floor than the light from the blue wall.


Fig. 5

It is also worth noting that the color of light changes during different times of the day. At dawn, sunlight has a red tinge. At sunset, the red tinge is more apparent. In between these two, the light’s yellow tinge is more apparent.

 Shadows change position as well as their shape during the course of a typical day. At dawn, there is no primary light source. All the light that we see at dawn comes to us after being reflected off the atmosphere. I am assuming here a place where there are objects between you and the sun, so that at dawn the horizon is not visible. In such a situation, it will be hard to find a well-defined shadow. The whole sky acts as a kind of a primary light source. Other objects do reflect light, there is not enough of it to have a significant effect.  Shadows are incredibly soft-edged.

Around mid-day, the shadows are much sharper. The distance between the shadow-casting object and the shadow-receiving object defines the sharpness. The variation in shadow sharpness is shown below in Fig. 6. I have exaggerated the softness of the shadow along the distance of the plane to illustrate my point. In reality, direct sunlight makes the shadows grow softer at a much slower rate as the distance between the shadow casting object and the shadow receiving object increases. The rate at which the shadow changes its sharpness is dictated by the size of the light source. The bigger the light source relative to the obstructing object, the greater will be the rate of increase of the shadow’s softness.


Fig. 6

At sunset, if an object is not directly being lit by sunlight, then its shadow will be extremely soft and will only be make a noticeable presence at the base of the object [Fig. 7]. The same can be said about shadows at dawn. The whole sky acts as one big light source and the light that comes from it hides most of the shadows. It is also worth noting that objects that are placed within shadows cast the same soft-edged shadow, but only when they are very close to some surface [Fig. 7].


Fig. 7

The Lightwave Lighting Engine

Lightwave’s lighting engine is one of the finest that you can find on the market. All of the power of Lightwave’s lighting is hidden behind an easy to use interface. Lightwave gives you five kinds of light types

  • Distant Light
  • Point Light
  • Spot Light
  • Linear Light
  • Area Light

The one difference that separates a distant light from all the other light types is that it casts parallel rays of light on to the objects. For all the other light types, light emanates from a point and goes out in a radial fashion. (In the case of Area and Linear lights, there are several of such light-emanating points arranged close together)

The one other light type defined in Lightwave is Ambient Light. While I would not advise using ambient light in every scene that requires certain areas to be lit, it does come in handy when you have to light up a certain area that is not that obvious to the viewer’s eye. You must be careful in setting up ambient lights if you already have lights placed in the scene. The reason for this is that ambient light will affect each and every light that exists in your scene. If you must use ambient light, then set its value at the start of the scene when all objects have been layed out and there’s only one light in your scene.

While Lightwave’s lighting engine will not allow you do specify surfaces that will be affected by certain lights (does not apply to Lightwave 6+) and not by others (selective lighting), you can mimic this effect to a certain extent by playing around with light settings.

Consider the Lightwave scene shown below. You will notice a floor plane and a wall plane. There is one light, the Main Light that lies above the two planes. Main light affects both the planes in the scene. The Simulated Floor Light has been placed under the floor plane and its shadows have been turned off. This way the light will affect only the wall plane, and not the floor plane. It will affect the floor plane from below, but we will place the camera above the floor plane, and therefore, will not see the effect of the Floor light on the floor.


Fig. 7.1


Fig. 7.2

This Floor light actually simulates bounced light from the floor (radiosity) to some extent. Note that I have also turned on ‘No Specular’ from the Lights menu for the floor light. This was done because if there were more objects placed in the scene with specular settings for their respective surfaces, then you would see the specular spot on the objects. The floor acts like a huge area light source with low intensity and would not cast specular hotspots on objects. We are using a point light here to simulate the floor’s reflected light and that would lead to a specular spot that is concentrated and not spread out. Therefore, it is advisable to turn on ‘No Specular’. (You could replace the point light with an area light for more realism, but then be prepared to wait as the rendering times will go up real high)


Fig. 7.3

Also note that I have turned on intensity fall-off for the Floor light to produce a more realistic lighting setting.

Before moving onto the next section, I would like to advise that if you use area light sources in your scene, keep their area small. A very large area light may produce very ‘noisy’ shadows that you may not be able to smooth out even with ‘Enhanced High’ anti-aliasing settings. If you have a use a huge area light source and still want acceptable shadows, break the one huge area light source into smaller area light sources (the trade off here is longer rendering times)

 

Some tips on Lighting

While I am no master of lighting as yet, I would like to share a few things that I have learnt about compositing a scene. But before I do that, I would like to point out that you should get yourself a book on lighting if you are a beginner (if you are not, then you should not be reading this article J ). One book that I have found very useful is Painting With Light (University of California Press). The book is written by the ace cinematographer of the age of black-and-white movies, John Alton. The book has no colored illustration and concentrates on some very effective techniques of film lighting. I would recommend the book to anyone who is planning to study indoor/outdoor lighting.

I have also found magazines of photography as very helpful in studying lighting techniques. One can learn so much by studying the art of those who have mastered the fine art of lighting. 

Now getting back to the subject at hand—lighting tips. I would recommend that you start out with simple black-and-white lighting studies. While this will keep your mind off the larger color spectrum, this exercise will give you some knowledge of how to play around with contrast to bring your subject to the attention of the viewer. John Alton once said, “Black and white are colors.”

The following renderings were done in Lightwave after looking at some lighting concepts in Alton’s book (In fact, they are almost exact replicas). They illustrate the concept of contrast and how it can enhance the shape of your subjects.


Fig. 8.1  (Average Approach)


Fig. 8.3  (Better Approach)


Fig. 8.3

Fig 8.1 shows how lack of contrast leads to a loss of shape definition for the two cubes. In Fig 8.2, the places of the cubes have been interchanged and that has brought out their features much more than in the previous case. (You could also have solved the problem by rotating the light by an angle of about 90 degrees so that it would face the wall behind the black cube in Fig. 8.1) Fig. 8.3 is just another very simple example of the use of contrast and how it has brought out the back of the cube.

However, it is not necessary for your images to have high contrast in them. It depends on the scene and the mood that you are trying to create. A comic scene should be lit brightly, though not necessarily. With a sad scene, contrast can play a major role and it should be thus emphasized more. The mood of a scene that is tragic can be enhanced by a strong contrast of deep blacks and blazing whites.

A Practical Example   

In this section I shall take you through the setup of a very simple scene in which I shall apply the lighting concepts discussed in the previous sections. (Note that this scene does not require any 3rd party plugins, but I will stress the need to use one to enhance the image)

The Scene: A roadside café. Time: afternoon. We shall only concentrate on a table, two chairs and other objects to fill up the scene. (See Figure 9 below)


Fig. 9

Most of the objects (the table, the chairs, the stool, the ashtray, the plate, and the potted plants) in this scene were taken from Lightwave’s CD. The cloth was modeled using Metanurbs, and box and the cylinder are Lightwave’s primitive objects.  The road and the sidewalk consist of planes and the curb is just a plane extruded along a path.

In Fig. 10 and Fig. 11 Below, I have setup the scene in Lightwave. The objects in the scene have default surface settings for diffusion, specularity etc. (Note that the objects taken from the Lightwave CD come with preset surface settings)


Fig. 10


Fig. 11 

(I have temporarily removed the preset surfaces 

of objects from Lightwave’s CD)

Fig. 11 shows a rendered image of the textureless scene. I applied some real world textures of cement, concrete and wood to get to Fig. 12 (below).


Fig. 12

The scene has one distant lightsource, which is pointing towards the table and ambient intensity is at 25% (Lightwave’s default value). Note that the road is too dark, the legs of the table are too bright, the chairs and the stool are too dark. The cloth and the box on the table are too bright. The problem is here is not the intensity of the light coming in from the distant light, it is the diffusion values that I have set for the objects in the scene. No matter how you adjust the intensity of the light or its angle, if you do not set the diffusion values of your surfaces properly, you will always end up with such disparities.

In Fig.13 below, I have reduced the diffusion values of those objects that were too bright, and increased the values of those that were too dim.  I have also increased the light intensity from 100% to 170%.


Fig. 13

Note that some parts of the image are still dark and some are still bright. I am talking about the two chairs in the scene. The one farther from the camera is brighter than the one closer to the camera. But both of them have the same surface! We have hit another problem and that is of the angle of the chairs relative to the light. We have used a distant light source up till now. Either we can add another light slightly displaced from the position of the light present in the scene, or we can use area lights. If we add another distant light and displace it slightly, it might fix the disparities in the brightness of objects in the scene, but it will lead to two shadows for all objects. That is not how it is, at least on this planet. Even with the single distant light, the shadows are unrealistically sharp. Replacing the distant light with a distant shadow-mapped spotlight will not solve the problem entirely. While the shadows will become soft, their softness will not vary as the shadows moves away from their parent objects (If the shadows are not playing a major part in the picture, then one should use shadow-mapped lights instead of area lights).

Until now I have not really applied what I have discussed in the previous sections. Now it is time…to get real. I will replace now replace our primary distant light source with an area light placed far into the ‘sky’, reduce the ambient intensity to 0% (like it is in the real world), and add some fill lights to the scene to simulate bounced light from the surroundings.


Fig. 14

In Fig. 14 above, the sun simulating light source is an area light source with a small area. The settings for the light are as follows.

Light Type:       Area

Intensity:          90%

Color:              Red—252, Green—201, Blue—143

Shadow Type: Ray Trace

No Diffusion:    Off

No Specular:    Off

Fig. 15 and Fig. 16 show a close-up view of the scene and descriptions about other fill lights in the scene.


Fig. 15 (left View)


Fig. 16 (Top View)

The Reflected Floor Light has been placed just below the ground. This has been done to simulate the reflected light from the ground and to serve as a fill light. The settings for the light are given below.

Light Type:       Point

Intensity:          30%

Color:              Red—255, Green—225, Blue—198

Shadow Type: Off

No Diffusion:    Off

No Specular:    On (box checked)

 

Settings for the light labeled ‘Fill Light’ are given below.

Light Type:       Distant

Intensity:          35%

Color:              Red—255, Green—225, Blue—198

Shadow Type: Off

No Diffusion:    Off

No Specular:    On (box checked)

 

Again, the purpose of this light is to fill up dark areas and make them a bit brighter.

 

Settings for the light labeled ‘Reflected light from surroundings on the right’ are given below.

Light Type:       Area

Intensity:          47%

Color:              Red—255, Green—225, Blue—198

Shadow Type: On

No Diffusion:    Off

No Specular:    On (box checked)

 

Note that this light has shadows turned on and its long and narrow in size. This size was made this was to simulate light that is reflected off say a wall on the right of the table, not visible to the camera.  The shadows have been turned on for this fill light in particular because area lights tend to produce much realistic shadows and in our case, the light produces an extremely soft shadow for the stool. Now you can say that an area light source will push the rendering time upward and turning on the shadows will have the same effect. Well, you are right in saying that. But when I replaced the light with a distant light with shadows turned off, the scene hardly looked realistic. Consider the figure below and see how the stool casts no shadows onto the floor that lies within the shadow of the table.


Fig. 17

With the long and narrow area light with shadows turned on, the resulting image came out to be much better looking. (Fig. 18)


Fig. 18

With this done, we are ready for the final render. However, we are not done yet. I have noticed that sometimes Lightwave tends to over-saturate colors, especially when using light intensities beyond 100%. To fix this, I sometimes take my Lightwave renders into PhotoShop and reduce the color saturation. I also increase the contrast of my images to counter Lightwave’s linear light fall-off. (there are plugins available that let you adjust hue/saturation/brightness/contrast etc. from withing Lightwave) And if my image looks too clean, I sometimes tend to add some noise into my images.

Before concluding this article, I would like to remind you again about diffusion settings. If you can’t get it right by playing around with light settings, play around with the diffusion settings. Diffusion settings have a strong impact on the realism value of the scene, and should never be taken lightly.

So go out in the sunlight…and just observe, but carefully…and you shall become themaster of natural lighting.

 

ALL CONTENTS OF WARPEDSPACE.ORG ARE OWNED & COPYRIGHTED BY AMAAN AKRAM, UNLESS STATED OTHERWISE
COPYRIGHT © 1996 -- 2007 AMAAN AKRAM