diff options
Diffstat (limited to 'js/helper-classes/backup-delete/Materials/BumpMetalMaterial.js')
-rwxr-xr-x | js/helper-classes/backup-delete/Materials/BumpMetalMaterial.js | 39 |
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 ) |