aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/twist-material.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/materials/twist-material.js')
-rw-r--r--js/lib/rdge/materials/twist-material.js84
1 files changed, 42 insertions, 42 deletions
diff --git a/js/lib/rdge/materials/twist-material.js b/js/lib/rdge/materials/twist-material.js
index 20e49713..d0b88b91 100644
--- a/js/lib/rdge/materials/twist-material.js
+++ b/js/lib/rdge/materials/twist-material.js
@@ -51,19 +51,19 @@ var TwistMaterial = function TwistMaterial() {
51 /////////////////////////////////////////////////////////////////////// 51 ///////////////////////////////////////////////////////////////////////
52 // Material Property Accessors 52 // Material Property Accessors
53 /////////////////////////////////////////////////////////////////////// 53 ///////////////////////////////////////////////////////////////////////
54 var u_tex0_index = 0, u_speed_index = 1; 54 var u_tex0_index = 0, u_speed_index = 1;
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[u_tex0_index]] = this._defaultTexMap.slice(0); 59 this._propValues[this._propNames[u_tex0_index]] = this._defaultTexMap.slice(0);
60 this._propValues[this._propNames[u_speed_index]] = 1.0; 60 this._propValues[this._propNames[u_speed_index]] = 1.0;
61 61
62 /////////////////////////////////////////////////////////////////////// 62 ///////////////////////////////////////////////////////////////////////
63 // Material Property Accessors 63 // Material Property Accessors
64 /////////////////////////////////////////////////////////////////////// 64 ///////////////////////////////////////////////////////////////////////
65 this.isAnimated = function() { return true; }; 65 this.isAnimated = function() { return true; };
66 this.getShaderDef = function() { return twistMaterialDef; }; 66 this.getShaderDef = function() { return twistMaterialDef; };
67 67
68 /////////////////////////////////////////////////////////////////////// 68 ///////////////////////////////////////////////////////////////////////
69 // Methods 69 // Methods
@@ -99,42 +99,42 @@ var TwistMaterial = function TwistMaterial() {
99// shader spec (can also be loaded from a .JSON file, or constructed at runtime) 99// shader spec (can also be loaded from a .JSON file, or constructed at runtime)
100var twistMaterialDef = 100var twistMaterialDef =
101{ 'shaders': 101{ 'shaders':
102 { 102 {
103 'defaultVShader': "assets/shaders/Basic.vert.glsl", 103 'defaultVShader': "assets/shaders/Basic.vert.glsl",
104 'defaultFShader': "assets/shaders/Twist.frag.glsl" 104 'defaultFShader': "assets/shaders/Twist.frag.glsl"
105 }, 105 },
106 'techniques': 106 'techniques':
107 { 107 {
108 'default': 108 'default':
109 [ 109 [
110 { 110 {
111 'vshader': 'defaultVShader', 111 'vshader': 'defaultVShader',
112 'fshader': 'defaultFShader', 112 'fshader': 'defaultFShader',
113 // attributes 113 // attributes
114 'attributes': 114 'attributes':
115 { 115 {
116 'vert': { 'type': 'vec3' }, 116 'vert': { 'type': 'vec3' },
117 'normal': { 'type': 'vec3' }, 117 'normal': { 'type': 'vec3' },
118 'texcoord': { 'type': 'vec2' } 118 'texcoord': { 'type': 'vec2' }
119 }, 119 },
120 // parameters 120 // parameters
121 'params': 121 'params':
122 { 122 {
123 'u_tex0': { 'type': 'tex2d' }, 123 'u_tex0': { 'type': 'tex2d' },
124 'u_time': { 'type': 'float' }, 124 'u_time': { 'type': 'float' },
125 'u_speed': { 'type': 'float' }, 125 'u_speed': { 'type': 'float' },
126 'u_resolution': { 'type': 'vec2' } 126 'u_resolution': { 'type': 'vec2' }
127 }, 127 },
128 128
129 // render states 129 // render states
130 'states': 130 'states':
131 { 131 {
132 'depthEnable': true, 132 'depthEnable': true,
133 'offset': [1.0, 0.1] 133 'offset': [1.0, 0.1]
134 } 134 }
135 } 135 }
136 ] 136 ]
137 } 137 }
138}; 138};
139 139
140TwistMaterial.prototype = new PulseMaterial(); 140TwistMaterial.prototype = new PulseMaterial();