We'll very quickly establish a common language to use when discussing the physics of light. The emphasis here (as with the entire course) is to build an intuition, rather than unnecessarily complex mathematical constructs.| We'll derive a [rendering equation](http://en.wikipedia.org/wiki/Rendering_equation) that governs the equilibrium of light in a scene. We will generate realistic images of 3D worlds by solving this equation.

Specifically, you'll code offline and interactive numerical solvers. The methods we explore also apply to other problems in engineering, physics and statistics: as such, you'll develop a broadly applicable "_numerical toolbox_". Here are links to two online demos of techniques you'll be learning about and implementing during the course:

_The course syllabus and schedule may be revised during the semester. The latest version is always online here,
at_ http://www.cim.mcgill.ca/~derek/ecse446.html
Requirements
================================================================================
We outline some high-level requirements and expectations, below.
Prerequisites (only enforced for ECSE students)
---------------------------------------------------
* [*ECSE 202*: Introduction to Software Development](https://www.mcgill.ca/study/2018-2019/courses/ecse-202)
* [*ECSE 205*: Probability and Statistics for Engineers](https://www.mcgill.ca/study/2018-2019/courses/ecse-205) and
* [*COMP 250*: Introduction to Computer Science](https://www.mcgill.ca/study/2018-2019/courses/comp-250)
Generally speaking, we expect students to be comfortable with basic probability concepts (discrete and continuous), differential calculus and linear algebra. You'll be coding quite a bit in this course, so comfort with the build-implement-debug workflow, data structures and algorithms, and basic software engineering will come in handy.
Textbook (available online: [HTML](http://www.pbr-book.org) and [PDF](https://www.sciencedirect.com/book/9780128006450/physically-based-rendering).)
---------------------------------------------------
![Optional Textbook](images/ift6095/pbrt3e.jpg width="25%")
*Physically Based Rendering: From Theory to Implementation* (_3rd ed._)

by Pharr, Humphreys and Jakob
- This text is *the* comprehensive reference on realistic image synthesis. The book is packaged with its own open-source renderer (PBRT), and this implementation is exposed in a literate programming style throughout the book.

At over 1500 pages, we only expect students to refer to this book as a supplemental resource for topics covered in class. You can access an e-publication version online for free in a [web-friendly format](http://www.pbr-book.org) and through [the McGill library network](https://www.sciencedirect.com/book/9780128006450/physically-based-rendering).
!!! Tip
You don't need to buy the textbook to be successful in the course, but it can help. Leveraging *lecture* and *tutorial* time (i.e., consistent attendance, taking notes and asking questions) correlates much more with success than reading the text.
Equipment
---------------------------------------------------
You don't need to buy any equipment. IT has configured lab machines in Trottier with an ECSE 446/546 development stack. The [first assignment](#Assignments) provides multi-platform instructions for setting up a local development environment, if you choose to work on a personal machine.
Time
---------------------------------------------------
We *strongly encourage* attending every lecture. Plan to invest *9 hours per week* for the 3-credit course or *12 hours per week* for the 4-credit version (this includes lecture & tutorial time.)
For assignments, it's reasonable to spend roughly *65% of your time coding* -- the remainder will be split between planning, debugging and testing. Start early and schedule appropriately. Attending tutorials with your prepared questions is a good way to skirt avoidable difficulties.
Evaluation
=====================================================================
ECSE 446/COMP 598 students are evaluated based on five (5) coding [assignments](#assignments) and a [final exam](#Final). ECSE 546/COMP 599 students have an additional _scribing_ task, [detailed below](#Scribing).

(

(

Setup & Basic Renders |

[

Light & Shadows |

[

MC Direct Lighting |

[

Advanced Monte Carlo |

[

Path Tracing |

[

- Familiarize yourself with the base code & build process - Implement basic _rendering loops_ (offline & interactive) - Surface normal vector visualization output - Jittered anti-aliasing -

- Diffuse direct lighting -- point lights - Interactive diffuse point light shader -

- Phong BRDF evaluation & sampling - Sampling spherical lights - Surface area and solid angle sampling - Ambient and reflection occlusion -

- ![A4 -- Area Lights](images/butterfly.png width="22%") Multiple importance sampling - Control variates for polygonal lights - Interactive unshadowed shading - Hybrid Rendering -

- ![Example A5 Output](http://www.cim.mcgill.ca/~derek/ecse446/imgs/cbox_path_explicit_rr.png width="25%") Implicit & explicit path tracing - Precomputed interactive lighting -

**Direct Illumination II** | |

**Advanced Materials I** |

([example](ecse446/ipt.pdf) & [mark up](ecse446/ipt_markup.pdf)) | **Global Illumination II** | | **Nowrouzezahrai** Explicit Path Tracing | **Global Illumination II** | |

: Welcome
- Course administration
- Course outline and schedule
: Systems I -- Programmable Rasterization
- Rasterization
- Transformation pipeline
- Z-buffer for primary visibility
- Hierarchical acceleration
- Programmable rasterization pipeline
- Vertex and Pixel/Fragment Shaders
- GPGPU
- Modern programmable rasterization pipeline
- Pros/Cons & Limitations
: Systems II -- Ray-tracing
- Rays and parameteric surfaces
- Basic intersection testing
- Spatial-hierarchy acceleration
- Pros/Cons & Limitations
: Phenomenological Shading I
- Shading -- definition
- Material vs. Lighting
- Basic shading models
- Diffuse/Lambertian reflection
- Point light emitters
- Ray-tracing shadows
: Phenomenological Shading II
- Mirror/perfect reflection & refraction
- Simple glossy reflection
- Directional light emitters
: Appearance Models
- Radiometry 101
- Bi-directional reflectance distribution functions (BRDFs)
- Mathematical definition
- Properties of physically-based local scattering
- Well-founded Diffuse & Glossy reflection
: Monte Carlo Methods
- Definitions
- Canonical random variables
- Expected value
- Variance
- Monte Carlo Integration
: Monte Carlo Methods
- Monte Carlo Estimator Design
- Sampling distributions
- Importance sampling
- __Case study__: Ambient Occlusion & Importance Sampling
: Direct Illumination I
- Definition
- Monte Carlo Estimators
- Hemispherical parameterization
- Surface-area parameterization
- Light Importance Sampling
- Spherical lights
- Mesh lights
: Direct Illumination II
- Revisiting Ambient Occlusion
- BRDF Importance Sampling
- Combining Sampling Strategies
- Multiple Importance Sampling
: Advanced Direct Illumination I -- Advanced Importance Sampling
- Environment light sampling
- Product importance sampling
- Hierarchical sample warping
- Primary Distribution Effects
- Depth of field
- Motion blur
(): Thanksgiving -- No Lecture
: Advanced Direct Illumination II -- Control Variates
- Control variates with unshadowed direct illumination
- Diffuse Reflection from Point Lights
- Diffuse Reflection from Polygonal Area Lights
- Diffuse Reflection from Environmental Lights
- Glossy Reflection
: Global Illumination I -- Path Space
- Light paths
- Heckbert notation
- The Rendering Equation
- Operator notation
- Finite Element Solutions -- Radiosity
: Global Illumination II -- Monte Carlo Estimators
- Naive estimator
- Geometric fan-out
- Deriving the (Implicit) Path Tracing Monte Carlo Estimator
- Explicit Path Tracing
- Russian Roulette Unbiased Path Termination
- Challenges of "complex paths"
: Global Illumination III -- Duality of Light Transport
- The Measurement Equation
- Local **and** Global Reciprocity in Light Transport
- Applying Duality
- Light tracing
- Light tracing with next-event estimation
- The Path Integral Formulation of Light Transport
- Solving Integrals in Path Space
- Monte Carlo Estimators
- Applying Multiple Importance Sampling
- Bidirectional Path Tracing
- Complications -- SDS Paths
: Density Estimation I
- Motivation -- Spatial Regularization
- "Backward" Ray Tracing
- Description & Limitations
- Photon Mapping
- Basic Algorithm
- Importance Sampling
- Relationship to Bidirectional Techniques
- Pros/Cons
: Density Estimation II
- Improving Basic Photon Mapping
- Segmenting Maps and Techniques
- Progressive Photon Mapping
- Convergence Guarantees
- Parallelization
: Many Light Methods I
- Characterizing Estimators
- Virtual Point Lighting Methods
- Advanced VPL Generation
- Bias from Clamping and Energy Loss
- Spatial Regularization for Virtual Sphere Lights
: Many Light Methods II
- Relationship to Photon Mapping
- Final Gathering versus VPLs
- Scalability of Many Light Methods
- _Lightcut_ Strategies
: Participating Media I -- Theory
- Definitions
- Examples of Volumetric Media
- Properties of Volumetric Media
- The Radiative Transport Equation
- Deriving the Volume Rendering Equation
: Participating Media II -- Monte Carlo Methods
- Basic Monte Carlo Estimators for the Volume Rendering Equation
- Volumetric (Forward) Path Tracing
- Implicit Volumetric Path Tracing
- Explicit Volumetric Path Tracing
- Importance Sampling Strategies
- Heterogeneous Volumes
- Woodcock Tracking
: Participating Media III -- Density Estimation
- Volumetric Photon Mapping
- Volumetric Radiance Density Estimators
- Photon Point Primitives
- Fixed-kernel vs. Kernel-adaptive Density Estimates
- The Beam Radiance Estimator
: Participating Media IV -- Advanced Density Estimationopope & Many Lights Methods
- Photon Beam Primitives
- Higher-order Photon Primitives
- Volumetric Virtual Point Lights
- Volumetric Virtual Ray Lights
- Spatial Regularization
- Volumetric Virtual Beam Lights
: Advanced Materials I -- Realistic Surface Reflectance
- Towards More Realistic Local Reflectance
- Conductors versus Dielectrics
- The Three Levels of Material Details
- Scattering from Rough Surfaces
- Normalized Phong Reflectance (review)
- Blinn-Phong
- Isotropic and Anisotropic Ward
- Microfacet Theory from Statistical Physics
- General Microfacet Model
- Instances of the Microfacet Model
- Beckmann Distributions
- Cook-Torrance Model
- Oren-Nayar Microfacet Diffuse Model
- Data-driven BRDFs
: Advanced Materials II -- Subsurface Scattering
- Blurring the Line between Surface and Volume Scattering
- Bi-directional Subsurface Scattering Reflectance Distribution Function
- Definition and Properties
- The High-scattering Regime
- Diffusion Approximations
- The Searchlight Problem
- An End-to-end Multi-scattering Subsurface Scattering Model
- Diffusion Dipoles
: Advanced Materials III -- BSSRDF Variants
- Practical Considerations
- Separating Single- and Multiple-scattering
- Hierarchical Sampling
- From Dipoles to Multipoles
- Quantized Diffusion
- Photon Beam Diffusion

Collaboration & Plagiarism
=====================================================================
*Plagiarism* is an academic offense of misrepresenting authorship. This can result in penalties up to expulsion. It is also possible to plagiarise _your own work_, e.g., by submitting work from another course without proper attribution. **When in doubt, attribute!**
We expect you to submit your own work. Assignments are individual tasks. That said, we want to promote an environment where you are comfortable discussing ideas together. **A good rule to follow**: fully understand every solution you submit and only submit code that was written by you.
McGill values academic integrity and students should take the time to fully understand the meaning and consequences of cheating, plagiarism and other academic offenses (as defined in the Code of Student Conduct and Disciplinary Procedures -- see [these](www.mcgill.ca/integrity) [two](www.mcgill.ca/students/srr/honest) links).
In accordance with article 15 of the Charter of Students' Rights, students may submit any written or programming components in either French or English.
If you have a disability, please advise the [Office for Students with Disabilities](www.mcgill.ca/osd) (514-398-6009) as early in the semester as possible. In the event of circumstances beyond our control, the evaluation scheme as set out above may require modification.
Additional policies governing academic issues which affect students can be found in the Handbook on Student Rights and Responsibilities.