aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/star-material.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/materials/star-material.js')
-rw-r--r--js/lib/rdge/materials/star-material.js100
1 files changed, 50 insertions, 50 deletions
diff --git a/js/lib/rdge/materials/star-material.js b/js/lib/rdge/materials/star-material.js
index e9e57863..34cca767 100644
--- a/js/lib/rdge/materials/star-material.js
+++ b/js/lib/rdge/materials/star-material.js
@@ -46,23 +46,23 @@ var StarMaterial = function StarMaterial() {
46 // array textures indexed by shader uniform name 46 // array textures indexed by shader uniform name
47 this._glTextures = []; 47 this._glTextures = [];
48 48
49 /////////////////////////////////////////////////////////////////////// 49 ///////////////////////////////////////////////////////////////////////
50 // Property Accessors 50 // Property Accessors
51 /////////////////////////////////////////////////////////////////////// 51 ///////////////////////////////////////////////////////////////////////
52 this.isAnimated = function() { return true; }; 52 this.isAnimated = function() { return true; };
53 this.getShaderDef = function() { return starMaterialDef; } 53 this.getShaderDef = function() { return starMaterialDef; }
54 54
55 /////////////////////////////////////////////////////////////////////// 55 ///////////////////////////////////////////////////////////////////////
56 // Material Property Accessors 56 // Material Property Accessors
57 /////////////////////////////////////////////////////////////////////// 57 ///////////////////////////////////////////////////////////////////////
58 var u_tex0_index = 0, u_speed_index = 1; 58 var u_tex0_index = 0, u_speed_index = 1;
59 this._propNames = ["u_tex0", "u_speed" ]; 59 this._propNames = ["u_tex0", "u_speed" ];
60 this._propLabels = ["Texture map", "Speed" ]; 60 this._propLabels = ["Texture map", "Speed" ];
61 this._propTypes = ["file", "float" ]; 61 this._propTypes = ["file", "float" ];
62 this._propValues = []; 62 this._propValues = [];
63 this._propValues[this._propNames[u_tex0_index]] = this._defaultTexMap.slice(0); 63 this._propValues[this._propNames[u_tex0_index]] = this._defaultTexMap.slice(0);
64 this._propValues[this._propNames[u_speed_index]] = 1.0; 64 this._propValues[this._propNames[u_speed_index]] = 1.0;
65 /////////////////////////////////////////////////////////////////////// 65 ///////////////////////////////////////////////////////////////////////
66 66
67 /////////////////////////////////////////////////////////////////////// 67 ///////////////////////////////////////////////////////////////////////
68 // Methods 68 // Methods
@@ -113,42 +113,42 @@ var StarMaterial = function StarMaterial() {
113// shader spec (can also be loaded from a .JSON file, or constructed at runtime) 113// shader spec (can also be loaded from a .JSON file, or constructed at runtime)
114var starMaterialDef = 114var starMaterialDef =
115{ 'shaders': 115{ 'shaders':
116 { 116 {
117 'defaultVShader': "assets/shaders/Basic.vert.glsl", 117 'defaultVShader': "assets/shaders/Basic.vert.glsl",
118 'defaultFShader': "assets/shaders/Star.frag.glsl" 118 'defaultFShader': "assets/shaders/Star.frag.glsl"
119 }, 119 },
120 'techniques': 120 'techniques':
121 { 121 {
122 'default': 122 'default':
123 [ 123 [
124 { 124 {
125 'vshader': 'defaultVShader', 125 'vshader': 'defaultVShader',
126 'fshader': 'defaultFShader', 126 'fshader': 'defaultFShader',
127 // attributes 127 // attributes
128 'attributes': 128 'attributes':
129 { 129 {
130 'vert': { 'type': 'vec3' }, 130 'vert': { 'type': 'vec3' },
131 'normal': { 'type': 'vec3' }, 131 'normal': { 'type': 'vec3' },
132 'texcoord': { 'type': 'vec2' } 132 'texcoord': { 'type': 'vec2' }
133 }, 133 },
134 // parameters 134 // parameters
135 'params': 135 'params':
136 { 136 {
137 'u_tex0': { 'type': 'tex2d' }, 137 'u_tex0': { 'type': 'tex2d' },
138 'u_time': { 'type': 'float' }, 138 'u_time': { 'type': 'float' },
139 'u_speed': { 'type': 'float' }, 139 'u_speed': { 'type': 'float' },
140 'u_resolution': { 'type': 'vec2' } 140 'u_resolution': { 'type': 'vec2' }
141 }, 141 },
142 142
143 // render states 143 // render states
144 'states': 144 'states':
145 { 145 {
146 'depthEnable': true, 146 'depthEnable': true,
147 'offset': [1.0, 0.1] 147 'offset': [1.0, 0.1]
148 } 148 }
149 } 149 }
150 ] 150 ]
151 } 151 }
152}; 152};
153 153
154StarMaterial.prototype = new PulseMaterial(); 154StarMaterial.prototype = new PulseMaterial();