From 818582d389f504c915be0c9052fafa33e3e76c92 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 7 Mar 2012 16:48:48 -0800 Subject: File IO --- js/lib/rdge/materials/bump-metal-material.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'js/lib/rdge/materials/bump-metal-material.js') diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js index 61126952..67b16371 100755 --- a/js/lib/rdge/materials/bump-metal-material.js +++ b/js/lib/rdge/materials/bump-metal-material.js @@ -75,7 +75,7 @@ var BumpMetalMaterial = 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; // make sure we have legitimate imput var ok = this.validateProperty( prop, value ); @@ -116,7 +116,7 @@ var BumpMetalMaterial = function BumpMetalMaterial() { this._shader['default'].u_light0Diff.set( this.getLightDiff() ); // set up the material node - this._materialNode = createMaterialNode( this.getShaderName() ); + this._materialNode = createMaterialNode( this.getShaderName() + "_" + world.generateUniqueNodeID() ); this._materialNode.setShader(this._shader); // set some image maps -- cgit v1.2.3 From 7b6e8194b91168abdeb94702eb350d14f147858b Mon Sep 17 00:00:00 2001 From: hwc487 Date: Thu, 8 Mar 2012 17:29:18 -0800 Subject: Canvas IO --- js/lib/rdge/materials/bump-metal-material.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'js/lib/rdge/materials/bump-metal-material.js') diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js index 67b16371..70873885 100755 --- a/js/lib/rdge/materials/bump-metal-material.js +++ b/js/lib/rdge/materials/bump-metal-material.js @@ -158,10 +158,14 @@ var BumpMetalMaterial = function BumpMetalMaterial() { var exportStr = "material: " + this.getShaderName() + "\n"; exportStr += "name: " + this.getName() + "\n"; + var world = this.getWorld(); + if (!world) + throw new Error( "no world in material.export, " + this.getName() ); + exportStr += "lightDiff: " + this.getLightDiff() + "\n"; - exportStr += "diffuseTexture: " + this.getDiffuseTexture() + "\n"; - exportStr += "specularTexture: " + this.getSpecularTexture() + "\n"; - exportStr += "normalMap: " + this.getNormalTexture() + "\n"; + exportStr += "diffuseTexture: " + world.cleansePath(this.getDiffuseTexture()) + "\n"; + exportStr += "specularTexture: " + world.cleansePath(this.getSpecularTexture()) + "\n"; + exportStr += "normalMap: " + world.cleansePath(this.getNormalTexture()) + "\n"; // every material needs to terminate like this exportStr += "endMaterial\n"; -- cgit v1.2.3 From e92a6da7b84c58803489d70efedf74837ddfe4cd Mon Sep 17 00:00:00 2001 From: hwc487 Date: Fri, 9 Mar 2012 13:34:09 -0800 Subject: Removed asset path replacement at authortime. --- js/lib/rdge/materials/bump-metal-material.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'js/lib/rdge/materials/bump-metal-material.js') diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js index 70873885..fa6f5300 100755 --- a/js/lib/rdge/materials/bump-metal-material.js +++ b/js/lib/rdge/materials/bump-metal-material.js @@ -163,9 +163,9 @@ var BumpMetalMaterial = function BumpMetalMaterial() { throw new Error( "no world in material.export, " + this.getName() ); exportStr += "lightDiff: " + this.getLightDiff() + "\n"; - exportStr += "diffuseTexture: " + world.cleansePath(this.getDiffuseTexture()) + "\n"; - exportStr += "specularTexture: " + world.cleansePath(this.getSpecularTexture()) + "\n"; - exportStr += "normalMap: " + world.cleansePath(this.getNormalTexture()) + "\n"; + exportStr += "diffuseTexture: " + this.getDiffuseTexture() + "\n"; + exportStr += "specularTexture: " + this.getSpecularTexture() + "\n"; + exportStr += "normalMap: " + this.getNormalTexture() + "\n"; // every material needs to terminate like this exportStr += "endMaterial\n"; -- cgit v1.2.3