1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-14 13:30:48 +03:00

0031284: Visualization - XCAFDoc_VisMaterialPBR lacks Index of Refraction

Added missing parameter.
This commit is contained in:
kgv
2019-12-27 14:24:58 +03:00
committed by bugmaster
parent 89d855ba58
commit 0858125fd4
9 changed files with 124 additions and 12 deletions

View File

@@ -204,10 +204,25 @@ Graphic3d_BSDF Graphic3d_BSDF::CreateMetallicRoughness (const Graphic3d_PBRMater
const Standard_ShortReal aRougness2 = thePbr.NormalizedRoughness() * thePbr.NormalizedRoughness();
Graphic3d_BSDF aBsdf;
aBsdf.FresnelBase = Graphic3d_Fresnel::CreateSchlick (aDiff * thePbr.Metallic());
aBsdf.Ks.SetValues (Graphic3d_Vec3 (thePbr.Alpha()), aRougness2);
aBsdf.Kt = Graphic3d_Vec3 (1.0f - thePbr.Alpha());
aBsdf.Kd = aDiff * (1.0f - thePbr.Metallic());
aBsdf.Le = thePbr.Emission();
if (thePbr.IOR() > 1.0f
&& thePbr.Alpha() < 1.0f
&& thePbr.Metallic() <= ShortRealEpsilon())
{
aBsdf.FresnelCoat = Graphic3d_Fresnel::CreateDielectric (thePbr.IOR());
aBsdf.Kt = Graphic3d_Vec3(1.0f);
aBsdf.Kc.r() = aBsdf.Kt.r();
aBsdf.Kc.g() = aBsdf.Kt.g();
aBsdf.Kc.b() = aBsdf.Kt.b();
aBsdf.Absorption.SetValues (thePbr.Color().GetRGB(), thePbr.Alpha() * 0.25f);
}
else
{
aBsdf.FresnelBase = Graphic3d_Fresnel::CreateSchlick (aDiff * thePbr.Metallic());
aBsdf.Ks.SetValues (Graphic3d_Vec3 (thePbr.Alpha()), aRougness2);
aBsdf.Kt = Graphic3d_Vec3 (1.0f - thePbr.Alpha());
aBsdf.Kd = aDiff * (1.0f - thePbr.Metallic());
}
return aBsdf;
}