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 445f6023..989b6160 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
@@ -103,42 +103,42 @@ var StarMaterial = function StarMaterial() {
103// shader spec (can also be loaded from a .JSON file, or constructed at runtime) 103// shader spec (can also be loaded from a .JSON file, or constructed at runtime)
104var starMaterialDef = 104var starMaterialDef =
105{ 'shaders': 105{ 'shaders':
106 { 106 {
107 'defaultVShader': "assets/shaders/Basic.vert.glsl", 107 'defaultVShader': "assets/shaders/Basic.vert.glsl",
108 'defaultFShader': "assets/shaders/Star.frag.glsl" 108 'defaultFShader': "assets/shaders/Star.frag.glsl"
109 }, 109 },
110 'techniques': 110 'techniques':
111 { 111 {
112 'default': 112 'default':
113 [ 113 [
114 { 114 {
115 'vshader': 'defaultVShader', 115 'vshader': 'defaultVShader',
116 'fshader': 'defaultFShader', 116 'fshader': 'defaultFShader',
117 // attributes 117 // attributes
118 'attributes': 118 'attributes':
119 { 119 {
120 'vert': { 'type': 'vec3' }, 120 'vert': { 'type': 'vec3' },
121 'normal': { 'type': 'vec3' }, 121 'normal': { 'type': 'vec3' },
122 'texcoord': { 'type': 'vec2' } 122 'texcoord': { 'type': 'vec2' }
123 }, 123 },
124 // parameters 124 // parameters
125 'params': 125 'params':
126 { 126 {
127 'u_tex0': { 'type': 'tex2d' }, 127 'u_tex0': { 'type': 'tex2d' },
128 'u_time': { 'type': 'float' }, 128 'u_time': { 'type': 'float' },
129 'u_speed': { 'type': 'float' }, 129 'u_speed': { 'type': 'float' },
130 'u_resolution': { 'type': 'vec2' } 130 'u_resolution': { 'type': 'vec2' }
131 }, 131 },
132 132
133 // render states 133 // render states
134 'states': 134 'states':
135 { 135 {
136 'depthEnable': true, 136 'depthEnable': true,
137 'offset': [1.0, 0.1] 137 'offset': [1.0, 0.1]
138 } 138 }
139 } 139 }
140 ] 140 ]
141 } 141 }
142}; 142};
143 143
144StarMaterial.prototype = new PulseMaterial(); 144StarMaterial.prototype = new PulseMaterial();