Blender Documentation: Last modified May 20 2003 S68
<<< Previous | Lighting | Next >>>

# Tweaking Light

Ok, now you've got the basics. Now we can talk of ligh. We will work on a single example, more complex that a plain 'sphere over a plane' setup, to see what we can achieve in realistic lightning with Blender.

We will resort to the setup in Figure 25. The humanoid figure is a gynoid - that is the female counterpart of an android - we will call her Liliana[1] in the following. She has a dull grey material (R=G=B=0.8, Ref=0.8 Spec=0.05, Hard=20 - Yes, a shiny chrome would have fit her better, but we are talking of lights, not of materials!) and stands on a blue plane (R=0.275,G=0.5,B=1.0, Ref=0.8, Spec=0.5, Hard=50). For now she's enlighted by a single spot (Energy=1.0, R=G=B=1.0, SpotSi=45.0, SpotBl=0.15 ClipSta=0.1,ClipEnd=100,Samples=3,Soft=3, Bias=1.0, BufSize=512).

Figure 25. Light tweaking setup.

A rendering of Liliana in this setup, with OSA=8 and Shadows enabled gives the result in Figure 26. The result is ugly. You have very black, unrealistic shadows on Liliana, and the shadow cast by Liliana herself is unacceptable.

Figure 26. Simple Light Spot set up.

The first tweak is on ClipStart and VlipEnd, if they are adjusted so as to encompass the scene as tightly ads possible (ClipSta=5, ClipEnd=20) the results gets definitely better, at least for projected shadow. Liliana's own shadow is still too dark (Figure 27).

Figure 27. Single Spot Light set up with appropriate Clipping.

To set good values for the Clipping data there is an useful trick: Any object in Blender can act as a Camera in the 3D view. Hence you can select the Spot Light and swithc to a view from it by pressing CTRL + NUM 0. What you would see, in shaded mode, is reported in Figure 28.

All stuff nearer to the Spot than CLipSta and further from the spot than ClipEnd is not shown at all. Hence you can fine tune these values by verifying that all shadow casting objects are visible.

Figure 28. Spot Light Clipping tweak. Left: ClipSta too high; Center: Good; Right: ClipEnd too low.

What is still really lacking is the pysical phenomenon of diffusion. A lit body shed light by itself, hence shadows are not completely black because some light leaks in from neighbouring lit regions.

This light diffusion is correctly accounted for in a Ray Tracer, and in Blender too, via the Radiosity Engine. But there are set ups which can fake this phenomenon in an acceptable fashion.

We will analize these, from simplest to more complex.

## Three point light

The three point light setup is a classical, very simple, scheme to achieve a more soft lighting of a scene. Our Spot Light is the main, or Key, Light of the scene, the one casting shadow. We will add two more lights to fake diffusion.

The next light needed is called 'Back Light'. It is placed behind Liliana (Figure 29). This illuminates the hidden side of our character, and allows to separate the foreground of our picture from the background, adding an overall sense of depth. Usually the Back Light is as strong as the Key Light, if not stronger. Here we used an Energy 1 Lamp Light (Figure 30).

Figure 29. Back Light set up.

Figure 30. Key Light only (left) Back Light only (center) and both (right).

The result is already far better. Next and last light is the third or 'Fill' Light. The Fill light aim is to light up the shadows on the front of Liliana. We will place the Fill Ligh exactly at the location of the camera, with an Energy lower than the lower of Key and Back Lights (Figure 31). For this example an Energy=0.75 has been chosen (Figure 32).

Figure 31. Fill Light set up.

Figure 32. Key and Back Light only (left) Fill Light only (center) and all three (right).

The Fill light makes visible parts of the model which are completely in darkness with the Key and Back light only.

| Color leakage

The three-point set up can be further enhanced with the addition of a fourth light, expecially when a bright coloured floor is present, like in this case.

If there is a bright coloured floor our eye expect that the floor diffuses part of the light all around, and that some of this light impinges on the model.

to fake this effect we place a second spot exactly specular to the Key Light with respect to the floor. This means that - if the floor is horizontal and a z=0, as it is in our example, and the Key light is in point (x=-5, y=-5, z=10), then the floor diffuse light is to be placed in (x=-5,y=-5,z=-10), pointing upwards (Figure 33).

Figure 33. Floor Diffuse Light set up.

The energy for this light should be lower than that of the Key Light (here it is 0.8) and its colour should match the colour of the floor (here R=0.25, G=0.5, B=1.0). The result is shown in Figure 34

Figure 34. Four Light set up.

Please note that we used a Spot light and not a lamp, so it would be completely blocked by the floor (shadowed) unless we set this spot shadeless by pressing the appropriate button.

Indeed we could have used a Lamp but if the floor is shiny the light it shed is more reflected than diffused. Reflected light, physically is itself a cone coming from the specular source.

## Three point light - Outdoor

By using a spot light as a key light the previous method is sadly bound to indoor settings or, at maximum, outdoor settings at night time. This because the Key light is at a finite distance, it rays spreads and the floor is no evenly illuminated

If we were outdoor on a cleas sunny day all the floor would be evenly lit, and shadows would be cast.

To have a uniform illumination all over the floor a Sun light is good. And if we add a hemy light for faking the light coming from all point of the sky (as in Figure 8 in the Section called Hemi Light) we can achieve a nice outdoor light... but we have no shadows!

The setup of the Key light (the sun, R=1.0, G=0.95, B=0.9, Energy=1.0) and the Fill/Back Light (the Hemi, R=0.8, G=0.9,B=1.0, Energy=0.6) is shown in Figure 35 and the relevant rendering in Figure 36

Figure 35. Sun and Hemi light for outdoor set up.

Figure 36. Sun and Hemi light for outdoor rendering.

The lack of shadow makes Liliana appear as if she were floating in space. To have a shadow let's place a Spot coincident with the sun and with the same direction. Let's make this spot a Shadow Only Spot (with the appropriate button). If Energy is lowered to 0.9 and all other settings are kept at the values used in the previous example (BufSiz=512, Samples=3 Soft=3 Bias=1 ClipSta=5, ClipEnd=20) the result is the one of Figure 37 (center).

Figure 37. Outdoor rendering.

The shadow is a bit blocky because Liliana has many fine details and the BufSize is too small, and the Sample value is to low to correctly take into account them. If BufSize is rised to 2560 and Samples to 6 and Bias to 3.0 the result is the one in Figure 37 (right). Much smoother.

## Area Light

The concept of Light coming from a point is an approximation. No real world light sourche is dimensionless. All light is shed by surfaces, not by points.

This has a couple of interesting implications, mainly on shadows:

- Sharp shadows does not exist: shadows have blurry edges

- Shadow edge blurriness depends on the relative positions and sizes of the light, the shadow casting object and the object receiving the shadow.

The first of this issues is approximated with the 'Soft' setting of the Spot light, but the second is not. To have a clearer understanding of this point imagine a tall thin pole in the middle of a flat plain illuminated by the Sun.

The Sun is not a point, it has its dimension and, for us earthlings, it is half of a degree wide. If you look at the shadow you will notice that it is very sharp at the base of the pole and that it grows blurrier as yo go towards the shadow of the tip. If the pole is enoguth tall and enought thin its shadow will vanish.

To better grasp this concept have a look at Figure 38. The sun shed lights, the middle object obstruct sun rays completely only in the dark blue region. For a point in the light blue region the Sun is partially visible, hence each of those point is partially lit.

Figure 38. Area light and its shadow.

The light blue region is a partial shadow region where illumination drops smoothly from full light to full shadow. It is also evident, from Figure 38 than that this transition region is smaller next to the shadow casting object and grow larger far away from it. Furthermore, if the shadow casting object is smaller than the light casting object (and if the light casting object is the sun this is often the case) there is a distance beyond which only partial shadow remains Figure 39.

Figure 39. Area light and its shadow 2

In Blender, if we place a single Spot at a fixed distance from a first plane and look at the shadow cast at a second plane as this second plane gets further away we notice that the shadow gets larger but not softer (Figure 40)

Figure 40. Spot light and its shadow

To fake an area light with Blender we can use several Spots, as if we were sampling the area casting light with a discrete number of point lights.

This can be either acheived by placing several spot by hand or by using Blender DupliVert feature (To Be Linked), which is more efficient.

Add a Mesh Grid 4x4 Where the spot is, be sure normals are pointing down (Figure 41). Parent Spot to Grid, select the Grid and in the Anim buttons press DupliVert and Rot. Rot is not strictly necessary but will help you in positioning the Area Light later on. You will have a set of Spots as in Figure 42.

Figure 41. Grid setup

Figure 42. Spot light and its dupliverts

Then decrease the Energy of the Spot. If for a single Spot you used a certain energy, now you must subdivide that energy among all the duplicates. Here whe have 16 spots, so each should be allotted 1/16 of Energy (that is Energy=0.0625).

The same two renderings of above, with this new hacked area light will yeld to the results in Figure 43. The result is far from the expected, because the Spot light sampling of the Area light is too coarse. On the other hand a finer sampling would yeld to higher number of duplicated Spots and to unacceptable rendering times.

Figure 43. Fake area light with multiple spots.

A much better result can be attained by softening the spots, that is setting SpotBl=0.45, Sample=12, Soft=24 and Bias=1.5 (Figure 44)

Figure 44. Fake area light with multiple soft spots.

Finally, Figure 45 shows what happens to Liliana once the Key Light is substituted with 65 duplicated Spots of Energy=0.0154 in a circular pettern. Please note how the shadow softly goes from sharp to softer and softer.

Figure 45. Liliana under Area Light.

## Global Illumination (And global Shadowing)

TBW

### Notes

[1] | Liliana is S68 grandmother...

<<< Previous | Home | Next >>>
Volumetric Light | Up | Animation