Skip to content

ludus::foundation::math::ApproximatePolygonIntegral

Ludus Wiki · API overview · Browse API

Struct

Hill and Heitz's approximation of a polygon's horizon-clipped cosine integral, without clipping.
Thanks to Stephen Hill and Eric Heitz, "Real-Time Area Lighting: a Journey from Research to Production", SIGGRAPH 2016 Advances in Real-Time Rendering course, https://advances.realtimerendering.com/s2016/: the vector form factor F of the unclipped polygon, whose norm is the form factor in the direction of F (slides 90-93), and the clipped form factor of a proxy sphere with the same F, max((|F|^2 + F.z) / (|F| + 1), 0) (slides 94-97 and 102). Edges use their quadratic fit of theta / sin(theta) (slide 77, at most 0.73% from the exact ratio). Departure: a polygon entirely above the horizon uses F.z, the unclipped form factor, which the course's tabulated variant also reproduces there, and a polygon with no vertex above the horizon has a zero integral.

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::ApproximatePolygonIntegral final

Fields

VectorFormFactor

Vector3 ludus::foundation::math::ApproximatePolygonIntegral::VectorFormFactor {}
F: the polygon's vector form factor, oriented towards the polygon; zero when the polygon's plane contains the origin.

Related types: Vector3

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

Integral

float32 ludus::foundation::math::ApproximatePolygonIntegral::Integral = 0.0F
The approximate clipped integral in [0, 1]. Zero when no vertex lies above the horizon. It may also be zero for a polygon that crosses the horizon, where the proxy sphere lies below it.

Related types: float32

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

UnitTripleProduct

float32 ludus::foundation::math::ApproximatePolygonIntegral::UnitTripleProduct = 0.0F
|d0 . (d1 x d2)| for the first three unit vertex directions d_i. It is positive exactly when the integral is computed, so a caller can add a positive defensive term wherever the polygon has area above the horizon.

Related types: float32

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