8. Rendering Algorithms and Global IlluminationIntroduction and ContextRendering is the stage in computer graphics at which a geometric description of a scene is converted into an image. The scene may contain objects, materials, lights, cameras, and environmental information; the rendered image records how these elements appear from a particular viewpoint. Rendering is therefore not merely a drawing operation. It is an approximation to the physical process by which light travels, interacts with surfaces, and reaches an observer or camera. The choice of rendering algorithm determines both visual quality and computational cost. Rasterization is highly efficient and remains central to interactive graphics, whereas ray-based methods provide a more direct model of visibility, reflection, refraction, and shadows. Global-illumination methods extend the calculation beyond direct light from a source by accounting for indirect light exchanged among surfaces. In professional production, no single algorithm is universally optimal. A real-time game, an architectural visualization, a scientific simulator, and a feature-film renderer may use different algorithms or combine several of them. This chapter examines rasterization, ray casting, ray tracing, path tracing, radiosity, shadows, reflection, refraction, Monte Carlo integration, denoising, and the quality–cost decisions that govern practical rendering systems. Learning ObjectivesAfter studying this chapter, the learner should be able to: 1. Distinguish rasterization, ray casting, ray tracing, path tracing, and radiosity. 2. Explain how visibility, shading, shadows, reflection, and refraction are computed. 3. Interpret the rendering equation and the role of Monte Carlo integration. 4. Evaluate noise, bias, variance, sampling, and denoising in global illumination. 5. Select rendering strategies for interactive, visualization, and production contexts. 6. Analyze technical, ethical, and professional trade-offs in rendering-system design. From Visibility to Light TransportA rendering algorithm must answer two related questions. First, which object is visible at each image location? Second, what radiance arrives at that location? Rasterization approaches the first question by projecting primitives onto the image plane and determining which fragments cover each pixel. Ray-based algorithms approach it by launching rays from the camera and finding their intersections with scene geometry. The distinction between local and global illumination is equally important. Local illumination evaluates a surface using its material, normal, and directly visible light sources. Global illumination also includes light that has bounced from other surfaces. A red wall can therefore tint a nearby white surface, and a room can remain partially illuminated even when a light source is not directly visible. Radiance is the central quantity in physically based rendering. It describes light travelling in a particular direction from a surface. Irradiance describes incident power per unit area, while intensity describes power emitted per unit solid angle. Confusing these quantities often produces incorrect lighting models. Rasterization: Projection as the Primary OperationRasterization converts geometric primitives, usually triangles, into fragments. The vertices of each triangle are transformed from object space through world, view, and projection spaces into screen coordinates. The rasterizer determines which pixel samples lie inside the projected triangle and interpolates attributes such as depth, texture coordinates, normals, and colours. Visibility is commonly resolved with a depth buffer. For each pixel, the depth buffer stores the nearest depth encountered so far. A fragment is accepted only if its depth passes the selected comparison rule. This process is fast because triangle setup, interpolation, depth testing, and texture access are highly parallel and supported by graphics processing units. Rasterization normally performs shading after visibility has been established. A fragment shader may evaluate a physically based local model, sample textures, and approximate shadows using shadow maps or screen-space methods. Its major strength is predictable, high throughput. Its weaknesses arise when light transport becomes complex. Accurate reflections, refractions, soft shadows, and indirect illumination require additional techniques or approximations. Rasterization is particularly suitable for games, virtual reality, user interfaces, and interactive simulation. However, it is not inherently non-physical. With carefully designed shaders, image-based lighting, physically based materials, temporal reconstruction, and hardware ray queries, rasterized pipelines can produce highly convincing images. Ray Casting and Ray TracingIn ray casting, a primary ray is generated from the camera through each pixel or sample. The ray–scene intersection test identifies the nearest visible surface. The surface point can then be shaded using its material and light information. Basic ray casting provides accurate visibility but does not necessarily trace secondary rays. Ray tracing extends this idea by recursively following rays generated at surface intersections. A shadow ray tests whether a light is visible from the surface. A reflection ray follows the mirror-reflected direction. A transmission or refraction ray passes through a transparent material according to Snell’s law. Secondary rays may themselves generate further rays, producing a tree of possible light paths. A simple recursive model can be written as L = L_e + L_direct + k_r L_reflected + k_t L_transmitted, where L_e is emitted radiance, L_direct is direct illumination, and k_r and k_t represent reflective and transmissive contributions. In practice, recursion depth, Russian roulette termination, and material models limit the computation. Ray tracing naturally handles visibility and geometric effects that are awkward for rasterization. Its cost depends on the number of rays, intersection complexity, recursion depth, and acceleration structure. Bounding volume hierarchies (BVHs), kd-trees, and grids reduce the number of primitive intersection tests. A BVH groups objects in nested bounding volumes; a ray first tests a volume and descends only when the volume is intersected. The Rendering Equation and Global IlluminationThe rendering equation expresses outgoing radiance at a surface point as emitted radiance plus reflected incoming radiance: L_o(x,\omega_o) = L_e(x,\omega_o) + ∫_Ω f_r(x,\omega_i,\omega_o)L_i(x,\omega_i)|cos θ_i|d\omega_i. Here, x is a surface point, \omega_i is an incoming direction, \omega_o is an outgoing direction, f_r is the bidirectional reflectance distribution function (BRDF), and the integral is taken over the hemisphere Ω. The cosine term accounts for the projected area of the surface. The BRDF describes how incident light is redistributed. It must generally be non-negative and should satisfy energy conservation. Diffuse reflection distributes energy broadly, while a specular BRDF concentrates it around a preferred direction. Modern physically based materials commonly combine diffuse, specular, metallic, roughness, transmission, and emission components. Global illumination is the evaluation of light transport involving multiple surface interactions. Direct illumination follows paths from a light to a surface and then to the camera. Indirect illumination includes paths with one or more intermediate reflections. In a room, indirect transport explains colour bleeding, soft illumination in corners, and light entering areas not directly facing a source. Path Tracing and Monte Carlo IntegrationPath tracing estimates the rendering equation by randomly sampling light-transport paths. At each surface, a direction is selected according to a probability density function (PDF), and the contribution is weighted by the BRDF, cosine factor, and reciprocal PDF. Repeating the process produces an estimator of the illumination integral. If a quantity is estimated from N samples, a simplified estimator is F̂ = (1/N) Σᵢ f(Xᵢ)/p(Xᵢ), where Xᵢ is a sampled direction, f is the integrand, and p is its probability density. With appropriate sampling, the estimator may be unbiased, but it has variance. The standard error generally decreases approximately with the inverse square root of the sample count. Consequently, reducing visible noise by a factor of two may require roughly four times as many samples. Path tracing is conceptually elegant because one algorithm can represent diffuse transport, glossy reflection, refraction, area-light shadows, and complex multiple-bounce effects. Its principal difficulty is variance. Small bright light sources, difficult visibility paths, caustics, glossy surfaces, and deep indirect illumination can produce noisy estimates. Important variance-reduction techniques include: - Importance sampling, which selects directions likely to contribute strongly.
- Multiple importance sampling, which combines sampling strategies such as light sampling and BRDF sampling.
- Russian roulette, which probabilistically terminates low-contribution paths while preserving an appropriate estimator.
- Next-event estimation, which explicitly samples a light source at a non-emissive surface.
- Stratified, low-discrepancy, and quasi-Monte Carlo sampling, which distribute samples more evenly.
A higher sample count is not always the best solution. Better sampling, improved light selection, and efficient geometry representations can produce greater gains than indiscriminate computation. Shadows, Reflection, and RefractionA hard shadow occurs when a surface point cannot see a light source. A shadow ray is launched from the point toward the source; if an opaque object blocks the ray, direct light from that source is absent. The origin of the shadow ray is usually offset slightly along the surface normal to avoid self-intersection, a problem known as shadow acne. Point lights produce hard geometric shadows. Area lights produce soft shadows because different points on the emitter are visible from different portions of the receiver. Monte Carlo sampling of an area light approximates this integral, with more samples reducing shadow noise. Perfect mirror reflection uses the reflection direction determined by the incident direction and surface normal. Real surfaces are rough, so a microfacet model treats the surface as a distribution of microscopic mirrors. Increasing roughness spreads reflected energy across a wider range of directions. Refraction occurs when light crosses between media with different indices of refraction. Snell’s law is n₁ sin θ₁ = n₂ sin θ₂. At sufficiently steep incident angles, total internal reflection occurs and no transmitted ray exists. Fresnel equations describe how the proportion of reflected and transmitted energy changes with angle. A physically plausible transparent material must account for both effects, as well as absorption when light travels through a medium. Radiosity and Alternative Global-Illumination ModelsRadiosity models diffuse energy exchange between surfaces. A surface is divided into patches, and the energy transferred between patches is described using form factors. In matrix form, a simplified radiosity system is Bᵢ = Eᵢ + ρᵢ Σⱼ FᵢⱼBⱼ, where Bᵢ is the radiosity of patch i, Eᵢ is emitted energy, ρᵢ is reflectivity, and Fᵢⱼ is the fraction of energy leaving patch i that reaches patch j, subject to an appropriate convention. Radiosity is valuable for diffuse architectural environments because it separates transport from viewpoint and can produce smooth, reusable illumination solutions. Its limitations are equally significant: it assumes diffuse or simplified reflection, can require substantial memory for patch relationships, and is less effective for sharp specular effects, caustics, and highly dynamic scenes. Modern renderers often combine methods. Rasterization may provide primary visibility, screen-space effects may approximate short-range transport, and hardware ray tracing may handle reflections and shadows. Offline systems may use path tracing with specialized techniques for difficult light paths. Denoising and Image ReconstructionA path-traced image with limited samples contains stochastic noise. Denoising estimates the underlying signal from noisy radiance and auxiliary buffers such as depth, surface normals, albedo, motion vectors, and material identifiers. Spatial filters use neighbouring pixels; temporal filters reuse information from earlier frames; machine-learning denoisers infer plausible structure from training data or rendered features. Denoising is not equivalent to increasing samples. It may remove variance but can introduce blur, ghosting, edge errors, or hallucinated detail. Temporal denoising is especially vulnerable to disocclusion, moving objects, and incorrect motion vectors. A robust pipeline combines moderate sampling with carefully validated reconstruction rather than relying on denoising to conceal severe undersampling. Image quality should be evaluated at the final display resolution and viewing condition. Pixel error alone may not correspond to perceived quality. Structural similarity, temporal stability, edge preservation, and task-specific judgments are often more informative. Choosing a Rendering StrategyRendering decisions are engineering decisions involving quality, latency, memory, hardware, scene complexity, and content volatility. Rasterization is generally preferred when frame time must be very low and lighting can be approximated. Ray tracing becomes attractive when accurate reflections, shadows, or visibility are central to the application. Path tracing is appropriate when physically coherent indirect illumination justifies longer computation. Radiosity remains useful for diffuse environments and precomputed lighting. An interactive application may use a hybrid pipeline: rasterize primary geometry, use shadow maps for distant lights, trace a limited number of rays for reflections, and apply temporal accumulation and denoising. An offline architectural renderer may instead use many path-traced samples because a single image can tolerate minutes or hours of computation. A scientific visualization system may prioritize reproducibility and numerical stability over photorealistic appearance. The cost–quality decision should consider: - spatial resolution and number of samples;
- number and type of light sources;
- ray depth and probability of difficult paths;
- acceleration-structure build and update costs;
- memory bandwidth and hardware occupancy;
- temporal coherence in animation;
- acceptable bias, noise, and latency;
- validation requirements and reproducibility.
Illustrative Case Study: Hybrid Rendering for an Architectural WalkthroughBackgroundA design firm is developing an interactive walkthrough of a museum interior. The building contains large windows, polished floors, translucent displays, and coloured walls. The target is a stable interactive frame rate on a range of workstation GPUs. Situation and ProblemA pure rasterization solution provides acceptable geometry and direct lighting but produces inaccurate floor reflections and weak illumination in areas away from windows. A pure path-traced solution produces excellent images but cannot maintain the required interactive latency. AnalysisThe dominant visual cues are primary visibility, contact shadows, window lighting, floor reflections, and colour bleeding. Full multi-bounce transport is desirable but not equally important everywhere. The team therefore distinguishes high-value effects from effects that can be approximated. Static building geometry permits precomputation, while visitors and movable exhibits require dynamic treatment. Approach and StrategyThe system rasterizes primary visibility and opaque geometry. Shadow maps provide efficient direct shadows for major lights. Light probes and precomputed diffuse transport approximate indirect illumination in static regions. A limited number of hardware rays calculate floor reflections and selected glossy surfaces. Screen-space information is used only when valid, with fallback rays for disoccluded regions. Temporal accumulation combines information across frames, and a denoiser uses depth, normals, albedo, and motion vectors. The team validates the result against a higher-sample offline reference for representative viewpoints. It measures frame time, temporal instability, reflection accuracy, and error near object boundaries rather than relying only on average pixel difference. OutcomeThe hybrid design meets the interactive target while preserving the most perceptually important effects. Its limitations are documented: reflections may degrade when an object leaves the screen, and precomputed illumination does not immediately respond to large structural changes. Learning PointsThe case demonstrates that rendering is a systems problem rather than a contest between algorithms. A well-designed hybrid pipeline assigns each effect to the method that provides the best quality–cost ratio, validates approximations against a reference, and communicates known failure conditions to users and artists. Challenges, Risks, and Common MistakesA frequent mistake is treating physically based rendering as a guarantee of visual correctness. Incorrect colour spaces, invalid normal maps, energy-violating materials, or unsuitable exposure can undermine a physically based algorithm. Another mistake is increasing recursion depth without identifying the actual source of noise or error. Shadow bias that is too large causes detached shadows; bias that is too small causes self-intersections. Incorrect handling of transparent surfaces can produce light leaks or black interiors. Fireflies—isolated extremely bright samples—often result from rare high-contribution paths and can be controlled through better sampling, clamping with care, or robust estimators. Temporal methods may create ghosting when motion data is inaccurate. Precomputed lighting can become invalid after geometry or material changes. Acceleration structures improve intersection performance but introduce build and update costs. Finally, denoising can hide systematic bias; visual smoothness must not be mistaken for physical accuracy. Professional, Ethical, and Governance ConsiderationsRendered images are persuasive representations and may influence engineering, planning, product, or public decisions. Professionals should disclose whether an image is physically based, composited, denoised, or substantially artistically modified. Architectural and scientific visualizations should not imply a level of predictive certainty that the underlying simulation does not support. Production pipelines should preserve scene versions, renderer settings, random seeds where reproducibility matters, color-management information, and reference outputs. Asset licenses, captured environments, and training data for machine-learning denoisers require appropriate rights and documentation. Accessibility also matters: excessive flicker, unstable temporal effects, or misleading lighting can impair users with visual sensitivities or distort interpretation. Current Developments and Best PracticesReal-time hardware ray tracing, neural denoising, neural radiance representations, reservoir-based sampling, and spatiotemporal reconstruction are extending the practical range of physically motivated rendering. These methods reduce cost but do not eliminate the need for sampling theory, error analysis, and validation. Neural methods can fail outside their training distribution, while learned reconstruction may introduce plausible but unsupported detail. Effective practice includes choosing a reference solution, profiling before optimizing, using physically meaningful material parameters, testing difficult lighting configurations, and separating geometric, sampling, shading, and display errors. Artists and engineers should inspect both static frames and motion sequences. A production-quality result is not simply the most realistic image; it is the image that satisfies the application’s accuracy, latency, stability, reproducibility, and communication requirements. Chapter SummaryRasterization determines visible fragments efficiently through projected primitives and depth testing, making it central to interactive graphics. Ray casting and ray tracing determine visibility through geometric intersections and naturally support shadows, reflections, and refractions. The rendering equation provides the theoretical foundation for global illumination, while path tracing estimates its integral using stochastic light paths. Monte Carlo methods introduce variance, which is controlled through importance sampling, multiple importance sampling, next-event estimation, and related techniques. Radiosity offers a useful diffuse energy-exchange model, especially for static environments. Denoising and temporal reconstruction improve practical performance but can introduce bias and instability. Rendering strategy must therefore balance image quality, physical plausibility, latency, memory, hardware, reproducibility, and application purpose. Hybrid systems are often the most effective professional solution. Key TermsRasterization: Conversion of projected geometric primitives into image fragments. Ray casting: Generation of camera rays to determine visible surface intersections. Ray tracing: Recursive simulation of rays for visibility and secondary light transport. Path tracing: Monte Carlo evaluation of light paths through a scene. Global illumination: Illumination including indirect light exchanged among surfaces. Local illumination: Shading based primarily on directly visible light sources. Rendering equation: Integral equation describing emitted and reflected outgoing radiance. Radiance: Directional light quantity transported along a ray. BRDF: Function describing how incident light is reflected toward outgoing directions. Irradiance: Incident radiant power per unit surface area. Monte Carlo integration: Numerical integration using random or statistically distributed samples. Variance: Statistical fluctuation of an estimator around its expected value. Importance sampling: Sampling strategy that favours high-contribution regions. Multiple importance sampling: Combination of several sampling techniques with weighted estimators. Radiosity: Diffuse energy-exchange method based on surface patches and form factors. BVH: Hierarchical grouping of bounding volumes used to accelerate ray intersection. Shadow ray: Ray testing visibility between a surface point and a light source. Fresnel effect: Angle-dependent variation in reflected and transmitted energy. Denoising: Reconstruction of a cleaner image from noisy rendered samples. Temporal accumulation: Reuse of information across successive frames. Review QuestionsShort Answer Questions1. How does a depth buffer support visibility determination in rasterization? 2. Distinguish ray casting from recursive ray tracing. 3. What roles do the BRDF and cosine term play in the rendering equation? 4. Why does path-tracing noise decrease slowly as sample count increases? 5. What is the purpose of a BVH? Long Answer Questions1. Explain the rasterization pipeline and evaluate its strengths and limitations for global illumination. 2. Derive and interpret the main terms of the rendering equation. 3. Compare path tracing and radiosity for an architectural visualization system. 4. Explain reflection, refraction, Fresnel effects, and total internal reflection in a ray tracer. 5. Discuss denoising, temporal accumulation, and the risks of using them in real-time rendering. Analytical / Application Questions1. Design a rendering architecture for a virtual-reality application with strict latency requirements and reflective surfaces. Justify each algorithmic choice. 2. A path-traced image contains noise concentrated around a small bright area light and glossy objects. Identify likely causes and propose a variance-reduction strategy. 3. An animation shows ghosting after temporal denoising whenever a character moves in front of a wall. Analyze the failure and recommend diagnostic and corrective measures. 22. Multiple Choice Questions with AnswersQuestion 1Which operation is primarily responsible for resolving visibility in a conventional rasterization pipeline? A. Recursive refraction B. Depth buffering after primitive coverage C. Monte Carlo path sampling D. Radiosity form-factor iteration Correct Answer: B. Depth buffering after primitive coverage Question 2What additional capability most directly distinguishes ray tracing from simple primary-ray casting? A. Texture interpolation B. Recursive generation of secondary rays C. Vertex transformation D. Triangle clipping Correct Answer: B. Recursive generation of secondary rays Question 3In the rendering equation, the term |cos θᵢ| accounts primarily for which effect? A. Projected area of incident illumination B. Number of recursion levels C. Material transparency D. Pixel depth quantization Correct Answer: A. Projected area of incident illumination Question 4Why does doubling the number of path-tracing samples not usually halve the noise? A. Ray intersections become nonphysical B. Standard error decreases approximately with the inverse square root of samples C. The BRDF becomes constant D. The depth buffer loses precision Correct Answer: B. Standard error decreases approximately with the inverse square root of samples Question 5Which technique explicitly samples a light source from a non-emissive surface point? A. Next-event estimation B. Back-face culling C. Bilinear filtering D. Shadow biasing Correct Answer: A. Next-event estimation Question 6A renderer must simulate light passing from glass into air. Which principle determines the transmitted direction? A. The painter’s algorithm B. Snell’s law C. The depth-test rule D. The radiosity balance alone Correct Answer: B. Snell’s law Question 7Why are BVHs used in ray-tracing systems? A. To increase material roughness B. To reduce the number of primitive intersection tests C. To convert radiance into irradiance D. To remove all Monte Carlo variance Correct Answer: B. To reduce the number of primitive intersection tests Question 8Which statement best describes radiosity? A. It models only camera visibility through primary rays B. It models diffuse energy exchange between surface patches C. It is a denoising filter for ray-traced images D. It is a method for interpolating triangle vertices Correct Answer: B. It models diffuse energy exchange between surface patches Question 9A temporal denoiser produces trails behind moving objects. What is the most likely contributing problem? A. Incorrect motion vectors or history rejection B. Excessively accurate Fresnel computation C. Too many BVH nodes only D. Use of a cosine-weighted sample Correct Answer: A. Incorrect motion vectors or history rejection Question 10For an interactive architectural walkthrough with static geometry and selected glossy surfaces, which strategy is generally most appropriate? A. Only unrestricted high-depth path tracing B. A hybrid rasterization, precomputation, limited ray tracing, and reconstruction pipeline C. Only radiosity recomputed every frame D. Disable visibility testing and rely on denoising Correct Answer: B. A hybrid rasterization, precomputation, limited ray tracing, and reconstruction pipeline
|