580 likes | 798 Views
Photorealism: Ray Tracing Huamin Wang (whmin@cc.gatech.edu) Georgia Tech Nov 11, 2008. Quiz 1. Quiz 2. Henrik Wann Jensen, 1992. quiz. "Boreal" by Norbert Kern (2004). "Christmas Baubles" by Jaime Vives Piqueres (2005). quiz. "The Wet Bird" by Gilles Tran (2001). CONTENT.
E N D
Photorealism: Ray Tracing Huamin Wang (whmin@cc.gatech.edu) Georgia Tech Nov 11, 2008
Quiz 2 Henrik Wann Jensen, 1992
quiz "Boreal" by Norbert Kern (2004)
quiz "The Wet Bird" by Gilles Tran (2001)
CONTENT • Basics of ray tracing • Monte Carlo integration • Distributed ray tracing • Soft shadow • Glossy surface • Fuzzy glass • Depth of field • Motion blur • Conclusion
Basics of ray tracing Light 0 Camera E Image Plane L(E)? Object 1 Object 0 Light 1
Light Transport N I L(I) E L(E) p Object
Phong modelAn example of Reflectance N I L(I) E R L(E) p
Light Transport N E L(E) p
Light Transport in Basic Ray Tracing L(I1) N L(In) I L(R) E L(E)? R T L(T) known direct illumination Glass (indirect) Mirror (indirect)
Basics of ray tracing g(p,I0)=1 Light 0 I0 Camera R N Image Plane • L(E) • p=Intersection(E); • if p==NULL return backgrd; • R=Reflection(E, N); • T=Refraction(E, N); • return l; E p I1 T Object 1 Object 0 Light 1 g(p,I1)=0
Result of Basic Ray Tracing Huamin Wang et al, 2005
…area of a triangle… P1=(P1.x, P1.y, P1.z) P3=(P3.x, P3.y, P3.z) P2=(P2.x, P2.y, P2.z)
Ray-Implicit Surface Intersection Implicit Surface: f(P)=0 Ray:P=O+tD Solution t: f(O+tD)=0 r Example (Sphere): C
Review: Basics of ray tracing Camera E L Intersection L T R L Intersection Intersection L L T R R L Intersection Intersection Intersection L
Result of Basic Ray Tracing A rendering result: max_depth=16
Limitations of Basic Ray Tracing R N Image Plane E p • Light Source • Indirect Illumination • Lens Camera • Pixel Intergration • …. T Object 1 Object 0 Light 1
CONTENT • Basics of ray tracing • Monte Carlo integration • Distributed ray tracing • Soft shadow • Glossy surface • Fuzzy glass • Depth of field • Motion blur • Conclusion
Monte Carlo Integration • What’s the integral of ? a b
Monte Carlo Integration • What’s the integral of ? Ω
Monte Carlo Integration • What’s the integral of ? Ω
Monte Carlo Integration • Given a 1D uniform random function Rand() from 0 to 1, How to uniformly sample a rectangle? (a,b) dy dx dy dx b p=(x,y) dy dx a (0,0)
Monte Carlo Integration • Given a 1D uniform random function Rand() from 0 to 1, How to uniformly sample a sphere? WRONG!
http://www.cs.utah.edu/~thiago/cs7650/hw5/ Monte Carlo Integration • Given a 1D uniform random function Rand() from 0 to 1, How to uniformly sample a sphere?
Monte Carlo Integration • Given a 1D uniform random function Rand() from 0 to 1, How to uniformly sample a sphere?
http://www.cs.utah.edu/~thiago/cs7650/hw5/ Monte Carlo Integration • Given a 1D uniform random function Rand() from 0 to 1, How to uniformly sample a sphere?
Monte Carlo Integration • Given a 1D uniform random function Rand() from 0 to 1, How to uniformly sample a region? (a,b) Rejection Method While(1) { if ( (x,y) in Ω ) break; } p=(x,y) (0,0)
Monte Carlo VS Riemann • Similar: • The difference between MC and Riemann:
Monte Carlo VS Riemann • The advantage of Monte Carlo
CONTENT • Basics of ray tracing • Monte Carlo integration • Distributed ray tracing • 1. Soft shadow • 2. Glossy surface • 3. Fuzzy glass • 4. Depth of field • 5. Motion blur • Conclusion
1. Hard Shadow by Point Light N E L(E) p Object Illuminated: Shadow: Genetti & Gordon, 1993
1. Soft Shadow by Area Light 1. No Shadow 2. Half Shadow (penumbra) 3. Complete Shadow (umbra) N E L(E) Object Genetti & Gordon, 1993
1. Area Light, distributed ray tracing N N I L(I) E E L(E) L(E) p p Object Object • For i=1:N • Ii=Uniform_Sample(Ω); • End;
1. Mathematical Validation I E: Eye Ω : Light p
http://www.cs.utah.edu/~thiago/cs7650/hw5/ 1. An Area Light Example Cornell Box: 4 samples
http://www.cs.utah.edu/~thiago/cs7650/hw5/ 1. An Area Light Example Cornell Box: 10 samples
http://www.cs.utah.edu/~thiago/cs7650/hw5/ 1. An Area Light Example Cornell Box: 100 samples
Distributed Ray Tracing • It was proposed by Cook, Porter and Carpenter in 1984. • It is NOTray tracing on a distributed system. • It is a ray tracing method based on sampling rays randomly with certain distribution.
2. Glossy Surface Definition L(R) L(E) L(E) R E R E
2. Glossy Surface, Distributed Ray Tracing L(E) R E • For i=1:N • Ri=Uniform_Sample(Ω); • End; Mirror 16 samples 4 samples 64 samples http://www.cse.ohio-state.edu/~xue/courses/782/final/dtr.html
2. Fuzzy Glass, Distributed Ray Tracing L(E) E T • For i=1:N • Ti=Uniform_Sample(Ω); • End; Mirror 4 samples 16 samples http://www.cse.ohio-state.edu/~xue/courses/782/final/dtr.html
3. An Fuzzy Glass Example Different glasses rendered by distributing refracted rays, from left to right: ideal glass, fuzzy glass, more fuzzy glass.
4. The Pinhole Camera Model Camera Image Plane E The projection model in basic ray tracing Object Pinhole Pixel Pixel Object Image Plane The pinhole camera model
4. Depth of Field: in-focus In-focus: lens Pixel Pixel Image Plane Focal plane
4. Depth of Field: out-of-focus Out-of-focus: Circle of Confusion lens Pixel object Image focal
4. Depth of Field: out-of-focus Out-of-focus: Circle of Confusion lens Pixel object Image focal