diff options
author | Valerio Virgillito | 2012-07-09 14:35:44 -0700 |
---|---|---|
committer | Valerio Virgillito | 2012-07-09 14:35:44 -0700 |
commit | 84b3327bd92faafab7954b5eb64c7abe24a3fe13 (patch) | |
tree | 3f56cbed2f08c5a81ea79eaf0bcb9bd031d8a627 /js/lib/rdge/materials/taper-material.js | |
parent | c0a42c56f768a873ba637f5b86d5f6a84d4a3312 (diff) | |
parent | 40c6eb2c06b34f65a74d59ef9687251952858bab (diff) | |
download | ninja-84b3327bd92faafab7954b5eb64c7abe24a3fe13.tar.gz |
Merge branch 'normalize' of https://github.com/kriskowal/ninja-internal
Conflicts:
js/components/gradientpicker.reel/gradientpicker.js
js/components/tools-properties/text-properties.reel/text-properties.js
js/document/views/base.js
js/document/views/design.js
js/helper-classes/3D/StageLine.js
js/helper-classes/3D/draw-utils.js
js/lib/drawing/world.js
js/lib/geom/circle.js
js/lib/geom/line.js
js/lib/geom/rectangle.js
js/lib/geom/shape-primitive.js
js/lib/rdge/materials/bump-metal-material.js
js/lib/rdge/materials/flag-material.js
js/lib/rdge/materials/fly-material.js
js/lib/rdge/materials/julia-material.js
js/lib/rdge/materials/keleidoscope-material.js
js/lib/rdge/materials/mandel-material.js
js/lib/rdge/materials/material.js
js/lib/rdge/materials/plasma-material.js
js/lib/rdge/materials/pulse-material.js
js/lib/rdge/materials/radial-gradient-material.js
js/lib/rdge/materials/taper-material.js
js/lib/rdge/materials/twist-vert-material.js
js/lib/rdge/materials/water-material.js
js/panels/Materials/materials-library-panel.reel/materials-library-panel.html
js/panels/Materials/materials-library-panel.reel/materials-library-panel.js
js/panels/Materials/materials-popup.reel/materials-popup.html
js/panels/Materials/materials-popup.reel/materials-popup.js
js/tools/LineTool.js
Signed-off-by: Valerio Virgillito <valerio@motorola.com>
Diffstat (limited to 'js/lib/rdge/materials/taper-material.js')
-rw-r--r-- | js/lib/rdge/materials/taper-material.js | 60 |
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; | |||
38 | var TaperMaterial = function TaperMaterial() | 38 | var 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 | ||