Definition and Properties
$D_{0}$ denotes the original distribution to be transformed. To generate a new distribution $D_{0}$, a linear transformation represented by a 3x3 matrix $M$ is applied to the direction vector $w_{0}$ of the original distribution $D_{0}$, where we get $w=\frac {Mw_{0}}{\left | Mw_{0}\right |}$.
The magnitude of an LTSD is the magnitude of the original distribution $D_{0}$ in the original direction $w_{0}$ multiplied by the change of solid angle measure due to the distortion of the spherical transformation. It has the closed-form expression:
where $\frac {\partial w_{0}}{\partial w}=\frac {\left | M^{-1}\right |}{\left | M^{-1}w\right |^{3}}$ is the Jacobian of the transformation of normalized direction vectors $w=\frac {Mw_{0}}{\left | Mw_{0}\right |}$. The distribution is invariant to scaling transformations $(M = \lambda I )$ since scaling vectors doesn’t change their directions. Furthermore, rotations only change the orientation of the distribution, not its shape. This is because the Jacobian of the spherical transformation is constant if $M$ is a scaling or rotation matrix: $\frac {\partial w_{0}}{\partial w}=1$. The transformed distribution $D$ inherits several properties of the original distribution $D_{0}$. Properties of are listed below:
- Normalization The norm of an LTSD $D$ is the norm of its original distribution $D_{0}$.
- Integration over Polygons The integral of an LTSD $D$ over a polygon $P$ is the integral of the original distribution $D_{0}$ over the polygon $P_{0} = M^{-1}P$ obtained by applying the inverse transformation $M^{-1}$ to each vertex of the polygon:
- Important Sampling Because $D$ is $D_{0}$ multiplied by the Jacobian of the transformation, the probability density function(PDF) of the sample $w$ is exactly $D(w)$.
Approximating Physically Based BRDFs with Linearly Transformed Cosines
Define the original distribution $D_{0}$ which is a normalized clamped cosine distribution in the hemisphere given by the z-direction:
Approximate the spherical functions given by the cosine-weighted GGX BRDFs over the light directions $w_{l}$:
Assume an isotropic material, the BRDF depends on the incident direction $w_{v} = (sin\theta _{v}, 0, cos\theta _{v})$ and the roughness parameter $\alpha$. A matrix $M$ could yield the best fit with a Linearly Transformed Cosine. Because of the planar symmetry of isotropic BRDFs and Linearly Transformed Cosine’s scale invariant, the Matrix $M$ can be represented as:
So only 4 parameters need to be fitted. More detail about the representation and storage, please see the paper.
Real-Time Polygonal-Light Shading with Linearly Transformed Cosines
Shading with diffuse polygonal lights means computing the illumination integral over a polygonal domain:
then an approximation can be derived:
Shading with Constant Polygonal Lights
If the radiance emitted by the polygonal light is spatially constant, it means $L(w_{l})=L$. Then it becomes a separable multiplication factor of the integral:
because we have the polygonal integration property above, the integration can be simplified to:
where $E$ is the irradiance of the polygon $P_{0} = M^{-1}P$. Since $D_{0}$ is a clamped cosine distribution, its integral over a polygon is the irradiance of this polygon, which has a closed-form expression:
with $j = (i + 1)\space mod\space n$.
Shading with Textured Polygonal Lights
Reference
Eric Heitz, J., S., D. Real-Time Polygonal-Light Shading with Linearly Transformed Cosines