projects
/
occt.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
blame
|
history
|
raw
|
HEAD
0030700: Visualization, TKOpenGl - support PBR Metallic-Roughness shading model
[occt.git]
/
src
/
Shaders
/
PBRGeometry.glsl
1
//! Calculates geometry factor for Cook-Torrance BRDF.
2
float occPBRGeometry (in float theCosV,
3
in float theCosL,
4
in float theRoughness)
5
{
6
float k = theRoughness + 1.0;
7
k *= 0.125 * k;
8
float g1 = 1.0;
9
g1 /= theCosV * (1.0 - k) + k;
10
float g2 = 1.0;
11
g2 /= theCosL * (1.0 - k) + k;
12
return g1 * g2;
13
}