mirror of
https://git.dev.opencascade.org/repos/occt.git
synced 2025-09-13 14:27:08 +03:00
Metallic-Roughness shading model Graphic3d_TOSM_PBR has been implemented. New materials descriptors Graphic3d_PBRMaterial have been added to Graphic3d_MaterialAspect. PBR shading model requires OpenGL 3.0+ or OpenGL ES 3.0+ hardware. Environment cubemap is expected to be provided for realistic look of metallic materials. occLight_IsHeadlight() now returns bool instead of int. Avoid using lowp for enumerations to workaround occLight_IsHeadlight() ignorance on Adreno 308 caused by some GLSL optimizator bugs. OpenGl_Texture::EstimatedDataSize() - fixed estimation for Cubemap textures. OpenGl_Sampler::applySamplerParams() - fixed uninitialized GL_TEXTURE_WRAP_R in case of GL_TEXTURE_CUBE_MAP target.
14 lines
354 B
GLSL
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;
|
|
}
|