ArticleslgStudy

computer science

Computer graphics lighting

Computer graphics lighting is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Computer graphics lighting rather than just read about it. In short: Computer graphics lighting is the collection of techniques used to simulate light in computer graphics scenes. While lighting techniques offer flexibility in the level of detail and functionality available, they also operate at different levels of computational demand and complexity.

Computer graphics lighting — main illustration
Computer graphics lighting — illustration

Key takeaways

  • Computer graphics lighting belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Computer graphics lighting to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Computer graphics lighting from memory before moving on to harder problems.

Reference excerpt

Computer graphics lighting is the collection of techniques used to simulate light in computer graphics scenes. While lighting techniques offer flexibility in the level of detail and functionality available, they also operate at different levels of computational demand and complexity. Graphics artists can choose from a variety of light sources, models, shading techniques, and effects to suit the needs of each application.

Light sources Light sources allow for different ways to introduce light into graphics scenes.

Point Point sources emit light from a single point in all directions, with the intensity of the light decreasing with distance. An example of a point source is a standalone light bulb.

Directional A directional source (or distant source) uniformly lights a scene from one direction. Unlike a point source, the intensity of light produced by a directional source does not change with distance over the scale of the scene, as the directional source is treated as though it is extremely far away. An example of a directional source is sunlight on Earth.

Spotlight A spotlight produces a directed cone of light. The light becomes more intense as the viewer gets closer to the spotlight source and to the center of the light cone. An example of a spotlight is a flashlight.

Area Area lights are 3D objects which emit light. Whereas point lights and spot lights sources are considered infinitesimally small points, area lights are treated as physical shapes. Area light produce softer shadows and more realistic lighting than point lights and spot lights.

Ambient Ambient light sources illuminate objects even when no other light source is present. The intensity of ambient light is independent of direction, distance, and other objects, meaning the effect is completely uniform throughout the scene. This source ensures that objects are visible even in complete darkness.

Lightwarp A lightwarp is a technique of which an object in the geometrical world refracts light based on the direction and intensity of the light. The light is then warped using an ambient diffuse term with a range of the color spectrum. The light then may be reflectively scattered to produce a higher depth of field, and refracted. The technique is used to produce a unique rendering style and can be used to limit overexposure of objects. Games such as Team Fortress 2 use the rendering technique to create a cartoon cel shaded stylized look.

HDRI HDRI stands for High dynamic range image and is a 360° image that is wrapped around a 3D model as an outdoor setting and uses the sun typically as a light source in the sky. The textures from the model can reflect the direct and ambient light and colors from the HDRI.

Lighting interactions In computer graphics, the overall effect of a light source on an object is determined by the combination of the object's interactions with it usually described by at least three main components. The three primary lighting components (and subsequent interaction types) are diffuse, ambient, and specular.

Diffuse Diffuse lighting (or diffuse reflection) is the direct illumination of an object by an even amount of light interacting with a light-scattering surface. After light strikes an object, it is reflected as a function of the surface properties of the object as well as the angle of incoming light. This interaction is the primary contributor to the object's brightness and forms the basis for its color.

Ambient As ambient light is directionless, it interacts uniformly across all surfaces, with its intensity determined by the strength of the ambient light sources and the properties of objects' surface materials, namely their ambient reflection coefficients.

Specular The specular lighting component gives objects shine and highlights. This is distinct from mirror effects because other objects in the environment are not visible in these reflections. Instead, specular lighting creates bright spots on objects based on the intensity of the specular lighting component and the specular reflection coefficient of the surface.

Illumination models Lighting models are used to replicate lighting effects in rendered environments where light is approximated based on the physics of light. Without lighting models, replicating lighting effects as they occur in the natural world would require more processing power than is practical for computer graphics. This lighting, or illumination model's purpose is to compute the color of every pixel or the amount of light reflected for different surfaces in the scene. There are two main illumination models, object oriented lighting and global illumination. They differ in that object oriented lighting considers each object individually, whereas global illumination maps how light interacts between objects. Currently, researchers are developing global illumination techniques to more accurately replicate how light interacts with its environment.

Object oriented lighting Object oriented lighting, also known as local illumination, is defined by mapping a single light source to a single object. This technique is fast to compute, but often is an incomplete approximation of how light would behave in the scene in reality. It is often approximated by summing a combination of specular, diffuse, and ambient light of a specific object. The two predominant local illumination models are the Phong and the Blinn-Phong illumination models.

Phong illumination model

One of the most common reflection models is the Phong model. The Phong model assumes that the intensity of each pixel is the sum of the intensity due to diffuse, specular, and ambient lighting. This model takes into account the location of a viewer to determine specular light using the angle of light reflecting off an object. The cosine of the angle is taken and raised to a power decided by the designer. With this, the designer can decide how wide a highlight they want on an object; because of this, the power is called the shininess value. The shininess value is determined by the roughness of the surface where a mirror would have a value of infinity and the roughest surface might have a value of one. This model creates a more realistic looking white highlight based on the perspective of the viewer.

Blinn-Phong illumination model

… excerpt ends here. Continue reading the full article.

Illustrations

Computer graphics lighting: Decomposition of lighting interactions
Decomposition of lighting interactions
Computer graphics lighting: Image rendered using ray tracing
Image rendered using ray tracing
Computer graphics lighting: An example of flat shading
An example of flat shading
Computer graphics lighting: An example of Gouraud shading
An example of Gouraud shading
Computer graphics lighting: An example of Phong shading
An example of Phong shading

Worked examples

Example 1 — a first encounter with Computer graphics lighting

Start with the simplest possible case. Write down what Computer graphics lighting claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Computer graphics lighting before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Computer graphics lighting ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Computer graphics lighting

In research
Computer graphics lighting appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Computer graphics lighting in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Computer graphics lighting is common in secondary-school and first-year university syllabi. It links to neighbouring topics 3D rendering, Lighting, Shading, so understanding it makes those chapters shorter.
In everyday life
Look for Computer graphics lighting outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Computer graphics lighting” →

How to study Computer graphics lighting in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Computer graphics lighting means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Computer graphics lighting out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Computer graphics lighting in simple terms?

Computer graphics lighting is the collection of techniques used to simulate light in computer graphics scenes. While lighting techniques offer flexibility in the level of detail and functionality available, they also operate at different levels of computational demand and complexity.

Why does Computer graphics lighting matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Computer graphics lighting?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Computer graphics lighting.

Tags

  • 3D rendering
  • Lighting
  • Shading

Keep exploring