02941 Physically Based Rendering Path Tracing Jeppe Revall Frisvad June 2020
Heckbert’s Light Transport Notation ◮ Path tracing includes all light paths: L ( S | D ) ∗ E . References: - Heckbert, P. S. Adaptive radiosity textures for bidirectional ray tracing. Computer Graphics (Proceedings of ACM SIGGRAPH 90) 24 (4), pp. 145–154, August 1990.
Progressive unidirectional path tracing 1. Generate rays from the camera through pixel positions. 2. Trace the rays and evaluate the rendering equation for each ray. 3. Randomize the position within the pixel area to Monte Carlo integrate (measure) the radiance arriving in a pixel. p 3 p 0 ◮ Noise is reduced by progressive updates of the measurement. p 2 p 1 ◮ Update the rendering result in a pixel L j after rendering a new frame with result L new using L j +1 = L new + jL j . http://www.pbr-book.org/ j + 1 ◮ Progressive (stop and go) rendering is convenient for several reasons: ◮ No need to start over. ◮ Result can be stored and refined later if need be. ◮ Convergence can be inspected during progressive updates.
Monte Carlo integration ◮ The rendering equation: � ω ′ ) cos θ d ω ′ . L o ( x , � ω ) = L e ( x , � ω ) + f r ( x , � ω ′ , � ω ) L i ( x , � 2 π ◮ The Monte Carlo estimator: N f r ( x , � ω ′ j , � ω ) L i ( x , � ω ′ j ) cos θ ω ) + 1 � L N ( x , � ω ) = L e ( x , � N pdf( � ω ′ j ) j =1 with cos θ = � ω ′ j · � n , where � n is the surface normal at x .
Splitting the evaluation ◮ Distinguishing between: ◮ Direct illumination L direct . ◮ Light reaching a surface directly from the source. ◮ Indirect illumination L indirect . ◮ Light reaching a surface after at least one bounce. ◮ The rendering equation is then L = L e + L direct + L indirect . ◮ L e is emission. ◮ L direct is sampling of lights. ◮ L indirect is sampling of the BRDF excluding lights.
Path tracing diffuse objects ◮ The diffuse BRDF: f r = ρ d /π . ◮ Computing direct illumination: ◮ Sample positions uniformly on light sources. ◮ Estimator for L direct is N n ℓ, j · ( − � � ω ′ j ) L direct , N = ρ d ( x ) 1 � L e ( x ℓ, j , − � ω ′ j ) V ( x , x ℓ, j ) � x ℓ, j − x � 2 A ℓ ( � ω ′ j · � n ) . π N j =1 ◮ Computing indirect illumination: ◮ Set L e = 0 . ◮ Sample directions using cosine-weighted hemisphere: pdf( � ω ′ j ) = cos θ/π . ◮ Estimator for L indirect is N L indirect , N = ρ d ( x ) 1 � ω ′ ω ′ V ( � j ) L i ( x , � j ) . N j =1
Example ◮ 100 samples per pixel. ◮ Time: c. 3 minutes and 39 seconds.
Example ◮ 100 samples per pixel. ◮ Split into 5 samples at first diffuse surface. ◮ Time: c. 8 minutes and 41 seconds.
Example ◮ 100 samples per pixel. ◮ Split into 5 samples at first diffuse surface. ◮ Russian roulette for remaining bounces. ◮ Time: c. 43 minutes.
Splitting vs. Russian roulette for diffuse objects ◮ Splitting is very expensive. Russian roulette is very noisy. ◮ A compromise: Final gathering. ◮ Final gathering: Trace from the eye. Split at the first diffuse surface encountered. Russian roulette afterwards. ◮ Russian roulette: Either diffuse reflection or absorption. ◮ What is the probability? The simplest idea is the average: probability of diffuse reflection = ρ d , R + ρ d , G + ρ d , B . 3 ◮ Could we importance sample this probability? Do some colours have more importance than others? ◮ The eye is more sensitive to some colours compared to others. ◮ This is estimated by luminance (photometric radiance ). ◮ The luminance of an RGB colour is a weighted average of R, G, and B. The weights depend on the RGB colour space used. ◮ Luminance according to the NTSC (1953) colour space: Y = 0 . 2989 R + 0 . 5866 G + 0 . 1145 B .
Path tracing specular objects ◮ See slides on Reflection and Transmission.
Example ◮ 288 samples per pixel. ◮ Split into 5 samples at first diffuse surface. ◮ Split in 2 at first 2 specular surfaces. ◮ Russian roulette for remaining bounces. ◮ Time: c. 2 hours.
Exercises ◮ Implement path tracing for diffuse objects. ◮ Render the Cornell box with blocks. ◮ Render the Cornell box with specular spheres. ◮ Explain light paths leading to secondary caustics. ◮ Extended light transport notation: L − Light E − Eye D − Diffuse surface S − Specular surface ( S r – reflection, S t – transmission) ∗ − 0 or more interactions + − 1 or more interactions ? − 0 or 1 interaction | − either the path on the left or the right side All possible paths: L ( D | S ) ∗ E Caustics: LS + DS ∗ E Primary caustics: L ( S r | S t S t ) DE | LS t D ( S t ?) E
Recommend
More recommend