Graphics Lighting Models

This document provides a comprehensive overview of various lighting models used in computer graphics. Understanding these models is crucial for creating realistic and visually appealing 3D scenes.

Fundamentals of Light and Surfaces

Light in a 3D scene is typically simulated as rays originating from light sources and interacting with the surfaces of objects. The appearance of a surface is determined by how it reflects, absorbs, and emits light. Key properties of light and surfaces include:

Types of Light Sources

Different light sources simulate real-world phenomena and contribute to scene illumination in distinct ways:

Common Lighting Models

1. Phong Lighting Model

The Phong lighting model is an empirical model that approximates the way light interacts with a surface. It calculates the color of a pixel by summing three components: ambient, diffuse, and specular reflection.

The final color is Ci = Ia + Id + Is. This model is computationally efficient and widely used.

2. Blinn-Phong Lighting Model

A modification of the Phong model that uses a halfway vector H instead of calculating the reflection vector R, which can be more computationally efficient for some hardware. The specular component is calculated as:

Is = Ks * Lp * max(0, dot(N, H))^shininess

This model offers similar visual results to Phong with potentially better performance.

3. Physically Based Rendering (PBR)

PBR aims to simulate light interaction more accurately based on physical principles. Instead of empirical formulas, PBR uses material properties derived from real-world measurements. Key concepts include:

PBR typically uses the Cook-Torrance BRDF (Bidirectional Reflectance Distribution Function) and produces more consistent and realistic results across different lighting conditions.

Example: Applying Ambient and Diffuse Light

Consider a diffuse surface with a green color (Kd = (0, 1, 0)) and ambient reflectivity Ka = 0.2. The ambient light La = (0.1, 0.1, 0.1) and directional light L = (0.5, 0.5, 0.5). If the surface normal N is (0, 1, 0) and the dot product dot(N, L) = 0.7:

Ambient Contribution: Ia = 0.2 * 0.1 = 0.02 (for each color channel)

Diffuse Contribution: Id = Kd * La * 0.7 = (0, 1, 0) * (0.1, 0.1, 0.1) * 0.7 = (0, 0.07, 0)

The resulting color would be influenced by these calculations, with the dominant diffuse component making the object appear green under the light.

Advanced Lighting Techniques

Conclusion

The choice of lighting model significantly impacts the visual fidelity and performance of a graphics application. From the simplicity of Phong to the accuracy of PBR, each model offers trade-offs suitable for different use cases.