Distributed Ray Tracing Sung-Eui Yoon ( ) Course URL: - - PowerPoint PPT Presentation

distributed ray tracing
SMART_READER_LITE
LIVE PREVIEW

Distributed Ray Tracing Sung-Eui Yoon ( ) Course URL: - - PowerPoint PPT Presentation

CS380: Computer Graphics Distributed Ray Tracing Sung-Eui Yoon ( ) Course URL: http://sgvr.kaist.ac.kr/~sungeui/CG/ Class Objectives Support various effects based on distributed ray tracing Acceleration methods Random


slide-1
SLIDE 1

CS380: Computer Graphics

Distributed Ray Tracing

Sung-Eui Yoon (윤성의)

Course URL: http://sgvr.kaist.ac.kr/~sungeui/CG/

slide-2
SLIDE 2

2

Class Objectives

  • Support various effects based on

distributed ray tracing

  • Acceleration methods
  • Random sampling, jittering, in each pixel
  • At the last time:
  • Ray generations of ray tracing
  • Intersection tests w/ implicit equations
slide-3
SLIDE 3

3

Questions

  • it seems ray tracing simulates reflection

and refraction of light. However, there are also other properties of light, like diffraction or interference. Is there any technique simulating those properties?

slide-4
SLIDE 4

4

Generalizing to Triangles

  • Find of the point of intersection on the plane

containing the triangle

  • Determine if the point is inside the triangle
  • Barycentric coordinate method
  • Many other methods

v1 v2 v3 p

slide-5
SLIDE 5

5

Barycentric Coordinates

  • Points in a triangle have positive

barycentric coordinates:

v1 v2 v3 p

) ( ) (

2 1

v v v v v p             

2 1

) 1 ( v v v p             

2 1

v v v p           1      

,where v0 v1 v2

p 

slide-6
SLIDE 6

6

Barycentric Coordinates

  • Points in a triangle have positive

barycentric coordinates:

  • Benefits:
  • Barycentric coordinates can be used for interpolating

vertex parameters (e.g., normals, colors, texture coordinates, etc)

v1 v2 v3 p

2 1

v v v p           1      

,where

slide-7
SLIDE 7

7

Ray-Triangle Intersection

  • A point in a ray intersects with a triangle
  • Three unknowns, but three equations
  • Compute the point based on t
  • Then, check whether the point is on the

triangle

v1 v2 v3 p

) ( ) ( ) (

2 1

v v v v v t p             

slide-8
SLIDE 8

8

Pros and Cons of Ray Tracing

Advantages of Ray Tracing:

  • Very simple design
  • Improved realism over

the graphics pipeline Disadvantages:

  • Very slow per pixel calculations
  • Only approximates full global illumination
  • Hard to accelerate with special-purpose H/W
slide-9
SLIDE 9

9

Acceleration Methods

  • Rendering time for a ray tracer depends on the

number of ray intersection tests per pixel

  • The number of pixels X the number of primitives in the scene
  • Early efforts focused on accelerating the ray-
  • bject intersection tests
  • More advanced methods required to make ray

tracing practical

  • Bounding volume hierarchies
  • Spatial subdivision
slide-10
SLIDE 10

10

Bounding Volumes

  • Enclose complex objects within a simple-to-

intersect objects

  • If the ray does not intersect the simple object then its contents

can be ignored

  • The likelihood that it will strike the object depends on how

tightly the volume surrounds the object.

Potentially tighter fit, but with higher computation

slide-11
SLIDE 11

11

Hierarchical Bounding Volumes

  • Organize bounding volumes as a tree
  • Each ray starts with the root BV of the tree

and traverses down through the tree

r         

slide-12
SLIDE 12

12

Spatial Subdivision

Idea: Divide space in to subregions

  • Place objects within a subregion into a list
  • Only traverse the lists of subregions that the ray

passes through

  • “Mailboxing” used to avoid multiple test with
  • bjects in multiple regions
  • Many types
  • Regular grid
  • Octree
  • BSP tree
  • kd-tree
slide-13
SLIDE 13

13

Kd-tree: Example

slide-14
SLIDE 14

14

Kd-tree: Example

slide-15
SLIDE 15

15

Kd-tree: Example

slide-16
SLIDE 16

16

Example

slide-17
SLIDE 17

17

Kd-tree: Example

What about triangles overlapping the split?

slide-18
SLIDE 18

18

Kd-tree: Example

slide-19
SLIDE 19

19

Other Optimizations

  • Shadow cache
  • Adaptive depth control
  • Lazy geometry loading/creation
slide-20
SLIDE 20

20

Distributed Ray Tracing [Cook et

  • al. 84]
  • Cook et al. realized that ray-tracing, when

combined with randomized sampling, i.e., “jittering”, could be adapted to address a wide range of rendering problems:

slide-21
SLIDE 21

21

Soft Shadows

  • Take many samples from area light source

and take their average

  • Computes fractional visibility leading to

penumbra

slide-22
SLIDE 22

22

Antialiasing

  • The need to sample is problematic because

sampling leads to aliasing

  • Solution 1: super-sampling
  • Increases sampling rate, but does not completely eliminate

aliasing

  • Difficult to completely eliminate aliasing without prefiltering

because the world is not band-limited

slide-23
SLIDE 23

23

Antialiasing

  • Solution 2: distribute the samples randomly
  • Converts the aliasing energy to noise which is less
  • bjectionable to the eye

Instead of casting one ray per pixel, cast several sub- sampling. Instead of uniform sub- sampling, jitter the pixels slightly off the grid.

slide-24
SLIDE 24

24

Jittering Results for Antialiasing

2x2 sub-sampling

slide-25
SLIDE 25

25

Depth-of-Field

  • Rays don’t have to all originate from a single point.
  • Real cameras collects rays over an aperture
  • Can be modeled as a disk
  • Final image is blurred away from the focal plane
  • Gives rise to depth-of-field effects
slide-26
SLIDE 26

26

Depth of Field

lens image plane focal plane

slide-27
SLIDE 27

27

Depth of Field

  • Start with normal eye ray and find

intersection with focal plane

  • Choose jittered point on lens and trace line

from lens point to focal point

lens focal plane

slide-28
SLIDE 28

28

Motion Blur

  • Jitter samples through time
  • Simulate the finite interval that a shutter is
  • pen on a real camera
slide-29
SLIDE 29

29

Motion Blur

slide-30
SLIDE 30

30

Complex Interreflection

  • Model true reflection behavior as described by a full

BRDF

  • Randomly sample rays over the hemisphere, weight

them by their BRDF value, and average them together

  • This technique is called “Monte Carlo Ray Tracing”
slide-31
SLIDE 31

31

Summary up to mid-term exam

slide-32
SLIDE 32

32

Summary after that

slide-33
SLIDE 33

33

Related Courses

  • CS580: Advanced Computer Graphics
  • Focus on rendering techniques that generate

photo-realistic images

  • CS482: Interactive Computer Graphics
  • Interactive global illumination implemented by

rasterization approaches

  • Techniques used in recent games
  • I’ll teach it at Fall of 2021