1
2
history
modern applications
19
ray casting
vs
ray tracing
hoxxep.github.io/webgl-ray-tracing-demo/
shadows
For each screen pixel
Find the ray from the eye through the pixel
For each object in the scene
If the ray intersects the object, and is closest yet
Record intersection and object
Find color for closest intersection
For each screen pixel
Find the ray from the eye through the pixel
For each object in the scene
If the ray intersects the object, and is closest yet
Record intersection and object
Shade(closest intersection)
Shade(surface)
color = ka*La + kd*Ld(N*L) + ks*Ls(N*H)^n
return(color)
For each screen pixel
Find the ray from the eye through the pixel
For each object in the scene
If the ray intersects the object, and is closest yet
Record intersection and object
Shade(closest intersection)
Shade(surface)
S = {0: shadow ray occluded, 1: not occluded}
color = ka*La + S*(kd*Ld(N*L) + ks*Ls(N*H)^a)
return(color)
go deeper with readings...
sites.google.com/view/cgwiki-ncsu/topics/ray-tracing
post reactions and... we might discuss them next time
log them and... get reading credit
Requests, questions, thoughts?
go-vxlab.csc.ncsu.edu / raytracingdiscussion
post them and... we’ll discuss them next time
log them and... get participation credit
37
39
40
41
ray casting
vs
ray tracing
hoxxep.github.io/webgl-ray-tracing-demo/
reflections
R̂ = norm(2N̂(N̂●L̂) – L̂)
where X̂ = norm(X) = X/‖X‖
where ‖X‖ = √(Xx2 + Xy2 + Xz2)
For each screen pixel
Find the ray from the eye through the pixel
For each object in the scene
If the ray intersects the object, and is closest yet
Record intersection and object
Shade(closest intersection,0)
Shade(surface,whichBounce)
S = {0: shadow ray occluded, 1: not occluded}
color = ka*La + S*(kd*Ld(N*L) + ks*Ls(N*H)^a)
if (whichBounce < NUMBOUNCES)
find surfaceR in direction R
color += ks*Shade(surfaceR,whichBounce+1)
return(color)
refractions
For each screen pixel
Find the ray from the eye through the pixel
For each object in the scene
If the ray intersects the object, and is closest yet
Record intersection and object
Shade(closest intersection,0)
Shade(surface,whichBounce)
S = {0: shadow ray occluded, 1: not occluded}
color = ka*La + S*(kd*Ld(N*L) + ks*Ls(N*H)^a)
if (whichBounce < NUMBOUNCES)
find surfaceR in direction R
color += ks*Shade(surfaceR,whichBounce+1)
find surfaceT in direction T
color += kr*Shade(surfaceT,whichBounce+1)
return(color)
hoxxep.github.io/webgl-ray-tracing-demo/
65
what’s missing
light path notation
E = eye location
L = light location
S = specular reflection
D = diffuse reflection
ray tracing
L[S]*(S|D)E
complete
L[S|D]*E
optimizations
go deeper with readings...
sites.google.com/view/cgwiki-ncsu/topics/ray-tracing
post reactions and... we might discuss them next time
log them and... get reading credit
Requests, questions, thoughts?
go-vxlab.csc.ncsu.edu / raytracingdiscussion
post them and... we’ll discuss them next time
log them and... get participation credit
82