Update: CC - Before Render - Moorcow (72d6a2a3kc.js) 434 bytes modified

beta.r3js.org
-=yb4f310 2017-11-14 09:29:46 +01:00
parent 55e52a2d03
commit 1c47297f86
1 changed files with 22 additions and 1 deletions

View File

@ -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;