Skip to content

ludus::foundation::math::LinearlyTransformedCosine

Ludus Wiki · API overview · Browse API

Struct

A linearly transformed cosine distribution (Heitz et al. 2016, Equation 1; Peters 2021, section 4.1).
The density at a unit direction w is p(w) = max(0, (M^-1 w).z) * |M^-1| / (pi * |M^-1 w|^4): the clamped cosine (1/pi) max(0, z) of the normalized direction M^-1 w / |M^-1 w|, times the Jacobian |M^-1| / |M^-1 w|^3. It integrates to one over the sphere. The distribution is invariant to a positive scale of M, so both matrices are stored scaled: InverseTransform by a power of two, and Transform as the adjugate of InverseTransform, a positive multiple of M. Produced by TryMakeLinearlyTransformedCosine; treat the fields as read-only.

Declared in modules/foundation/math/include/ludus/foundation/math/linearly_transformed_cosine.hpp

#include <ludus/foundation/math/linearly_transformed_cosine.hpp>
struct ludus::foundation::math::LinearlyTransformedCosine final

Fields

InverseTransform

Matrix3 ludus::foundation::math::LinearlyTransformedCosine::InverseTransform = Matrix3::Identity()
M^-1 scaled by a power of two so that its largest-magnitude entry lies in [1, 2).

Related types: Matrix3

Declared in modules/foundation/math/include/ludus/foundation/math/linearly_transformed_cosine.hpp

Transform

Matrix3 ludus::foundation::math::LinearlyTransformedCosine::Transform = Matrix3::Identity()
The adjugate of InverseTransform, |M^-1| times the inverse of InverseTransform; maps cosine directions to w.

Related types: Matrix3

Declared in modules/foundation/math/include/ludus/foundation/math/linearly_transformed_cosine.hpp

InverseDeterminant

float32 ludus::foundation::math::LinearlyTransformedCosine::InverseDeterminant = 1.0F
Determinant of InverseTransform, at least MIN_LINEARLY_TRANSFORMED_COSINE_DETERMINANT.

Related types: float32

Declared in modules/foundation/math/include/ludus/foundation/math/linearly_transformed_cosine.hpp