npr in ray tracing

20
NPR in Ray Tracing Dan Maljovec

Upload: falala

Post on 24-Feb-2016

53 views

Category:

Documents


0 download

DESCRIPTION

NPR in Ray Tracing. Dan Maljovec. Reference. - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: NPR in Ray Tracing

NPR in Ray Tracing

Dan Maljovec

Page 2: NPR in Ray Tracing

ReferenceChoudhury, A. N. and Parker, S. G. 2009. Ray tracing NPR-style feature lines. In

Proceedings of the 7th international Symposium on Non-Photorealistic Animation and Rendering (New Orleans, Louisiana, August 01 - 02, 2009). S. N. Spencer, Ed. NPAR '09. ACM, New York, NY, 5-14.

Page 3: NPR in Ray Tracing

Ray Stencil

Compare:• Geometry ID (gs)

• Depth (ts)

• Normal (ns)

S

N = 1

Page 4: NPR in Ray Tracing

Types of Feature Lines

Compare:• Geometry ID (gs)

• Depth (ts)

• Normal (ns)

Intersections & silhouettes

Silhouettes& self-occluding

contours

Creases

S

N = 1

Page 5: NPR in Ray Tracing

Edge Strength Function

• You want the largest edge strength to be when half of your rays see something different

• Let M = # of stencil rays we are going to shoot

Page 6: NPR in Ray Tracing

Different Geometry

Compare:• Geometry ID

For each stencil ray rIf(gs != gr)

m++

Radiance = lambertian * eM(m)

S

M = # of stencil rays

Edge Strength Function

N = 1

Page 7: NPR in Ray Tracing

Depth Discontinuity

Compare:• Depth

For each stencil ray rIf(|ts – tr| > Td)

d++

Radiance = lambertian * eM(d)

Td = depth threshold

M = # of stencil rays

Edge Strength Function

N = 1

S

Page 8: NPR in Ray Tracing

Normal Discontinuity

Compare:• Normal

For each stencil ray rIf(||ns – nr|| > TN)

Radiance = black

TN = normal threshold

S

M = # of stencil rays

Edge Strength Function

N = 1

Page 9: NPR in Ray Tracing

Results

Page 10: NPR in Ray Tracing

Results

Page 11: NPR in Ray Tracing

Alternative Method

Do we need to shoot the ray stencil? – We already have that information from the neighboring rays

Page 12: NPR in Ray Tracing

Alternative Method

Do we need to shoot the ray stencil? – We already have that information from the neighboring rays

Solution: – Shoot one ray per pixel– Pass normal, geometry, color, and depth values to shader

that computes edge strengths.

Page 13: NPR in Ray Tracing

Alternative Method

Do we need to shoot the ray stencil? – We already have that information from the neighboring rays

Solution: – Shoot one ray per pixel– Pass normal, geometry, color, and depth values to shader

that computes edge strengths.

Ideally, you would want to pass the Optix buffers to a CUDA program and process in parallel– Eliminating the overhead of involving OpenGL

Page 14: NPR in Ray Tracing

Alternative Method

Page 15: NPR in Ray Tracing

Alternative Method

Page 16: NPR in Ray Tracing

Performance

Pure Optix Method• Works well for N = 1

– (5-point stencil)

• Slows down for N > 1

• Dependent on # of rays that need stencil rays

CG Hybrid Method• Slight stutter in animation

– Copy overhead?

• Scales better when N > 1

• Independent of number of scene layout

In practice, N > 2 doesn’t look very good, witness Exhibit A:

Page 17: NPR in Ray Tracing

N = 3

Page 18: NPR in Ray Tracing

N = 7

Page 19: NPR in Ray Tracing

Open Issue

Page 20: NPR in Ray Tracing

Open Issue

No Feature LinesThrough glass