aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge
diff options
context:
space:
mode:
authorhwc4872012-06-13 15:50:04 -0700
committerhwc4872012-06-13 15:50:04 -0700
commit13e2155e043990170a05f57bf7aad63d23120ecf (patch)
tree7b1f218ed296cf332564bb1d461ff3c449e2b68d /js/lib/rdge
parent544aa96828cd77276566f6911cab63aeb4aff3da (diff)
downloadninja-13e2155e043990170a05f57bf7aad63d23120ecf.tar.gz
Fixes for runtime Taper material
Diffstat (limited to 'js/lib/rdge')
-rw-r--r--js/lib/rdge/materials/taper-material.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/js/lib/rdge/materials/taper-material.js b/js/lib/rdge/materials/taper-material.js
index a44314b6..0ae039f7 100644
--- a/js/lib/rdge/materials/taper-material.js
+++ b/js/lib/rdge/materials/taper-material.js
@@ -32,6 +32,7 @@ var TaperMaterial = function TaperMaterial()
32 32
33 this.isAnimated = function () { return true; }; 33 this.isAnimated = function () { return true; };
34 this.getShaderDef = function() { return taperShaderDef; }; 34 this.getShaderDef = function() { return taperShaderDef; };
35 this.getTechniqueName = function() { return 'colorMe' };
35 36
36 this.hasVertexDeformation = function () { return this._hasVertexDeformation; }; 37 this.hasVertexDeformation = function () { return this._hasVertexDeformation; };
37 this._hasVertexDeformation = true; 38 this._hasVertexDeformation = true;
@@ -50,12 +51,12 @@ var TaperMaterial = function TaperMaterial()
50 51
51 // set up the material node 52 // set up the material node
52 this._materialNode = RDGE.createMaterialNode("taperMaterial" + "_" + world.generateUniqueNodeID()); 53 this._materialNode = RDGE.createMaterialNode("taperMaterial" + "_" + world.generateUniqueNodeID());
54 this._materialNode.setShader(this._shader);
53 55
54 this._time = 0; 56 this._time = 0;
55 if (this._shader && this._shader['default']) { 57 if (this._shader && this._shader['default']) {
56 this._shader['default'].u_time.set([this._time]); 58 this._shader['default'].u_time.set([this._time]);
57 } 59 }
58 this._materialNode.setShader(this._shader);
59 60
60 // initialize the taper properties 61 // initialize the taper properties
61 this.setShaderValues(); 62 this.setShaderValues();
@@ -133,7 +134,8 @@ taperShaderDef = {
133 'u_minVal': { 'type': 'float' }, 134 'u_minVal': { 'type': 'float' },
134 'u_maxVal': { 'type': 'float' }, 135 'u_maxVal': { 'type': 'float' },
135 'u_center': { 'type': 'float' }, 136 'u_center': { 'type': 'float' },
136 'u_taperAmount': { 'type': 'float' } 137 'u_taperAmount': { 'type': 'float' },
138 'u_speed': { 'type': 'float' }
137 } 139 }
138 } 140 }
139 ] 141 ]