How to set up Black color model with Graphic3d_MaterialAspect?

I have been playing around with Ambient, Diffuse, Specular and Emissive color... Whatever I set up I just can not have pure Black color.
Why I get Blue color If I set everything to 0.0?
Same If I turn all lights off.
Same If I have Graphic3d_MATERIAL_ASPECT

        Handle(myDataSource) aDS = new myDataSource();
        //create mesh
        Handle(MeshVS_Mesh) aMesh = new MeshVS_Mesh();
        aMesh->SetDataSource(aDS);

        //use builder
        Handle(MeshVS_MeshPrsBuilder) aBuilder = new MeshVS_MeshPrsBuilder(aMesh);
        Handle(MeshVS_Drawer) myCurrentDrawer = aMesh->GetDrawer();
        
        Graphic3d_MaterialAspect anAspects;

        anAspects.SetAmbientColor(Quantity_Color(0.0, 0.0, 0.0, Quantity_TOC_RGB));
        anAspects.SetDiffuseColor(Quantity_Color(0.0, 0.0, 0.0, Quantity_TOC_RGB));
        anAspects.SetSpecularColor(Quantity_Color(0.0, 0.0, 0.0, Quantity_TOC_RGB));
        anAspects.SetEmissiveColor(Quantity_Color(0.0, 0.0, 0.0, Quantity_TOC_RGB));

        /*
        // anAspects.SetAmbientColor(Quantity_Color(0.180000, 0.060000, 0.060000, Quantity_TOC_RGB));
        // anAspects.SetDiffuseColor(Quantity_Color(0.878431, 0.560784, 0.341176, Quantity_TOC_RGB));
        // anAspects.SetSpecularColor(Quantity_Color(0.0720000, 0.0720000, 0.0720000, Quantity_TOC_RGB));
        // anAspects.SetEmissiveColor(Quantity_Color(0.320000, 0.320000, 0.320000, Quantity_TOC_RGB));
        */

        anAspects.SetMaterialType(Graphic3d_MATERIAL_PHYSIC);
        anAspects.SetShininess(0.10);
        anAspects.ReflectionMode(Graphic3d_TOR_SPECULAR);
        myCurrentDrawer->SetMaterial(MeshVS_DA_FrontMaterial, anAspects);
        //myCurrentDrawer->SetMaterial(MeshVS_DA_BackMaterial, anAspects);

        aMesh->SetDisplayMode(MeshVS_DMF_Shading);
        aMesh->GetDrawer()->SetBoolean(MeshVS_DA_InteriorColor, Standard_False); //MeshVS_DrawerAttribute
        aMesh->GetDrawer()->SetBoolean(MeshVS_DA_Reflection, Standard_True); //MeshVS_DrawerAttribute
        aMesh->GetDrawer()->SetBoolean(MeshVS_DA_SmoothShading, Standard_True); //MeshVS_DrawerAttribute
        aMesh->GetDrawer()->SetBoolean(MeshVS_DA_ShowEdges, Standard_False);
        aMesh->GetDrawer()->SetBoolean(MeshVS_DA_DisplayNodes, Standard_False);

        aMesh->SetDrawer(myCurrentDrawer);
        aMesh->AddBuilder(aBuilder, Standard_True);
        myAISContext->SetDisplayMode(aMesh, MeshVS_DMF_Shading, Standard_False);
        myAISContext->Display(aMesh, Standard_True);
        Fit();
David Toth's picture

If I set Deffuse to 0,0,0 I have Blue model. If I set 0.001, 0.001, 0.001 I have almost Black - but now If I turn lights Off I get 100 percent Black
Strange...
Do you guys know why Diffuse can not be 0, 0, 0?

David Toth's picture

        anAspects.SetAmbientColor(Quantity_Color(0.0, 0.0, 0.0, Quantity_TOC_RGB));
        anAspects.SetDiffuseColor(Quantity_Color(0.0, 0.0, 0.0, Quantity_TOC_RGB));
        anAspects.SetSpecularColor(Quantity_Color(0.0, 0.0, 0.0, Quantity_TOC_RGB));
        anAspects.SetEmissiveColor(Quantity_Color(1.0, 0.0, 0.0, Quantity_TOC_RGB));

One more question: Is that normal If I have red emissive my model will be red even with lights off?
Because my problem is that in this case Emissive is like a base color regardless of any lights are specified or not.

But this is maybe just my lack of knowledge in OpenGL basics and this behaviour is just fine...

Kirill Gavrilov's picture

Emission component is not a base color - it is a color that object "emits" itself regardless of external lighting (simulating a "fake" light).