From e065244ac75d1d0f25fd5c75cb58e714a13fe16b Mon Sep 17 00:00:00 2001 From: Jonathan Duran Date: Wed, 14 Mar 2012 08:59:17 -0700 Subject: Squashed commit of the following: merge master into timeline Signed-off-by: Jonathan Duran --- .../backup-delete/Materials/BumpMetalMaterial.js | 39 ++++++++++++---------- 1 file changed, 22 insertions(+), 17 deletions(-) (limited to 'js/helper-classes/backup-delete/Materials/BumpMetalMaterial.js') 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() this.setProperty = function( prop, value ) { // every material should do something with the "color" property - if (prop === "color") prop = "lightDiff"; + if (prop === "color") return; //prop = "lightDiff"; // make sure we have legitimate imput var ok = this.validateProperty( prop, value ); @@ -97,22 +97,27 @@ function BumpMetalMaterial() this.init = function( world ) { // save the world - if (world) this.setWorld( world ); - - // set up the shader - this._shader = new jshader(); - this._shader.def = bumpMetalMaterialDef; - this._shader.init(); - this._shader.default.u_light0Diff.set( this.getLightDiff() ); - - // set up the material node - this._materialNode = createMaterialNode( this.getShaderName() ); - this._materialNode.setShader(this._shader); - - // set some image maps - this.updateTexture(1); - this.updateTexture(2); - this.updateTexture(3); + if (world) + { + this.setWorld( world ); + + // set up the shader + this._shader = new jshader(); + this._shader.def = bumpMetalMaterialDef; + this._shader.init(); + this._shader.default.u_light0Diff.set( this.getLightDiff() ); + + // set up the material node + this._materialNode = createMaterialNode( this.getShaderName() + "_" + world.generateUniqueNodeID() ); + this._materialNode.setShader(this._shader); + + // set some image maps + this.updateTexture(1); + this.updateTexture(2); + this.updateTexture(3); + } + else + throw new Error( "GLWorld not supplied to material initialization" ); }; this.updateTexture = function( index ) -- cgit v1.2.3