header
Welcome, Guest. Please login or register.
Did you miss your activation email?
   

+ B0010 - Lighting in Blender +



Instructor - Pradeep Mamgain

+ Blender Lighting +

In this tutorial we will look at the Blender Lamps in details. We will explore each and every option in detail.

Before you start the tutorial please download the project files, link is at the bottom. Setting up light in a scene is one of the most important parts of getting a quality render. Blender has a range of differnet lamp types you can choose from. Lamps are visualized in a 3D view using a solid dot, surrounded by a circle and a wireframe of dashed line.

Lamp
If shadow are enabled an additional dashed circle is added.

Lamp
A dimmed grey line helps locate the light relative to the global X-Y plane. The opcity of the line can be controlled from the themes preferences.

Lamp
A material (All objects using the material) is illuminated by all the lights in the visible layer.To limits lighting by a sepecific group of lights. Click on the Shading button or press F5. Switch to Shader Material Button and under shader mini window, enter the name of the group in the GR: field.

Lamp
You must define a group of lights first and click on Exclusive button next to GR: field.

+ Lamp Types +

Lamp :- It shines in all directions. It is an omnidirectional lamp that can cast ray shadows or have shadow completely disabled. It does not have option for buffered shadows. This default lamp offers no control over the direction of the light.

Area :- It is good for large area lighting. A directional area light source. It can be used to show lights from the windows.

Spot :- It shines a direct angle of light.It creates a directional cone light source. Spot lights are the most commonly used type of light in most lighting situations. The beam of spot light can be controlled. You can control direction, distance, width and sharpness of the beam.

Sun :- Creates a constant direction parrallel ray of light. Like the hemi lamp, only the angle of the lamp matters not its placement in the 3D scene. It is a uniformly directed light source. You can enable ray shadow with Sun Lamp.

Hemi :- Creates a constant 180 degree light source. Hemi lights provide a very diffuse light. Rays are scattered in different directions. Hemi lights are not good for serious lighting. A hemi light placed in 3D space illuminates the whole rendered area. It does not matter where you place the light in 3d space, only the direction of the light matters.

+ Lamp +

Lamp is a omnidirectional light source, like a point light source.

Lamp Options

Lamp Options

Energy :- Sets the intensity of the light.

Color :- Color of the Lamp’s illumination. Use RGB sliders to change the color of illumination. You can click on the color swatch to change the colors manually.

Distance :- Sets the distance value at which the light inetnsity is half. Objects closer than that received more light, objects further than that receive less light.

Light Distance
Light Distance
Decay Falloff :-  Falloff controls intensity decay with diatance. Quad decay is more phsically acurate then the linear decay but it is little bit difficult to achieve then the linear decay. Linear decay is used to achieve the quick results. The characterstic feature of using Quad is that the light’s intensity begins to falloff very quickly but then starts off falling very rapidly.

Decay Falloff

Inverse Linear : - Lamp attenuate linearly scaled by the Dist value. This kind of falloff is not physically accurate but it it is easy to setup.

Inverse Square
Inverse Square :- It follows Inverse Square Law. This falloff is realistic and sharper. Useful for lighting Street Lamps and Desk Lamps.

Constant
Constant :-  It does not attenuate with the distance. It is useful for light sources like Sun and Sky. Hemi and Sun Lamp always have constant Attenuation.

Lin/Quad/Weighted
Lin/Quad Weighted
Custome Curve

Sphere :- Restricts the light intensity to zero for object beyond the distance value. Light does not decay to infinity.

Sphere
It clips the light intensity. Change distance value to set the sphere falloff. Any objects beyond the sphere receives no light. Light will stop at the sphere surface regardless of light intensity.

More Lamp Options

There are few more buttons in panel.

Layer :- Illuminates object in the same layer as the lamp.

Negative :- Set lamp to cast the negative light.

No Diffuse :- Disables diffuse shading of material illuminated by lamp.

No Diffuse
No Specular :- Disables specular shading of material illuminated by lamp.

No Specular

+ Shadows +

Blender supports Raytraced and Buffer shadows. Apart from applying these two types of shadows, you can also use Ambient Occlusion Darkning as well as radiosity. These two options we will discuss later. You can use Raytraced shadows or buffered shadows or both to achieve releastic looking shadows inside of blender. You can also set lamps and materials to only cast and receive shadows.

To enable shadows click on the Ray Shadow button in Shadow and Spot Panel.

Shadows and Spot

Constant QMC and Adaptive QMC are the methods for generating shadow samples. Adaptive QMC is faster but Constant QMC is less noisy and slower. Only Shadow button causes ligt to cast shadow only without illuminating the objects.

QMC stands for Quasi-Monte Carlo sampling. It is a pure random sampling. Samples geneated in QMC sampling is almost random. It is better distributed then the Pure Random samples. There is drawback when it comes to random sampling. Points may fall too close to each other that may cause big gaps between points thus causing noise in the rendered image. As shown in image below (Taken from Blender’s Manual), Constant QMC is more evenly distributed than Random sampling and Constant sampling. However, points in Adaptive Sampling are distributed efficiently. It is calculated incremently whereas Constant QMC is pre-calculated. It all depends on the scene that what kind of sampling you need.

QMC

Adaptive sampling speeds up the rendering time. Samples are calculated against a threshold. Blender checks if more samples are required against a threshold. If it finds that no more samples are required, it will stop the process before hitting the amount specified in the UI and then it move on to next set of samples. By doing this, blender increase the rendering speed because blender does not calculate the samples which are not contributing to the quality of rendered image.

Smples Sets the amount of samples taken extra. Threshold slider controls the threshold for adaptive sampling.

QMC

+ Area Lights +

Area lamp is a directional light source. It can be used to simulate lighting from windows, a TV screen of from sky. Area lights produce soft shadows. Area lights can be of square or rectangular shape.

Area Lights
Area Light Options

Diatance :- Distance controls the area light’s falloff distance. Distance value is sensitive in case of the Area Lights. Any objects within the range of the distance are usually blown out and overexposed.

Gamma :- This sliders is used to correct the brightness of the illumination. Higher values give more contrast and less falloff.

Area Light
Area Light
We have two more buttons to the left of the Energy slider, shape and size. Shape lets you choose the shape of the area. Size is the width of square edge. If you change shape to rectangle, you can use SizeX and SizeY to control the horizontal width or vertical height of the rectangle shape.
Shape

Shadows

If you set samples to 3, it will generate 3*3=9 lights. Area light produces soft shadows by overlapping the shadows from the individual light source. The area light then considered as a grid with a resolution of 3 in each direction.

Area Lamp Shadows
Area Lamp Shadows
When you choose shape is rectangle for area light, you can set values for X and Y samples individually.
Area Lamp
When you change Sampling method to Constant Jittered, you get three more buttons Umbra, Dither and Noise to artificially boost the soft shadow effect.
Shadow

Umbra :- Produces sharp shadow gradient. The light transition between fully shadowed area and fully lit areas changes rapidly.

Dither :- It applies a sampling over the border of the shadows. It softens the border of the shadows. It is useful when using low samples values as high sample values will produce soft shadows by default.

Noise :- Noise is again effective when you use low sample rates. It adds noise to the edges of the shadows to break them up. Use this option carefully as it produces visible grainyess.

Open the scene Area V2.blend. Area light in this scene has following settings.
Area Light
We have raised size value to 5 to, in order to exaggerate the shadows displaced from one another. It has samples setting of 3 hence it will generate 3+3, 6 shadows. If you enable Dither now, it will soften up the shadows. To improve it more, enable the Noise button.

Umbra/Dither/Noise
You can artificially improve the soft shadows using Dither and Noise but you can not match the quality high sample rates generate. If you have a slow computer or you want to save some rendering time. Use Dither, Noise or both the fake the soft shadows.

+ Spot Lamp +

Spot lamp is most complex and most videly used lamp type in blender. It supports raytraced and buffer shadows. Buffer shadows of Spot Lamp are fast calculating when it comes to rendering. Spot Lamps also produce volumetric halos.

Spot Light

Options

The spot light’s Lamp panel is same as if was for lamp light. Spot light cone’s outer circles represent the cutoff distance. SpotSi is the angle of spot lamp’s cone. SpotBl sets the softness of the spot light edge. It controls the blurinees of the spot lamp’s circle. SpotSi and SpotBl control the softness of the cone, it does not control the softness of the shadows.

Spot Light
Halo button is used to generate a volumetric halo. HaloInt sliders sets the intensity of the halo. Enable square button in order to change shape of the cone circle to square.

Halo

Spot light can cast both raytraced and buffered shadows. Raytraced shadows are physically accurate but are time consuming. Buffered shadows save you render time but little difficult to set up. It need more tweaking then raytraced shadows. We have three options under Buf. Shadow buttons to generate different shadow schemes, Irregular, Classical and classic-halfway.


Shadows

Classic halfway is default shadowing mode in Blender and gives better results. It averages the closest and second closest Z value to reduce the biasing. Bias is a offset value that prevents faces from self-shadowing. In classic mode you have to set the bias value carefully. If you make bias value large, precesion gets lost.



ClipSta and ClipEnd defines the clipping reason. This is the region within which shadow buffer is calculated. All objects between the lamp and ClipSta never checked up for shadows.

Irregular buffer produces sharp shadows. Bias offsets the shadows from the object that casts them. Lowering  the value moves shadows closer to the objects.

Bias
Open Spot V2.blend. Classical is the regular buffer type. Shadow buffer size is the resolution of the shadow buffer to nearest multiple of 16, e.g. 512*512 pixels. The higher the resolution, the more detailed shadows will be generated. Box, Tent and Gauss buttons are used to apply Box, Tent and Gauss filter to shadowbuffer sample. Sample slider is used to set the shadow map samples. Soft is the size of area over which the buffer samples are scattered and blurred. For smooth results Soft value shoudn’t be more than double the samples value.
Shadow Buffer

Open file Spot v3.Blend. Halo step slider is used to set volumetric halo sampling frequency. Halo is a volumetric effect used to simulate light diffusing with an atmosphere. When raytraced shadows are used halo passed right through the object. When used with buffer shadows, halos can cast volumetric shadows. Defualt value for Halo Step slider is 0 which means that no sampling will be done, which means no volumetric shadows. A value of 1 gives good result but eats redner time. A max value of 12 gives bad results but renders fast. According to Blender Documentation, a value of 8 is a good compromise between speed and accuracy.

Volumetric Halo
At the bottom of Shadow and Lamp panel there are three buttons labeled Sample Buffers 1, 4 and 9. They are used to generate multiple shadow buffers. It produces better quality shadows and less flickring. When first button is enabled only one lamp buffer is rendered. 4 button renders four lamp buffers. Enabling 4 buttons quardruples memory uses while when 9 button is enabled, this uses nine time more memory.

+Hemi Lamp +

Creates a constant 180 degree light source. Hemi lights provide a very diffuse light. Rays are scattered in different directions. A hemi light placed in 3D space illuminates the whole rendered area. It does not matter where you place the light in 3d space, only the direction of the light matters. It is designed to simulate the light from a heavily clouded sky or uniform sky. It is represened by four arcs which represents the hemispherical dome. By default, hemi lights do not produce specular highlights.

Hemi Light
Hemi Lamp
+ Sun Lamp +

A sun lamp is represented by a circle and rays emitting from it, plus a dashed line indicating the direction of the light. The location of the sun lamp is not important  in the scene. Sun lamp supports raytraced shadows.

Sun Lamp
You can use sun and hemi lamp togther to achieve the outdoor lighting effect. Add a sun lamp to the scene and  give it warm orange/yellow color. Add a hemi light above the objects and set its color to light blue. Set the values for both lights as shown below.

Sun Lamp
Sun Lamp


+ Download Project +


Dear guest, Only registered members can download projects/footages and Video files.Kindly get registered to download the files. Once you get registered downlaod link will appear here.

+ Other Info +

+ Discuss in Forums
+ Save / Promote This Article/Tutorial/Information +

Enjoyed this article/page/article/information? Your vote is always highly appreciated. If you own a website please create a backlink to CGSutra on your website. Get registered in the Forums and interact with other CGSutrians. You can also subscribe for CGSutra Google and CGSutra Yahoo Groups, so that we can inform you about new tutorials and developments. CGSutra Blog is updated daily and provides information about latest offsite CG tutorials, new plugin-software-movie releases, CG resources and inspirational artwork.

Subscribe to CGSutra Group

Powered by us.groups.yahoo.com




Add CGSutra blog and forum feed to your favorite feed reader application. Here is the link to the What is RSS and how to read feeds in feedreader application?
CGSutra.COM on Facebook




Fusion®, Maya®, Blender® and After Effects® are registered trademarks of eyeon, Autodesk , Blender Foundation and Adobe.

Content Copyrights © 2008, CG Sutra.

Copyright © 2007 Free Templates by Zymic - Free Web Hosting

Best Viewed in Mozilla Firefox, Safari, Opera and Google Chrome.