Skip to content

Commit

Permalink
fixed transparency duplication bug (google#2267)
Browse files Browse the repository at this point in the history
  • Loading branch information
elalish authored Apr 8, 2021
1 parent d69724f commit 5ba2844
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,8 @@ export class ModelViewerGLTFInstance extends GLTFInstance {
const duplicateMaterial = Array.isArray(mesh.material) ?
duplicateMaterials :
duplicateMaterials[0];
const meshBack = new Mesh(mesh.geometry, duplicateMaterial);
const meshBack = mesh.clone() as Mesh;
meshBack.material = duplicateMaterial;
meshBack.renderOrder = -1;
mesh.add(meshBack);
}
Expand Down

0 comments on commit 5ba2844

Please sign in to comment.