diff options
Diffstat (limited to 'js/lib/rdge/materials/deform-material.js')
-rw-r--r-- | js/lib/rdge/materials/deform-material.js | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/js/lib/rdge/materials/deform-material.js b/js/lib/rdge/materials/deform-material.js index 234f22e4..6c5f93ad 100644 --- a/js/lib/rdge/materials/deform-material.js +++ b/js/lib/rdge/materials/deform-material.js | |||
@@ -51,21 +51,21 @@ var DeformMaterial = function DeformMaterial() { | |||
51 | /////////////////////////////////////////////////////////////////////// | 51 | /////////////////////////////////////////////////////////////////////// |
52 | // all defined in parent PulseMaterial.js | 52 | // all defined in parent PulseMaterial.js |
53 | // load the local default value | 53 | // load the local default value |
54 | var u_tex0_index = 0; | 54 | var u_tex0_index = 0; |
55 | this._propNames = ["u_tex0", "u_speed" ]; | 55 | this._propNames = ["u_tex0", "u_speed" ]; |
56 | this._propLabels = ["Texture map", "Speed" ]; | 56 | this._propLabels = ["Texture map", "Speed" ]; |
57 | this._propTypes = ["file", "float" ]; | 57 | this._propTypes = ["file", "float" ]; |
58 | this._propValues = []; | 58 | this._propValues = []; |
59 | this._propValues[this._propNames[0]] = this._defaultTexMap.slice(0); | 59 | this._propValues[this._propNames[0]] = this._defaultTexMap.slice(0); |
60 | this._propValues[this._propNames[1]] = 1.0; | 60 | this._propValues[this._propNames[1]] = 1.0; |
61 | 61 | ||
62 | this._propValues[ this._propNames[ u_tex0_index] ] = this._defaultTexMap.slice(0); | 62 | this._propValues[ this._propNames[ u_tex0_index] ] = this._defaultTexMap.slice(0); |
63 | 63 | ||
64 | /////////////////////////////////////////////////////////////////////// | 64 | /////////////////////////////////////////////////////////////////////// |
65 | // Material Property Accessors | 65 | // Material Property Accessors |
66 | /////////////////////////////////////////////////////////////////////// | 66 | /////////////////////////////////////////////////////////////////////// |
67 | this.isAnimated = function() { return true; }; | 67 | this.isAnimated = function() { return true; }; |
68 | this.getShaderDef = function() { return pulseMaterialDef; } | 68 | this.getShaderDef = function() { return pulseMaterialDef; } |
69 | 69 | ||
70 | /////////////////////////////////////////////////////////////////////// | 70 | /////////////////////////////////////////////////////////////////////// |
71 | 71 | ||
@@ -106,42 +106,42 @@ var DeformMaterial = function DeformMaterial() { | |||
106 | // shader spec (can also be loaded from a .JSON file, or constructed at runtime) | 106 | // shader spec (can also be loaded from a .JSON file, or constructed at runtime) |
107 | var deformMaterialDef = | 107 | var deformMaterialDef = |
108 | {'shaders': | 108 | {'shaders': |
109 | { | 109 | { |
110 | 'defaultVShader':"assets/shaders/Basic.vert.glsl", | 110 | 'defaultVShader':"assets/shaders/Basic.vert.glsl", |
111 | 'defaultFShader':"assets/shaders/Deform.frag.glsl" | 111 | 'defaultFShader':"assets/shaders/Deform.frag.glsl" |
112 | }, | 112 | }, |
113 | 'techniques': | 113 | 'techniques': |
114 | { | 114 | { |
115 | 'default': | 115 | 'default': |
116 | [ | 116 | [ |
117 | { | 117 | { |
118 | 'vshader' : 'defaultVShader', | 118 | 'vshader' : 'defaultVShader', |
119 | 'fshader' : 'defaultFShader', | 119 | 'fshader' : 'defaultFShader', |
120 | // attributes | 120 | // attributes |
121 | 'attributes' : | 121 | 'attributes' : |
122 | { | 122 | { |
123 | 'vert' : { 'type' : 'vec3' }, | 123 | 'vert' : { 'type' : 'vec3' }, |
124 | 'normal' : { 'type' : 'vec3' }, | 124 | 'normal' : { 'type' : 'vec3' }, |
125 | 'texcoord' : { 'type' : 'vec2' } | 125 | 'texcoord' : { 'type' : 'vec2' } |
126 | }, | 126 | }, |
127 | // parameters | 127 | // parameters |
128 | 'params' : | 128 | 'params' : |
129 | { | 129 | { |
130 | 'u_tex0': { 'type' : 'tex2d' }, | 130 | 'u_tex0': { 'type' : 'tex2d' }, |
131 | 'u_time' : { 'type' : 'float' }, | 131 | 'u_time' : { 'type' : 'float' }, |
132 | 'u_speed' : { 'type' : 'float' }, | 132 | 'u_speed' : { 'type' : 'float' }, |
133 | 'u_resolution' : { 'type' : 'vec2' } | 133 | 'u_resolution' : { 'type' : 'vec2' } |
134 | }, | 134 | }, |
135 | 135 | ||
136 | // render states | 136 | // render states |
137 | 'states' : | 137 | 'states' : |
138 | { | 138 | { |
139 | 'depthEnable' : true, | 139 | 'depthEnable' : true, |
140 | 'offset':[1.0, 0.1] | 140 | 'offset':[1.0, 0.1] |
141 | } | 141 | } |
142 | } | 142 | } |
143 | ] | 143 | ] |
144 | } | 144 | } |
145 | }; | 145 | }; |
146 | 146 | ||
147 | DeformMaterial.prototype = new PulseMaterial(); | 147 | DeformMaterial.prototype = new PulseMaterial(); |