cse 681 distributed ray tracing some implementation notes

12
CSE 681 DISTRIBUTED RAY TRACING some implementation notes

Upload: shavonne-carpenter

Post on 13-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CSE 681 DISTRIBUTED RAY TRACING some implementation notes

CSE 681

DISTRIBUTED RAY TRACING

some implementation notes

Page 2: CSE 681 DISTRIBUTED RAY TRACING some implementation notes

CSE 681

Theory v. practice

• Brute force – multiple rays at every sampling opportunity

• Implementation – for each pixel subsample, randomize at each opportunity

Page 3: CSE 681 DISTRIBUTED RAY TRACING some implementation notes

CSE 681

DRT components

• anti-aliasing and motion blur– supersampling - in time and space: anti-aliasing

– jitter sample in time and space: motion blur

• depth of field - sample lens: blurs• shadows – sample light source: soft shadows• reflection – sample reflection direction: rough surface• transparency – sample transmission direction:

translucent surface

Page 4: CSE 681 DISTRIBUTED RAY TRACING some implementation notes

CSE 681

Replace Camera Model

• shift from pinhole camera model to lens camera model

• picture plane at -w, not +w• camera position becomes lens center• picture plane is behind 'pinhole'• negate u, v, w, trace ray from pixel to camera

Page 5: CSE 681 DISTRIBUTED RAY TRACING some implementation notes

CSE 681

ANTI-ALIASING: Organizing subpixel samples

Options

1. Do each subsample in raster order

2. do each pixel in raster order, do each subsample in raster order

3. do each pixel in raster order, do all subsamples in temporal order

4. keep framebuffer, do all subsamples in temporal order

Page 6: CSE 681 DISTRIBUTED RAY TRACING some implementation notes

CSE 681

SPATIAL JITTERING

• for each pixel 200x200, i,j• for each subpixel sample 4x4 s,t• Jitter sample

Page 7: CSE 681 DISTRIBUTED RAY TRACING some implementation notes

CSE 681

MOTION BLURTEMPORAL JITTERING

• for subsample• get delta time from table• jitter delta +/- 1/2 time division• move objects to that instant in time

Page 8: CSE 681 DISTRIBUTED RAY TRACING some implementation notes

CSE 681

DEPTH OF FIELD

• generate ray from subsample through lens center to focal plane

• generate random sample on lens disk - random in 2D u,v

• generate ray from this point to focal plane point

Page 9: CSE 681 DISTRIBUTED RAY TRACING some implementation notes

CSE 681

VISIBILITY - as usual

• intersect ray with environment• find first intersection at point p on object o

with normal n

Page 10: CSE 681 DISTRIBUTED RAY TRACING some implementation notes

CSE 681

Shadows

• generate random vector on surface of light - random on sphere

Page 11: CSE 681 DISTRIBUTED RAY TRACING some implementation notes

CSE 681

Reflections

• computer reflection vector• generate random sample in sphere at end of R

– Importance sampling

• Randomize n instead of R

Page 12: CSE 681 DISTRIBUTED RAY TRACING some implementation notes

CSE 681

Transparency

• compute transmission vector• generate random sample in sphere at end of T

– Importance sampling

• Randomize n instead of T