diff --git a/72d6a2a3kc.js b/72d6a2a3kc.js index a859946..a99de4d 100644 --- a/72d6a2a3kc.js +++ b/72d6a2a3kc.js @@ -208,7 +208,9 @@ if (this.mouseIsDown) { } else { mesh.instance.material.color.sub(this.toBlack); if (mesh.instance.material.color.r <= 0) { - mesh.instance.material.emissive.add(this.toRed); + if (mesh.instance.material.emissive) { + mesh.instance.material.emissive.add(this.toRed); + } } } @@ -217,6 +219,25 @@ if (this.mouseIsDown) { ); } else { + + this.scene.meshes.map( + function(mesh) { + if (mesh.instance.material instanceof Array) { + mesh.instance.material.map( + function(material) { + if (material.emissive) { + material.emissive.sub(this.toRed); + } + } + ); + } else { + if (mesh.instance.material.emissive) { + mesh.instance.material.emissive.sub(this.toRed); + } + } + } + ); + this.renderer.clearColor.r -= 0.01; if (this.renderer.clearColor.r < 0) { this.renderer.clearColor.r = 0;