You are previewing Ray Tracing from the Ground Up.
O'Reilly logo
Ray Tracing from the Ground Up

Book Description

With the increase in computing speed and due to the high quality of the optical effects it achieves, ray tracing is becoming a popular choice for interactive and animated rendering. This book takes readers through the whole process of building a modern ray tracer from scratch in C++. All concepts and processes are explained in detail with the aid of hundreds of diagrams, ray-traced images, and sample code. It is suitable for undergraduate and graduate computer graphics courses and for individual programmers who would like to learn ray tracing.

Table of Contents

  1. Preliminaries
  2. Dedication
  3. Foreword
  4. Preface
    1. Where Did This Book Come From?
    2. What Is Ray Tracing?
    3. Why Is Ray Tracing Important?
    4. Book Features
    5. Pathways through This Book
    6. What Knowledge and Skills Do You Need?
    7. Intended Audience
    8. Online Resources
    9. Topics Not Covered
    1. Figure 1
  5. Acknowledgments
  6. Chapter 1 Ray Tracer Design and Programming
    1. 1.1 General Approaches
    2. 1.2 Inheritance
    3. 1.3 Language
    4. 1.4 Building Scenes
    5. 1.5 The User Interface
    6. 1.6 Skeleton Ray Tracer
    7. 1.7 Developing the Ray Tracer
    8. 1.8 Floats or Doubles
    9. 1.9 Efficiency Issues
      1. 1.9.1 Small is Beautiful
      2. 1.9.2 Data Storage
      3. 1.9.3 Pass by Reference
      4. 1.9.4 Don’t Return by Reference
      5. 1.9.5 Avoid Floating-Point Divides
      6. 1.9.6 Use Inlining Judiciously
      7. 1.9.7 Utility Classes
    10. 1.10 Coding Style
      1. 1.10.1 Identifiers
      2. 1.10.2 Concrete Data Types
      3. 1.10.3 Encapsulation
      4. 1.10.4 Function Signatures
      5. 1.10.5 Changing a Function Signature
      6. 1.10.6 Pure Virtual and Virtual Functions
      7. 1.10.7 File Structure
      8. 1.10.8 Project Structure
    11. 1.11 Debugging
      1. 1.11.1 Get to Know Your Debugger
      2. 1.11.2 Ray Trace Single-Pixel Images
      3. 1.11.3 Keep Track of Pixel Coordinates
      4. 1.11.4 Use cout
      5. 1.11.5 Watch Out for Unallocated Memory
      6. 1.11.6 Simplify
      7. 1.11.7 Transparency
      8. 1.11.8 Use the Images Here
    12. Further Reading
    1. Figure 1.1
  7. Chapter 2 Some Essential Mathematics
    1. Objectives
    2. 2.1 Sets
      1. 2.1.1 Definition and Notation
      2. 2.1.2 Subsets
      3. 2.1.3 Ordered Pairs and the Cartesian Product of Sets
    3. 2.2 Intervals
    4. 2.3 Angles
      1. 2.3.1 Measurement
      2. 2.3.2 Degrees and Radians
    5. 2.4 Trigonometry
      1. 2.4.1 Definitions
      2. 2.4.2 Relations
    6. 2.5 Coordinate Systems
      1. 2.5.1 3D Cartesian Coordinates
      2. 2.5.2 Cylindrical Coordinates
      3. 2.5.3 Spherical Coordinates
    7. 2.6 Vectors
      1. 2.6.1 Definition and Representation
      2. 2.6.2 Operations
    8. 2.7 Points
    9. 2.8 Normals
    10. 2.9 Mathematical Surfaces
      1. 2.9.1 Implicit Surfaces
      2. 2.9.2 Parametric Surfaces
      3. 2.9.3 Tangent Planes
    11. 2.10 Solid Angles
      1. 2.10.1 Definition
      2. 2.10.2 Solid Angles in Spherical Coordinates
      3. 2.10.3 Integrals Over a Hemisphere
    12. 2.11 Random Numbers
    13. 2.12 Orthonormal Bases and Frames
      1. 2.12.1 Definition
      2. 2.12.2 Construction
      3. 2.12.3 Orthonormal Frames
      4. 2.12.4 Using an Orthonormal Frame
    14. 2.13 Geometric Series
    15. 2.14 The Dirac Delta Function
    16. Notes and Discussion
    17. Further Reading
    18. Questions
    19. Exercises
    1. Figure 2.1
    2. Figure 2.2
    3. Figure 2.3
    4. Figure 2.4
    5. Figure 2.5
    6. Figure 2.6
    7. Figure 2.7
    8. Figure 2.8
    9. Figure 2.9
    10. Figure 2.10
    11. Figure 2.11
    12. Figure 2.12
    13. Figure 2.13
    14. Figure 2.14
    15. Figure 2.15
    16. Figure 2.16
    17. Figure 2.17
    18. Figure 2.18
    19. Figure 2.19
    20. Figure 2.20
    1. Table 2.1
  8. Chapter 3 Bare-Bones Ray Tracing
    1. Objectives
    2. 3.1 How Ray Tracing Works
    3. 3.2 The World
    4. 3.3 Rays
    5. 3.4 Ray-Object Intersections
      1. 3.4.1 General Points
      2. 3.4.2 Rays and Implicit Surfaces
      3. 3.4.3 Geometric Objects
      4. 3.4.4 Planes
      5. 3.4.5 Spheres
    6. 3.5 Representing Colors
    7. 3.6 A Bare-Bones Ray Tracer
      1. 3.6.1 Required Classes
      2. 3.6.2 The Main Function
      3. 3.6.3 The View Plane
      4. 3.6.4 Pixels and Pictures
      5. 3.6.5 The Build Function
      6. 3.6.6 Rendering the Scene
    8. 3.7 Tracers
    9. 3.8 Color Display
    10. 3.9 Ray Tracing Multiple Objects
    11. Notes and Discussion
    12. Further Reading
    13. Questions
    14. Exercises
    1. Figure 3.1
    2. Figure 3.2
    3. Figure 3.3
    4. Figure 3.4
    5. Figure 3.5
    6. Figure 3.6
    7. Figure 3.7
    8. Figure 3.8
    9. Figure 3.9
    10. Figure 3.10
    11. Figure 3.11
    12. Figure 3.12
    13. Figure 3.13
    14. Figure 3.14
    15. Figure 3.15
    16. Figure 3.16
    17. Figure 3.17
    18. Figure 3.18
    19. Figure 3.19
    20. Figure 3.20
    21. Figure 3.21
  9. Chapter 4 Antialiasing
    1. Objectives
    2. 4.1 Aliasing Effects
    3. 4.2 Remedies
      1. 4.2.1 Increase the Image Resolution
      2. 4.2.2 Regular Sampling
      3. 4.2.3 Random Sampling
      4. 4.2.4 Jittered Sampling
    4. 4.3 Antialiasing Fine Detail
    5. 4.4 Filtering
    6. Further Reading
    7. Questions
    8. Exercises
    1. Figure 4.1
    2. Figure 4.2
    3. Figure 4.3
    4. Figure 4.4
    5. Figure 4.5
    6. Figure 4.6
    7. Figure 4.7
    8. Figure 4.8
    9. Figure 4.9
  10. Chapter 5 Sampling Techniques
    1. Objectives
    2. 5.1 A Sampling Architecture
    3. 5.2 Characteristics of Good Sampling
    4. 5.3 Sampling Patterns
      1. 5.3.1 Random Sampling
      2. 5.3.2 Jittered Sampling
      3. 5.3.3 n-Rooks Sampling
      4. 5.3.4 Multi-Jittered Sampling
      5. 5.3.5 Hammersley Sampling
    5. 5.4 Shuffling the Indices
    6. 5.5 Some Results
    7. Notes and Discussion
    8. Further Reading
    9. Questions
    10. Exercises
    1. Figure 5.1
    2. Figure 5.2
    3. Figure 5.3
    4. Figure 5.4
    5. Figure 5.5
    6. Figure 5.6
    7. Figure 5.7
    8. Figure 5.8
    9. Figure 5.9
    10. Figure 5.10
    11. Figure 5.11
    12. Figure 5.12
    13. Figure 5.13
    14. Figure 5.14
    15. Figure 5.15
    16. Figure 5.16
    17. Figure 5.17
    18. Figure 5.18
    19. Figure 5.19
    20. Figure 5.20
    21. Figure 5.21
    22. Figure 5.22
    1. Table 5.1
  11. Chapter 6 Mapping Samples to a Disk
    1. Objectives
    2. 6.1 Rejection Sampling
    3. 6.2 The Concentric Map
    4. Further Reading
    5. Questions
    6. Exercises
    1. Figure 6.1
    2. Figure 6.2
    3. Figure 6.3
    4. Figure 6.4
    1. Table 6.1
  12. Chapter 7 Mapping Samples to a Hemisphere
    1. Objectives
    2. 7.1 Cosine Distributions
    3. 7.2 Mapping Theory
    4. 7.3 Implementation
    5. 7.4 Results
    6. Further Reading
    7. Exercises
    1. Figure 7.1
    2. Figure 7.2
    3. Figure 7.3
    4. Figure 7.4
    5. Figure 7.5
    6. Figure 7.6
  13. Chapter 8 Perspective Viewing
    1. Objectives
    2. 8.1 Definitions
    3. 8.2 Properties of Perspective Projections
    4. 8.3 Axis-Aligned Perspective Viewing
    5. 8.4 Implementation
    6. 8.5 Processes and Results
    7. 8.6 Perspective Distortion
    8. Further Reading
    9. Questions
    10. Exercises
    1. Figure 8.1
    2. Figure 8.2
    3. Figure 8.3
    4. Figure 8.4
    5. Figure 8.5
    6. Figure 8.6
    7. Figure 8.7
    8. Figure 8.8
    9. Figure 8.9
    10. Figure 8.10
    11. Figure 8.11
    12. Figure 8.12
    13. Figure 8.13
    14. Figure 8.14
    15. Figure 8.15
    16. Figure 8.16
    17. Figure 8.17
    18. Figure 8.18
    19. Figure 8.19
    20. Figure 8.20
    21. Figure 8.21
    22. Figure 8.22
    23. Figure 8.23
    24. Figure 8.24
    25. Figure 8.25
  14. Chapter 9 A Practical Viewing System
    1. Objectives
    2. 9.1 Description
    3. 9.2 The User Interface
    4. 9.3 Viewing Coordinates
    5. 9.4 Primary-Ray Calculation
    6. 9.5 Implementation
    7. 9.6 Examples
    8. 9.7 Zooming
    9. 9.8 The Roll Angle
    10. 9.9 The Singularity
    11. Further Reading
    12. Questions
    13. Exercises
    1. Figure 9.1
    2. Figure 9.2
    3. Figure 9.3
    4. Figure 9.4
    5. Figure 9.5
    6. Figure 9.6
    7. Figure 9.7
    8. Figure 9.8
    9. Figure 9.9
    10. Figure 9.10
    11. Figure 9.11
    12. Figure 9.12
  15. Chapter 10 Depth of Field
    1. Objectives
    2. 10.1 Thin-Lens Theory
    3. 10.2 Simulation
    4. 10.3 Implementation
    5. 10.4 Results
    6. Further Reading
    7. Questions
    8. Exercises
    1. Figure 10.1
    2. Figure 10.2
    3. Figure 10.3
    4. Figure 10.4
    5. Figure 10.5
    6. Figure 10.6
    7. Figure 10.7
    8. Figure 10.8
    9. Figure 10.9
    10. Figure 10.10
    11. Figure 10.11
    12. Figure 10.12
    13. Figure 10.13
  16. Chapter 11 Nonlinear Projections
    1. Objectives
    2. 11.1 Fisheye Projection
      1. 11.1.1 Theory
      2. 11.1.2 Implementation
      3. 11.1.3 Results
    3. 11.2 Spherical Panoramic Projection
      1. 11.2.1 Theory
      2. 11.2.2 Implementation
      3. 11.2.3 Results
    4. Further Reading
    5. Questions
    6. Exercises
    1. Figure 11.1
    2. Figure 11.2
    3. Figure 11.3
    4. Figure 11.4
    5. Figure 11.5
    6. Figure 11.6
    7. Figure 11.7
    8. Figure 11.8
    9. Figure 11.9
    10. Figure 11.10
    11. Figure 11.11
    12. Figure 11.12
    13. Figure 11.13
    14. Figure 11.14
    15. Figure 11.15
  17. Chapter 12 Stereoscopy
    1. Objectives
    2. 12.1 Parallax
    3. 12.2 Camera Arrangements
    4. 12.3 The Stereo Camera
    5. 12.4 Stereo-Pair Display and Viewing
    6. 12.5 Implementation
    7. 12.6 Results
    8. Notes and Discussion
    9. Further Reading
    10. Questions
    11. Exercises
    1. Figure 12.1
    2. Figure 12.2
    3. Figure 12.3
    4. Figure 12.4
    5. Figure 12.5
    6. Figure 12.6
    7. Figure 12.7
    8. Figure 12.8
    9. Figure 12.9
    10. Figure 12.10
    11. Figure 12.11
    12. Figure 12.12
    13. Figure 12.13
    14. Figure 12.14
    15. Figure 12.15
    16. Figure 12.16
    17. Figure 12.17
  18. Chapter 13 Theoretical Foundations
    1. Objectives
    2. 13.1 Radiometric Quantities
    3. 13.2 Angular Dependence of Irradiance
    4. 13.3 Notation and Directions
    5. 13.4 Radiance and Irradiance
    6. 13.5 Spectral Representation
    7. 13.6 BRDFs
      1. 13.6.1 Definition
      2. 13.6.2 Reflected Radiance
      3. 13.6.3 Properties
    8. 13.7 Reflectance
    9. 13.8 The Perfect Diffuse BRDF
    10. 13.9 The BRDF Classe
      1. 13.9.1 Organization and Member Functions
      2. 13.9.2 Lambertian class implementation
    11. 13.10 The Rendering Equation
      1. 13.10.1 Hemisphere Form
      2. 13.10.2 Area Form
      3. 13.10.3 Solutions
    12. 13.11 Monte Carlo Integration
      1. 13.11.1 The Basic Technique
      2. 13.11.2 Variance
      3. 13.11.3 Importance Sampling
    13. Further Reading
    14. Exercises
    1. Figure 13.1
    2. Figure 13.2
    3. Figure 13.3
    4. Figure 13.4
    5. Figure 13.5
    6. Figure 13.6
    7. Figure 13.7
    8. Figure 13.8
    9. Figure 13.9
    10. Figure 13.10
    11. Figure 13.11
    12. Figure 13.12
    13. Figure 13.13
    1. Table 13.1
  19. Chapter 14 Lights and Materials
    1. Objectives
    2. 14.1 Illumination and Reflection
    3. 14.2 Lights
      1. 14.2.1 The Ambient Light
      2. 14.2.2 Directional Lights
      3. 14.2.3 Point Lights
    4. 14.3 Light Classe
    5. 14.4 The World and ShadeRec Classes
      1. 14.4.1 The World
      2. 14.4.2 The ShadeRec Class
    6. 14.5 Tracers
    7. 14.6 Diffuse Shading
      1. 14.6.1 Basic Expressions
      2. 14.6.2 Shading Both Sides of Surfaces
    8. 14.7 Materials
    9. 14.8 An Example
    10. 14.9 Out-of-Gamut Colors
    11. Further Reading
    12. Questions
    13. Exercises
    1. Figure 14.1
    2. Figure 14.2
    3. Figure 14.3
    4. Figure 14.4
    5. Figure 14.5
    6. Figure 14.6
    7. Figure 14.7
    8. Figure 14.8
    9. Figure 14.9
    10. Figure 14.10
    11. Figure 14.11
    12. Figure 14.12
    13. Figure 14.13
    14. Figure 14.14
    15. Figure 14.15
    16. Figure 14.16
    17. Figure 14.17
    18. Figure 14.18
    19. Figure 14.19
    20. Figure 14.20
    21. Figure 14.21
    22. Figure 14.22
    23. Figure 14.23
    24. Figure 14.24
    25. Figure 14.25
    26. Figure 14.26
  20. Chapter 15 Specular Reflection
    1. Objectives
    2. 15.1 Modeling
    3. 15.2 Implementation
    4. 15.3 Viewer Dependence
    5. 15.4 Colored Highlights
    6. 15.5 Highlights and Overflow
    7. 15.6 Other Reflection Models
    8. Further Reading
    9. Questions
    10. Exercises
    1. Figure 15.1
    2. Figure 15.2
    3. Figure 15.3
    4. Figure 15.4
    5. Figure 15.5
    6. Figure 15.6
    7. Figure 15.7
    8. Figure 15.8
    9. Figure 15.9
    10. Figure 15.10
    11. Figure 15.11
    12. Figure 15.12
    13. Figure 15.13
    14. Figure 15.14
    15. Figure 15.15
  21. Chapter 16 Shadows
    1. Objectives
    2. 16.1 Why Shadows Are Important
    3. 16.2 Definitions
    4. 16.3 Implementation
    5. 16.4 The Epsilon Factor
    6. 16.5 Examples
    7. 16.6 Costs
    8. 16.7 Shadowing Options
    9. Notes and Discussion
    10. Further Reading
    11. Questions
    12. Exercises
    1. Figure 16.1
    2. Figure 16.2
    3. Figure 16.3
    4. Figure 16.4
    5. Figure 16.5
    6. Figure 16.6
    7. Figure 16.7
    8. Figure 16.8
    9. Figure 16.9
    10. Figure 16.10
    11. Figure 16.11
    12. Figure 16.12
    13. Figure 16.13
    14. Figure 16.14
    15. Figure 16.15
  22. Chapter 17 Ambient Occlusion
    1. Objectives
    2. 17.1 Modeling
    3. 17.2 Implementation
    4. 17.3 A Simple Scene
    5. 17.4 Two-Sided Objects
    6. 17.5 Other Scenes
    7. Notes and Discussion
    8. Further Reading
    9. Questions
    10. Exercises
    1. Figure 17.1
    2. Figure 17.2
    3. Figure 17.3
    4. Figure 17.4
    5. Figure 17.5
    6. Figure 17.6
    7. Figure 17.7
    8. Figure 17.8
    9. Figure 17.9
    10. Figure 17.10
    11. Figure 17.11
    12. Figure 17.12
    13. Figure 17.13
    14. Figure 17.14
    15. Figure 17.15
  23. Chapter 18 Area Lights
    1. Objectives
    2. 18.1 Area-Lighting Architecture
    3. 18.2 Direct Rendering
    4. 18.3 Estimating Direct Illumination
    5. 18.4 The Area-Lighting Tracer
    6. 18.5 The Emissive Material
    7. 18.6 Other Materials
    8. 18.7 The Geometric Object Classes
    9. 18.8 The Area Light Class
    10. 18.9 Example Images
    11. 18.10 Environment Lights
    12. Notes and Discussion
    13. Further Reading
    14. Questions
    15. Exercises
    1. Figure 18.1
    2. Figure 18.2
    3. Figure 18.3
    4. Figure 18.4
    5. Figure 18.5
    6. Figure 18.6
    7. Figure 18.7
    8. Figure 18.8
    9. Figure 18.9
    10. Figure 18.10
    11. Figure 18.11
    12. Figure 18.12
  24. Chapter 19 Ray-Object Intersections
    1. Objectives
    2. 19.1 Bounding Boxes
    3. 19.2 Axis-Aligned Boxes
    4. 19.3 Triangles
      1. 19.3.1 Definition
      2. 19.3.2 Intersection
    5. 19.4 Other Objects
      1. 19.4.1 Disks
      2. 19.4.2 Rectangles
    6. 19.5 Generic Objects
      1. 19.5.1 Motivation
      2. 19.5.2 Generic Spheres, Disks, and Rectangles
      3. 19.5.3 Generic Open Cylinder
      4. 19.5.4 Generic Torus
      5. 19.5.5 Generic Objects and Default Objects
    7. 19.6 Shading Issues
    8. 19.7 Part Objects
      1. 19.7.1 Theory
      2. 19.7.2 Part Cylinders
      3. 19.7.3 Part Spheres
      4. 19.7.4 Part Tori
      5. 19.7.5 Angular-Range Problem
    9. 19.8 Compound Objects
      1. 19.8.1 Benefits
      2. 19.8.2 Implementation
      3. 19.8.3 Solid Cylinder
    10. Further Reading
    11. Questions
    12. Exercises
    1. Figure 19.1
    2. Figure 19.2
    3. Figure 19.3
    4. Figure 19.4
    5. Figure 19.5
    6. Figure 19.6
    7. Figure 19.7
    8. Figure 19.8
    9. Figure 19.9
    10. Figure 19.10
    11. Figure 19.11
    12. Figure 19.12
    13. Figure 19.13
    14. Figure 19.14
    15. Figure 19.15
    16. Figure 19.16
    17. Figure 19.17
    18. Figure 19.18
    19. Figure 19.19
    20. Figure 19.20
    21. Figure 19.21
    22. Figure 19.22
    23. Figure 19.23
    24. Figure 19.24
    25. Figure 19.25
    26. Figure 19.26
    27. Figure 19.27
    28. Figure 19.28
    29. Figure 19.29
    30. Figure 19.30
  25. Chapter 20 Affine Transformations
    1. Objectives
    2. 20.1 2D Transformations
      1. 20.1.1 Scaling
      2. 20.1.2 Rotation
      3. 20.1.3 Shearing
      4. 20.1.4 Reflection
      5. 20.1.5 Translation
    3. 20.2 3D Homogeneous Coordinates
    4. 20.3 3D Transformations
      1. 20.3.1 Translation
      2. 20.3.2 Scaling
      3. 20.3.3 Rotation
      4. 20.3.4 Reflection
      5. 20.3.5 Shearing
    5. 20.4 Composition of Transformations
    6. 20.5 Inverse Transformations
      1. 20.5.1 Individual Inverse Transformations
      2. 20.5.2 Composite Inverse Transformations
    7. 20.6 Rotation about an Arbitrary Line
    8. Further Reading
    9. Questions
    10. Exercises
    1. Figure 20.1
    2. Figure 20.2
    3. Figure 20.3
    4. Figure 20.4
    5. Figure 20.5
    6. Figure 20.6
    7. Figure 20.7
    8. Figure 20.8
    9. Figure 20.9
    10. Figure 20.10
    11. Figure 20.11
    12. Figure 20.12
    13. Figure 20.13
    14. Figure 20.14
    15. Figure 20.15
  26. Chapter 21 Transforming Objects
    1. Objectives
    2. 21.1 Intersecting Transformed Objects
      1. 21.1.1 General Theory
      2. 21.1.2 Transforming Points and Vectors
      3. 21.1.3 Programming Aspects
      4. 21.1.4 Ray Intersection with Transformed Objects
      5. 21.1.5 Inverse of the Transformation Matrix
      6. 21.1.6 Example
    3. 21.2 Transforming Normals
      1. 21.2.1 Theory
      2. 21.2.2 Programming Aspects
    4. 21.3 Directly Transforming Objects
    5. 21.4 Instancing
    6. 21.5 Beveled Objects
    7. Further Reading
    8. Notes and Discussion
      1. The Instance Hit Function
      2. Transformation Code
      3. Important Point
    9. Questions
    10. Exercises
    1. Figure 21.1
    2. Figure 21.2
    3. Figure 21.3
    4. Figure 21.4
    5. Figure 21.5
    6. Figure 21.6
    7. Figure 21.7
    8. Figure 21.8
    9. Figure 21.9
    10. Figure 21.10
    11. Figure 21.11
    12. Figure 21.12
    13. Figure 21.13
    14. Figure 21.14
    15. Figure 21.15
    16. Figure 21.16
    17. Figure 21.17
  27. Chapter 22 Regular Grids
    1. Objectives
    2. 22.1 Description
    3. 22.2 Construction
    4. 22.3 Traversal
    5. 22.4 Testing
      1. 22.4.1 Testing Tips
      2. 22.4.2 Eight Boxes
      3. 22.4.3 Random Spheres
      4. 22.4.4 Some Issues
    6. 22.5 Grids and Transformed Objects
    7. 22.6 Comparison with BVHs
    8. Further Reading
    9. Questions
    10. Exercises
    1. Figure 22.1
    2. Figure 22.2
    3. Figure 22.3
    4. Figure 22.4
    5. Figure 22.5
    6. Figure 22.6
    7. Figure 22.7
    8. Figure 22.8
    9. Figure 22.9
    10. Figure 22.10
    11. Figure 22.11
    12. Figure 22.12
    13. Figure 22.13
    14. Figure 22.14
    15. Figure 22.15
    16. Figure 22.16
    17. Figure 22.17
    18. Figure 22.18
    1. Table 22.1
    2. Table 22.2
  28. Chapter 23 Triangle Meshes
    1. Objectives
    2. 23.1 Tessellating a Sphere
      1. 23.1.1 Flat Shading
      2. 23.1.2 Smooth Shading
    3. 23.2 A Mesh Data Structure
    4. 23.3 PLY Files
    5. 23.4 Examples
      1. 23.4.1 Two Triangles
      2. 23.4.2 Computing the Normals
      3. 23.4.3 Multiple-Mesh Objects
    6. 23.5 Hierarchical Instance Grids
    7. Further Reading
    8. Questions
    9. Exercises
    1. Figure 23.1
    2. Figure 23.2
    3. Figure 23.3
    4. Figure 23.4
    5. Figure 23.5
    6. Figure 23.6
    7. Figure 23.7
    8. Figure 23.8
    9. Figure 23.9
    10. Figure 23.10
    11. Figure 23.11
    12. Figure 23.12
    13. Figure 23.13
    14. Figure 23.14
  29. Chapter 24 Mirror Reflection
    1. Objectives
    2. 24.1 The Illumination Model
    3. 24.2 Implementation
      1. 24.2.1 Things to Do
      2. 24.2.2 The Whitted Tracer
      3. 24.2.3 The Perfect Specular BRDF
      4. 24.2.4 A Reflective Material
    4. 24.3 Reflective Objects
    5. 24.4 Inconsistencies
    6. 24.5 Colored Reflectors
    7. 24.6 Real and Virtual Images
    8. 24.7 Examples
      1. 24.7.1 Sphere Reflections
      2. 24.7.2 Hall of Mirrors
      3. 24.7.3 Self-Reflection
      4. 24.7.4 Four Spheres
      5. 24.7.5 Reflections in a Hollow Sphere
      6. 24.7.6 Making Mirages
      7. 24.7.7 Beveled Objects
      8. 24.7.8 Triangle Meshes
    9. Further Reading
    10. Questions
    11. Exercises
    1. Figure 24.1
    2. Figure 24.2
    3. Figure 24.3
    4. Figure 24.4
    5. Figure 24.5
    6. Figure 24.6
    7. Figure 24.7
    8. Figure 24.8
    9. Figure 24.9
    10. Figure 24.10
    11. Figure 24.11
    12. Figure 24.12
    13. Figure 24.13
    14. Figure 24.14
    15. Figure 24.15
    16. Figure 24.16
    17. Figure 24.17
    18. Figure 24.18
    19. Figure 24.19
    20. Figure 24.20
    21. Figure 24.21
    22. Figure 24.22
    23. Figure 24.23
    24. Figure 24.24
    25. Figure 24.25
    26. Figure 24.26
    27. Figure 24.27
    28. Figure 24.28
    29. Figure 24.29
    30. Figure 24.30
    31. Figure 24.31
    32. Figure 24.32
    33. Figure 24.33
    34. Figure 24.34
    35. Figure 24.35
    36. Figure 24.36
    37. Figure 24.37
    38. Figure 24.38
    39. Figure 24.39
    40. Figure 24.40
    41. Figure 24.41
    42. Figure 24.42
    43. Figure 24.43
  30. Chapter 25 Glossy Reflection
    1. Objectives
    2. 25.1 Modeling
    3. 25.2 Implementation
    4. 25.3 Results
    5. Further Reading
    6. Questions
    7. Exercises
    1. Figure 25.1
    2. Figure 25.2
    3. Figure 25.3
    4. Figure 25.4
    5. Figure 25.5
    6. Figure 25.6
    7. Figure 25.7
    8. Figure 25.8
    9. Figure 25.9
    10. Figure 25.10
    11. Figure 25.11
    12. Figure 25.12
    13. Figure 25.13
  31. Chapter 26 Global Illumination
    1. Objectives
    2. 26.1 Light Transport
    3. 26.2 Path Tracing
      1. 26.2.1 Description
      2. 26.2.2 Implementation
    4. 26.3 Results
      1. 26.3.1 Environment Light
      2. 26.3.2 The Cornell Box
      3. 26.3.3 Reflective Surfaces and Caustics
    5. 26.4 Sampling the Lights
    6. Notes and Discussion
    7. Further Reading
    8. Questions
    9. Exercises
    1. Figure 26.1
    2. Figure 26.2
    3. Figure 26.3
    4. Figure 26.4
    5. Figure 26.5
    6. Figure 26.6
    7. Figure 26.7
    8. Figure 26.8
    9. Figure 26.9
    10. Figure 26.10
    11. Figure 26.11
    12. Figure 26.12
  32. Chapter 27 Simple Transparency
    1. Objectives
    2. 27.1 Index of Refraction
    3. 27.2 Surface Physics and Refraction
    4. 27.3 Total Internal Reflection
    5. 27.4 The Illumination Model
    6. 27.5 Practical Aspects
    7. 27.6 Implementation
    8. 27.7 Transparent Spheres
      1. 27.7.1 General Analysis
      2. 27.7.2 The Case η ≥ 1
      3. 27.7.3 The Case η < 1
      4. 27.7.4 What Happens to Rays that Enter the Sphere?
    9. 27.8 Transparent Compound Objects
    10. 27.9 Leaving Out the Etas
    11. Further Reading
    12. Questions
    13. Exercises
    1. Figure 27.1
    2. Figure 27.2
    3. Figure 27.3
    4. Figure 27.4
    5. Figure 27.5
    6. Figure 27.6
    7. Figure 27.7
    8. Figure 27.8
    9. Figure 27.9
    10. Figure 27.10
    11. Figure 27.11
    12. Figure 27.12
    13. Figure 27.13
    14. Figure 27.14
    15. Figure 27.15
    16. Figure 27.16
    17. Figure 27.17
    18. Figure 27.18
    19. Figure 27.19
    20. Figure 27.20
    21. Figure 27.21
    22. Figure 27.22
    23. Figure 27.23
    24. Figure 27.24
    25. Figure 27.25
    26. Figure 27.26
    27. Figure 27.27
    28. Figure 27.28
    29. Figure 27.29
    30. Figure 27.30
    31. Figure 27.31
    32. Figure 27.32
    1. Table 27.1
  33. Chapter 28 Realistic Transparency
    1. Objectives
    2. 28.1 The Fresnel Equations
      1. 28.1.1 Normal Incidence
      2. 28.1.2 Grazing Incidence
      3. 28.1.3 Total Internal Reflection
    3. 28.2 Color Filtering
    4. 28.3 Implementation
    5. 28.4 Images
      1. 28.4.1 Fresnel Effects
      2. 28.4.2 Color Filtering
      3. 28.4.3 Triangle Meshes
      4. 28.4.4 Nested Spheres
      5. 28.4.5 Area Lights
    6. 28.5 Transparent Boxes
      1. 28.5.1 Theory
      2. 28.5.2 Transmission of Light through a Pane of Glass
    7. 28.6 Transparent Spheres
      1. 28.6.1 Where Are the Reflections?
      2. 28.6.2 Sphere Inside a Transparent Sphere
      3. 28.6.3 Camera Inside a Transparent Sphere
    8. 28.7 A Glass of Water
    9. 28.8 Fishbowls
    10. 28.9 Caustics
    11. Further Reading
    12. Questions
    13. Exercises
    1. Figure 28.1
    2. Figure 28.2
    3. Figure 28.3
    4. Figure 28.4
    5. Figure 28.5
    6. Figure 28.6
    7. Figure 28.7
    8. Figure 28.8
    9. Figure 28.9
    10. Figure 28.10
    11. Figure 28.11
    12. Figure 28.12
    13. Figure 28.13
    14. Figure 28.14
    15. Figure 28.15
    16. Figure 28.16
    17. Figure 28.17
    18. Figure 28.18
    19. Figure 28.19
    20. Figure 28.20
    21. Figure 28.21
    22. Figure 28.22
    23. Figure 28.23
    24. Figure 28.24
    25. Figure 28.25
    26. Figure 28.26
    27. Figure 28.27
    28. Figure 28.28
    29. Figure 28.29
    30. Figure 28.30
    31. Figure 28.31
    32. Figure 28.32
    33. Figure 28.33
    34. Figure 28.34
    35. Figure 28.35
    36. Figure 28.36
    37. Figure 28.37
    38. Figure 28.38
    39. Figure 28.39
    40. Figure 28.40
    41. Figure 28.41
    42. Figure 28.42
    43. Figure 28.43
    44. Figure 28.44
    45. Figure 28.45
    46. Figure 28.46
    47. Figure 28.47
    48. Figure 28.48
    49. Figure 28.49
    50. Figure 28.50
    51. Figure 28.51
    52. Figure 28.52
  34. Chapter 29 Texture Mapping
    1. Objectives
    2. 29.1 Introduction
    3. 29.2 Implementing Textures
    4. 29.3 Mapping Techniques
      1. 29.3.1 General Procedures
      2. 29.3.2 Rectangular Mapping
      3. 29.3.3 Cylindrical Mapping
      4. 29.3.4 Spherical Mapping
      5. 29.3.5 The Mercator Projection
      6. 29.3.6 Light-Probe Mapping
    5. 29.4 Implementing the Mappings
    6. 29.5 Antialiasing
    7. 29.6 Triangle Meshes
    8. Notes and Discussion
    9. Further Reading
    10. Questions
    11. Exercises
    1. Figure 29.1
    2. Figure 29.2
    3. Figure 29.3
    4. Figure 29.4
    5. Figure 29.5
    6. Figure 29.6
    7. Figure 29.7
    8. Figure 29.8
    9. Figure 29.9
    10. Figure 29.10
    11. Figure 29.11
    12. Figure 29.12
    13. Figure 29.13
    14. Figure 29.14
    15. Figure 29.15
    16. Figure 29.16
    17. Figure 29.17
    18. Figure 29.18
    19. Figure 29.19
    20. Figure 29.20
    21. Figure 29.21
    22. Figure 29.22
    23. Figure 29.23
    24. Figure 29.24
    25. Figure 29.25
    26. Figure 29.26
    27. Figure 29.27
  35. Chapter 30 Procedural Textures
    1. Objectives
    2. 30.1 Introduction
      1. Advantages.
      2. Disadvantages.
    3. 30.2 Checker Textures
      1. 30.2.1 3D Checker Textures
      2. 30.2.2 2D Checker Textures
    4. 30.3 Textures and Transformations
      1. 30.3.1 Intrinsic Texture Transformations
      2. 30.3.2 Object Transformations and Textures
      3. 30.3.3 Excluding Object Transformations
    5. Further Reading
    6. Questions
    7. Exercises
    1. Figure 30.1
    2. Figure 30.2
    3. Figure 30.3
    4. Figure 30.4
    5. Figure 30.5
    6. Figure 30.6
    7. Figure 30.7
    8. Figure 30.8
    9. Figure 30.9
    10. Figure 30.10
    11. Figure 30.11
    12. Figure 30.12
    13. Figure 30.13
    14. Figure 30.14
    15. Figure 30.15
    16. Figure 30.16
  36. Chapter 31 Noise-Based Textures
    1. Objectives
    2. 31.1 Noise Functions
      1. 31.1.1 Desirable Properties
      2. 31.1.2 Lattice Noise Functions
    3. 31.2 Interpolation Techniques
      1. 31.2.1 Linear Interpolation
      2. 31.2.2 Cubic Interpolation
      3. 31.2.3 Overshooting
    4. 31.3 Sums of Noise Functions
      1. 31.3.1 Fractal Sum
      2. 31.3.2 Turbulence
      3. 31.3.3 Fractional Brownian Motion
    5. 31.4 Basic Noise Textures
    6. 31.5 Wrapped Noise Textures
    7. 31.6 Marble
    8. 31.7 Sandstone
    9. Further Reading
    10. Questions
    11. Exercises
    1. Figure 31.1
    2. Figure 31.2
    3. Figure 31.3
    4. Figure 31.4
    5. Figure 31.5
    6. Figure 31.6
    7. Figure 31.7
    8. Figure 31.8
    9. Figure 31.9
    10. Figure 31.10
    11. Figure 31.11
    12. Figure 31.12
    13. Figure 31.13
    14. Figure 31.14
    15. Figure 31.15
    16. Figure 31.16
    17. Figure 31.17
    18. Figure 31.18
    19. Figure 31.19
    20. Figure 31.20
    21. Figure 31.21
    22. Figure 31.22
    23. Figure 31.23
    24. Figure 31.24
    25. Figure 31.25
    26. Figure 31.26
    27. Figure 31.27
    28. Figure 31.28
    29. Figure 31.29
    30. Figure 31.30
    31. Figure 31.31
    32. Figure 31.32
    33. Figure 31.33
    34. Figure 31.34
    35. Figure 31.35
    36. Figure 31.36
    37. Figure 31.37
    38. Figure 31.38
    39. Figure 31.39
    40. Figure 31.40
    41. Figure 31.41
    42. Figure 31.42
  37. Bibliography