aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/tunnel-material.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/materials/tunnel-material.js')
-rw-r--r--js/lib/rdge/materials/tunnel-material.js90
1 files changed, 45 insertions, 45 deletions
diff --git a/js/lib/rdge/materials/tunnel-material.js b/js/lib/rdge/materials/tunnel-material.js
index 74913aa8..d197ce7f 100644
--- a/js/lib/rdge/materials/tunnel-material.js
+++ b/js/lib/rdge/materials/tunnel-material.js
@@ -50,19 +50,19 @@ var TunnelMaterial = function TunnelMaterial() {
50 /////////////////////////////////////////////////////////////////////// 50 ///////////////////////////////////////////////////////////////////////
51 // Material Property Accessors 51 // Material Property Accessors
52 /////////////////////////////////////////////////////////////////////// 52 ///////////////////////////////////////////////////////////////////////
53 var u_tex0_index = 0, u_speed_index = 1; 53 var u_tex0_index = 0, u_speed_index = 1;
54 this._propNames = ["u_tex0", "u_speed" ]; 54 this._propNames = ["u_tex0", "u_speed" ];
55 this._propLabels = ["Texture map", "Speed" ]; 55 this._propLabels = ["Texture map", "Speed" ];
56 this._propTypes = ["file", "float" ]; 56 this._propTypes = ["file", "float" ];
57 this._propValues = []; 57 this._propValues = [];
58 this._propValues[this._propNames[u_tex0_index]] = this._defaultTexMap.slice(0); 58 this._propValues[this._propNames[u_tex0_index]] = this._defaultTexMap.slice(0);
59 this._propValues[this._propNames[u_speed_index]] = 1.0; 59 this._propValues[this._propNames[u_speed_index]] = 1.0;
60 60
61 /////////////////////////////////////////////////////////////////////// 61 ///////////////////////////////////////////////////////////////////////
62 // Material Property Accessors 62 // Material Property Accessors
63 /////////////////////////////////////////////////////////////////////// 63 ///////////////////////////////////////////////////////////////////////
64 this.isAnimated = function() { return true; }; 64 this.isAnimated = function() { return true; };
65 this.getShaderDef = function() { return tunnelMaterialDef; }; 65 this.getShaderDef = function() { return tunnelMaterialDef; };
66 66
67 /////////////////////////////////////////////////////////////////////// 67 ///////////////////////////////////////////////////////////////////////
68 // Methods 68 // Methods
@@ -104,46 +104,46 @@ var TunnelMaterial = function TunnelMaterial() {
104 104
105/////////////////////////////////////////////////////////////////////////////////////// 105///////////////////////////////////////////////////////////////////////////////////////
106// RDGE shader 106// RDGE shader
107 107
108// shader spec (can also be loaded from a .JSON file, or constructed at runtime) 108// shader spec (can also be loaded from a .JSON file, or constructed at runtime)
109var tunnelMaterialDef = 109var tunnelMaterialDef =
110{'shaders': 110{'shaders':
111 { 111 {
112 'defaultVShader':"assets/shaders/Basic.vert.glsl", 112 'defaultVShader':"assets/shaders/Basic.vert.glsl",
113 'defaultFShader':"assets/shaders/Tunnel.frag.glsl" 113 'defaultFShader':"assets/shaders/Tunnel.frag.glsl"
114 }, 114 },
115 'techniques': 115 'techniques':
116 { 116 {
117 'default': 117 'default':
118 [ 118 [
119 { 119 {
120 'vshader' : 'defaultVShader', 120 'vshader' : 'defaultVShader',
121 'fshader' : 'defaultFShader', 121 'fshader' : 'defaultFShader',
122 // attributes 122 // attributes
123 'attributes' : 123 'attributes' :
124 { 124 {
125 'vert' : { 'type' : 'vec3' }, 125 'vert' : { 'type' : 'vec3' },
126 'normal' : { 'type' : 'vec3' }, 126 'normal' : { 'type' : 'vec3' },
127 'texcoord' : { 'type' : 'vec2' } 127 'texcoord' : { 'type' : 'vec2' }
128 }, 128 },
129 // parameters 129 // parameters
130 'params' : 130 'params' :
131 { 131 {
132 'u_tex0': { 'type' : 'tex2d' }, 132 'u_tex0': { 'type' : 'tex2d' },
133 'u_time' : { 'type' : 'float' }, 133 'u_time' : { 'type' : 'float' },
134 'u_speed' : { 'type' : 'float' }, 134 'u_speed' : { 'type' : 'float' },
135 'u_resolution' : { 'type' : 'vec2' } 135 'u_resolution' : { 'type' : 'vec2' }
136 }, 136 },
137 137
138 // render states 138 // render states
139 'states' : 139 'states' :
140 { 140 {
141 'depthEnable' : true, 141 'depthEnable' : true,
142 'offset':[1.0, 0.1] 142 'offset':[1.0, 0.1]
143 } 143 }
144 } 144 }
145 ] 145 ]
146 } 146 }
147}; 147};
148 148
149TunnelMaterial.prototype = new PulseMaterial(); 149TunnelMaterial.prototype = new PulseMaterial();