1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-04-01 17:36:21 +03:00
occt/resources/Shaders/PBRGeometry.glsl
Pasukhin Dmitry df4b931988
Configuration - Resource structure reorganization #429
Reorganized resources to keep source part in src and real-time scripts in resource folder.
For the installation result no changes, still installed to src for windows.
2025-03-18 22:54:43 +00:00

14 lines
354 B
GLSL

//! Calculates geometry factor for Cook-Torrance BRDF.
float occPBRGeometry (in float theCosV,
in float theCosL,
in float theRoughness)
{
float k = theRoughness + 1.0;
k *= 0.125 * k;
float g1 = 1.0;
g1 /= theCosV * (1.0 - k) + k;
float g2 = 1.0;
g2 /= theCosL * (1.0 - k) + k;
return g1 * g2;
}