E N D
NPR in Ray Tracing Dan Maljovec
Reference Choudhury, 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.
Ray Stencil N = 1 Compare: • Geometry ID (gs) • Depth (ts) • Normal (ns) S
Types of Feature Lines N = 1 Compare: • Geometry ID (gs) • Depth (ts) • Normal (ns) Intersections & silhouettes S Silhouettes & self-occluding contours Creases
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
Different Geometry N = 1 Compare: • Geometry ID For each stencil ray r If(gs != gr) m++ Radiance = lambertian * eM(m) S Edge Strength Function M = # of stencil rays
Depth Discontinuity N = 1 Compare: • Depth For each stencil ray r If(|ts – tr| > Td) d++ Radiance = lambertian * eM(d) Td = depth threshold S Edge Strength Function M = # of stencil rays
Normal Discontinuity N = 1 Compare: • Normal For each stencil ray r If(||ns – nr|| > TN) Radiance = black TN = normal threshold S Edge Strength Function M = # of stencil rays
Alternative Method Do we need to shoot the ray stencil? • We already have that information from the neighboring rays
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.
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
Performance Pure Optix Method CG Hybrid Method Slight stutter in animation Copy overhead? Scales better when N > 1 Independent of number of scene layout • Works well for N = 1 • (5-point stencil) • Slows down for N > 1 • Dependent on # of rays that need stencil rays In practice, N > 2 doesn’t look very good, witness Exhibit A:
Open Issue No Feature Lines Through glass