CSL%20859:%20Advanced%20Computer%20Graphics - PowerPoint PPT Presentation

About This Presentation
Title:

CSL%20859:%20Advanced%20Computer%20Graphics

Description:

if (depth MAX) return Background; if(! intersect ... Depth of Field. Use multiple origins. Distributed on a disk. Motion Blur. Jitter rays in time ... – PowerPoint PPT presentation

Number of Views:34
Avg rating:3.0/5.0
Slides: 27
Provided by: sub8
Category:

less

Transcript and Presenter's Notes

Title: CSL%20859:%20Advanced%20Computer%20Graphics


1
CSL 859 Advanced Computer Graphics
  • Dept of Computer Sc. Engg.
  • IIT Delhi

2
Ray Tracing
Courtesy POV-Ray gallery
3
Ray Tracing Forward Rendering
Color
Light Direction
normal
Point Directional Or Both
View Direction
4
Basic Ray-casting
  • For each pixel
  • Form the Ray
  • For each Object
  • Find point of intersection
  • If closest, save object
  • Shade Ray
  • If no intersection, return background color
  • Otherwise, shade(saved object)
  • For each light
  • Form light ray
  • Shade surface and accumulate color

5
Ray-traced picture
6
Shadow Rays
  • Shade Ray
  • If no intersection, return Background
  • Otherwise, For each light
  • Compute Shadow Ray
  • If(shadow Ray doesnt intersect light first)
  • ignore and continue
  • Otherwise
  • shade surface and accumulate color

7
Shadow Rays
8
Recursive Ray Tracing
9
Recursive Ray Tracing
L
n
v
10
Recursive Ray Tracing
  • Color RayTrace(Ray ray, int depth)
  • Point IntersectionPoint
  • if (depth gt MAX) return Background
  • if(! intersect(IntersectionPoint, ray))
  • return Background
  • Ilocal kaIa Ip.v.(kd(n.l) ks.(h.n)m)
  • return Ilocal krRayTrace(ReflectRay,
    depth1)
  • ktRayTrace(RefractRay
    , depth1)

11
Computing the reflection direction
  • Ideal reflection
  • ? ?
  • -v r -2(v.n) n
  • r v - 2(v.n)n

n
?
?
r
v
12
Refraction
n
n
v
?
index of refraction
?1
m
?2
t
ß
13
Refracted Ray Computation
  • Notes
  • Negative root gt Total internal reflection
  • Transparent gt Invert light behind object

14
Specular Transmission
  • A transparent surface can be illuminated from
    behind and this should be calculated in Ilocal

l
n
v
?
?1
?2
l
ß
15
Make Ray
tan(fovy/2)
  • Origin
  • Direction
  • o t d

tan(fovx/2)
ref
y
x
16
Algebraic Intersection
  • Point satisfies
  • o t d
  • f (x, y, z) 0
  • f (ox t dx , oy t dy, oz t dz) 0
  • Example
  • (0, 0, 5) t (0, 0, 1)
  • X2y2z2 1
  • 0 0 (5t)2 1, i.e., t -1 5, -4/-6
  • (0, 0, 5) 4(0, 0, 1) (0, 0, 1)

17
Geometric Intersection
d2 r2 (c-e).(c-e) - (c-e).d
c
(c-e).d
(c-e).(c-e)
d
e
18
Triangle Intersection?
  • Intersect with plane
  • Ax By Cz 1
  • Check if point inside triangle
  • Barycentric coordinates must be ve
  • Point must be in the positive half-planes

19
Half-plane Method
Ax By Cz 1
p
n op X oq n.(p-o) gt 0
v1
v2
Orient edges in CW order
o
20
Distributed Ray Tracing
Multiple randomly jittered rays
21
Depth of Field
  • Use multiple origins
  • Distributed on a disk

22
Motion Blur
  • Jitter rays in time

23
Soft Shadows
  • Light has area
  • Shoot multiple rays to light
  • Take average contribution

Courtesy H.P. Seidel
24
Monte-Carlo Integration
  • At intersection
  • Generate multiple rays
  • Typically based on material properties
  • Weighted average of resulting ray colors
  • Path tracing
  • Global illumination
  • More later

25
Tracing Efficiency
  • Embarassingly parallel
  • Bounding volume hierarchy


26
Bounding Box Test
ty1
tx1
ty0
tx0
ox t dx a t (a ox )/dx
o t d
x a
Write a Comment
User Comments (0)
About PowerShow.com