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.js86
1 files changed, 43 insertions, 43 deletions
diff --git a/js/lib/rdge/materials/tunnel-material.js b/js/lib/rdge/materials/tunnel-material.js
index 0a96e23e..fd2e28d5 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
@@ -98,42 +98,42 @@ var TunnelMaterial = function TunnelMaterial() {
98// shader spec (can also be loaded from a .JSON file, or constructed at runtime) 98// shader spec (can also be loaded from a .JSON file, or constructed at runtime)
99var tunnelMaterialDef = 99var tunnelMaterialDef =
100{'shaders': 100{'shaders':
101 { 101 {
102 'defaultVShader':"assets/shaders/Basic.vert.glsl", 102 'defaultVShader':"assets/shaders/Basic.vert.glsl",
103 'defaultFShader':"assets/shaders/Tunnel.frag.glsl" 103 'defaultFShader':"assets/shaders/Tunnel.frag.glsl"
104 }, 104 },
105 'techniques': 105 'techniques':
106 { 106 {
107 'default': 107 'default':
108 [ 108 [
109 { 109 {
110 'vshader' : 'defaultVShader', 110 'vshader' : 'defaultVShader',
111 'fshader' : 'defaultFShader', 111 'fshader' : 'defaultFShader',
112 // attributes 112 // attributes
113 'attributes' : 113 'attributes' :
114 { 114 {
115 'vert' : { 'type' : 'vec3' }, 115 'vert' : { 'type' : 'vec3' },
116 'normal' : { 'type' : 'vec3' }, 116 'normal' : { 'type' : 'vec3' },
117 'texcoord' : { 'type' : 'vec2' } 117 'texcoord' : { 'type' : 'vec2' }
118 }, 118 },
119 // parameters 119 // parameters
120 'params' : 120 'params' :
121 { 121 {
122 'u_tex0': { 'type' : 'tex2d' }, 122 'u_tex0': { 'type' : 'tex2d' },
123 'u_time' : { 'type' : 'float' }, 123 'u_time' : { 'type' : 'float' },
124 'u_speed' : { 'type' : 'float' }, 124 'u_speed' : { 'type' : 'float' },
125 'u_resolution' : { 'type' : 'vec2' } 125 'u_resolution' : { 'type' : 'vec2' }
126 }, 126 },
127 127
128 // render states 128 // render states
129 'states' : 129 'states' :
130 { 130 {
131 'depthEnable' : true, 131 'depthEnable' : true,
132 'offset':[1.0, 0.1] 132 'offset':[1.0, 0.1]
133 } 133 }
134 } 134 }
135 ] 135 ]
136 } 136 }
137}; 137};
138 138
139TunnelMaterial.prototype = new PulseMaterial(); 139TunnelMaterial.prototype = new PulseMaterial();