aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/backup-delete/Materials/BumpMetalMaterial.js
diff options
context:
space:
mode:
authorEric Guzman2012-03-13 13:12:43 -0700
committerEric Guzman2012-03-13 13:12:43 -0700
commit61fd46cad105f0a52afa028e5301b96120f00ab4 (patch)
treed8a7e23e1ea7d9b5c64a288822b7797bb19e50d4 /js/helper-classes/backup-delete/Materials/BumpMetalMaterial.js
parent7e3161153b87b891875ac65368a19aed12909fa3 (diff)
parentf56b8cf4d3316d250c0f0045fb78f0dbd5c56e94 (diff)
downloadninja-61fd46cad105f0a52afa028e5301b96120f00ab4.tar.gz
Merge branch 'refs/heads/master' into CSSPanelUpdates
Conflicts: js/controllers/styles-controller.js
Diffstat (limited to 'js/helper-classes/backup-delete/Materials/BumpMetalMaterial.js')
-rwxr-xr-xjs/helper-classes/backup-delete/Materials/BumpMetalMaterial.js39
1 files changed, 22 insertions, 17 deletions
diff --git a/js/helper-classes/backup-delete/Materials/BumpMetalMaterial.js b/js/helper-classes/backup-delete/Materials/BumpMetalMaterial.js
index a7a3724e..52332ab8 100755
--- a/js/helper-classes/backup-delete/Materials/BumpMetalMaterial.js
+++ b/js/helper-classes/backup-delete/Materials/BumpMetalMaterial.js
@@ -65,7 +65,7 @@ function BumpMetalMaterial()
65 this.setProperty = function( prop, value ) 65 this.setProperty = function( prop, value )
66 { 66 {
67 // every material should do something with the "color" property 67 // every material should do something with the "color" property
68 if (prop === "color") prop = "lightDiff"; 68 if (prop === "color") return; //prop = "lightDiff";
69 69
70 // make sure we have legitimate imput 70 // make sure we have legitimate imput
71 var ok = this.validateProperty( prop, value ); 71 var ok = this.validateProperty( prop, value );
@@ -97,22 +97,27 @@ function BumpMetalMaterial()
97 this.init = function( world ) 97 this.init = function( world )
98 { 98 {
99 // save the world 99 // save the world
100 if (world) this.setWorld( world ); 100 if (world)
101 101 {
102 // set up the shader 102 this.setWorld( world );
103 this._shader = new jshader(); 103
104 this._shader.def = bumpMetalMaterialDef; 104 // set up the shader
105 this._shader.init(); 105 this._shader = new jshader();
106 this._shader.default.u_light0Diff.set( this.getLightDiff() ); 106 this._shader.def = bumpMetalMaterialDef;
107 107 this._shader.init();
108 // set up the material node 108 this._shader.default.u_light0Diff.set( this.getLightDiff() );
109 this._materialNode = createMaterialNode( this.getShaderName() ); 109
110 this._materialNode.setShader(this._shader); 110 // set up the material node
111 111 this._materialNode = createMaterialNode( this.getShaderName() + "_" + world.generateUniqueNodeID() );
112 // set some image maps 112 this._materialNode.setShader(this._shader);
113 this.updateTexture(1); 113
114 this.updateTexture(2); 114 // set some image maps
115 this.updateTexture(3); 115 this.updateTexture(1);
116 this.updateTexture(2);
117 this.updateTexture(3);
118 }
119 else
120 throw new Error( "GLWorld not supplied to material initialization" );
116 }; 121 };
117 122
118 this.updateTexture = function( index ) 123 this.updateTexture = function( index )