aboutsummaryrefslogtreecommitdiff
path: root/js/helper-classes/RDGE/Materials/BumpMetalMaterial.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/helper-classes/RDGE/Materials/BumpMetalMaterial.js')
-rwxr-xr-xjs/helper-classes/RDGE/Materials/BumpMetalMaterial.js37
1 files changed, 21 insertions, 16 deletions
diff --git a/js/helper-classes/RDGE/Materials/BumpMetalMaterial.js b/js/helper-classes/RDGE/Materials/BumpMetalMaterial.js
index a7a3724e..1a6c54c9 100755
--- a/js/helper-classes/RDGE/Materials/BumpMetalMaterial.js
+++ b/js/helper-classes/RDGE/Materials/BumpMetalMaterial.js
@@ -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 )