Blender V5.3
eevee::ltc::detail Namespace Reference

Functions

float diffuse_sphere_integral (sampler2DArray util_tx, float avg_dir_z, float form_factor)
float3 solve_cubic (float4 coefs)
float3 edge_integral_vec (float3 v1, float3 v2)
float upper_parabole (float x, float scale, float y_1)
float3 dominant_bxdf_direction (float3x3 Minv)
float form_factor_attenuation (LightShape shape, LTCData ltc_data, float3 L)

Function Documentation

◆ diffuse_sphere_integral()

float eevee::ltc::detail::diffuse_sphere_integral ( sampler2DArray util_tx,
float avg_dir_z,
float form_factor )

Diffuse clipped sphere integral. This should equal the irradiance (form factor) of a horizon-clipped sphere w.r.t. a single point. However, the form factor is divided out, resulting in a multiplier defining the clipped sphere only.

Definition at line 32 of file eevee_ltc_lib.bsl.hh.

References diffuse_sphere_integral(), max, texture(), UTIL_DISK_INTEGRAL_COMP, UTIL_DISK_INTEGRAL_LAYER, UTIL_TEX_UV_BIAS, and UTIL_TEX_UV_SCALE.

Referenced by diffuse_sphere_integral(), eevee::ltc::evaluate_disk(), and eevee::ltc::evaluate_quad().

◆ dominant_bxdf_direction()

float3 eevee::ltc::detail::dominant_bxdf_direction ( float3x3 Minv)

Get the 3rd column of the inverse of 3x3 matrix M^{-1}, normalized. We can avoid computing the reciprocal determinant as we need a unit vector.

Definition at line 173 of file eevee_ltc_lib.bsl.hh.

References dominant_bxdf_direction(), and normalize.

Referenced by dominant_bxdf_direction(), and form_factor_attenuation().

◆ edge_integral_vec()

float3 eevee::ltc::detail::edge_integral_vec ( float3 v1,
float3 v2 )

Approximate edge integral as part of a polygon area integral over a cosine (hemi)sphere.

  1. This dates back to Lambert, see: Geometric Derivation of the Irradiance of Polygonal Lights.
  2. This is a fitting that avoids precision issues, see: Real-Time Area Lighting: a Journey from Research to Production

Definition at line 145 of file eevee_ltc_lib.bsl.hh.

References abs, b, cross, dot(), edge_integral_vec(), inversesqrt(), max, x, and y.

Referenced by edge_integral_vec(), and eevee::ltc::evaluate_quad().

◆ form_factor_attenuation()

float eevee::ltc::detail::form_factor_attenuation ( LightShape shape,
LTCData ltc_data,
float3 L )

◆ solve_cubic()

float3 eevee::ltc::detail::solve_cubic ( float4 coefs)

An extended version of the implementation from How to solve a cubic equation, revisited.

Definition at line 50 of file eevee_ltc_lib.bsl.hh.

References A, atan, B, C, clamp(), cos, D, dot(), F, FLT_MAX, G, M_PI, solve_cubic(), sqrt, float4::w, float2::x, float3::x, float4::x, float2::y, float3::y, float4::y, float3::z, and float4::z.

Referenced by eevee::ltc::evaluate_disk(), and solve_cubic().

◆ upper_parabole()

float eevee::ltc::detail::upper_parabole ( float x,
float scale,
float y_1 )

Upper parabolic curve of the form x/(1+x), going through y_1 at x=1, with scale determining the curve shape.

Definition at line 163 of file eevee_ltc_lib.bsl.hh.

References saturate, scale(), upper_parabole(), and x.

Referenced by form_factor_attenuation(), and upper_parabole().