Introduction to Color Theory and Lighting Basics in Blender

 

Blender 2.5 Lighting and Rendering

Blender 2.5 Lighting and Rendering

Bring your 3D world to life with lighting, compositing, and rendering

        Read more about this book      

(For more resources on Blender, see here.)

Basic color theory

To fully understand how light works, we need to have a basic understanding of what color is and how different colors interact with each other. The study of this phenomenon is known as color theory.

What is color?

When light comes in contact with an object, the object absorbs a certain amount of that light. The rest is reflected into the eye of the viewer in the form of color. The easiest way to visualize colors and their relations is in the form of a color wheel.

Blender 2.5 Lighting and Rendering

Primary colors

There are millions of colors, but there are only three colors that cannot be created through color mixing—red, yellow, and blue. These colors are known as primary colors, which are used to create the other colors on the color wheel through a process known as color mixing. Through color mixing, we get other "sets" of colors, including secondary and tertiary colors.

Blender 2.5 Lighting and Rendering

Secondary colors

Secondary colors are created when two primary colors are mixed together. For example, mixing red and blue makes purple, red and yellow make orange, and blue and yellow make green.

Blender 2.5 Lighting and Rendering

Tertiary colors

It's natural to assume that, because mixing two primary colors creates a secondary color, mixing two secondary colors would create a tertiary color. Surprisingly, this isn't the case. A tertiary color is, in fact, the result of mixing a primary and secondary color together. This gives us the remainder of the color wheel:

  • Red-orange
  • Orange-yellow
  • Chartreuse
  • Turquoise
  • Indigo
  • Violet-red

Color relationships

There are other relationships between colors that we should know about before we start using Blender. The first is complimentary colors. Complimentary colors are colors that are across from each other on the color wheel.

For example, red and green are compliments. Complimentary colors are especially useful for creating contrast in an image, because mixing them together darkens the hue. In a computer program, mixing perfect compliments together will result in black, but mixing compliments in a more traditional medium such as oil pastels results in more of a dark brown hue. In both situations, though, the compliments are used to create a darker value.

Be wary of using complimentary colors in computer graphics—if complimentary colors mix accidentally, it will result in black artifacts in images or animations.

The other color relationship that we should be aware of is analogous colors. Analogous colors are colors found next to each other on the color wheel. For example, red, red-orange, and orange are analogous. Here's the kicker—red, orange, and yellow can also be analogous as well. A good rule to follow is as long as you don't span more than one primary color on the color wheel, they're most likely considered analogous colors.

Color temperature

Understanding color temperature is an essential step in understanding how lights work—at the very least, it helps us understand why certain lights emit the colors they do. No light source emits a constant light wavelength. Even the sun, although considered a constant light source, is filtered by the atmosphere to various degrees based on the time of the day, changing its perceived color.

Color temperature is typically measured in degrees Kelvin (°K), and has a color range from a red to blue hue, like in the image below:

Blender 2.5 Lighting and Rendering

Real world, real lights

So how is color applicable beyond a two-dimensional color wheel? In the real world, our eyes perceive color because light from the sun—which contains all colors in the visible color spectrum—is reflected off of objects in our field of vision. As light hits an object, some wavelengths are absorbed, while the rest are reflected. Those reflected rays are what determine the color we perceive that particular object to be.

Of course, the sun isn't the only source of light we have. There are many different types of natural and artificial light sources, each with its own unique properties. The most common types of light sources we may try to simulate in Blender include:

  • Candlelight
  • Incandescent light
  • Florescent light
  • Sunlight
  • Skylight

Candlelight

Candlelight is a source of light as old as time. It has been used for thousands of years and is still used today in many cases. The color temperature of a candle's light is about 1500 K, giving it a warm red-orange hue. Candlelight also has a tendency to create really high contrast between lit areas and unlit areas in a room, which creates a very successful dramatic effect.

Incandescent light bulbs

When most people hear the term "light bulb", the incandescent light bulb immediately comes to mind. It's also known as a tungsten-halogen light bulb. It's your typical household light bulb, burning at approximately 2800 K-3200 K. This color temperature value still allows it to fall within the orange-yellow part of the spectrum, but it is noticeably brighter than the light of a candle.

Florescent light bulbs

Florescent lights are an alternative to incandescent. Also known as mercury vapor lights, fluorescents burn at a color temperature range of 3500 K-5900 K, allowing them to emit a color anywhere between a yellow and a white hue. They're commonly used when lighting a large area effectively, such as a warehouse, school hallway, or even a conference room.

The sun and the sky

Now let's take a look at some natural sources of light! The most obvious example is the sun. The sun burns at a color temperature of approximately 5500 K, giving it its bright white color. We rarely use pure white as a light's color in 3D though—it makes your scene look too artificial. Instead, we may choose to use a color that best suits the scene at hand. For example, if we are lighting a desert scene, we may choose to use a beige color to simulate light bouncing off the sand. But even so, this still doesn't produce an entirely realistic effect. This is where the next source of light comes in—the sky.

The sky can produce an entire array of colors from deep purple to orange to bright blue. It produces a color temperature range of 6000 K-20,000 K. That's a huge range! We can really use this to our advantage in our 3D scenes—the color of the sky can have the final say in what the mood of your scene ends up being.

Chromatic adaptation

What is chromatic adaptation? We're all more familiar with this process than you may realize. As light changes, the color we perceive from the world around us changes. To accommodate for those changes, our eyes adjust what we see to something we're more familiar with (or what our brains would consider normal). When working in 3D you have to keep this in mind, because even though your 3D scene may be physically lit correctly, it may not look natural because the computer renders the final image objectively, without the chromatic adaptation that we, as humans, are used to.

Blender 2.5 Lighting and Rendering

Take this image for example. In the top image, the second card from the left appears to be a stronger shade of pink than the corresponding card in the bottom picture. Believe it or not, they are the exact same color, but because of the red hue of the second photo, our brains change how we perceive that image.

 

 

        Read more about this book      

(For more resources on Blender, see here.)

Lighting basics in Blender

Now that we have a basic understanding of real-world light sources and color theory, we can start applying it to our 3D scenes. Let's take a look at the lamp types found in Blender, some basic lighting setups (or "rigs"), and how Blender deals with shadows.

Blender provides us with five different types of lamps we can use to light our scenes:

  • Point
  • Sun
  • Spot
  • Hemi
  • Area

These lamps can be added to a scene through the Add menu.

Blender 2.5 Lighting and Rendering

The Point lamp

When we open Blender for the first time, the default scene includes a cube, a camera, and a Point lamp.

(Move the mouse over the image to enlarge.)

The Point lamp is an omni-directional light, meaning it emits light in all directions. There is, as with all other lamps in Blender, a fall-off factor, which means that as the distance between an object and the light source increases, the amount of light illuminating the object decreases.

Blender 2.5 Lighting and Rendering

The Sun lamp

The sun is so far away from earth that as light rays travel away from the sun, the angle between them grows closer and closer to 0. Because of this phenomenon, a convention in the CG industry is to simulate sunlight with a lamp that emits light in a single direction with parallel rays.

Other 3D programs refer to this lamp as a "direction light", but they all behave in the same fashion.

Blender 2.5 Lighting and Rendering

The Spot lamp

The Spot lamp acts in the same fashion a spot light would in the real world. When we break it down, the Spot lamp is a default lamp attached to a cone, restricting the light to the volume of the cone. The settings for the size and length of the cone can be edited manually to fit different needs.

This lamp is especially useful for scenes that require large contrasts in light such as scenes using a 1-Point light rig. A nice feature that sets it apart from some of the other lights is that the Spot lamp supports both buffer and raytraced shadows—some of the other lamp types only support raytraced shadows.

Blender 2.5 Lighting and Rendering

The Hemi lamp

The Hemi lamp directs light by emitting light in one direction from a hemispherical shape. Sounds confusing? It works in the same way the flash from an old camera would, used to simulate a cloudy (or otherwise uniform) sky.

Just like the Sun lamp, the direction of the Hemi lamp is only affected by the lamp's rotation, and not its position.

Blender 2.5 Lighting and Rendering

Area lamp

The Area lamp is an interesting lamp. All of the other lamps in Blender are single-point lamps, meaning they light a scene based on light rays emitted from a single point.

The Area lamp is different in that it's a multi-point light. This means that when it comes to render an image, Blender places a user-determined number of point lights within the boundaries of the Area lamp and then calculates the effect those lights have on the scene. This creates smoother shadows, and emulates the effect of bending light.

Blender 2.5 Lighting and Rendering

Of course, this algorithm does have some rendering consequences. The first, and most obvious one, is that the number of lamps used in the Area lamp multiplies the time it takes Blender to render the image. Secondly, some objects will not receive the full effect of the Area lamp due to other objects blocking the rays from some of the Blender-generated lights. Placing several lamps on a grid can create the same effect, but the Area lamp gives you more precise control over shadow settings and other parameters.

Summary

We've learned a lot about real-world light sources and their properties. We've also taken a look at color theory. In addition, we've taken a look at Blender's native light types.

Let's take a look at what we've covered so far:

  • Color is the light reflected off objects
  • Color temperature is the "temperature" of the perceived light in degrees Kelvin
  • There are many different kinds of natural and artificial lights, each with their own distinct characteristics
  • Blender has many internal light types, each with its own unique properties

Further resources on this subject:


You've been reading an excerpt of:

Blender 2.5 Lighting and Rendering

Explore Title