Skip to content

Commit c520f25

Browse files
committed
Change material properties to avoid transparency with new models
1 parent ecebb0c commit c520f25

1 file changed

Lines changed: 10 additions & 1 deletion

File tree

api/material.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ export const flockMaterial = {
229229

230230
const replaceIfPBRMaterial = (targetMesh) => {
231231
const material = targetMesh.material;
232-
232+
233233
if (material && material.getClassName() === "PBRMaterial") {
234234
if (!replacedMaterialsMap.has(material)) {
235235
// Replace with a cloned default material, preserving the name
@@ -239,8 +239,17 @@ export const flockMaterial = {
239239
}
240240

241241
// Assign the replaced material to the mesh
242+
targetMesh.material = replacedMaterialsMap.get(material);
243+
242244
targetMesh.material = replacedMaterialsMap.get(material);
243245
targetMesh.backFaceCulling = false;
246+
targetMesh.material.alpha = 1;
247+
targetMesh.material.transparencyMode = flock.BABYLON.Material.MATERIAL_OPAQUE;
248+
// targetMesh.material.alphaMode = undefined;
249+
//targetMesh.material.reflectionTexture = null;
250+
targetMesh.material.needDepthPrePass = false;
251+
targetMesh.material.specularColor = new flock.BABYLON.Color3(0, 0, 0);
252+
244253
}
245254
};
246255

0 commit comments

Comments
 (0)