Lighting in Blender Internal

I. Basics

standard version | .blend files | next part

Introduction

Hello, I'm Marek Skrajnowski (some might know me as Kroni/Kronos from forums) and I've been using blender as a hobby for about 3 years now. I'd like to share my knowledge about lighting in Blender Internal using new features in SVN (after v.2.45) - so you should grab an SVN build from graphicall.org. It's not a beginner's tutorial, you have to know the basics of Blender's UI and how to get around, as I don't want to make a click-here-click-there tutorial, instead I've attached all the .blend files used in the tutorial.

I've divided this tutorial into 5 parts I'd like to cover:
1. Basics
2. Interior Lighting
3. Exterior Lighting
4. Studio Lighting
5. Car Studio

This part of the tutorial will cover basic info about lighting in blender, light types and their properties and usage, Ambient Occlusion, compositing with nodes to speed up the setup. Ok, enough introduction ;) let's get started...

Lamp Types

Point Light: hard shadows, soft 2, soft 4

Lamp - point/sphere light

Nothing to add really, can be used for all kinds of light bulb based sources.







Attributes: Hints:

Sun Light: hard shadows, soft 2, soft 4

Sun light

Simulates direct lighting of the sun and can't be used for anything else really. It lits the whole scene evenly, so only the lamp's direction counts (can be placed anywhere in the scene)




Attributes - similar to point light:

Spot Light: hard shadows, hard shadows with halo and halo with soft shadows

Spot Lamp/Light

Probably the light source with most added features. Very good for animation purposes due to buffered shadows (I won't cover them here though). Very good for placing a highlight on an object.




Attributes (raytraced shadows only): Hints:

Area Light: size 2, size 10

Area Lamp/Light

Invaluable for studio lighting and interiors to give very soft shadows and as such are perfect fill lights. Apart from that they can be used for non-standard light sources such as TV's and various other displays/screens, some neons. My personal favourite ;)





Attributes (raytraced shadows only): Hints:

Ambient Occlusion

Ambient Occlusion is the most basic (yet really powerful) way of faking indirect illumination. It uses the distance between objects to brighten or darken the scene (the longer the distance from surrounding faces the more an object is illuminated).
This means it doesn't depend on the lights setup of the scene at all and as such wont give realistic results by itself, but it's good enough to get satisfying results. Because of that it's widely used in animations, it's faster than most Global Illumination algorithms such as Photon Mapping or Path Tracing. Recently an even faster algorithm for AO has been added to Blender called Approximate Ambient Occlusion, which doesnt use raytracing for finding distances and produces no noise, which makes it perfect for animations, where lighting precission isn't as crucial as in stills.

Blender's AO controls are quite similar to every other light source's properties (energy, samples, falloff). So I'll focus on the differences. AO is the tool You will use for sky dome lighting (exteriors) and for faking indirect illumination (interiors), and for basic fill lighting so You can reveal the whole scene. So as You can see it's a very simple yet very useful tool.

Hints:

AO falloff 1, falloff 2, falloff 5

AO simple, sky color, sky texture

AO distance 5, distance 1


Sky

Now something has to be said about skies in general, when what to use. First off I'm talking about the sky visible to the renderer (reflections/AO mainly) and not the final background for Your 3D scenes, because these may (and probably will) differ. So basically the choice is obvious: simple color, gradient or image (also HDR or LDR).

I would say that in general it's good to use a simple gradient for the sky as it's easy to set up and use, and it should give good results. Let's take a simple clear sky, we can fake it by making a vertical blend texture and using it as sky (as shown on the screen). Using a gradient is also very flexible compared to image or plain color, with just changing the gradient a bit You can change the mood of the scene (time of day for example) or completely change it like I did with a kind of dark studio setup.


In some cases using a complicated sky is useless... and I don't mean the obvious case when the sky isn't visible at all ;) eg. interiors, the viewer will only see the sky through windows behind which You'll probably put a plane with an image of a realistic background so setting the sky to a simple sky blue color is probably a good choice (or even white to get stronger reflections of the sky). Using a solid color instead of gradients and images will also make sky based AO less noisy.

The last option is using an image as background (probably an angular map of the environment). As everything it has it's good and bad sides.
Good: combined with AO gives very realistic results,
Bad: image based AO is quite noisy (especially if using HDRI), quite hard to find the perfect image and probably even harder to set it up right.

I would say that images are good in 2 cases: Hints:

Lights Combined sun+sky

Obviously You're not gonna use a single light source for the whole scene, so let's take a quick try using some light sources to light the example scene. A very common sollution is a clear sky day illumination, which is quite easy to set up so I'm going to start with it. The first question You should ask yourself is what generates light in Your scene. In a bright summer day there are 2 basic light sources, the sun and the sky (and a lot of indirect illumination which we'll skip for now).

Sun, Sky AO, Sun+Sky

Sun

In blender we have a sun lamp so it's not difficult to choose a light source for the sun. On a side note, it wasn't that obvious in 2.45 where only area lights could throw raytraced soft shadows.

Sky

This is a bit more tricky, but I'm gonna go for a simple and fast solution of using AO with a blueish color. This way the sky dome will cast very soft lighting and fill the shadows of the sun.

Balance

The real problem of the setup is the energy balance between the sun and AO, because we don't want the scene overexposed, the shadows have to be visible yet quite bright. This part is mostly trial and error, I always start with a sun lamp energy of 1 and AO at 2 and decrease the values to get acceptable results. As far as color balance is concerned a fully lit ground plane should be white, so the yellow color of the sun must be balanced by the blue sky dome. You shouldn't spend too much time with it because a raw render like that won't look good no matter what You do, because AO will darken the edges. To get rid of that (or just make the effect less obvious) I use composition nodes.

My standard post processing setup consists of:

Base Render, gamma, gamma+rgb, gamma+rgb+brightness/contrast

Finishing touches

If You're happy with the result here's Your final render. Sometimes though it's impossible to fix everything with nodes so You have to get back to the light balance step, refine the lights, maybe change color a bit, re-render and refine the nodes. Most of the time You should see what's wrong with the first render, for example if You can't get the right sun shadow brightness without overlighting the rest You should lower the energy of the sun lamp

Lights combined sun+sky+bounce

Ok, so now we have some basic illumination, but what about indirect illumination? Some of it was faked by AO, but the render lacks the 1st bounce of the sun light most. An easy sollution is putting a spot lamp underneath the ground plane pointing up. It will illuminate the bottom of our objects as sun rays would bounced off the ground plane. You might also want to decrease AO energy, because it doesn't have to add so much indirect illumination.

Base Render, Composition Nodes, Fake Bounce



Lights Combined enlightened mood

Now this one was made for fun, because I liked the look of the spot+halo render done earlier for the lamp types part and I wanted to see what can be done based on it. I would call it a 2.5 point lighting ;) (key+fill+AO)

Spot, Area, Spot+Area+AO

I used the spot lamp as the ky light with the same setup as earlier, fill light is a big blueish area on the left and a bit of ambient occlusion to fill the darkest spots (energy 0.2 so it's barely visible).







But as You can see it looks far from what's o the header, most of the mood work was done with Nodes. Simple setup I wrote earlier (gamma,RGB curves, hsv, brightness/contrast). Most of the work was done by RGB curves to play with contrast and colors, all the channels were used to get it just right.


Before the rgb curve is a standard gamma 0.5 filter to show the darker places, which i'm going to darken later but using my own rgb curve for good control. HSV wasn't used in this one and brightness/contrast was used for final contrast adjustment as it's easier to use than rgb curve and as such is great for such final touches.

Base Render, Gamma, Gamma+RGB Curves, Final


Conclusion next part

That would be all for the first, general lighting part. I hope it was helpful and if You have comments & feedback I'd love to hear from You, send me a PM at blenderartists (kroni) or email (m.skrajnowski@gmail.com).

Next parts will be more in-depth and focused as we're moving to specific solutions. First in these is interior lighting, so prepare for area lights, AO and lots of composite nodes ;)

See You next time