aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/taper-material.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/materials/taper-material.js')
-rw-r--r--js/lib/rdge/materials/taper-material.js60
1 files changed, 30 insertions, 30 deletions
diff --git a/js/lib/rdge/materials/taper-material.js b/js/lib/rdge/materials/taper-material.js
index b4ff07d3..bf5236fd 100644
--- a/js/lib/rdge/materials/taper-material.js
+++ b/js/lib/rdge/materials/taper-material.js
@@ -38,7 +38,7 @@ var Texture = require("js/lib/rdge/texture").Texture;
38var TaperMaterial = function TaperMaterial() 38var TaperMaterial = function TaperMaterial()
39{ 39{
40 // initialize the inherited members 40 // initialize the inherited members
41 this.inheritedFrom = Material; 41 this.inheritedFrom = Material;
42 this.inheritedFrom(); 42 this.inheritedFrom();
43 43
44 /////////////////////////////////////////////////////////////////////// 44 ///////////////////////////////////////////////////////////////////////
@@ -55,8 +55,8 @@ var TaperMaterial = function TaperMaterial()
55 this.getShaderName = function () { return this._shaderName; }; 55 this.getShaderName = function () { return this._shaderName; };
56 56
57 this.isAnimated = function () { return true; }; 57 this.isAnimated = function () { return true; };
58 this.getShaderDef = function() { return taperShaderDef; }; 58 this.getShaderDef = function() { return taperShaderDef; };
59 this.getTechniqueName = function() { return 'colorMe' }; 59 this.getTechniqueName = function() { return 'colorMe' };
60 60
61 this.hasVertexDeformation = function () { return this._hasVertexDeformation; }; 61 this.hasVertexDeformation = function () { return this._hasVertexDeformation; };
62 this._hasVertexDeformation = true; 62 this._hasVertexDeformation = true;
@@ -78,7 +78,7 @@ var TaperMaterial = function TaperMaterial()
78 // set up the material node 78 // set up the material node
79 this._materialNode = RDGE.createMaterialNode("taperMaterial" + "_" + world.generateUniqueNodeID()); 79 this._materialNode = RDGE.createMaterialNode("taperMaterial" + "_" + world.generateUniqueNodeID());
80 this._materialNode.setShader(this._shader); 80 this._materialNode.setShader(this._shader);
81 81
82 this._time = 0; 82 this._time = 0;
83 if (this._shader && this._shader['default']) { 83 if (this._shader && this._shader['default']) {
84 this._shader['default'].u_time.set([this._time]); 84 this._shader['default'].u_time.set([this._time]);
@@ -99,7 +99,7 @@ var TaperMaterial = function TaperMaterial()
99 this._propValues[this._propNames[6]] = 0.9; 99 this._propValues[this._propNames[6]] = 0.9;
100 this._propValues[this._propNames[7]] = this._vertexDeformationTolerance; 100 this._propValues[this._propNames[7]] = this._vertexDeformationTolerance;
101 this._propValues[this._propNames[8]] = 1.0; 101 this._propValues[this._propNames[8]] = 1.0;
102 102
103 var nProps = this._propNames.length; 103 var nProps = this._propNames.length;
104 for (var i=0; i<nProps; i++) 104 for (var i=0; i<nProps; i++)
105 this.setProperty( this._propNames[i], this._propValues[this._propNames[i]] ); 105 this.setProperty( this._propNames[i], this._propValues[this._propNames[i]] );
@@ -137,7 +137,7 @@ var TaperMaterial = function TaperMaterial()
137 } 137 }
138 138
139 var t1 = this._propValues["u_limit1"] - this._deltaTime, 139 var t1 = this._propValues["u_limit1"] - this._deltaTime,
140 t2 = this._propValues["u_limit2"] - this._deltaTime; 140 t2 = this._propValues["u_limit2"] - this._deltaTime;
141 141
142 142
143 this._shader.colorMe["u_limit1"].set([t1]); 143 this._shader.colorMe["u_limit1"].set([t1]);
@@ -158,32 +158,32 @@ taperShaderDef = {
158 }, 158 },
159 'techniques': { // rendering control 159 'techniques': { // rendering control
160 'colorMe': [ // simple color pass 160 'colorMe': [ // simple color pass
161 { 161 {
162 'vshader': 'defaultVShader', 162 'vshader': 'defaultVShader',
163 'fshader': 'defaultFShader', 163 'fshader': 'defaultFShader',
164 164
165 // attributes 165 // attributes
166 'attributes': 166 'attributes':
167 { 167 {
168 'vert': { 'type': 'vec3' }, 168 'vert': { 'type': 'vec3' },
169 'normal': { 'type': 'vec3' }, 169 'normal': { 'type': 'vec3' },
170 'texcoord': { 'type': 'vec2' } 170 'texcoord': { 'type': 'vec2' }
171 }, 171 },
172 // attributes 172 // attributes
173 'params': 173 'params':
174 { 174 {
175 'u_limit1': { 'type': 'float' }, 175 'u_limit1': { 'type': 'float' },
176 'u_limit2': { 'type': 'float' }, 176 'u_limit2': { 'type': 'float' },
177 'u_limit3': { 'type': 'float' }, 177 'u_limit3': { 'type': 'float' },
178 'u_minVal': { 'type': 'float' }, 178 'u_minVal': { 'type': 'float' },
179 'u_maxVal': { 'type': 'float' }, 179 'u_maxVal': { 'type': 'float' },
180 'u_center': { 'type': 'float' }, 180 'u_center': { 'type': 'float' },
181 'u_taperAmount': { 'type': 'float' }, 181 'u_taperAmount': { 'type': 'float' },
182 'facettol': { 'type': 'float' }, 182 'facettol': { 'type': 'float' },
183 'u_speed': { 'type': 'float' } 183 'u_speed': { 'type': 'float' }
184 } 184 }
185 } 185 }
186 ] 186 ]
187 } 187 }
188}; 188};
189 189