1
0
mirror of https://git.dev.opencascade.org/repos/occt.git synced 2025-08-09 13:22:24 +03:00

0032198: Visualization, TKOpenGl - per-vertex lighting ignores back/front material colors

Graphic3d_ShaderManager::stdComputeLighting() now multiplies vertex color by material color.
This commit is contained in:
kgv
2021-03-06 03:22:05 +03:00
committed by bugmaster
parent 941f6cae55
commit 61a05a3658
7 changed files with 107 additions and 18 deletions

View File

@@ -3014,7 +3014,7 @@ static int VDrawSphere (Draw_Interpretor& /*di*/, Standard_Integer argc, const c
aMat.SetSpecularColor(Quantity_Color (Graphic3d_Vec3 (0.50f)));
Handle(Graphic3d_AspectFillArea3d) anAspect
= new Graphic3d_AspectFillArea3d (Aspect_IS_SOLID,
Quantity_NOC_RED,
Quantity_NOC_WHITE,
Quantity_NOC_YELLOW,
Aspect_TOL_SOLID,
1.0,
@@ -3438,6 +3438,17 @@ Standard_Boolean MyPArrayObject::Init (Graphic3d_TypeOfPrimitiveArray thePrimTyp
if (myPArray.IsNull())
{
myPArray = Graphic3d_ArrayOfPrimitives::CreateArray (thePrimType, aVertexNum, aBoundNum, aEdgeNum, anArrayFlags);
if (myPArray->HasVertexColors())
{
myDrawer->SetupOwnShadingAspect();
Graphic3d_MaterialAspect aMat (Graphic3d_NameOfMaterial_Plastified);
aMat.SetSpecularColor (Quantity_NOC_BLACK);
aMat.SetEmissiveColor (Quantity_NOC_BLACK);
aMat.SetAmbientColor (Quantity_Color (Graphic3d_Vec3 (0.5f)));
aMat.SetDiffuseColor (Quantity_Color (Graphic3d_Vec3 (0.5f)));
myDrawer->ShadingAspect()->SetMaterial (aMat);
myDrawer->ShadingAspect()->SetColor (Quantity_NOC_WHITE);
}
}
else
{