AS

W6: Lighting Models

CSCI 3090 - Lighting Models

Introduction

Faculty of Science, Ontario Tech

Rendering Process

The rendering process is fundamental in computer graphics and is typically divided into three standard steps:

  1. Viewing and Projection: This involves transforming a 3D scene into a 2D image while considering the camera perspective and projection methods (orthogonal or perspective).

  2. Hidden Surface Removal: This step involves algorithms that determine which surfaces are visible in the final image and which are obscured by other surfaces, ensuring that only the relevant geometry is rendered.

  3. Determining Surface Color: This includes calculating the color of each pixel based on lighting conditions, material properties, and the viewer's angle.

These processes apply to both photorealistic and non-photorealistic rendering styles, making them integral to diverse applications in graphics.

Learning Goals

  • Understand the distinction between local and global illumination and their applications in rendering environments.

  • Describe the standard local illumination model and how it approximates light interactions.

  • Relate lighting models to physical reality, improving the realism of rendered images.

Lighting Overview

Key Aspects:

  • Illumination Models: The mathematical frameworks that describe how light interacts with surfaces in a scene.

  • Light Sources: The origin of the illumination, which can vary in type (e.g., point, directional) and intensity.

  • Light Interactions with Surfaces: How light is absorbed, reflected, or transmitted by differing materials.

This section includes a detailed discussion of the Phong illumination model and its applications in different shading methods:

  • Flat Shading: Simplistic method that assigns a single color to each polygon, resulting in a blocky appearance.

  • Gouraud Shading: Colors are computed at the vertices of polygons and interpolated across their surfaces, improving visual appearance but sometimes resulting in loss of highlight detail.

  • Phong Shading: Involves per-pixel normal interpolation, providing detailed highlights and better visual fidelity, though at a higher computational cost.

The challenge lies in striking a balance between rendering efficiency and quality, which is pivotal in many graphics applications.

Real World Light Interactions

  • Surfaces can emit, absorb, reflect, and scatter light, impacting how objects appear under various lighting conditions.

  • Depending on a surface's orientation to the light source, the intensity and color of the light reflected can change significantly.

  • Light reflection often involves multiple interactions, where light bounces between surfaces, leading to nuanced color and intensity outcomes in complex scenes.

Surface Colour Modeling

The model used to represent surface color is semi-physical. Although it draws on physical properties of light, it is not completely accurate.

  • Emphasis is placed on simple light reflections while considering how light color interacts with object color, excluding emissive objects (objects that emit their own light).

Mathematical Aspects of Illumination Models

The complexity of realistic rendering necessitates mathematical descriptions that culminate in the rendering equation, often requiring numerical solutions.

  • Simplifications made for practical applications include using idealized light sources to reduce computational overhead and facilitate faster processing.

Local vs. Global Illumination Models

Local Illumination Models:
  • Focus on pixel-light interaction using a localized approach that considers only the immediate light sources affecting a pixel.

  • Use heuristic approximations to make calculations simpler, as seen in models like Phong and polygon shading.

Global Illumination Models:
  • These models assess the entire scene's interactions, taking into account all objects to achieve accurate and realistic light computation.

  • Notable global methods include radiosity and ray tracing, which simulate how light interacts within and bounces between objects for true realism.

Components of Local Illumination Model

A local illumination model typically consists of:

  • Ambient Reflection: A constant illumination level simulating light scattered in the environment.

  • Diffuse Reflection: Accounts for light scattered uniformly across a surface; the intensity depends on the angle of incidence.

  • Specular Reflection: Highlights that occur on glossy surfaces, influenced by viewer angle relative to the reflection angle.

Types of Light Sources in Computer Graphics

  • Point Light Source: Emits light equally in all directions from a defined position, simulating bulbs or small light sources.

  • Spot Light Source: Projects light in a specified direction within a cone, with intensity tapering towards the edges.

  • Directional Light Source: No specific position, represents parallel rays, commonly used to simulate sunlight.

Phong Illumination Model

Proposed by Bùi Tường Phong in 1973, this model integrates three components to simulate realistic lighting:

  • Formula: Combines ambient, diffuse, and specular reflections into a single equation, enhancing versatility in rendering scenarios.

  • Ambient Light: Acts as a base level of illumination, representing indirect light.

  • Diffuse Light: Reflects light from non-shiny surfaces uniformly, creating softer color distributions.

  • Specular Light: Reflects light in shiny surfaces, creating highlights perceptible based on viewer position.

Ambient Light

  • Defined at a constant level across the scene but characterized by RGB components for color definition.

  • Each object in the scene has a reflection coefficient in RGB that influences how ambient light interacts with it.

Diffuse Reflection

  • Characterized by uniform light reflection in all directions, where the amount of reflection is proportional to lighting area, adhering to Lambert's cosine law.

Interaction of Light with Surfaces

  • The interaction primarily occurs on rough surfaces, heavily influenced by the orientation of light vectors and surface normals.

  • Lambert's Law: The angle (θ) between the light vector (L) and surface normal (N) determines the intensity of the reflection.

  • The model has been adjusted to account for zero intensity when the light source is blocked.

Combining Reflections

  • When ambient and diffuse reflections are blended, the outcome is a flat matte appearance lacking highlights.

  • Specular reflections are then incorporated to introduce highlights, achieving depth and realism.

Specular Highlights

  • Highlight intensity is contingent on the angle between the viewer's direction (V) and the reflected light vector (R).

  • Intensity peaks when these angles align, contributing visually striking elements to surfaces.

Surface Reflection Models

The Blinn-Phong Reflection Model offers a variation that enhances performance in scenarios where efficiency is paramount by utilizing a half vector between light and eye vectors.

Materials and Complex Reflections

  • Specular reflection intensity can be adjusted based on material color characteristics, particularly for metallic surfaces.

  • In scenes with multiple light sources, both diffuse and specular reflections are aggregated across different sources to achieve total illumination.

Phong Illumination Model Integrative Approach

  • Combined Formula: ( I = A + \max(0, L \cdot N) + (R \cdot V) )

  • This model effectively approximates various scenarios, providing necessary flexibility for adaptation in different rendering needs.

Rendering Techniques Comparison

  • Flat Shading: Simplifies rendering by applying a single color to polygons, leading to a lack of detail and depth perception.

  • Gouraud Shading: Enhances the appearance by calculating colors at vertices, interpolating across surfaces, and occasionally sacrificing highlight detail.

  • Phong Shading: Achieves the highest detail by interpolating normals at every pixel, ensuring highlights are sharp and pronounced, albeit with increased computational requirements.

Advanced Techniques

  • BRDF (Bidirectional Reflectance Distribution Function): This model extends reflection behavior by describing how light is reflected and scattered at the surface for varying angles—a vital component for achieving realistic rendering.

  • Techniques such as ray tracing and texture mapping serve to increase realism in rendered scenes, pushing towards more lifelike simulations of materials and environments.

Summary

In essence, lighting in graphics is modeled as a complex interplay of ambient, diffuse, and specular reflections. Mastering these interactions is crucial for effective simulations in 3D graphics modeling.