A Spherical Cap Preserving Parameterization for Spherical Distributions

Doing Stuff with Spherical Caps


Jonathan Dupuy Eric Heitz Laurent Belcour
Unity Technologies Unity Technologies Unity Technologies






A Spherical Cap Preserving Parameterization for Spherical Distributions

"Doing Stuff with Spherical Caps"


Jonathan Dupuy Eric Heitz Laurent Belcour
Unity Technologies Unity Technologies Unity Technologies

Overview

Theoretical contribution
  • Spherical distributions
  • Analytic cap integration
  • Analytic sampling


Applied to sphere lighting
  • Real-time shading
  • Specular occlusion
  • Variance reduction


Overview

Theoretical contribution
  • Spherical distributions
  • Analytic cap integration
  • Analytic sampling


Applied to sphere lighting
  • Real-time shading
  • Specular occlusion
  • Variance reduction


Overview

Theoretical contribution
  • Spherical distributions
  • Analytic cap integration
  • Analytic sampling


Applied to sphere lighting
  • Real-time shading
  • Specular occlusion
  • Variance reduction


Overview

Theoretical contribution
  • Spherical distributions
  • Analytic cap integration
  • Analytic sampling


Applied to sphere lighting
  • Real-time shading
  • Specular occlusion
  • Variance reduction


Overview

Theoretical contribution
  • Spherical distributions
  • Analytic cap integration
  • Analytic sampling


Applied to sphere lighting
  • Real-time shading
  • Specular occlusion
  • Variance reduction

Overview

Theoretical contribution
  • Spherical distributions
  • Analytic cap integration
  • Analytic sampling


Applied to sphere lighting
  • Real-time shading
  • Specular occlusion
  • Variance reduction

Overview

Theoretical contribution
  • Spherical distributions
  • Analytic cap integration
  • Analytic sampling


Applied to sphere lighting
  • Real-time shading
  • Specular occlusion
  • Variance reduction
MIS@64spp: Previous MIS@64spp: Ours

Motivation

Problem

$$\mathscr{C}$$
$$ \boxed{\; I = \int_\mathscr{C} D(\boldsymbol{\omega}) \, d\boldsymbol{\omega} \;} $$
How to compute efficiently ?

Related Work

Uniform Clipped Uniform Cosine
vMF (Spherical Gaussian) Phong Lobes
Low frequency
No closed-form
O(exponent)

Contribution

Uniform Clipped Uniform Cosine
vMF (Spherical Gaussian) Phong Lobes
Low frequency
No closed-form
O(exponent)
NEW Pivot Distributions
All frequency + closed-form + O(1)

Pivot Distributions

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =
\begin{align} {\color{red}\boldsymbol{\omega}} \end{align}

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =
\begin{align} {\color{red}\boldsymbol{\omega}} \mapsto {\color{green}\boldsymbol{\omega}} \end{align}

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =
\begin{align} {\color{red}\boldsymbol{\omega}} \mapsto {\color{green}\boldsymbol{\omega}} &= g({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
\begin{align} \Rightarrow {\color{red}\boldsymbol{\omega}} &= g({\color{green}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =
\begin{align} {\color{red}\boldsymbol{\omega}} \mapsto {\color{green}\boldsymbol{\omega}} &= g({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
\begin{align} \Rightarrow {\color{red}\boldsymbol{\omega}} &= g({\color{green}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
$$D_\textrm{std}({\color{red}\boldsymbol{\omega}})$$
\begin{align} D({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) = D_\textrm{std}({\color{green}\boldsymbol{\omega}}) \frac{ d {\color{green}\boldsymbol{\omega}} }{ d {\color{red}\boldsymbol{\omega}} } \end{align}

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =
\begin{align} {\color{red}\boldsymbol{\omega}} \mapsto {\color{green}\boldsymbol{\omega}} &= g({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
\begin{align} \Rightarrow {\color{red}\boldsymbol{\omega}} &= g({\color{green}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
$$D_\textrm{std}({\color{red}\boldsymbol{\omega}})$$
\begin{align} D({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) = D_\textrm{std}({\color{green}\boldsymbol{\omega}}) \frac{ d {\color{green}\boldsymbol{\omega}} }{ d {\color{red}\boldsymbol{\omega}} } \end{align}

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =
\begin{align} {\color{red}\boldsymbol{\omega}} \mapsto {\color{green}\boldsymbol{\omega}} &= g({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
\begin{align} \Rightarrow {\color{red}\boldsymbol{\omega}} &= g({\color{green}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
$$D_\textrm{std}({\color{red}\boldsymbol{\omega}})$$
\begin{align} D({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) = D_\textrm{std}({\color{green}\boldsymbol{\omega}}) \frac{ d {\color{green}\boldsymbol{\omega}} }{ d {\color{red}\boldsymbol{\omega}} } \end{align}

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =
\begin{align} {\color{red}\boldsymbol{\omega}} \mapsto {\color{green}\boldsymbol{\omega}} &= g({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
\begin{align} \Rightarrow {\color{red}\boldsymbol{\omega}} &= g({\color{green}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
$$\mathbf{u} \mapsto {\color{red}\boldsymbol{\omega}}$$
$$\mathbf{u} \mapsto {\color{green}\boldsymbol{\omega}} = g({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p})$$

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =
\begin{align} {\color{red}\mathscr{C}} \end{align}

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =
\begin{align} {\color{red}\mathscr{C}} \mapsto {\color{green}\mathscr{C}} \end{align}

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =
\begin{align} {\color{red}\mathscr{C}} \mapsto {\color{green}\mathscr{C}} &= g({\color{red}\mathscr{C}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
\begin{align} \Rightarrow {\color{red}\mathscr{C}} &= g({\color{green}\mathscr{C}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =
\begin{align} {\color{red}\mathscr{C}} \mapsto {\color{green}\mathscr{C}} &= g({\color{red}\mathscr{C}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
\begin{align} \Rightarrow {\color{red}\mathscr{C}} &= g({\color{green}\mathscr{C}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
$$\mathbf{u} \mapsto {\color{red}\boldsymbol{\omega}} \in {\color{red}\mathscr{C}}$$
$$\mathbf{u} \mapsto {\color{green}\boldsymbol{\omega}} = g({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \in {\color{green}\mathscr{C}}$$

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =
\begin{align} {\color{red}\mathscr{C}} \mapsto {\color{green}\mathscr{C}} &= g({\color{red}\mathscr{C}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
\begin{align} \Rightarrow {\color{red}\mathscr{C}} &= g({\color{green}\mathscr{C}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
$\int_{\color{red}\mathscr{C}} D_\textrm{std}({\color{red}\boldsymbol{\omega}}) \, d {\color{red}\boldsymbol{\omega}}$
$\int_{\color{green}\mathscr{C}} D ({\color{green}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \, d {\color{green}\boldsymbol{\omega}}$

Pivot Distributions

Overview
  • Pivot transformation
  • Jacobian as PDF


Properties
  • Analytic sampling
  • Cap-preserving
  • Analytic cap integrals
+ =
\begin{align} {\color{red}\mathscr{C}} \mapsto {\color{green}\mathscr{C}} &= g({\color{red}\mathscr{C}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
\begin{align} \Rightarrow {\color{red}\mathscr{C}} &= g({\color{green}\mathscr{C}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
$\int_{\color{red}\mathscr{C}_1 \bigcap \mathscr{C}_2} D_\textrm{std}({\color{red}\boldsymbol{\omega}}) \, d {\color{red}\boldsymbol{\omega}}$
$\int_{\color{green}\mathscr{C}_1 \bigcap \mathscr{C}_2} D ({\color{green}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \, d {\color{green}\boldsymbol{\omega}}$





Applications


Realtime Sphere Light Shading

Realtime Shading






  • BRDF approximation
  • Specular occlusion
  • Validation

Realtime Shading






  • BRDF approximation
  • Specular occlusion
  • Validation
=
$$\int_{\color{green}\mathscr{C}} f_r \; \cos \theta_i \; d\boldsymbol{\omega}_i$$
$$\int_{\color{green}\mathscr{C}} D(\boldsymbol{\omega}_i; {\color{RoyalBlue}\mathbf{r}_p}) \; d\boldsymbol{\omega}_i$$
$$\int_{\color{red}\mathscr{C}} D_\textrm{std}(\boldsymbol{\omega}) \; d\boldsymbol{\omega}$$

Realtime Shading






  • BRDF approximation
  • Specular occlusion
  • Validation
=
$$\int_{\color{green}\mathscr{C}} f_r \; \cos \theta_i \; d\boldsymbol{\omega}_i$$
$$\int_{\color{green}\mathscr{C}} D(\boldsymbol{\omega}_i; {\color{RoyalBlue}\mathbf{r}_p}) \; d\boldsymbol{\omega}_i$$
$$\int_{\color{red}\mathscr{C}} D_\textrm{std}(\boldsymbol{\omega}) \; d\boldsymbol{\omega}$$

Realtime Shading






  • BRDF approximation
  • Specular occlusion
  • Validation
=
$$\int_{\color{green}\mathscr{C}} f_r \; \cos \theta_i \; d\boldsymbol{\omega}_i$$
$$\int_{\color{green}\mathscr{C}} D(\boldsymbol{\omega}_i; {\color{RoyalBlue}\mathbf{r}_p}) \; d\boldsymbol{\omega}_i$$
$$\int_{\color{red}\mathscr{C}} D_\textrm{std}(\boldsymbol{\omega}) \; d\boldsymbol{\omega}$$

Realtime Shading






  • BRDF approximation
  • Specular occlusion
  • Validation
=
$$\int_{\color{green}\mathscr{C}} f_r \; \cos \theta_i \; d\boldsymbol{\omega}_i$$
$$\int_{\color{green}\mathscr{C}} D(\boldsymbol{\omega}_i; {\color{RoyalBlue}\mathbf{r}_p}) \; d\boldsymbol{\omega}_i$$
$$\int_{\color{red}\mathscr{C}} D_\textrm{std}(\boldsymbol{\omega}) \; d\boldsymbol{\omega}$$

Realtime Shading






  • BRDF approximation
  • Specular occlusion
  • Validation
=
$$\int_{\color{green}\mathscr{C} \bigcap \mathscr{C}_v} f_r \; \cos \theta_i \; d\boldsymbol{\omega}_i$$
$$\int_{\color{green}\mathscr{C} \bigcap \mathscr{C}_v} D(\boldsymbol{\omega}_i; {\color{RoyalBlue}\mathbf{r}_p}) \; d\boldsymbol{\omega}_i$$
$$\int_{\color{red}\mathscr{C} \bigcap \mathscr{C}_v} D_\textrm{std}(\boldsymbol{\omega}) \; d\boldsymbol{\omega}$$
Specular Occlusion: OFF
Specular Occlusion: ON

Realtime Shading






  • BRDF approximation
  • Specular occlusion
  • Validation
$f_r \cdot \cos \theta_i$ $D$
Ours Ref (raytraced)
$\alpha = 0.001$
Ours Ref (raytraced)
$\alpha = 0.10$
Ours Ref (raytraced)
$\alpha = 0.25$
Ours Ref (raytraced)
$\alpha = 0.50$
Ours Ref (raytraced)
$\alpha = 1.00$
Ours Ref (raytraced)
$\alpha = \textrm{map}$

Variance Reduction

Variance Reduction






  • BRDF MIS
  • MIS demo
  • Pivot phase function
MIS (previous) MIS (ours)
BRDF Light
BRDF Pivot-Light
BRDF
Pivot

Variance Reduction






  • BRDF MIS
  • MIS demo
  • Pivot phase function
MIS (previous) MIS (ours)
BRDF Light
BRDF Pivot-Light
MIS (previous) MIS (ours)
$\alpha = 0.01$
MIS (previous) MIS (ours)
$\alpha = 0.25$
MIS (previous) MIS (ours)
$\alpha = 0.75$

Variance Reduction






  • BRDF MIS
  • MIS demo
  • Pivot phase function

Variance Reduction






  • BRDF MIS
  • MIS demo
  • Pivot phase function


Henyey-Greenstein Pivot
$$f_s(\mu; g) = \frac{1}{4\pi}\frac{1 - g^2}{(1 + g^2 - 2 \,g\, \mu)^\frac{3}{2}} $$ $$f_s(\mu; g) = \frac{1}{4\pi}\left(\frac{1 - g^2}{1 + g^2 - 2 \,g\, \mu}\right)^2 $$

Phase Function Fitting

Henyey-Greenstein ($g = 0$) Our fit

Phase Function Fitting

Henyey-Greenstein ($g = -0.8$) Our fit

Phase Function Fitting

Henyey-Greenstein ($g = +0.8$) Our fit

Variance Reduction






  • BRDF MIS
  • MIS demo
  • Pivot phase function
MIS (previous) Perfect (ours)
Phase function Light
Phase function-Light

Variance Reduction






  • BRDF MIS
  • MIS demo
  • Pivot phase function

Conclusion

New spherical distributions
  • Pivot parameterization
  • Analytic properties
  • Useful for sphere lights


Future Work
  • Unify SPTDs with LTSDs ?
  • Generalize further ?
+ =
\begin{align} {\color{red}\boldsymbol{\omega}} \mapsto {\color{green}\boldsymbol{\omega}} &= g({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
$$D_\textrm{std}({\color{red}\boldsymbol{\omega}})$$
\begin{align} D({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) = D_\textrm{std}({\color{green}\boldsymbol{\omega}}) \frac{ d {\color{green}\boldsymbol{\omega}} }{ d {\color{red}\boldsymbol{\omega}} } \end{align}

Acknowledgements

  • Morgan Villedieu
  • Hamza Cheggour
  • Laurent Harduin
Link to shadertoy: www.shadertoy.com

Acknowledgements

  • Morgan Villedieu
  • Hamza Cheggour
  • Laurent Harduin
Free download: www.emirage.org

Acknowledgements

  • Morgan Villedieu
  • Hamza Cheggour
  • Laurent Harduin
Lighting by Laurent Harduin

Acknowledgements

  • Morgan Villedieu
  • Hamza Cheggour
  • Laurent Harduin
Lighting by Jonathan Dupuy

Questions


+ =
\begin{align} {\color{red}\boldsymbol{\omega}} \mapsto {\color{green}\boldsymbol{\omega}} &= g({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) \end{align}
$$D_\textrm{std}({\color{red}\boldsymbol{\omega}})$$
\begin{align} D({\color{red}\boldsymbol{\omega}}; {\color{RoyalBlue}\mathbf{r}_p}) = D_\textrm{std}({\color{green}\boldsymbol{\omega}}) \frac{ d {\color{green}\boldsymbol{\omega}} }{ d {\color{red}\boldsymbol{\omega}} } \end{align}


Get our source code online: https://github.com/jdupuy/pivot

Related Work

$$ \boxed{\quad I = \int_\mathscr{C} D(\boldsymbol{\omega}) \, d\boldsymbol{\omega} \quad} $$
  • Polygon lighting
  • Approximations
[Heitz et al. 2016]
O(Edges)
$\mathscr{C} \approx \mathscr{P}_1 + \mathscr{P}_2 + \cdots + \mathscr{P}_N$

Related Work

$$ \boxed{\quad I = \int_\mathscr{C} D(\boldsymbol{\omega}) \, d\boldsymbol{\omega} \quad} $$
  • Polygon lighting
  • Approximations
[Lecocq et al. 2016] [Drobot2014]
$\mathscr{C} \approx \mathscr{P}$ $\mathscr{C} \approx \boldsymbol{\omega}_i$

Rendering: Point Lights

Rendering: Point Lights

Rendering: Ours

Closed-form solutions

Uniform ✓
Clipped Uniform ✓
Clamped Cosine ✓
Cheap closed-form ?

Closed-form solutions

Uniform ✓
Clipped Uniform ✓
Clamped Cosine ✓
Cheap closed-form ?

Closed-form solutions

Uniform ✓
Clipped Uniform ✓
Clamped Cosine ✓
Cheap closed-form ?

Parametric BRDF Shapes


BRDF:
(varying roughness)



Rendering:

Closed-form solutions

Uniform ✓
Clipped Uniform ✓
Clamped Cosine ✓
vMF ✘
k = 2
k = 30
k = 200

Cheap Analytic Approximation ?

Closed-form solutions

Uniform ✓
Clipped Uniform ✓
Clamped Cosine ✓
Phong ✓
k = 2
k = 30
k = 200

Cheap Analytic Approximation ?

Closed-form solutions

Uniform ✓
Clipped Uniform ✓
Clamped Cosine ✓
O(1)
Phong ✓
k = 2
k = 30
k = 200 ✘✘
O(k)

Cheap Analytic Approximation ?

Closed-form solutions

Uniform ✓
Clipped Uniform ✓
Clamped Cosine ✓
O(1)
Phong ✓
k = 2
k = 30
k = 200 ✘✘
O(k)
Related Work [Drobot2014] [Technicolor2017] [LTC2017] O(Edges)

Closed-form solutions

Uniform ✓
Clipped Uniform ✓
Clamped Cosine ✓
O(1)
Phong ✓
k = 2
k = 30
k = 200 ✘✘
O(k)




Can we extend the set of exact solutions ?
Related Work [Drobot2014] [Technicolor2017] [LTC2017] O(Edges)

Closed-form solutions

Uniform ✓
Clipped Uniform ✓
Clamped Cosine ✓
O(1)
Phong ✓
k = 2
k = 30
k = 200 ✘✘
O(k)
Our Distributions ✓
O(1)
Related Work [Drobot2014] [Technicolor2017] [LTC2017] O(Edges)

Pivot Distribution

Pivot Distribution

= Point set PDF

Pivot Distribution

= Point set PDF

Pivot Distribution

= Point set PDF

Pivot Distribution

= E[ X ] Integral

Pivot Distribution

= E[ X ] Integral

Pivot Distribution

= E[ X ] = E[ X ] Integral

Pivot Distribution

= E[ X ] = Integral' Integral

Video

Pivot Distribution

Some Text