1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-19 13:40:49 +03:00

0028738: Data Exchange, XCAFPrs_Style - add transparency property

Use Quantity_ColorRGBA as surface color to store a transparency in XCAFPrs_Style.
This commit is contained in:
akz
2017-05-11 13:52:18 +03:00
committed by bugmaster
parent 46710942db
commit a71a71de09
15 changed files with 145 additions and 60 deletions

View File

@@ -341,8 +341,8 @@ OpenGl_RaytraceMaterial OpenGl_View::convertMaterial (const OpenGl_AspectFace*
const Graphic3d_MaterialAspect& aSrcMat = theAspect->Aspect()->FrontMaterial();
const OpenGl_Vec3& aMatCol = theAspect->Aspect()->InteriorColor();
const bool isPhysic = aSrcMat.MaterialType (Graphic3d_MATERIAL_PHYSIC);
const float aShine = 128.0f * float(aSrcMat.Shininess());
const bool isPhysic = aSrcMat.MaterialType (Graphic3d_MATERIAL_PHYSIC) == Standard_True;
// ambient component
if (aSrcMat.ReflectionMode (Graphic3d_TOR_AMBIENT))
@@ -399,8 +399,7 @@ OpenGl_RaytraceMaterial OpenGl_View::convertMaterial (const OpenGl_AspectFace*
}
const float anIndex = (float )aSrcMat.RefractionIndex();
theMaterial.Transparency = BVH_Vec4f (1.0f - (float )aSrcMat.Transparency(),
(float )aSrcMat.Transparency(),
theMaterial.Transparency = BVH_Vec4f (aSrcMat.Alpha(), aSrcMat.Transparency(),
anIndex == 0 ? 1.0f : anIndex,
anIndex == 0 ? 1.0f : 1.0f / anIndex);