Kamis, 07 Juni 2012

Lighting and Shadow Basics


Lighting and Shadow Basics - Part 1

by Montree T. (easyyong@hotmail.com) - Smoke3dStudio

Ambient Light

Ambient light is one of the most important parts of creating a realistic rendering becuase it sets the time and mood of picture that you are trying to create.
The complete scene should be composed of a specular pass, a diffuse pass and an ambient pass. Some artists use only the default specular and diffuse settings, but I always like to use ambient light only as a main ambient light.


The examples, below are done without the ambient only light seeting checked.

Compare with the scene, done with ambient only lights (below)




3D images by Narin Assawapornchai, gio_rin@hotmail.com(top) and Peangporn Boonmema, peangporn@yahoo.com (bottom)
So what color should we use for the ambient light in the scene? The color of the ambient light should be the average color of light affecting the scene + the average color of the entire room.
For example, skylight will influence a room with a large window or opening the most as the skylight (a kind of area light) will scatter around a large portion of the room or even throughout the entire room. So if the wall is a white or cream color, the ambient color should be blue(skylight) + white or cream which results in a yellow-green color. Also, don't forget to dim down the intensity of the color.
The sunlight itself will only affect the room in some parts, that is only the floor and walls as the sun is a directional light and it will not scatter around like the skylight, with exception to its indirect illumination from floor or wall. However, this indirect illumination will not have as much of an effect as the skylight.

If you still don't know what color you should use. I suggest that you go with a brown-grey first. I don't use pure grey as its lack of color will make the image look dead.
I have some suggestions about color below, but keep in mind these colors are not set in stone. You may use this as a guideline.
Example 1: The color of a room with a small opening

Ambient only R= 142 G=139 B=116


Example 2: The color of a room with a bigger openning

Ambient only R= 168 G=175 B=159

If we have any downlights or diffusers in the room, the skylight and sunlight are still considered stronger. If I give skylight multiplier = 1, the multipier of downlighs or any diffusers should be less. I always start creating lights whose multiplier is the strongest first.



The 2nd picture shows that the multiplier of skylight is equal or lesser than downlights.
Example 3: The color of atmosphere of a room without natural light. Suppose the color or these down light is yellow.

Ambient only R = 163 G =128 B = 23

Example 4: The color of atmosphere of a room without natural light as well, but the light sources are more diffuse.

Ambient only R = 138 G =143 B = 117
Another interesting way to understand how to use color to make our renderings look better and more colorful is to understand color theory. I have read a number of books about painting written by artists. They always try to avoid black and grey becuase this causes images to look dead and colorless. Complimentary color is also interesting. An artist (I am sorry that I don't remember his name) says "Cool light(color) warm shadow(color) and warm light cool shadow." I am not too sure if this conflicts with our present science theory but as long as your work turns out very well and you call it "Art" , nothing is right or wrong. For example, if we see orange and blue (complemantary colors), you may think about evening time, as the color of sunlight appear orange in the evening and the ambient light is blue. Another example that is yellow and purple, yellow light goes well with purple ambient light.

Example 5: The scene is filled with blue and orange light
 
 






Lighting and Shadow Basics - Part 2

by Montree T. (easyyong@hotmail.com) - Smoke3dStudio

Area Lights and Area Shadows

Another thing that a new user should not ignore is the beauty of area light. Area lights cause specular scattering on objects and blend with its diffuse area, creating a very soft look with beautiful soft shadows.

The bigger the light sources is, the softer its shadow will be.



Indirect light is bounced light that reflects from an object when it is affected by direct light. The color of that light is affected by the color of the object. I also consider indirect light as a kind of arealight as well as the light is scattered from the object surface.
The area light is not that difficult to fake, but its soft shadow is what we need to pay more attention to. In Autodesk Viz 4, we have a new shadow type called the "area shadow" but the problem is that it takes a really long time to render. Some use many lights to fake this effect, (ie. skydome light) but that is for a still light or exterior rendering. For interior scenes, we can not use this method as there are too many objects in the scene to consider.



Figure 1: Area light, divided into small units and the units are replaced with free spots




Figure 2: A shadow, casted by 1 single point light



Figure3: Faking arealight effect, using spotlights

Figure 4: The shadow before changing size and sample range


Figure 5: After adjusting size and sample range, The shadows looks smoother


There is another technique I have found using a negative parameter for shadow density to fake an area shadow. Sometimes if we use a lot of bright ambient-only lights in a scene, the default shadows may look faded or pale. The negative shadow value also helps to make the shadows darker.







Figure 6: Shows the black color shadow with the default density parameter of 1 or more. You will see in the middle of the shadow area is brighter than the edge of the shadow.



Figure 7: Shows the shadow with a negative density (-1,-2,-3). Due to the negative value, you also need to change the color of shadow to be whiter or light grey to inverse. The middle of the shadow appears darker than the edge. The result is a much softer look.






Lighting and Shadow Basics - Part 3

by Montree T. (easyyong@hotmail.com) - Smoke3dStudio

Step by Step

Let's start with a question: How many kinds of light affect the scene that we are going to create and which one is the affecting scene the most? In the last teo parts we leanred there are skylight from openings, Sunlight and indirect light. The skylight may have the most effect on the entire atmosphere color if the openings are big or it may be the color of the objects in the room.

1. Creating ambient

Once I know the color of atmosphere, I create an omni light as the main ambient light in the scene and enable "ambient only". Place the omni in the middle of the room then adjust the attenuation range. The "start" of the far attenuation should be fit to the room and the "end" of the attenuation is out of the room as shown in picture. I use uniform scale to scale down the Omni to fit to the height of the room so that the ratio between start and end should be around 1:2 or 3:5.


2. Creating soft shadows from area lights and indirect light
I usually make 2 layers of shadow for my interior scenes. The first layer is for the shape of the shadow from light source and the second layer is for soft shadows from indirect light and area light. The different look between soft and sharp shadows makes the scene look more fuzzy and realistic.
Basically, I always have one free direct under the ceiling and make the multiplier as small as possible. A typical value might be 0.1-0.2 and the color as dark as possible. What I want is only the soft shadow of every object in the room on the floor. Make the shadow color light grey and change the shadow density to a negative number like -1, -2 or -3 with a sample range as large as possible ie. 28-50. The negative shadow seems to be the easiet way for me to fake the area shadow. The advantage of the negative shadow is that it saves time during rendering. The negative shadow will appear darker or brighter depending on the color of the ambient light, so if the shadow appears very dark, you can reduce either the color or shadow parameters.

Casting these types of shadows is not limited to the floor. Sometimes I also place this kind of direct light to cast the shadow onto the ceiling or even on the wall.

3. Add specular and diffuse pass from direct light
3.1. Creating skylight
When the skylight come into the room from opening ie. windows or doors, I consider those openings that the sky light came through as area light sources. Put new omnis as blue skylight outside every opening and adjust the far attenuation ranges to fit in the opening area. You may use cast shadow from these lights and the shadow should be soft as well.



3.2. Sunlight
The sunlight itseft is not an arealight as the sun is only a small light spot in the sky, compared with the sky. (The sky is considered as a big dome of an area light) The sunlight shadow has a sharp edge. Sunlight is also considered as a directional light source.
Place a target directional light as a sun outside of the room, and set the shadow to a shadow map or raytrace and change the edge of the shadow to be sharp.


3.3 In case of we have any interior lights sources ie. Downlight or any diffuser, we also add them in at this stage. Don't forget that the bigger the light source, the softer the shadow will be.
Note: Sometimes, I finish the rendering without the sunlight and this may make the atmosphere look cooler. With the sun, the interior might look hot and look like it was in the middle of the afternoon.
4. Indirect light and illumination
Take a look around the whole scene again. I notice that there are 2-3 main indirect illuminations that we need to add.
4.1 Illumination from the big orange wall. I place an orange omni light behind the orange wall and make the attenuation as big as the wall size. Use ambient only. The ambient only light will also make the orange wall illuminte but if we put normal specular and diffuse light, it will illuminate only the rest of the wall, floor and ceiling. The advantage of ambient only is it will affect the opposite side of an object.
4.2 Illumination on the floor, affected by sunlight. When the sunlight touchs the floor, it will bounce and scatter to its surroundings. I put a color of blue (floor's color) + a bit of yellow tint omni (ambient only) under the floor and set the attenuation size to fit into the sunlit area. If you see the scene is too full of ambient only light, it will make the scene lack dimension. You may change the omni to diffuse and specular instead. This method is flexible, it depends on your sharp eyes.


In a bigger interior scene that is more complex and has more indirect illumination, we might not put indirect light on all the illumination. Just placing a few main indirect illumination lights is enough as we are not the machine that can calculate all the illumination correctly. The look of the scene is based primarily on your sharp eyes. I also compare light to a brush that we are playing with on our artwork.

 



Tidak ada komentar:

Posting Komentar