From 129b5282ef35f320ea39d1878d2b5f77ae73a3e2 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Tue, 29 May 2012 14:36:59 -0700 Subject: Fixed authortime & runtime for twist vertex shader. --- js/lib/geom/geom-obj.js | 1 + js/lib/rdge/materials/twist-vert-material.js | 24 ++++++++++++++++++++++-- 2 files changed, 23 insertions(+), 2 deletions(-) (limited to 'js/lib') diff --git a/js/lib/geom/geom-obj.js b/js/lib/geom/geom-obj.js index 6b73463f..417c8731 100755 --- a/js/lib/geom/geom-obj.js +++ b/js/lib/geom/geom-obj.js @@ -388,6 +388,7 @@ exports.GeomObj = Object.create(Object.prototype, { case "keleidoscope": case "radialBlur": case "pulse": + case "twistVert": mat = MaterialsModel.getMaterialByShader(shaderName); if (mat) mat = mat.dup(); break; diff --git a/js/lib/rdge/materials/twist-vert-material.js b/js/lib/rdge/materials/twist-vert-material.js index 4d5ab88d..cc232444 100644 --- a/js/lib/rdge/materials/twist-vert-material.js +++ b/js/lib/rdge/materials/twist-vert-material.js @@ -125,8 +125,17 @@ var TwistVertMaterial = function TwistVertMaterial() this.exportJSON = function () { var jObj = { - 'material': this.getShaderName(), - 'name': this.getName(), + 'material' : this.getShaderName(), + 'name' : this.getName(), + + 'tex0' : this._propValues[this._propNames[4]], + 'tex1' : this._propValues[this._propNames[5]], + + 'speed' : this._propValues[this._propNames[3]], + + 'limit1' : this._propValues[this._propNames[0]], + 'limit2' : this._propValues[this._propNames[1]], + 'angle' : this._propValues[this._propNames[2]] } return jObj; @@ -137,6 +146,17 @@ var TwistVertMaterial = function TwistVertMaterial() this.setName(jObj.name); try { + + this._propValues[this._propNames[4]] = jObj.tex0; + this._propValues[this._propNames[5]] = jObj.tex1; + + this._propValues[this._propNames[3]] = jObj.speed; + + this._propValues[this._propNames[0]] = jObj.limit1; + this._propValues[this._propNames[1]] = jObj.limit2; + this._propValues[this._propNames[2]] = jObj.angle; + + this.updateShaderValues(); } catch (e) { throw new Error("could not import material: " + importStr); -- cgit v1.2.3