Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/boksajak/brdf
/ functions
Functions
67 in github.com/boksajak/brdf
⨍
Functions
67
◇
Types & classes
2
↓ 5 callers
Function
Smith_G_a
Function to calculate 'a' parameter for lambda functions needed in Smith G term This is a version for shape invariant (isotropic) NDFs Note: makse sur
brdf.h:602
↓ 5 callers
Function
saturate
brdf.h:28
↓ 4 callers
Function
Smith_G2
Evaluates G2 for selected configuration (GGX/Beckmann, optimized/non-optimized, separable/height-correlated) Note that some paths aren't optimized too
brdf.h:712
↓ 4 callers
Function
evalFresnel
brdf.h:425
↓ 4 callers
Function
mul
brdf.h:29
↓ 4 callers
Function
shadowedF90
Attenuates F90 for very low F0 values Source: "An efficient and Physically Plausible Real-Time Shading Model" in ShaderX7 by Schuler Also see section
brdf.h:436
↓ 3 callers
Function
beckmannAlphaToShininess
Converts Beckmann roughness (alpha) to Phong's exponent (shininess) Source: "Microfacet Models for Refraction through Rough Surfaces" by Walter et al.
brdf.h:278
↓ 3 callers
Function
prepareBRDFData
Precalculates commonly used terms in BRDF evaluation Clamps around dot products prevent NaNs and ensure numerical stability, but make sure to correctl
brdf.h:940
↓ 3 callers
Function
rotatePoint
Optimized point rotation using quaternion Source: https://gamedev.stackexchange.com/questions/28395/rotating-vector3-by-a-quaternion
brdf.h:361
↓ 2 callers
Function
Smith_G1_GGX
Smith G1 term (masking function) optimized for GGX distribution (by substituting G_Lambda_GGX into G1)
brdf.h:631
↓ 2 callers
Function
luminance
brdf.h:288
↓ 2 callers
Function
phongNormalizationTerm
For derivation see "Phong Normalization Factor derivation" by Giesen
brdf.h:461
↓ 2 callers
Function
rsqrt
brdf.h:27
↓ 1 callers
Function
GGX_D
brdf.h:744
↓ 1 callers
Function
Smith_G2_Height_Correlated
Smith G2 term (masking-shadowing function) Height correlated version - non-optimized, uses G_Lambda functions for selected NDF
brdf.h:665
↓ 1 callers
Function
Smith_G2_Height_Correlated_GGX_Lagarde
Smith G2 term (masking-shadowing function) for GGX distribution Height correlated version - optimized by substituing G_Lambda for G_Lambda_GGX and div
brdf.h:687
↓ 1 callers
Function
Smith_G2_Over_G1_Height_Correlated
A fraction G2/G1 where G2 is height correlated can be expressed using only G1 terms Source: "Implementing a Simple Anisotropic Rough Diffuse Material
brdf.h:703
↓ 1 callers
Function
Smith_G2_Separable
Smith G2 term (masking-shadowing function) Separable version assuming independent (uncorrelated) masking and shadowing, uses G1 functions for selected
brdf.h:657
↓ 1 callers
Function
Smith_G2_Separable_GGX_Lagarde
Smith G2 term (masking-shadowing function) for GGX distribution Separable version assuming independent (uncorrelated) masking and shadowing - optimize
brdf.h:676
↓ 1 callers
Function
baseColorToDiffuseReflectance
brdf.h:302
↓ 1 callers
Function
baseColorToSpecularF0
brdf.h:293
↓ 1 callers
Function
beckmannAlphaToOrenNayarRoughness
Converts Beckmann roughness (alpha) to Oren-Nayar roughness (sigma) Source: "Moving Frostbite to Physically Based Rendering" by Lagarde & de Rousiers
brdf.h:284
↓ 1 callers
Function
disneyDiffuse
Disney's diffuse term Source "Physically-Based Shading at Disney" by Burley
brdf.h:563
↓ 1 callers
Function
evalFresnelSchlick
Schlick's approximation to Fresnel term f90 should be 1.0, except for the trick used by Schuler (see 'shadowedF90' function)
brdf.h:403
↓ 1 callers
Function
frostbiteDisneyDiffuse
Frostbite's version of Disney diffuse with energy normalization. Source: "Moving Frostbite to Physically Based Rendering" by Lagarde & de Rousiers
brdf.h:579
↓ 1 callers
Function
getRotationFromZAxis
Calculates rotation quaternion from vector (0, 0, 1) to the input vector Input vector must be normalized!
brdf.h:345
↓ 1 callers
Function
getRotationToZAxis
Calculates rotation quaternion from input vector to the vector (0, 0, 1) Input vector must be normalized!
brdf.h:335
↓ 1 callers
Function
invertRotation
Returns the quaternion with inverted rotation
brdf.h:354
↓ 1 callers
Function
orenNayar
Based on Oren-Nayar's qualitative model Source: "Generalization of Lambert's Reflectance Model" by Oren & Nayar
brdf.h:530
↓ 1 callers
Function
sampleHemisphere
Samples a direction within a hemisphere oriented along +Z axis with a cosine-weighted distribution Source: "Sampling Transformations Zoo" in Ray Traci
brdf.h:372
↓ 1 callers
Function
samplePhong
Samples a Phong distribution lobe oriented along +Z axis Source: "Sampling Transformations Zoo" in Ray Tracing Gems by Shirley et al.
brdf.h:477
Function
Beckmann_D
brdf.h:736
Function
Smith_G1_Beckmann_Walter
Smith G1 term (masking function) optimized for Beckmann distribution (by substituting G_Lambda_Beckmann_Walter into G1) Source: "Microfacet Models for
brdf.h:643
Function
Smith_G1_General
Smith G1 term (masking function) This non-optimized version uses NDF specific lambda function (G_Lambda) resolved bia macro based on selected NDF
brdf.h:626
Function
Smith_G2_Height_Correlated_GGX_Hammon
Smith G2 term (masking-shadowing function) for GGX distribution Height correlated version - approximation by Hammon Source: "PBR Diffuse Lighting for
brdf.h:697
Function
Smith_G_Lambda_Beckmann_Walter
Lambda function for Smith G term derived for Beckmann distribution This is Walter's rational approximation (avoids evaluating of error function) Sourc
brdf.h:615
Function
Smith_G_Lambda_GGX
Lambda function for Smith G term derived for GGX distribution
brdf.h:607
Function
diffusePdf
For sampling of all our diffuse BRDFs we use cosine-weighted hemisphere sampling, with PDF equal to (NdotL/PI)
brdf.h:393
Function
evalCombinedBRDF
This is an entry point for evaluation of all other BRDFs based on selected configuration (for direct light)
brdf.h:978
Function
evalDisneyDiffuse
brdf.h:573
Function
evalFresnelHoffman
Schlick's approximation to Fresnel term with Hoffman's improvement using the Lazanyi's error term Source: "Fresnel Equations Considered Harmful" by Ho
brdf.h:418
Function
evalFresnelSchlickSphericalGaussian
Schlick's approximation to Fresnel term calculated using spherical gaussian approximation Source: https://seblagarde.wordpress.com/2012/06/03/spherica
brdf.h:410
Function
evalFrostbiteDisneyDiffuse
brdf.h:591
Function
evalIndirectCombinedBRDF
This is an entry point for evaluation of all other BRDFs based on selected configuration (for indirect light)
brdf.h:1000
Function
evalIndirectVoid
brdf.h:315
Function
evalLambertian
brdf.h:452
Function
evalMicrofacet
Evaluates microfacet specular BRDF
brdf.h:920
Function
evalOrenNayar
brdf.h:553
Function
evalPhong
brdf.h:466
Function
evalVoid
brdf.h:311
Function
lambertian
brdf.h:448
Function
none
brdf.h:307
Function
sampleBeckmannWalter
Samples a microfacet normal for the Beckmann distribution using walter's method. Source: "Microfacet Models for Refraction through Rough Surfaces" by
brdf.h:831
Function
sampleGGXVNDF
Samples a microfacet normal for the GGX distribution using VNDF method. Source: "Sampling the GGX Distribution of Visible Normals" by Heitz Source: "S
brdf.h:758
Function
sampleGGXVNDFReflectionPdf
PDF of sampling a reflection vector L using 'sampleGGXVNDF'. Note that PDF of sampling given microfacet normal is (G1 * D) when vectors are in local s
brdf.h:807
Function
sampleGGXWalter
Samples a microfacet normal for the GG-X distribution using walter's method. Source: "Microfacet Models for Refraction through Rough Surfaces" by Walt
brdf.h:849
Function
sampleSpecularHalfVectorVoid
brdf.h:325
Function
sampleSpecularMicrofacet
Samples a reflection ray from the rough surface using selected microfacet distribution and sampling method Resulting weight includes multiplication by
brdf.h:888
Function
sampleSpecularPhong
Sampling the specular BRDF based on Phong, includes normalization term
brdf.h:499
Function
sampleSpecularVoid
brdf.h:320
Function
sampleWalterReflectionPdf
PDF of sampling a reflection vector L using 'sampleBeckmannWalter' or 'sampleGGXWalter'. Note that PDF of sampling given microfacet normal is (D * Ndo
brdf.h:822
Function
shininessToBeckmannAlpha
Converts Phong's exponent (shininess) to Beckmann roughness (alpha) Source: "Microfacet Models for Refraction through Rough Surfaces" by Walter et al.
brdf.h:272
Function
specularGGXReflectanceApprox
Approximates the directional-hemispherical reflectance of the micriofacet specular BRDF with GG-X distribution Source: "Accurate Real-Time Specular Re
brdf.h:1062
Function
specularSampleWeightBeckmannWalter
Weight for the reflection ray sampled from Beckmann distribution using Walter's method
brdf.h:873
Function
specularSampleWeightGGXVNDF
Weight for the reflection ray sampled from GGX distribution using VNDF method
brdf.h:864
Function
specularSampleWeightGGXWalter
Weight for the reflection ray sampled from GGX distribution using Walter's method
brdf.h:878
Function
waltersTrick
"Walter's trick" is an adjustment of alpha value for Walter's sampling to reduce maximal weight of sample to about 4 Source: "Microfacet Models for Re
brdf.h:815