Docsity

Distributed Ray Tracing and Advanced Sampling Techniques in Computer Graphics, Exams of Computer Graphics

Partial preview of the text

Download Distributed Ray Tracing and Advanced Sampling Techniques in Computer Graphics and more Exams Computer Graphics in PDF only on Docsity!

1

Advanced Ray Tracing

Advanced Ray Tracing

Mani Thomas

Mani Thomas

CISC 440/

CISC 440/

Computer Graphics

Computer Graphics

2

Review Review

z z

Ray tracing

Ray tracing

z z

Compute 3D ray into the scene for each 2D image Compute 3D ray into the scene for each 2D image

pixel pixel

z z

Compute 3D intersection point of ray with nearest Compute 3D intersection point of ray with nearest

object in scene object in scene

z z

Test each primitive in the scene for intersection Test each primitive in the scene for intersection

z z

Find nearest intersection Find nearest intersection

z z

Recursively spawn rays from the point of intersection Recursively spawn rays from the point of intersection

z z

Shadow Rays Shadow Rays

z z

Reflected rays Reflected rays

z z

Transmitted rays Transmitted rays

z z

Accumulate the color from each of the spawned rays Accumulate the color from each of the spawned rays

at the point of intersection at the point of intersection

4

Review Review

z z

“

“Shadow feelers”

Shadow feelers” z z

Spawn a ray from P to the light sources

Spawn a ray from P to the light sources

z z

If there is an intersection of the shadow ray

If there is an intersection of the shadow ray

with any object then

with any object then P is in shadow

P is in shadow

z z

Reflection

Reflection

z z

Angle of incidence = angle of Reflection

Angle of incidence = angle of Reflection

(

)

(

)

(

)

(

)

(

)

n n a n n a

n

n

n

a

n

n

n

a

n

n

n n

a

m

ˆ

ˆ

ˆ

180

cos

ˆ

1

ˆ

ˆ

1

2

⋅

=

−

−

=

=

⋅

−

=

⋅

−

=

−

⎞⎟⎟⎠

⎛⎜⎜⎝

⋅

=

θ

n

n

a

a

m a m m a m e r

ˆ

ˆ

2

2

⋅

−

=

− = − + − = − + =

5

Review Review

z z

Refraction

Refraction

z z

Ray passing through media of different

Ray passing through media of different

refractive indices bend towards/away from the

refractive indices bend towards/away from the

normal

normal

z z

Snell’s Law

Snell’s Law

z z

n n

ii

and n and n

r r

are the refractive indices of the two media are the refractive indices of the two media

z z

Transmitted ray

Transmitted ray

r

r

i

i

n

n

θ

θ

sin

sin

=

n

u

T

⎞⎟⎟⎠

⎛⎜⎜⎝

−

−

=

i

r

i

r

r

i

n

n

n

n

θ

θ

cos

cos

7

Anti aliasing Anti aliasing

z

Ray tracing gives a color for every possible point in theimage

z

But a square pixel contains an

infinite

number of points

z

These points may not all have the same color

z

Sampling: choose the color of one point (center of pixel)

z

This leads to

aliasing

z

jaggies

z

moire patterns

z

Aliasing means one frequency (high) masquerading asanother (low)

z

e.g. wagon wheel effect

8

Super Super

sampling sampling

z z

Ray tracing is a point

Ray tracing is a point-

sampling process

sampling process

z z

Take discrete looks at the scene along individual rays Take discrete looks at the scene along individual rays

passing through each pixel passing through each pixel

z z

Reduce aliasing due to this discrete signal

Reduce aliasing due to this discrete signal

sampling

sampling

Courtesy F.S. Hill, “Computer Graphics using OpenGL”

Stochastic Super sampling Stochastic Super sampling

z z

Visible aliasing is Visible aliasing is

possible even with possible even with

adaptive super adaptive super-

sampling sampling

z z

sampling grid interacts with sampling grid interacts with

regular structures regular structures

z z

objects aligned with objects aligned with

sampling grid sampling grid

z z

Stochastic sampling Stochastic sampling

z z

instead of a regular grid, instead of a regular grid,

subsample randomly subsample randomly

z z

keep taking samples until keep taking samples until

the color estimates the color estimates

converge converge

z z

jittering: perturb a regular jittering: perturb a regular

grid grid

Courtesy of C. Rasmussen, CISC 640

Using Extents Using Extents

z z

Ray tracing is slow, performing the same

Ray tracing is slow, performing the same

functions.

functions.

z z

Most of the time is spent in computing

Most of the time is spent in computing

intersections

intersections

z z

Each ray should be intersected with every

Each ray should be intersected with every

object in the scene

object in the scene

z z

Each ray, spawns out reflected/transmitted

Each ray, spawns out reflected/transmitted

rays which have to be interested with the

rays which have to be interested with the

objects in the scene

objects in the scene

Distributed Ray Tracing Distributed Ray Tracing

z z

Distributed ray tracing is NOT ray tracing

Distributed ray tracing is NOT ray tracing

on a distributed system.

on a distributed system.

z z

Distributed ray tracing is a ray tracing

Distributed ray tracing is a ray tracing

method based on randomly distributed

method based on randomly distributed

oversampling to reduce aliasing artifacts in

oversampling to reduce aliasing artifacts in

rendered images (Allen Martin,

rendered images (Allen Martin,

http://www.cs.wpi.edu/~matt/courses/cs

http://www.cs.wpi.edu/~matt/courses/cs

3/talks/dist_ray/dist.html

3/talks/dist_ray/dist.html

)

)

Distributed Ray Tracing Distributed Ray Tracing

z z

Developed by Cook, et. al. (“

Developed by Cook, et. al. (“

Distributed Ray

Distributed Ray

Tracing

Tracing

Computer Graphics

Computer Graphics

, vol. 18, no. 3, pp

, vol. 18, no. 3, pp

z z

Stochastic Oversampling

Stochastic Oversampling

http://www.cs.virginia.edu/~cs551dl/lecture11/sl

http://www.cs.virginia.edu/~cs551dl/lecture11/sl

d016.htm

d016.htm

z z

Pixel for antialiasing Pixel for antialiasing

z z

Light source for soft shadows Light source for soft shadows

z z

Reflection function for soft (glossy) reflections Reflection function for soft (glossy) reflections

z z

Time for motion blur Time for motion blur

z z

Lens for depth of field Lens for depth of field

Distributed Ray tracing Distributed Ray tracing

z z

Distributing a set of Distributing a set of

reflection rays by reflection rays by

randomly perturbing the randomly perturbing the

ideal specular reflection ideal specular reflection

ray. ray.

z z

The spread of the The spread of the

distribution determines distribution determines

the glossiness where a the glossiness where a

wider distribution spread wider distribution spread

models a rougher models a rougher

surface. surface.

taken from http://www.cs.wpi.edu/~emmanuel/courses/cs563/write_ups/zackw/realistic_raytracing.html

Distributed Ray tracing Distributed Ray tracing

z z

first image is from the traditional ray tracer

first image is from the traditional ray tracer

z z

second one uses 16 rays in place of the single

second one uses 16 rays in place of the single

reflected ray

reflected ray

z z

third image uses 64 rays

third image uses 64 rays

taken from http://www.uwm.edu/People/dtstrock/graphics/mcrt.html

Distributed Ray tracing Distributed Ray tracing

z z

Fuzzy translucency

Fuzzy translucency

z z

Same as glossy reflections, but you jitter the refracted Same as glossy reflections, but you jitter the refracted

ray ray

z z

Analytical function similar to the shading Analytical function similar to the shading

z z

A transmission function is used instead of a reflectance A transmission function is used instead of a reflectance

function function

z z

Light is gathered from the other side of the surface. Light is gathered from the other s

ide

of the s

u

rface.

z z

Cast randomly distributed rays in the general direction Cast randomly distributed rays in the general direction

of the transmitted ray from traditional ray tracing. of the transmitted ray from traditional ray tracing.

z z

The average value computed from each of these rays The average value computed from each of these rays

the true translucent component. the true translucent component.

Distributed Ray tracing Distributed Ray tracing

z z

first image is obtained from a traditional ray

first image is obtained from a traditional ray

tracer

tracer

z z

Second image uses 10 rays for the transmitted

Second image uses 10 rays for the transmitted

ray

ray

z z

third image uses 20 rays

third image uses 20 rays

taken from http://www.cs.wpi.edu/~matt/courses/cs563/talks/dist_ray/dist_trans_fuzzy_20.html