Shade 9 Chapter 12 Lights
In Shade, there are several types of lights: a parallel light which we call a “Distant Light,” light which spreads out radially from a “Point Light,” a point light whose irradiation range is limited is referred to as a “Spotlight,” and an “Area light” and “Linear light” which can be generated using line objects. If you are using Radiosity, you can also use a “Sky Light.” This chapter will explain the creation and setting of lights.
Let’s master the use of lights!
Distant Light can simulate a light such as sunlight, the source of which is located very far away. Light rays emitted from a distant light are parallel (do not spread out), and the brightness of planes facing the same direction is constant regardless of location. When the color of a distant light is white (1, 1, 2161), then the color of a surface perpendicular to the distant light will be the same as the diffuse color of the object. Shadows caused by a distant light have, in principle, sharp outlines and constant density. To express soft shadows, use Path Tracing, or properly set the value of Shadow Map Blur. Distant lights can be set without limitation for each scene. Distant light settings are made in the Distant Light window. For details on the items in the Distant Light window, refer to the Shade Reference.
The brightness of the wall irradiated by distant lights is constant regardless of the distance from the Eye point.
A point light produces light from a single point with no surface area, and is used to simulate small light sources such as light bulbs. A point light can be used to cast light on surfaces, as well as an object in itself, such as a light bulb inside lighting apparatuses and marker lamps. When the color of a point light is white (1, 1, 1), then the color of a surface perpendicular to the point light will be the same as the diffuse color of the object. Shadows caused by a point light as well as a distant light have, in principle, sharp outlines and constant density. To express soft shadows, use Path Tracing, or properly set the value of Shadow Map Blur.
The brightness of the wall irradiated by a point light gets darker as the distance from the point light becomes greater.
A spotlight is a point light whose angle of irradiation is limited. In general, it is the same as a point light.
An area light can be used as a light source that affects the brightness of the surface of an object, as well as an object itself, similar to a point light. Unlike a point light, you can render an area light, to create an object such as a light-emitting panel. The distribution of colors on a surface irradiated by an area light can be faithfully simulated using Radiosity. If you are not using Radiosity, the result will be the same as a point light if you use Ray Tracing. However, when you use Path Tracing, the same calculation for half-shadow is applied to express the distribution of color, which takes into account the area. The damping of the light in the area light is always proportional to the inverse square of the distance. In Ray Tracing and Path Tracing, you can simulate the half-shadow of an area light.
The upper left white object is an area light. This figure shows the rendering result using Ray Tracing. The shadow edge for the long side of the object is fine, but that for the short side is too dark, almost invisible. As illustrated in this figure, when the area light is used as the main light, the irradiation appears awkward.
A point light is used instead of the area light in the previous scene. The object appears to be evenly irradiated. The brightness value and the point of the light source are the same, but the point light seems a little brighter. Point lights cast sharper shadows.
This scene is rendered with Path Tracing. The Ray Tracing Quality setting is low, which results in a rougher look, but the shadow edges and irradiation seem fine.
This scene is rendered with Ray Tracing, using the direct radiation and indirect radiation options of Radiosity. Whether to use Ray Tracing or Path Tracing depends on the scene you are working on, but when you use Radiosity, faster Ray Tracing is possible after the first Radiosity calculation.
The result of rendering the linear light effects can be gained only with the Radiosity calculation result and Path Tracing rendering. Other rendering methods allow only point light to be processed.
Path Tracing without incorporating a linear light in a luminous body.
Path Tracing with a linear light incorporated in a luminous body. The blue light reflected on the floor is generated by the linear light effect.
Ambient Light and Sky Light
As sunlight passes through the air, part of the light is dispersed by particles in the air, and reflects in all directions. Almost no particles exist in the vacuum of outer space, and therefore diffusion of light does not take place. However, here on earth, the intensity resulting from diffusion of sunlight cannot be ignored; the amount of diffusion is constant regardless of location and direction, and shadows are not completely black. The attributes used to simulate this effect are ambient light and sky light. The Ambient parameter can be set for each distant light. The color of the ambient light is obtained by mulNotelying a real number ranging from 0 to 1 by the distant light color, and affects the shadow cast by an object as well as the color of shadows falling on an object. The sky light is the total amount of parallel light perpendicular to each cutoff point when a sphere is equally divided latitudinally, and it simulates the diffuse reflection of sunlight. Sky light can be used in Radiosity. Ambient light and sky light are completely different, in that ambient light acts as the color of a shadow, but for sky light the sphere itself acts as the light source. The Ambient setting is ignored when you are using Radiosity.
A distant light and sky light are used. Gradation by sky light can be seen in the shadow of the distant light.
Sky light is not used. The shadow is filled by ambient color.
Four distant lights are added in four directions without using sky light. Appearance of solidity is expressed by the differences in light over the surface directions.
A shadow under a blue summer sky would reflect the color of the sky, and appear bluish. This type of colored shadow can be simulated by combining multiple distant lights. Set the color of the first distant light to the desired color of the shadow, and create a second distant light at the same location and intensity. Then, set the color of the second distant light to the complement of the color of the first light, and its ambient light to zero. If necessary, set a third distant light at the same location, and adjust its intensity. Of course, the intensity of the first and second distant lights can be adjusted without using a third distant light.
The color of the wall, floor, and the distant light is white.
The color of one of the distant light is set to blue.
Set the complementary color of the previous distant light as the color of the other distant light, and set the Ambient value to 0. The color of the previous distant light affects the color of the shadows and shading.
When the air is full of dust, the dust will obstruct the light at a distance. The color of the dust will affect the distant scene. The attribute used to simulate this is “Fog.” Fog can be used with Ray Tracing and Path Tracing renderings, and affects only objects, not the background. Use the “Haze” attribute in the Background window to simulate fog or dust that affects the background.
The color of the fog to be reflected from a surface is obtained from the inverse tangent of the distance from the Eye point. It is 0% at the position of the Eye point, 50% at the position of the Target point, and 100% for distant light. The color of the fog will be processed by means of additive synthesis with the color of an object.
When light hits an object, the brightness of the object depends on the distance from the light. Looking at the object from the position of the light, no light would reach the back of the object, as it will be shadowed by the object itself. The darkest areas are those lit only by ambient light. The attribute used to simulate the variation of brightness is called “Shading.”
Shading gives volume and depth to objects. In a technique called Smooth Shading, a curved surface is divided into polygons such as quadrilaterals and triangles, and the normal vector between each vertex of the respective polygons is interpolated. Then, an appropriate algorithm for each type of light is applied, to obtain the brightness of the surface.
In Ray Tracing and Path Tracing renderings, the brightness of the surface can be obtained without dividing disks and spheres into polygons. This type of Smooth Shading model is called Phong Shading.
Objects can be shaded without interpolating the brightness between each vertex in a polygon using Scan Line rendering. This model is called Flat Shading.
Shading for Distant Lights
The brightness of an object under a distant light can be obtained from the inner product of the vector in the direction of the light and the normal vector to the surface. This is called Lambert’s law of cosines. When the surface is perpendicular to the light, then the brightness will be the most intense; when it is parallel or facing backward, it will be the darkest.
Shading for Point Lights
The brightness of a surface under a point light is obtained by proportioning the reciprocal or reverse square of the distance from the light to the brightness obtained with Lambert’s law of cosines. In reality, it is well known that the light energy is in inverse proportion to the square of the distance. However, distance may seem exaggerated in an image rendered using this relationship.
Note that shading depends on the relative directions of the light and surface. Unlike the projection of shadows, shading is not affected by the surfaces of other object.
The attribute which simulates flat surfaces is “No Shading.” This technique enables you to realize 2D expression and render alpha-channel images of a particular object. Also, a unique image with two gradation sequences can be realized by displaying the shadow.
A “cell-shader” image can be created by not applying shading.
When the surface of another object is present between the light source and an object, some portion of the light that would hit the object is obstructed by the surface of the object in between, and a shadow is projected onto the object. For the projection of shadows, using Shadow Map or executing Ray Tracing or Path Tracing renderings provide more faithful simulation.
The color of a simulated shadow depends on the color of the ambient light reflected by the color of the object, and different darkness can be set for respective lights. A shadow can have a clear outline formed by parallel light rays from a distant light, or the light that spreads out from a point light (this type of shadow is sometimes called an umbra); or, it can have a blurred outline formed by area light (we call this a “soft shadow”). Path Tracing rendering or the Shadow Map function make it possible to blur the outline of shadows generated from distant lights or point lights. The blur of the outlines of shadows can be set for each light, and simulates shadows resulting from light interacting with the surface on which the shadow is projected.
Shadow Map is a method to create a three-dimensional and limited-size shadow image for each light to project the image on an object, and is therefore not capable of expressing sharply-outlined shadows, contrary to Ray Tracing rendering. Errors may occur when there are shadows cast by multiple light sources, or when those shadows are obstructed.
Shortening the Shadow. Calculation Time
Using the Shadow Map will considerably shorten the time required for shadow calculation. In particular, when the shadow softness effect of Path Tracing is replaced with the Shadow Map and Ray Tracing, and properly setting the Shadow Map Blur value, the processing speed may be accelerated by ten times or more.
Effect of shadow softness using Path Tracing. The shadow softness value was maximized for one of the two point lights. For this rendering, 649 seconds were required.
This was rendered using Ray Tracing, with Shadow Map used for one of the lights. The Shadow Map Blur value is 3.00, and 47 seconds were required for rendering.
This is an example of Scan Line rendering. The refraction of the left transparent sphere is not expressed. Although Shadow Map was used for shadowing for both of the lights, one was set with 1024 for Shadow Map Size and 0.50 for Shadow Map Blur, while the other was set with 512 (default value) for Shadow Map Size and 3.00 for Shadow Map Blur. 30 seconds were required for rendering. When using Shadow Map with Ray Tracing and Path Tracing, the Shadow Type pull-down menu in the Light dialog box, the Distant Lights window, or the Rendering Options dialog box should be set.
Some Notes on Shadows
You can determine whether or not to set shadows for the entire scene, or for individual objects and lights. In the case of an object, you can decide whether or not to display the shadows of other objects on the object itself, and whether or not to project shadows onto other objects. In the case of a light, the darkness of the shadow can be set, as previously described. You can also easily remove or decrease unnecessary shadows. When no shadows are displayed, the light hitting a surface cannot be obstructed by another object. When shadows are displayed, the shadow projected by an object onto itself and the shading may not correspond at the light and shade border between the lighted part and the shadowed part. This can be solved with finer polygon subdivision of the object, though the easiest solution is to stop displaying the shadow. The method used to remove the shadow depends on the circumstances.
Entering a distance equivalent to the position and intensity allows a point light to be created.
Step 1) Select Point Light from the Create tool and drag the mouse cursor for a distance equivalent to the intensity from the light position.
When dragging, a sphere with the mouse buttonpressed position and the three-dimensional cursor recognized respectively as the center and the radius appears to serve as a visual aid in determining the distance equivalent to the intensity.
Step 2) The mouse button-released position is entered as the distance equivalent to the intensity to complete creation of the point light. The name “Point Light” is displayed in the Browser window. When selecting Point Light from the Create tool and then clicking the display, a point light having an intensity equivalent to the radius of the previous disk or sphere entered, with the clicked-position treated as the center, the intensity of a point light, or the intensity equivalent to 1- grid radius is created.
Entering a distance equivalent to the position, direction and intensity allows a spotlight to be created.
1. Select Spotlight from the Create tool and drag the mouse cursor in the illuminating direction from the spot light position, for a distance equivalent to the desired intensity. While dragging, a line appears connecting the mouse button-pressed position to the three-dimensional cursor appears and serves as a visual aid in determining the distance equivalent to the intensity. The relationship between the dragged length and spotlight intensity is the same as for the point light.
2. The mouse button-released position is entered as the distance equivalent to the intensity to complete creation of the spotlight. The name “Spotlight” is displayed in the Browser window.
3. In the view pane perpendicular to the view pane where the spot light was created, shift the spot light direction using the Rotate function from the Move tool.
Closed line objects can be treated as area lights when setting the intensity in the Object Info for line objects.
1. Select a closed line object and select Object Info from the View menu.
2. Set the Intensity text box, lumen checkbox, Specular checkbox, and Visible checkbox in the Object Info for the line objects.
A closed or open line object can be treated as a linear light by choosing Linear light from the Light pull-down menu in the Object Info for the line object, and then entering a value in the Intensity text box. The Visible checkbox is available for closed line objects, but not for open line objects.
Setting a Spotlight
You will now try setting a spotlight. For the sample file, let’s use “Bottle4.shd” contained in the “Chapter12” folder in the “User Guide” folder. 1. Select Spotlight from the Create tool in the Toolbox.
2. Within the Top view, click Point A while holding down the Ctrl (Win) / option (Mac) to set the depth (the Z coordinate value).
3. Drag from Point B to C within the Front view to create a spotlight.
A spotlight is created whose Note is placed at the middle of the shape. 4. Select Rotate from the Move tool in the Toolbox, click Point D within the Top view, and drag from E to F to rotate the spotlight whose Note is placed near the center of the shape.
Now the spotlight is turned toward the shape.
Note: You can modify the direction and size of the spotlight intuitively by selecting Modify Control Points from the Modify tool in the Toolbox and turning on the Object Info mode. Modify the attributes of the spotlight.
5. With the spotlight selected, select Object Info from the View menu. The Object Info dialog box for the light appears. The Object Info dialog box for the light has several parameters. Here, you will change the values for Angle, Edge Softness, and Shadow.
6. Set the Angle to about 35 degrees, the Edge Softness to about 0.1, and the Shadow to about 0.9.
The Angle literally sets the irradiation angle of the spotlight. The Edge Softness attribute blurs the edge of the circle of light created by the spotlight. As the Edge Softness gets larger, the image appears with a more blurred border between light and shadow. The Shadow setting determines the density of the shadows caused by the shapes. If you set it to 0.0, the shadow created by the spotlight disappears completely.
7. From the View menu, select Distant Light, and set the Intensity to 0.0.
This setting eliminates the influence of the distant light.
8. Select all the shapes and render with any method.
This figure shows the image rendered with Ray Tracing, Regular for Surface Subdivision, as well as the Anti-aliasing and Shadow checkboxes on. The label becomes almost invisible in our rendered image. Next, create a spotlight that irradiates the label part.
9. Select Spotlight from the Create tool in the Toolbox.
10. Within the Front view, click the center point A of the Label shape while holding down the Ctrl (Win) / option (Mac) to set the height of the 3D cursor (the Z coordinate value).
11. Drag from Point B to C within the Top view.
A spotlight is created.
You don’t have to create a spotlight with the same position and size as this example. Here, the Note of the spotlight is laid across the Label shape.
12. With the spotlight selected, select Object Info from the View menu.
13. In the Light’s Object Info dialog box, set about 70 degrees for the Angle, about 0.2 for Softness, and 0.0 for Specular.
14. Render with any method.
Spotlight Specular at 0.0
Here, the Specular attribute is set to 0.0 to reduce the glare on the front of the Label and Bottle shapes. If you set the surface attribute Specular 1 and Specular 2 settings to 0.0 for the Label and Bottle shapes, the glare does not appear on the shapes even if the spotlight Specular value is set to 1.0. However, when the Specular settings are 0.0, the glare created from other spotlights will also not appear.