ray-tracing - department of computer sciencejoanne/cs105/spring18/raytracing.pdfray-tracing in...
TRANSCRIPT
![Page 1: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/1.jpg)
Ray-Tracing
Misha Kazhdan
![Page 2: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/2.jpg)
Ray-Tracing
In graphics, we often represent the surface of a 3D
shape by a set of triangles.
![Page 3: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/3.jpg)
Ray-Tracing
Goal:
Take a collection of triangles representing a 3D
scene and render a detailed image.
![Page 4: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/4.jpg)
Physical Pinhole Camera
The film sits behind the pinhole of the camera.
Rays come in from the outside, pass through the
pinhole, and hit the film plane.
Film Plane Pinhole
Photograph is upside down
![Page 5: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/5.jpg)
Virtual Camera
The film sits in front of the pinhole of the camera.
Rays come in from the outside, pass through the
film plane, and hit the pinhole.
PinholeVirtual Film
PlaneFilm Plane
Photograph is right side up
![Page 6: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/6.jpg)
Ray-Casting
We invert the process of image generation by
sending rays out from the pinhole.
PinholeVirtual Film
Plane
![Page 7: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/7.jpg)
Ray-Casting
We invert the process of image generation by
sending rays out from the pinhole.
For each pixel in the virtual file plane, we:
โCompute the ray: pinhole โ pixel
โFigure out what object in the scene is hit first
โSet the pixel to the color of the object
Film PlanePinhole
![Page 8: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/8.jpg)
Ray-Casting
Image RayCast( Camera camera , Scene scene , int width , int height ){
Image image = new Image( width , height );for( int i=0 ; i<width ; i++ ) for ( int j=0 ; j<height ; j++ ){
Ray ray = ConstructRayThroughPixel( camera , i , j );Intersection hit = FindIntersection( ray , scene );image[i][j] = GetColor( hit );
}return image;
}
![Page 9: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/9.jpg)
Ray-Casting
If we ignore the color computation, we get the
silhouettes of the scene:
![Page 10: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/10.jpg)
Outline
Ray-Tracing
โ Overview
โ Direct Illumination
โ Global Illumination
![Page 11: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/11.jpg)
Modeling Surface Reflectance
Surface color is determined by the lights and the
way different surfaces reflect the light.
Ideally, we would model the surface
reflectance properties at ๐:
๐ ๐(๐, ๐, ๐, ๐พ, ๐)
SurfaceSurface
(๐, ๐)
๐
(๐พ, ๐)
๐ ๐ is the fraction of incident light:
โข arriving from direction (๐พ, ๐)โข with wavelength ๐โข leaving in direction (๐, ๐)
โข Too much storageโข Difficult in practice
![Page 12: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/12.jpg)
Simple Reflectance Model
Simple model:
โ diffuse reflection +
โ specular reflection +
โ emission +
โ โambientโ
Surface
Based on model
proposed by Phong
![Page 13: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/13.jpg)
Simple Reflectance Model
Simple model:
โ diffuse reflection +
โ specular reflection +
โ emission +
โ โambientโ
Surface
Based on Phong
illumination model
Based on model
proposed by Phong
![Page 14: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/14.jpg)
Diffuse Reflection
Assume surface reflects equally in all directions
โ Examples: chalk, clay
Surface
![Page 15: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/15.jpg)
Diffuse Reflection
How much light is reflected?
โ Depends on angle of incident light
Surface
q
![Page 16: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/16.jpg)
Diffuse Reflection
How much light is reflected?
โ Depends on angle of incident light
Surface
1
ฮค1 cos๐
q
Think of a
flashlight!
Physically motivated:(Surface color) = (Light color) * cos ๐ * (Diffuse)
![Page 17: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/17.jpg)
Diffuse Reflection
Assume surface reflects equally in all directions
โ Examples: chalk, clay
![Page 18: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/18.jpg)
Simple Reflectance Model
Simple analytic model:
โ diffuse reflection +
โ specular reflection +
โ emission +
โ โambientโ
Surface
![Page 19: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/19.jpg)
Specular Reflection
Reflection is strongest near mirror angle
โ Examples: metals, shiny apples
Specular
![Page 20: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/20.jpg)
Specular Reflection
How much light is seen?
Depends on:
โ angle of incident light
โ angle to viewer
Viewer
a
Works well in practice:(Surface color) = (Light color) * cos๐ ๐ผ * (Specular)
![Page 21: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/21.jpg)
Specular Reflection
Reflection is strongest near mirror angle
โ Examples: metals, shiny apples
![Page 22: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/22.jpg)
Simple Reflectance Model
Simple analytic model:
โ diffuse reflection +
โ specular reflection +
โ emission +
โ โambientโ
Surface
![Page 23: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/23.jpg)
Emission
Emission 0
Represents light emanating directly from polygon
![Page 24: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/24.jpg)
Simple Reflectance Model
Simple analytic model:
โ diffuse reflection +
โ specular reflection +
โ emission +
โ โambientโ
Surface
![Page 25: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/25.jpg)
Ambient Term
Represents accumulation of indirect illumination
Locations that are not
directly illuminated are
still not black because
of indirect illumination.
![Page 26: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/26.jpg)
Simple Reflectance Model
Simple analytic model:
โ diffuse reflection +
โ specular reflection +
โ emission +
โ โambientโ
Surface
![Page 27: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/27.jpg)
Simple Reflectance Model
Simple analytic model:
โ diffuse reflection +
โ specular reflection +
โ emission +
โ โambientโ
Surface
![Page 28: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/28.jpg)
Surface Illumination Calculation
Single light source:
Viewer
a
๐ผ = ๐พ๐ธ + ๐พ๐ด + cos ๐ โ ๐พ๐ท + cos๐ ๐ผ โ ๐พ๐ โ ๐ผ๐ฟ
![Page 29: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/29.jpg)
Surface Illumination Calculation
Multiple light sources:
Viewer
๐ผ = ๐พ๐ธ + ๐พ๐ด +
๐ฟโ๐ฟ๐๐โ๐ก๐
cos ๐๐ฟ โ ๐พ๐ท + cos๐ ๐ผ๐ฟ โ ๐พ๐ โ ๐ผ๐ฟ
![Page 30: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/30.jpg)
Outline
Ray-Tracing
โ Overview
โ Direct Illumination
โ Global Illumination
![Page 31: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/31.jpg)
Shadows
Shadow term tells if light sources are blocked
โ Cast ray towards each light.
If the ray is blocked, ignore the lightโs contribution.
![Page 32: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/32.jpg)
Shadows
Shadow term tells if light sources are blocked
โ Cast ray towards each light.
๐๐ = 0 if ray is blocked, ๐๐ = 1 otherwise
๐ฟ1
๐ฟ0
Shadow
Term
๐ผ = ๐พ๐ธ + ๐พ๐ด +
๐ฟโ๐ฟ๐๐โ๐ก๐
cos๐๐ฟ โ ๐พ๐ท + cos๐ ๐ผ๐ฟ โ ๐พ๐ โ ๐ผ๐ฟ โ ๐๐ฟ
![Page 33: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/33.jpg)
Shadows
Shadow term tells if light sources are blocked
โ Cast ray towards each light.
๐๐ = 0 if ray is blocked, ๐๐ = 1 otherwise
๐0 = 1:
โข ๐ฟ0 contributes
Shadow
Term
๐ฟ1
๐ฟ0
๐ผ = ๐พ๐ธ + ๐พ๐ด +
๐ฟโ๐ฟ๐๐โ๐ก๐
cos๐๐ฟ โ ๐พ๐ท + cos๐ ๐ผ๐ฟ โ ๐พ๐ โ ๐ผ๐ฟ โ ๐๐ฟ
![Page 34: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/34.jpg)
Shadows
Shadow term tells if light sources are blocked
โ Cast ray towards each light.
๐๐ = 0 if ray is blocked, ๐๐ = 1 otherwise
๐0 = 1:
โข ๐ฟ0 contributes
๐1 = 0:
โข ๐ฟ1 does not contribute
Shadow
Term
๐ฟ1
๐ฟ0
๐ผ = ๐พ๐ธ + ๐พ๐ด +
๐ฟโ๐ฟ๐๐โ๐ก๐
cos๐๐ฟ โ ๐พ๐ท + cos๐ ๐ผ๐ฟ โ ๐พ๐ โ ๐ผ๐ฟ โ ๐๐ฟ
![Page 35: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/35.jpg)
Ray Casting
Trace primary rays from camera
โ Direct illumination from unblocked lights only
![Page 36: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/36.jpg)
Recursive Ray Tracing
Also trace secondary rays from hit surfaces
โ Consider contributions from:
1. Reflected Rays
2. Refracted Rays
![Page 37: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/37.jpg)
Mirror Reflections
Also trace secondary rays from hit surfaces
โ Consider contributions from:
1. Reflected Rays
2. Refracted Rays
Contribution from mirror
reflection ray
๐ฟ1
๐ฟ0
๐ผ = ๐พ๐ธ + ๐พ๐ด +
๐ฟโ๐ฟ๐๐โ๐ก๐
cos ๐๐ฟ โ ๐พ๐ท + cos๐ ๐ผ๐ฟ โ ๐พ๐ โ ๐ผ๐ฟ โ ๐๐ฟ + ๐พ๐ โ ๐
![Page 38: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/38.jpg)
Mirror Reflections
Also trace secondary rays from hit surfaces
โ Consider contributions from:
1. Reflected Rays
2. Refracted Rays
๐ฟ1
๐ฟ0
Contribution from mirror
reflection ray
๐ผ = ๐พ๐ธ + ๐พ๐ด +
๐ฟโ๐ฟ๐๐โ๐ก๐
cos ๐๐ฟ โ ๐พ๐ท + cos๐ ๐ผ๐ฟ โ ๐พ๐ โ ๐ผ๐ฟ โ ๐๐ฟ + ๐พ๐ โ ๐
![Page 39: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/39.jpg)
Mirror Reflections
Also trace secondary rays from hit surfaces
โ Consider contributions from:
1. Reflected Rays
2. Refracted Rays
๐ฟ1
๐ฟ0
Contribution from mirror
reflection ray
๐ผ = ๐พ๐ธ + ๐พ๐ด +
๐ฟโ๐ฟ๐๐โ๐ก๐
cos ๐๐ฟ โ ๐พ๐ท + cos๐ ๐ผ๐ฟ โ ๐พ๐ โ ๐ผ๐ฟ โ ๐๐ฟ + ๐พ๐ โ ๐
![Page 40: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/40.jpg)
Mirror Reflections
Also trace secondary rays from hit surfaces
โ Consider contributions from:
1. Reflected Rays
2. Refracted Rays
![Page 41: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/41.jpg)
Transparency
Also trace secondary rays from hit surfaces
โ Consider contributions from:
1. Reflected Rays
2. Refracted Rays
๐ฟ1
๐ฟ0
๐ผ = ๐พ๐ธ +๐พ๐ด +
๐ฟโ๐ฟ๐๐โ๐ก๐
cos ๐๐ฟ โ ๐พ๐ท + cos๐ ๐ผ๐ฟ โ ๐พ๐ โ ๐ผ๐ฟ โ ๐๐ฟ + ๐พ๐ โ ๐ + ๐พ๐ โ ๐
Contribution from refraction ray
![Page 42: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/42.jpg)
Transparency
Also trace secondary rays from hit surfaces
โ Consider contributions from:
1. Reflected Rays
2. Refracted Rays
![Page 43: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/43.jpg)
Refraction (Snellโs Law)
Light bends as it passes through a transparent
object (qi โ qr).
T
qi
qr
![Page 44: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/44.jpg)
Refraction (Snellโs Law)
Light bends as it passes through a transparent
object (qi โ qr).
๐ฟ1
๐ฟ0
๐ผ = ๐พ๐ธ +๐พ๐ด +
๐ฟโ๐ฟ๐๐โ๐ก๐
cos ๐๐ฟ โ ๐พ๐ท + cos๐ ๐ผ๐ฟ โ ๐พ๐ โ ๐ผ๐ฟ โ ๐๐ฟ + ๐พ๐ โ ๐ + ๐พ๐ โ ๐
Contribution from refraction ray
![Page 45: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/45.jpg)
Refraction (Snellโs Law)
Light bends as it passes through a transparent
object (qi โ qr).
![Page 47: Ray-Tracing - Department of Computer Sciencejoanne/cs105/spring18/RayTracing.pdfRay-Tracing In graphics, we often represent the surface of a 3D shape by a set of triangles. Ray-Tracing](https://reader033.vdocuments.mx/reader033/viewer/2022060600/6053a5267b95c304a533150c/html5/thumbnails/47.jpg)
Discussion
โขHow do we make ray-tracing fast?
โขWhat does this model fail to capture?