diff options
author | hwc487 | 2012-03-02 09:36:31 -0800 |
---|---|---|
committer | hwc487 | 2012-03-02 09:36:31 -0800 |
commit | d044b6d9755d8ca686501fc3dd5644180e2ffbf0 (patch) | |
tree | 0ff6ca04987639417c0188ca8af2580b62d65f9f /js/helper-classes/RDGE/Materials/BumpMetalMaterial.js | |
parent | cf32843b1d64c631e6e7c808cc4f13ac316e1baf (diff) | |
download | ninja-d044b6d9755d8ca686501fc3dd5644180e2ffbf0.tar.gz |
WebGL File IO
Diffstat (limited to 'js/helper-classes/RDGE/Materials/BumpMetalMaterial.js')
-rwxr-xr-x | js/helper-classes/RDGE/Materials/BumpMetalMaterial.js | 37 |
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 ) |