Slide 1

Slide 1 text

Real-time Shading with Free-form Planar Area Lights using Linearly Transformed Cosines Takahiro Kuge1 β—‹Tatsuya Yatagawa2 Shigeo Morishima1 1Waseda University 2The University of Tokyo

Slide 2

Slide 2 text

Pioneering work by Baum et al. [1989] l Lambertian surface illuminated by polygonal light 2 Real-time rendering of flat area lights 𝐼 = # ! 𝐿 cos πœƒ dπœ” = Cosine is integrated over a solid angle = The integral equals to area of projected figure [Lambert 1760] Light source Solid angle: 𝛀 Projected figure Shading point * A figure is projected to β€œlocal” shading plane, and the shaded object should not be planar.

Slide 3

Slide 3 text

Area of projected figure is analytic when light shape is polygon 3 Baum’s formula = - - Sum of areas of projected β€œfans” 𝐼 = + # acos 𝐩# β‹… 𝐩$ 𝐩#×𝐩$ 𝐩# ×𝐩$ β‹… 𝐞% 𝑗 = 𝑖 + 1 mod 𝑁, 𝐞𝐳 is unit vector along z axis. Light source Solid angle: Ξ© Projected figure Shading point

Slide 4

Slide 4 text

l Surfaces with Phong BRDF [Arvo 1995] l Surfaces with Microfacet BRDF (GGX) [Heitz+ 2016] l Special light shapes, e.g., ellipses and lines [Heitz & Hill 2017] l Polygon-clipped spherical harmonics [Wang+ 2018; Belcour+ 2018] 4 Extensions of Baum’s approach [Heitz & Hill 2017] [Wang et al. 2018] Free-form area lights hasn’t been well investigated!

Slide 5

Slide 5 text

Real-time shading with free-form area lights bounded by 3rd-order Bezier l Approximate boundary curve with polyline, then apply Baum’s method β†’ Adaptive polygonization based on magnitude of light contribution l Extend [Heitz+ 2016] to handle Microfacet BRDF β†’ Efficient clipping operation (shown later) for polynomial curve Research objectives 5 Real-time shading with free-form area lights bounded by 3rd-order Bezier l Approximate boundary curve with polyline, then apply Baum’s method β†’ Adaptive polygonization based on magnitude of light contribution l Extend [Heitz+ 2016] to handle Microfacet BRDF β†’ Efficient clipping operation (shown later) for polynomial curve

Slide 6

Slide 6 text

Requirement: Area of projected figure is solved analytically Assume polynomial curve 𝐢 𝑑 = π‘₯ 𝑑 , 𝑦 𝑑 , 𝑧 𝑑 is projected to ( 𝐢(𝑑) 6 Why difficult to handle polynomial curves? 𝐴 = # ! "($) $ 𝑦 d$ π‘₯ = # $ 𝑦 𝑑 d$ π‘₯(𝑑) d𝑑 d𝑑 + 𝐢 𝑑 = $ π‘₯ 𝑑 , $ 𝑦 𝑑 , Μƒ 𝑧 𝑑 = π‘₯ 𝑑 𝐢 𝑑 , 𝑦 𝑑 𝐢 𝑑 , 𝑧(𝑑) 𝐢(𝑑) = # 𝑦 𝑑 π‘₯& 𝑑 + 𝑦& 𝑑 + 𝑧&(𝑑) d d𝑑 π‘₯(𝑑) π‘₯& 𝑑 + 𝑦& 𝑑 + 𝑧&(𝑑) d𝑑 In general, fractional function does not have analytic infinite integral Projected figure Light source Shading point = # 𝑃(3𝐷 βˆ’ 1) 𝑃(4𝐷) d𝑑 z y x 𝐢(𝑑) % 𝐢(𝑑) (𝑃 𝐷 : 𝐷th-order polynomial, 𝐷: order of polynomial curve) projection on hemisphere

Slide 7

Slide 7 text

Ramer-Douglas-Peucker algorithm Originally, a method for approximating curve based on β€œdistance” (see figure below) Adaptive boundary curve polygonization 7 Extension for light contribution: l Compute increase/decrease of light contribution when new point added l Subdivide a curve until increase/decrease is sufficiently small

Slide 8

Slide 8 text

For each partial curve, add a midpoint and calculate light contribution from a triangle 8 Adaptive boundary curve polygonization continue much contribution terminate little contribution terminate Contribution of each triangle is calculated using Baum’s formula Partial curve is always divided by a midpoint No re-computation required little contribution

Slide 9

Slide 9 text

9 Threshold for traverse termination Experiments with constant threshold for different roughness l Intuition: small threshold slows down shading computation. Low roughness Time: not affected Quality: affected β†’ small thres. can be used High roughness Time: affected Quality: not affected β†’ large thres. will be fine

Slide 10

Slide 10 text

10 Threshold for traverse termination Accordingly, we can use a threshold proportional to roughness With adaptive thresholding, we obtain both speed and accuracy

Slide 11

Slide 11 text

Real-time shading with free-form area lights bounded by 3rd-order Bezier l Approximate boundary curve with polyline, then apply Baum’s method β†’ Adaptive polygonization based on magnitude of light contribution l Extend [Heitz+ 2016] to handle Microfacet BRDF β†’ Efficient clipping operation (shown later) for polynomial curve Research objectives 11

Slide 12

Slide 12 text

Microfacet BRDF is approximated by linearly transforming cosine distribution 12 Linearly Transformed Cosines [Heitz et al. 2016] Linear transformation Cosine distribution BRDF By linear transformation, Baum’s formula is available for microfacet BRDF! Light shape deformation

Slide 13

Slide 13 text

A part can be hidden under the ground after deformed by inverse transformation l Baum’s formula enforce area light is on upper hemisphere β†’ We need to clip (= exclude) the part under the ground 13 Clipping operation For polygon, each edge is checked intersection with the ground plane Unfortunately, adaptive polygonization results in considerably many edges Cosine distribution BRDF Linear transformation Light shape deformation This part must be clipped!

Slide 14

Slide 14 text

l Points of intersection between boundary curve and shading plane β†’ Those with 𝑧 = 0 on the boundary curve β†’ Solving cubic equation for z coordinates is sufficient (3rd-order Bezier) l Owing to affine invariance of Bezier, we can efficiently evaluate transformed curve by transforming only control points β†’ We can instantly obtain the cubic equation Algebraic clipping 14 π‘Ž = βˆ’π‘&,( + 3 𝑝),( βˆ’ 𝑝*,( + 𝑝+,( 𝑏 = 3(𝑝&,( βˆ’ 2𝑝),( + 𝑝*,( ) 𝑐 = 3(βˆ’π‘&,( + 𝑝),( ) 𝑑 = 𝑝&,( Specifically, we solve the equation below π‘Žπ‘‘+ + 𝑏𝑑* + 𝑐𝑑 + 𝑑 = 0, We can algebraically solve polynomial equation whose order is less than five. 𝑑 ∈ 0, 1

Slide 15

Slide 15 text

What we need are only real-number solutions l [Blinn 2007] shows an efficient solution for cubic equation 15 Algebraic solution for cubic equation Reference: http://momentsingraphics.de/CubicRoots.html#_Blinn07b

Slide 16

Slide 16 text

Computer: CPU: Intel Xeon 5119 Gold GPU: NVIDIA GeForce 1080 (8GB Memory) RAM: 64GB Implementation: l We use the method for both diffuse and specular (shading is computed twice). l We assume light source itself can intersect with a shading surface (clipping is performed twice) Reference pictures: Rendered by Blender Cycles, Unidirectional Path Tracing (GPU enabled) 16 Experiment

Slide 17

Slide 17 text

Currently, our method spends 1ms for each interval of Bezier curve 17 Rendering result: Concave shape with cavity

Slide 18

Slide 18 text

Currently, our method spends 1ms for each interval of Bezier curve 18 Rendering result: Character

Slide 19

Slide 19 text

Currently, our method spends 1ms for each interval of Bezier curve 19 Rendering result: Textured light

Slide 20

Slide 20 text

Comparison method l Divide curve domain into a fixed number of intervals l Then, apply [Heitz+ 2016] with clipping operation to resulting polygon Comparison with [Heitz+ 2016] 20 For same-quality image, our method is twice faster! equal time equal quality

Slide 21

Slide 21 text

Order of computation is a dominant factor. 21 Why ours is faster? [Heitz et al. 2016] 1. Divide entire boundary curve into line segments 2. For every line segment, ・Shading computation ・Clipping operation Our method 1. Clip boundary curve β†’ Reduce # of curves 2. For only remained curves, ・Adaptive polygonization ・Shading computation First clipping operation reduce the number of curves processed οΌ‹ Adaptive polygonization concentrates more resource on more important parts

Slide 22

Slide 22 text

Our method shares the same limitations with [Heitz+ 2016] 22 Limitations Low accuracy for textured lights Highly rough surface illuminated from small grating angle Light is entirely hidden under the ground

Slide 23

Slide 23 text

New real-time shading method for area lights contoured by 3rd-order Bezier. l Contrib. #1: Adaptive boundary curve polygonization based on light contribution l Contrib. #2: Efficient clipping operation for polynomial curve (algebraic clipping) β†’ More efficient than straightforward application of previous method Conclusion 23 The same idea will be available for rational Bezier and B-splines!

Slide 24

Slide 24 text

24 Thank you for listening GitHub: https://github.com/Paul180297/BezierLightLTC.git