Sunday, July 31, 2011

Lighting a Cube

For this tutorial, I'm going to basically just take the default scene and light it to get the final render pictured above.
Start Blender with a default scene. Select the Point Lamp (point with a little starburst thing) and delete it (X). The first thing to do is add a ground plane for our cube to sit on. Switch to Top View (Num Pad 7) and hit Shift + A. Select Plane from the Mesh menu. Scale it by 20 or so (Hit S, then type in 20). Make sure that it covers all the area seen by the camera. You can switch to camera view to make sure that it fills the view.

Now, go into Front View (Num Pad 1) and move the ground plane down along the Z axis so it is barely touching the bottom of the cube. 

In Camera View, move the camera to position the cube a little off center from the screen to make it more interesting. Now, on to the lights.

If we render the scene now, you will see a black screen. This is because there is no light on the scene. Let's add our primary (or Key light). Switch to Top View (Num Pad 7) and click your 3D cursor off to one corner of the cube. Add an Area Lamp by pressing Shift + A, Lamp > Area.


In Front View, move it up on the Z axis so it is a little higher than the camera. Rotate it (R) so the dashed line representing the angle of the light is on the cube. Back into Top View, rotate it on the Z axis (R + Z) so the line is on the cube.

Front view.

Top view.

Now go ahead and render the scene right now (F12). You'll probably get some crap that looks like this:

If you read my earlier lighting lesson, you'll know that this is very "blown out." 
There also isn't any shadow cast on the ground plane.
Pretty much all the detail in this image is gone because the light is so bright. Typically you never really have any lights that are at full strength (1). I set this lamp very low. Set the Energy now to somewhere around .12 or so. In the above image there was no shadow from the cube on the ground plane. Things in real life cast shadows. So we need to tell our lamp to calculate shadows. Under the Shadow Panel, switch from No Shadow to Ray Shadow. That's all you need to do. Now render.

Much better.

The lighting on the right side of the cube is looking pretty good. Perhaps a bit dark, but that will be fixed when we add our other lamps. Look at the left side of the cube. It is almost completely black because our only light source is coming from the other side of the cube.

Tip: As a general rule, you should always avoid pure blacks or pure whites. If you have pure blacks, it usually means there is no light on that part of the scene and you should add some. If you have pure whites, the lighting is too bright.

We're going to brighten the left side of the cube now. In a 3-point lighting sense, we're going to add a Fill light. In Top View add another Area Lamp off to the opposite side of the Key lamp. Switch to Side View with Num Pad 3 move it up so it is about level with our other light. I put mine a little lower but its up to you. Rotate it so the dashed line is pointing on the cube. Rotate it again in Top View.

Side View.

Top View.

Go ahead and render it now. 

Arghh!!! Blown out again!

Our fill lamp is way to bright! Fill lamps should be set to an even lower setting than the main Key lamp. I set the Energy to about .01. Rendering now gives you a well lit cube:

You have the main source of light from the left. Then the secondary Fill is lighting up the other side. Not too much though, there should still be a difference between one side and the other.

You may have to go back and fiddle around with the Energy settings of the two lamps to get a good, balanced look. Its also important to note now that we didn't enable shadows for our secondary lamp. If we did, another shadow would be cast in the opposite direction from the current one, producing a double shadow. This isn't what we want, so we simply leave shadows off for that lamp.

Alright, so far so good. The only thing I'm noticing is that the lighting is rather bland. Pretty much just gray. We can add a little more interest if we color the scene a bit. We'll do this by adding  a Hemi lamp. (Remember: A Hemi provides universal lighting in one direction)

Go into Top View and add a Hemi Lamp. Shift + A, Lamp > Hemi. In Front View, move it up about level with our other lights. It doesn't really matter where it is positioned, but I do it for organization's sake.

I'm going to set this lamp to a nice subtle blue.

This is supposed to be a subtle effect so I'm going to set the Energy even lower then our secondary light. I put at around .08. 

Tip: Subtlety in coloring like this is key!

Now, have a look at that.

















There is a very slight difference but it still makes the scene a lot cooler looking.


Congratulations, you've lit a cube! Try experimenting with the lighting a little to get used to how it works. Even try to replicate photos to capture the essence of light in the real world. That's it for now, I hope I've taught you something, and we'll see you next time :)

No comments:

Post a Comment