aShapeAttribs.RawName = theMeshName;
// assign material and not color
- // aShapeAttribs.Style.SetColorSurf (aMeshData->BaseColor());
- aShapeAttribs.Style.SetMaterial(aMat);
-
+ if (aMode == RWGltf_GltfPrimitiveMode_Lines)
+ {
+ aShapeAttribs.Style.SetColorCurv(aMeshData->BaseColor().GetRGB());
+ }
+ else
+ {
+ aShapeAttribs.Style.SetMaterial(aMat);
+ }
myAttribMap->Bind(aShape, aShapeAttribs);
}
myShapeMap[ShapeMapGroup_PrimArray].Bind(aPrimArrayId, aShape);
{
aShapeAttribs.RawName = theId;
}
- if (theShape.ShapeType() == TopAbs_FACE)
+ if (theShape.ShapeType() == TopAbs_FACE || theShape.ShapeType() == TopAbs_EDGE
+ || theShape.ShapeType() == TopAbs_VERTEX)
{
RWMesh_NodeAttributes aFaceAttribs;
if (myAttribMap->Find(aShape, aFaceAttribs))
{
aShapeAttribs.Style.SetMaterial(aFaceAttribs.Style.Material());
+ if (aFaceAttribs.Style.IsSetColorCurv())
+ {
+ aShapeAttribs.Style.SetColorCurv(aFaceAttribs.Style.GetColorCurv());
+ }
+ if (aFaceAttribs.Style.IsSetColorSurf())
+ {
+ aShapeAttribs.Style.SetColorSurf(aFaceAttribs.Style.GetColorSurf());
+ }
if (aShapeAttribs.Name.IsEmpty() && myUseMeshNameAsFallback)
{
// fallback using Mesh name
aComMat.IsDefined = true;
aComMat.DiffuseTexture = myPbrMat.BaseColorTexture;
aComMat.DiffuseColor = myPbrMat.BaseColor.GetRGB();
- aComMat.SpecularColor = Quantity_Color(Graphic3d_Vec3(myPbrMat.Metallic));
+ aComMat.SpecularColor = Quantity_Color(myPbrMat.BaseColor.GetRGB().Rgb() * myPbrMat.Metallic);
aComMat.Transparency = 1.0f - myPbrMat.BaseColor.Alpha();
aComMat.Shininess = 1.0f - myPbrMat.Roughness;
if (myPbrMat.EmissiveTexture.IsNull())
theAspect = Graphic3d_MaterialAspect(Graphic3d_NameOfMaterial_UserDefined);
theAspect.SetDiffuseColor(myPbrMat.BaseColor.GetRGB());
theAspect.SetAlpha(myPbrMat.BaseColor.Alpha());
- theAspect.SetSpecularColor(Quantity_Color(Graphic3d_Vec3(myPbrMat.Metallic)));
+ theAspect.SetSpecularColor(
+ Quantity_Color(myPbrMat.BaseColor.GetRGB().Rgb() * myPbrMat.Metallic));
theAspect.SetShininess(1.0f - myPbrMat.Roughness);
if (theAspect.Shininess() < 0.01f)
{