Blender V5.3
eevee_bxdf_microfacet.bsl.hh File Reference

Go to the source code of this file.

Functions

Microfacet GGX distribution
float bxdf_ggx_D (float NH, float a2)
float bxdf_ggx_smith_G1 (float NX, float a2)
Bounded VNDF Sampling for Smith-GGX Reflections

Eto, Kenta, and Yusuke Tokuyoshi. SIGGRAPH Asia 2023 Technical Communications. 2023. 1-4. https://gpuopen.com/download/publications/Bounded_VNDF_Sampling_for_Smith-GGX_Reflections.pdf

BsdfSample bxdf_ggx_sample_reflection (float3 rand, float3 Vt, float alpha, bool do_clamp)
BsdfEval bxdf_ggx_eval_reflection (float3 N, float3 L, float3 V, float alpha, bool do_clamp)
Sampling Visible GGX Normals with Spherical Caps

Jonathan Dupuy and Anis Benyoub, HPG Vol. 42, No. 8, 2023. https://diglib.eg.org/bitstream/handle/10.1111f/cgf14867/v42i8_03_14867.pdf

float3 bxdf_ggx_sample_vndf (float3 rand, float3 Vt, float alpha, float &G_V)
BsdfSample bxdf_ggx_sample_refraction (float3 rand, float3 Vt, float alpha, float ior, Thickness thickness, const bool do_clamp)
BsdfEval bxdf_ggx_eval_refraction (float3 N, float3 L, float3 V, float alpha, float ior, Thickness thickness, const bool do_clamp)
Roughness Mappings & Light Evaluation
float bxdf_ggx_perceived_roughness_reflection (float roughness)
float bxdf_ggx_perceived_roughness_transmission (float roughness, float ior)
float3 bxdf_ggx_dominant_direction_reflection (float3 N, float3 V, float roughness)
float3 bxdf_ggx_dominant_direction_transmission (float3 N, float3 V, float ior, float roughness)
LightProbeRay bxdf_ggx_lightprobe_reflection (ClosureReflection cl, float3 V)
LightProbeRay bxdf_ggx_lightprobe_transmission (ClosureRefraction cl, float3 V, Thickness thickness)
LightProbeRay bxdf_ggx_lightprobe_thin_glass_transmission (ClosureThinRefraction cl, float3 V)
void bxdf_ggx_context_amend_transmission (ClosureUndetermined &cl, float3 &V, Thickness thickness)
Ray bxdf_ggx_ray_amend_transmission (ClosureUndetermined cl, float3 V, Ray ray, Thickness thickness)
ClosureLight bxdf_ggx_light_reflection (const UtilityTexture &util_tx, ClosureReflection cl, float3 V)
ClosureLight bxdf_ggx_light_transmission (const UtilityTexture &util_tx, ClosureRefraction cl, float3 V, Thickness thickness)
ClosureLight bxdf_ggx_light_thin_glass_transmission (const UtilityTexture &util_tx, ClosureThinRefraction cl, float3 V)

Function Documentation

◆ bxdf_ggx_context_amend_transmission()

◆ bxdf_ggx_D()

◆ bxdf_ggx_dominant_direction_reflection()

float3 bxdf_ggx_dominant_direction_reflection ( float3 N,
float3 V,
float roughness )

Returns the dominant direction for one reflection event. roughness is expected to be the linear (from UI) roughness.

Definition at line 334 of file eevee_bxdf_microfacet.bsl.hh.

References bxdf_ggx_dominant_direction_reflection(), mix, N, normalize, R, reflect, sqrt, square(), and V.

Referenced by bxdf_ggx_dominant_direction_reflection(), bxdf_ggx_lightprobe_reflection(), and bxdf_ggx_lightprobe_thin_glass_transmission().

◆ bxdf_ggx_dominant_direction_transmission()

float3 bxdf_ggx_dominant_direction_transmission ( float3 N,
float3 V,
float ior,
float roughness )

◆ bxdf_ggx_eval_reflection()

◆ bxdf_ggx_eval_refraction()

◆ bxdf_ggx_light_reflection()

ClosureLight bxdf_ggx_light_reflection ( const UtilityTexture & util_tx,
ClosureReflection cl,
float3 V )

◆ bxdf_ggx_light_thin_glass_transmission()

ClosureLight bxdf_ggx_light_thin_glass_transmission ( const UtilityTexture & util_tx,
ClosureThinRefraction cl,
float3 V )

◆ bxdf_ggx_light_transmission()

◆ bxdf_ggx_lightprobe_reflection()

◆ bxdf_ggx_lightprobe_thin_glass_transmission()

◆ bxdf_ggx_lightprobe_transmission()

◆ bxdf_ggx_perceived_roughness_reflection()

float bxdf_ggx_perceived_roughness_reflection ( float roughness)

roughness is expected to be the linear (from UI) roughness.

Definition at line 312 of file eevee_bxdf_microfacet.bsl.hh.

References bxdf_ggx_perceived_roughness_reflection().

Referenced by bxdf_ggx_perceived_roughness_reflection(), and closure_apparent_roughness_get().

◆ bxdf_ggx_perceived_roughness_transmission()

float bxdf_ggx_perceived_roughness_transmission ( float roughness,
float ior )

Return the equivalent reflective roughness resulting in a similar lobe. roughness is expected to be the linear (from UI) roughness.

Definition at line 321 of file eevee_bxdf_microfacet.bsl.hh.

References bxdf_ggx_perceived_roughness_transmission(), saturate, and sqrt_fast().

Referenced by bxdf_ggx_context_amend_transmission(), bxdf_ggx_light_transmission(), bxdf_ggx_lightprobe_transmission(), bxdf_ggx_perceived_roughness_transmission(), bxdf_ggx_ray_amend_transmission(), and closure_apparent_roughness_get().

◆ bxdf_ggx_ray_amend_transmission()

◆ bxdf_ggx_sample_reflection()

BsdfSample bxdf_ggx_sample_reflection ( float3 rand,
float3 Vt,
float alpha,
bool do_clamp )

Returns a tangent space reflection direction following the GGX distribution.

Parameters
randrandom point on the unit cylinder (result of sample_cylinder). The Z component can be biased towards 1.
VtView vector in tangent space.
alpharoughness parameter.
do_clampclamp for numerical stability during ray tracing.
Returns
: the sampled direction and the pdf of sampling the direction.

Definition at line 52 of file eevee_bxdf_microfacet.bsl.hh.

References BSDF_ROUGHNESS_THRESHOLD, bxdf_ggx_D(), bxdf_ggx_sample_reflection(), cos_theta(), D, BsdfSample::direction, length(), length_squared(), max, mix, normalize, normalize_and_get_length(), BsdfSample::pdf, reflect, saturate, sin_theta(), sqrt, square(), float3::x, and float3::z.

Referenced by bxdf_ggx_sample_reflection(), eevee::lut::GGXBrdfClosure::eval(), eevee::lut::GGXBsdfClosure::eval(), and eevee::ray_generate_direction().

◆ bxdf_ggx_sample_refraction()

BsdfSample bxdf_ggx_sample_refraction ( float3 rand,
float3 Vt,
float alpha,
float ior,
Thickness thickness,
const bool do_clamp )

Returns a tangent space refraction direction following the GGX distribution.

Parameters
randrandom point on the unit cylinder (result of sample_cylinder). The Z component can be biased towards 1.
VtView vector in tangent space.
alpharoughness parameter
iorrefractive index of the material.
do_clampclamp for numerical stability during ray tracing.
Returns
: the sampled direction and the pdf of sampling the direction.

Definition at line 204 of file eevee_bxdf_microfacet.bsl.hh.

References abs, BSDF_ROUGHNESS_THRESHOLD, bxdf_ggx_D(), bxdf_ggx_sample_refraction(), bxdf_ggx_sample_vndf(), D, BsdfSample::direction, dot(), BsdfSample::pdf, refract(), saturate, square(), Thickness::value(), and float3::z.

Referenced by bxdf_ggx_sample_refraction(), eevee::lut::GGXBsdfClosure::eval(), eevee::lut::GGXBtdfGt1Closure::eval(), and eevee::ray_generate_direction().

◆ bxdf_ggx_sample_vndf()

float3 bxdf_ggx_sample_vndf ( float3 rand,
float3 Vt,
float alpha,
float & G_V )

◆ bxdf_ggx_smith_G1()

float bxdf_ggx_smith_G1 ( float NX,
float a2 )