Skip to content

Commit 2433a7a

Browse files
authored
better colors for MeshPhysicalMaterial (#126)
1 parent 874b3fe commit 2433a7a

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

src/buildingpart.js

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,13 @@ class BuildingPart {
458458
}
459459
const material = BuildingPart.getBaseMaterial(materialName);
460460
if (color !== '') {
461-
material.color = new Color(color);
461+
if (material instanceof MeshPhysicalMaterial) {
462+
material.emissive = new Color(color);
463+
material.emissiveIntensity = 0.5;
464+
material.roughness = 0.5;
465+
} else {
466+
material.color = new Color(color);
467+
}
462468
} else if (materialName === ''){
463469
material.color = new Color('white');
464470
}
@@ -488,7 +494,11 @@ class BuildingPart {
488494
material = BuildingPart.getBaseMaterial(materialName);
489495
}
490496
if (color !== '') {
491-
material.color = new Color(color);
497+
if (material instanceof MeshPhysicalMaterial) {
498+
material.emissive = new Color(color);
499+
} else {
500+
material.color = new Color(color);
501+
}
492502
}
493503
return material;
494504
}

0 commit comments

Comments
 (0)