THE MATH BEHIND THE MOVIES

Have you ever wondered why the things you see around you look the way they do? A big part of my work as a computer graphics researcher is to answer this question, so that we can simulate real-world objects using computers. This work is important for creating movies and video games that are visually appealing to the audience. However, there are also many other applications of realistic computer graphics, such as training, product design, architecture, and others. In this article, I will tell you how we create realistic images of the world using computers, and how my work improved the way we simulate skin and hair in virtual characters. It will give you a new perspective on the magic and beauty of the visual scenery that we experience in our everyday lives and on the computer-generated images and movies that imitate these natural scenes.


THE WORLD AROUND US
What do you see when you look out of your window?I see some oak trees with beautiful leaf canopies.When it is sunny, the leaves seem to be glowing with glorious light.Because I have worked for so many years in computer graphics, I look at our everyday surroundings

COMPUTER GRAPHICS
Generation of digital images using computers.
with an inquisitive, observing mind.When I see a beautiful landscape, I notice subtle variations in lighting of natural objects, such as that on the leaves outside my window, I wonder: what makes it so visually interesting and beautiful?How exactly do the leaves scatter the sunlight that hits them before it reaches my eyes?And what would be the best way to imitate this using a computer so that the leaves on my computer screen will also look beautiful as they do in nature?
If you think about it, everything that we see in the world-from trees to people to clothes-is made up of complex shapes and materials.To describe the composition of a visual scene, we must describe all the geometric shapes that make up the objects within that scene, as well as the materials they are made of.If we look at a human, for example, we see the skin, the face, the hair, the clothes-all made of materials with unique properties.There are also several kinds of light sources-the Sun, a neon light, or a spotlight, for example-and each source creates a unique pattern of lighting.Finally, the observed scene is perceived by the viewer (or recorded by the camera) from a certain point of view.A close look at any scene reveals a huge variety of elements working together to eventually create the image we see.We usually take what we see for granted in our daily lives, but when we must create a realistic image of the world using a computer, we begin to appreciate how interesting and intricate our visual reality is and how challenging it is to represent it convincingly in the computer.

SIMULATING THE WORLD USING COMPUTERS
In my early career, I worked at Pixar-a studio well-known now for their animated stories.Pixar wanted to make special e ects in movies more convincing by combining computer-generated material with photographs taken of live action.To seamlessly combine the computer-generated parts with photographs, the computer-generated images had to be photorealistic, meaning indistinguishable from real-world photos (Figure ).This required creating D pictures from descriptions of the elements in a scene.This was the first stage in the process called rendering-simulating

RENDERING
The process of taking a description of a D scene and converting it into a computer image.
the world using a computer (to learn more about rendering, see this video) [ ].Eventually, we realized that rendering could be used not only for special e ects, but for creating entire movies only in the computer without having to film them in nature.I was fascinated by the challenge of creating a realistic virtual world, and for the last -years I have been making rendering better and better.How does rendering work?First, artists, designers, and animators provide us with D descriptions (in drawings or in text) of the world we want to simulate.These descriptions are saved within computer files.Once we have a complete description of a specific scene, we must create a computer model of it to eventually convert the description

COMPUTER MODEL
Representation, using the computer, of real-life situations and processes.
files into actual images like the JPEG files you might be familiar with.The simplest way to model complex shapes with a computer is by using polygons, such as triangles and squares (Figure ).We break all the complex shapes in a scene down into very small triangles, normally billions of polygons per image.Then, one of the biggest challenges for realistic rendering is to correctly simulate the lighting.The simplest way to model light in a computer-simulated world is to assume that light rays move in straight lines.To model light correctly, we use a technique called ray tracing, in which we follow the paths of simulated

RAY TRACING
A method used in rendering to figure out the lighting of a scene by simulating the behavior of light.light rays in our virtual scene, to figure out what the lighting of this image should look like.
Every direct light source in a scene, like the Sun or a light bulb, emits light rays.These rays travel in space until they hit the surface of some object and get scattered.Every material scatters light in a unique way, depending on the specific properties of its surface (for example, how smooth and transparent it is).Much of our work as computer graphics researchers is focused on simulating how di erent materials (say a stone, cloth or the skin) scatter light.For every material we eventually want to find a mathematical function that describes how that material scatters light.This mathematical function is called the scattering function of the material.

SCATTERING FUNCTION
A mathematical description of how a specific material scatters the light that hits it.
One way to model the scattering function of a material is to represent the material's surface as if it is composed of many small mirrors pointing in various directions (Figure B).When light rays hit a perfect mirror, they are reflected at an angle that is equal to the angle at which they hit the mirror (Figure A).Modeling the scattering function of a material as a random distribution of mirrors on its surface can work well for some materials, but many natural materials require more sophisticated models.We can determine the scattering functions of complex materials by direct measurements of light scattered from these materials.To do this, we shine light on the material, and measure the light scattered o of it in various directions.We can store the reflection in tables or arrays and use this information to model this specific material in the computer.We can also fit physical models to these measurements.

Figure
Modeling materials using mirrors.(A) In a perfect mirror, light rays are reflected such that the angle at which the rays hit the mirror is equal to the angle at which they leave the mirror.(B) A simple way to approximate the scattering function of a material is to model its surface as a collection of perfect mirrors, each scattering the light in a known way.This works well for some materials, while others require a more complex model.

HOW DOES YOUR SKIN LOOK SO GOOD?
One of the most interesting problems I worked on was how to realistically model skin.In early movies that used rendering, skin looked Hanrahan quite unhealthy and artificial.No wonder, as it was essentially modeled like plastic!Healthy skin has a special glow to it that makes it look alive.There were no physics books explaining why skin looks this way, but luckily, I found two sources of information to help me crack this riddle.The first was work modeling of the atmospheres of planets (like Venus, Mars, or Jupiter), to explain why planets look the way they do.Planets often have a special glow around them, like skin does-see for example this image of Jupiter.These models of the planet's atmospheres contained a solid core (the planet) surrounded by a thin layer of gases.
The second clue came from an art history book in the library at Princeton University, describing how the great painter Rembrandt painted skin, which look highly realistic in his paintings.through the surface of the skin, hits the skin's internal, subsurface layers, gets scattered, and then comes back out (Figure ).I wanted my first model to be as simple as possible, so I assumed that incoming light that scattered underneath the skin's surface comes out from the same point where it entered.This model was a fairly good simulation of skin, so I knew this was the right approach.However, my simple model made skin look bumpy, so I eventually developed a more complicated skin model, in which the light comes out of the skin at a di erent point from where it entered.That made the math behind the model more complicated, but it was worth it-the skin finally looked smooth!The reason the skin initially looked bumpy was that, if a small area has one lit side and one dark side, it will look like a bump.But, if the light that enters from the lit side is scattered Hanrahan inside the skin and comes out on the dark side, the dark side also gets lit.In other words, the subsurface reflection spreads out the light in a way that makes the skin look smooth.
I also had an interesting journey trying to model hair.Early on, hair also looked unrealistic in renderings.It turned out that modeling hair as colored, transparent cylinders works very well [ ]. Humans have about , hairs on their heads and, in current movies, each hair is individually simulated using a cylindrical model.Of course there are di erent kinds of hair, so human hair is modeled di erently than animal fur, for example.It took time, but computer graphics designers eventually realized how to model each type of hair-now, simulated hair looks very good.

MATH POWER IN COMPUTER GRAPHICS
Simulating light requires math because we must find and use the correct scattering functions to track the way light rays move in virtual scenes.But there is another important use for math in computer graphics simulations.In the real world, a practically infinite number of light rays enters every scene.Each ray hits objects and gets scattered an infinite number of times before the light reaches the observer.To realistically simulate light in a virtual scene, we must sum up all the paths that light could travel to arrive at a certain point, to understand how much light we have at that point.We cannot analytically perform this summation.So, we must take a finite number of samples that accurately represents all the possibilities.How can we figure out how many samples will give us the best estimate of lighting?To do this, we use a mathematical method that was originally used to predict the behavior of randomly bouncing particles, called the Monte Carlo simulation [ ].

MONTE CARLO SIMULATION
A mathematical method that uses random sampling to calculate the outcome of an uncertain event.It is used in computer graphics to simulate the lighting in digital scenes.
Today, every pixel in a simulated movie image has about , light rays coming into it and randomly bouncing around.There are billions of pixels in every image, so we must track an extraordinarily large number of rays for every frame within every scene.This requires a lot of computations and is very expensive.The fastest computers in the world are used to perform the computations for computer-generated movies and computer games.In a typical movie, about h of computing by the fastest computers are needed to compute a single film image.This can mean that some movies need up to one million hours of computing time!That is a lot of time, but it would be orders of magnitude more if we had not developed the mathematical tools that significantly decreased the number of calculations needed.
The next time you watch a computer-generated scene in a movie, I hope that you will have a new appreciation for the amount of research and computing resources that went into making it!Our everyday world becomes quite magical when we look at it from a computer scientist's Hanrahan perspective.I invite you to learn to see the beauty of the world through careful observation, with curiosity about why things look the way they do.
Hanrahan the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice.No use, distribution or reproduction is permitted which does not comply with these terms.

YOUNG REVIEWERS
HRDAYA, AGE: I love reading books and I am fond of pointing out spelling or grammatical mistakes in magazines since I was years old.English is my favorite subject.My hobbies are reading books, dancing, and playing card games.I am also curious to know more about things around me.I love puppies and birds.

MRS. MINOGUE'S CLASS AT KLONDIKE ELEMENTARY, AGES:
-Located in West Lafayette, Indiana, we are a classroom of voracious learners full of curiosity, creativity, perseverance, and compassion.We are a family of scholars! Figure

FigureFigure
Figure He would layer pigments and oils on top of each other to create the skin's lively glow (to learn more about how Rembrandt painted skin, see here).Rembrandt was not familiar with the structure of the skin, but he somehow intuitively captured the fact that skin has several layers.Pictures explaining his painting technique show light rays going into the layers of the skin and eventually being reflected back out from the top layer.Using these two clues, I developed the first mathematical model of the scattering function of the skin [ ].This model was based on a process called subsurface reflection, in which light enters