aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge
diff options
context:
space:
mode:
authorhwc4872012-06-14 13:55:32 -0700
committerhwc4872012-06-14 13:55:32 -0700
commitbcb0266bb6f9a578d033ad5b7b9869074e4f98a1 (patch)
treeb66210f852aa924f890f9c2b2925a6a36553ff5b /js/lib/rdge
parentbcd7ce86e2fb71ebc1420ea5967770ce70d9faa2 (diff)
downloadninja-bcb0266bb6f9a578d033ad5b7b9869074e4f98a1.tar.gz
Fixed alphabetization of material names.
Removed console output. Removed texture map field from Mandel material editor.
Diffstat (limited to 'js/lib/rdge')
-rw-r--r--js/lib/rdge/materials/mandel-material.js12
-rwxr-xr-xjs/lib/rdge/materials/material.js8
-rwxr-xr-xjs/lib/rdge/materials/uber-material.js2
3 files changed, 9 insertions, 13 deletions
diff --git a/js/lib/rdge/materials/mandel-material.js b/js/lib/rdge/materials/mandel-material.js
index e1c19145..af477f2b 100644
--- a/js/lib/rdge/materials/mandel-material.js
+++ b/js/lib/rdge/materials/mandel-material.js
@@ -14,8 +14,6 @@ var MandelMaterial = function MandelMaterial() {
14 this._name = "MandelMaterial"; 14 this._name = "MandelMaterial";
15 this._shaderName = "mandel"; 15 this._shaderName = "mandel";
16 16
17 this._defaultTexMap = 'assets/images/rocky-normal.jpg';
18
19 this._time = 0.0; 17 this._time = 0.0;
20 this._dTime = 0.01; 18 this._dTime = 0.01;
21 19
@@ -27,12 +25,11 @@ var MandelMaterial = function MandelMaterial() {
27 /////////////////////////////////////////////////////////////////////// 25 ///////////////////////////////////////////////////////////////////////
28 // Material Property Accessors 26 // Material Property Accessors
29 /////////////////////////////////////////////////////////////////////// 27 ///////////////////////////////////////////////////////////////////////
30 var u_tex0_index = 0, u_speed_index = 1; 28 var u_speed_index = 0;
31 this._propNames = ["u_tex0", "u_speed" ]; 29 this._propNames = [ "u_speed" ];
32 this._propLabels = ["Texture map", "Speed" ]; 30 this._propLabels = [ "Speed" ];
33 this._propTypes = ["file", "float" ]; 31 this._propTypes = [ "float" ];
34 this._propValues = []; 32 this._propValues = [];
35 this._propValues[this._propNames[u_tex0_index]] = this._defaultTexMap.slice(0);
36 this._propValues[this._propNames[u_speed_index]] = 1.0; 33 this._propValues[this._propNames[u_speed_index]] = 1.0;
37 34
38 /////////////////////////////////////////////////////////////////////// 35 ///////////////////////////////////////////////////////////////////////
@@ -97,7 +94,6 @@ var MandelMaterialDef =
97 // parameters 94 // parameters
98 'params' : 95 'params' :
99 { 96 {
100 'u_tex0': { 'type' : 'tex2d' },
101 'u_time' : { 'type' : 'float' }, 97 'u_time' : { 'type' : 'float' },
102 'u_speed' : { 'type' : 'float' }, 98 'u_speed' : { 'type' : 'float' },
103 'u_resolution' : { 'type' : 'vec2' }, 99 'u_resolution' : { 'type' : 'vec2' },
diff --git a/js/lib/rdge/materials/material.js b/js/lib/rdge/materials/material.js
index 34529e6b..65448c0c 100755
--- a/js/lib/rdge/materials/material.js
+++ b/js/lib/rdge/materials/material.js
@@ -220,9 +220,9 @@ var Material = function GLMaterial( world ) {
220 console.log( "setting invalid material property: " + prop + ", value: " + value ); 220 console.log( "setting invalid material property: " + prop + ", value: " + value );
221 } 221 }
222 222
223 if (!rtnVal && (prop != 'color')) { 223// if (!rtnVal && (prop != 'color')) {
224 console.log( "invalid material property: " + prop + " : " + value ); 224// console.log( "invalid material property: " + prop + " : " + value );
225 } 225// }
226 226
227 return rtnVal; 227 return rtnVal;
228 }; 228 };
@@ -231,7 +231,7 @@ var Material = function GLMaterial( world ) {
231 { 231 {
232 var ok = this.validateProperty( prop, value ); 232 var ok = this.validateProperty( prop, value );
233 if (!ok && (prop != 'color')) { 233 if (!ok && (prop != 'color')) {
234 console.log( "invalid property in Material:" + prop + " : " + value ); 234 //console.log( "invalid property in Material:" + prop + " : " + value );
235 return; 235 return;
236 } 236 }
237 237
diff --git a/js/lib/rdge/materials/uber-material.js b/js/lib/rdge/materials/uber-material.js
index 9aa0f7ea..3dffb238 100755
--- a/js/lib/rdge/materials/uber-material.js
+++ b/js/lib/rdge/materials/uber-material.js
@@ -183,7 +183,7 @@ var UberMaterial = function UberMaterial() {
183 this.updateAmbientColor = function () { 183 this.updateAmbientColor = function () {
184 this._ambientColor = this._propValues['ambientColor'].slice(0); 184 this._ambientColor = this._propValues['ambientColor'].slice(0);
185 var material = this._materialNode; 185 var material = this._materialNode;
186 console.log( "ambient color: " + this._ambientColor ); 186 //console.log( "ambient color: " + this._ambientColor );
187 if (material) { 187 if (material) {
188 var technique = material.shaderProgram.defaultTechnique; 188 var technique = material.shaderProgram.defaultTechnique;
189 technique.u_ambientColor.set(this._ambientColor); 189 technique.u_ambientColor.set(this._ambientColor);