If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

2. Light reflection

Let's look more closely at how light behaves when it strikes an object. We'll cover diffuse and specular surface responses. The rendering equation takes three main factors into account: the amount of light falling on a point, how the surface at that point reflects light, and the position of the camera.

Want to join the conversation?

Video transcript

- In the previous video we saw that the basic job of a ray tracer is to determine what color to paint each pixel. And it does that by casting a mathematical ray that starts at the camera, passes through a pixel, and then off into the scene. The ray tracer must then compute the closest intersection point between the ray and the scene geometry, and return that geometry's color. In this video, we're gonna look at how we determine how much light is travelling along the ray back towards camera. That's what we need to figure out in order to determine each pixel's color. This is actually a pretty deep and complicated question that is mathematically governed by the rendering equation. I know it looks scary. I mean believe me, this equation still gives me nightmares. But it's actually easy if you break it down into a few pieces. The amount of light travelling from a point on a surface back to the camera depends on three things. One, how much light is falling on that point? Two. how does the surface of the object at that point reflect light? And three, where is the camera? Let's examine each of these factors in turn using some props. My scene consists of a tennis ball and a light source. Now, the first factor is how much light is falling on a spot on that tennis ball? It's pretty obvious that the farther away the light, the lower the intensity of light falling on the ball. So, we need to know the distance to the light source and we need to know how bright the light is. It's less obvious that we need to take into account the orientation of the surface when determining how much light falls on the point. Grazing angles receive less light or energy, so they appear less bright. Whereas the point will be brighter or hotter if the surface is oriented perpendicular to the direction of the light. You feel this every sunny day. It's why it's hottest at noon and cooler in the morning and evening. If there is more than one light source, we repeat the process for each one of them. The second factor is how does the surface reflect light? The color of an object is a big part of how it responds to light. But it's not the only factor. Some objects have a fuzzy or dull appearance like the tennis ball. Others are shiny and display bright highlights like this pool ball. These two objects are receiving the same amount of light, but they look very different. Other surfaces are somewhere in between dull and shiny like human skin, wood, or even hair. Dull surfaces are said to be diffuse and shiny surfaces are said to be specular. Finally, the last factor is where is the camera? Watch the middle of the number 3 on the pool ball. Notice that as we move around, the brightness of that point changes. Even though everything else is the same the only thing changing is the location of the camera. Let's look at a virtual version of this physical situation. There are three sliders that you can control. Spotlight intensity which is like controlling the brightness of the flashlight. A diffuse slider which controls the dullness of the surface or roughness. And specular slider which controls the shininess. You can also move the spotlight around which is represented by a white dot. For every object in a Pixar movie there's a shader packet. The shader packet describes in visual detail everything about a surface. It will include photographs of what something looks like in real life. Drawings describing may be the way the roughness on a surface looks or how someone's hair should look. In this next exercise, you can sit in the seat of an artist using tools based on these concepts we just covered. Your job as a Pixar artist is to match the reference art. Have fun.