From 1c47297f8624fe146892358bfed1e0b7d310f8c3 Mon Sep 17 00:00:00 2001 From: -=yb4f310 Date: Tue, 14 Nov 2017 09:29:46 +0100 Subject: [PATCH] Update: CC - Before Render - Moorcow (72d6a2a3kc.js) 434 bytes modified --- 72d6a2a3kc.js | 23 ++++++++++++++++++++++- 1 file changed, 22 insertions(+), 1 deletion(-) 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;