diff options
Diffstat (limited to 'js/lib/rdge/materials/z-invert-material.js')
-rw-r--r-- | js/lib/rdge/materials/z-invert-material.js | 102 |
1 files changed, 51 insertions, 51 deletions
diff --git a/js/lib/rdge/materials/z-invert-material.js b/js/lib/rdge/materials/z-invert-material.js index ef93584d..d1bb0c00 100644 --- a/js/lib/rdge/materials/z-invert-material.js +++ b/js/lib/rdge/materials/z-invert-material.js | |||
@@ -47,24 +47,24 @@ var ZInvertMaterial = function ZInvertMaterial() { | |||
47 | // array textures indexed by shader uniform name | 47 | // array textures indexed by shader uniform name |
48 | this._glTextures = []; | 48 | this._glTextures = []; |
49 | 49 | ||
50 | this.isAnimated = function() { return true; }; | 50 | this.isAnimated = function() { return true; }; |
51 | this.getShaderDef = function() { return zInvertMaterialDef; }; | 51 | this.getShaderDef = function() { return zInvertMaterialDef; }; |
52 | 52 | ||
53 | /////////////////////////////////////////////////////////////////////// | 53 | /////////////////////////////////////////////////////////////////////// |
54 | // Properties | 54 | // Properties |
55 | /////////////////////////////////////////////////////////////////////// | 55 | /////////////////////////////////////////////////////////////////////// |
56 | // all defined in parent PulseMaterial.js | 56 | // all defined in parent PulseMaterial.js |
57 | // load the local default value | 57 | // load the local default value |
58 | this._propNames = ["u_tex0", "u_speed"]; | 58 | this._propNames = ["u_tex0", "u_speed"]; |
59 | this._propLabels = ["Texture map", "Speed"]; | 59 | this._propLabels = ["Texture map", "Speed"]; |
60 | this._propTypes = ["file", "float"]; | 60 | this._propTypes = ["file", "float"]; |
61 | 61 | ||
62 | var u_tex_index = 0, | 62 | var u_tex_index = 0, |
63 | u_speed_index = 1; | 63 | u_speed_index = 1; |
64 | 64 | ||
65 | this._propValues = []; | 65 | this._propValues = []; |
66 | this._propValues[ this._propNames[u_tex_index ] ] = this._defaultTexMap.slice(0); | 66 | this._propValues[ this._propNames[u_tex_index ] ] = this._defaultTexMap.slice(0); |
67 | this._propValues[ this._propNames[u_speed_index ] ] = 1.0; | 67 | this._propValues[ this._propNames[u_speed_index ] ] = 1.0; |
68 | 68 | ||
69 | /////////////////////////////////////////////////////////////////////// | 69 | /////////////////////////////////////////////////////////////////////// |
70 | // Methods | 70 | // Methods |
@@ -89,7 +89,7 @@ var ZInvertMaterial = function ZInvertMaterial() { | |||
89 | } | 89 | } |
90 | 90 | ||
91 | // set the shader values in the shader | 91 | // set the shader values in the shader |
92 | this.setShaderValues(); | 92 | this.setShaderValues(); |
93 | this.setResolution([world.getViewportWidth(), world.getViewportHeight()]); | 93 | this.setResolution([world.getViewportWidth(), world.getViewportHeight()]); |
94 | this.update(0); | 94 | this.update(0); |
95 | }; | 95 | }; |
@@ -101,42 +101,42 @@ var ZInvertMaterial = function ZInvertMaterial() { | |||
101 | // shader spec (can also be loaded from a .JSON file, or constructed at runtime) | 101 | // shader spec (can also be loaded from a .JSON file, or constructed at runtime) |
102 | var zInvertMaterialDef = | 102 | var zInvertMaterialDef = |
103 | { 'shaders': | 103 | { 'shaders': |
104 | { | 104 | { |
105 | 'defaultVShader': "assets/shaders/Basic.vert.glsl", | 105 | 'defaultVShader': "assets/shaders/Basic.vert.glsl", |
106 | 'defaultFShader': "assets/shaders/ZInvert.frag.glsl" | 106 | 'defaultFShader': "assets/shaders/ZInvert.frag.glsl" |
107 | }, | 107 | }, |
108 | 'techniques': | 108 | 'techniques': |
109 | { | 109 | { |
110 | 'default': | 110 | 'default': |
111 | [ | 111 | [ |
112 | { | 112 | { |
113 | 'vshader': 'defaultVShader', | 113 | 'vshader': 'defaultVShader', |
114 | 'fshader': 'defaultFShader', | 114 | 'fshader': 'defaultFShader', |
115 | // attributes | 115 | // attributes |
116 | 'attributes': | 116 | 'attributes': |
117 | { | 117 | { |
118 | 'vert': { 'type': 'vec3' }, | 118 | 'vert': { 'type': 'vec3' }, |
119 | 'normal': { 'type': 'vec3' }, | 119 | 'normal': { 'type': 'vec3' }, |
120 | 'texcoord': { 'type': 'vec2' } | 120 | 'texcoord': { 'type': 'vec2' } |
121 | }, | 121 | }, |
122 | // parameters | 122 | // parameters |
123 | 'params': | 123 | 'params': |
124 | { | 124 | { |
125 | 'u_tex0': { 'type': 'tex2d' }, | 125 | 'u_tex0': { 'type': 'tex2d' }, |
126 | 'u_time': { 'type': 'float' }, | 126 | 'u_time': { 'type': 'float' }, |
127 | 'u_speed': { 'type': 'float' }, | 127 | 'u_speed': { 'type': 'float' }, |
128 | 'u_resolution': { 'type': 'vec2' } | 128 | 'u_resolution': { 'type': 'vec2' } |
129 | }, | 129 | }, |
130 | 130 | ||
131 | // render states | 131 | // render states |
132 | 'states': | 132 | 'states': |
133 | { | 133 | { |
134 | 'depthEnable': true, | 134 | 'depthEnable': true, |
135 | 'offset': [1.0, 0.1] | 135 | 'offset': [1.0, 0.1] |
136 | } | 136 | } |
137 | } | 137 | } |
138 | ] | 138 | ] |
139 | } | 139 | } |
140 | }; | 140 | }; |
141 | 141 | ||
142 | ZInvertMaterial.prototype = new PulseMaterial(); | 142 | ZInvertMaterial.prototype = new PulseMaterial(); |