From 812851b925bf3d7560ebcc10e51e509a08b69db6 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Fri, 15 Jun 2012 13:25:12 -0700 Subject: Fixed a problem with Uber shader where new values were getting clobbered by old values. --- js/lib/rdge/materials/uber-material.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/js/lib/rdge/materials/uber-material.js b/js/lib/rdge/materials/uber-material.js index 31a8756c..347e45d3 100755 --- a/js/lib/rdge/materials/uber-material.js +++ b/js/lib/rdge/materials/uber-material.js @@ -358,13 +358,14 @@ var UberMaterial = function UberMaterial() { newMat._useLights = this._useLights; newMat._useNormalMap = this._useNormalMap; newMat._useSpecularMap = this._useSpecularMap; - newMat.rebuildShader(); // copy over the current values; var n = propNames.length; for (var i = 0; i < n; i++) newMat.setProperty(propNames[i], propValues[i]); + newMat.rebuildShader(); + return newMat; }; -- cgit v1.2.3