11 Computer Graphics
What is Computer Graphics?
Computer Graphics is the field that studies how to generate, manipulate, and display visual content using computers.
It includes:
- 2D and 3D image generation
- Modeling, rendering, and animation
- Visualization and interactive systems
- User interfaces and human-computer interaction
Historical Milestones
Utah Teapot (1975)
- A mathematically modeled 3D object
- Became a standard test model for rendering algorithms
- Important for its simplicity and shared geometry
Cornell Box (1984)
- A physical test scene used to evaluate rendering methods
- Designed to study global illumination
- Demonstrates effects such as:
- Soft shadows
- Color bleeding (e.g., red wall tinting white wall)
Rendering Fundamentals
Ray Tracing Pipeline
Typical ray tracing process:
- Camera emits a view ray through the image plane
- View ray intersects a scene object
- At the intersection point:
- A shadow ray is cast toward the light source
- If the shadow ray is blocked → point is in shadow
Key properties:
- Rays originate from the camera, not the light
- If no intersection occurs, no shadow ray is needed
Global Illumination
Radiosity
- Models light transfer between diffuse surfaces
- Captures indirect lighting effects
- Produces realistic:
- Soft shadows
- Color bleeding
Differentiable Simulation (DiffSim)
Differentiable Simulation enables:
- Computing gradients of outputs with respect to inputs
- Optimizing control parameters using gradient-based methods
Example (1D motion):
- State update:
- Loss:
Using the chain rule, gradients can be propagated through time.
Applications:
- Robotics control
- Physics-based learning
- Simulation-based optimization
Performance and Hardware Acceleration
- GPUs: SIMT architecture, good for parallel workloads
- TPUs: Systolic arrays, optimized for dense tensor operations
If a simulator (e.g., MJX) runs much faster on TPUs than GPUs:
- The simulation is likely expressed as large tensor operations
- Implemented using JAX-style differentiable computation
- Avoids branching-heavy classical physics engines
Geometry and Curves
Bézier Curves
A cubic Bézier curve is defined by four control points:
Parametric form:
Properties:
- Tangent at ( t=0 ): direction ( P_1 - P_0 )
- Tangent at ( t=1 ): direction ( P_3 - P_2 )
- The derivative of a Bézier curve is itself a Bézier curve of degree ( n-1 )
Scope of Computer Graphics
Computer Graphics covers:
- Rendering (rasterization, ray tracing)
- Geometry modeling
- Animation and simulation
- Visualization
- Interaction and UI systems