aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/bump-metal-material.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/materials/bump-metal-material.js')
-rwxr-xr-xjs/lib/rdge/materials/bump-metal-material.js12
1 files changed, 7 insertions, 5 deletions
diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js
index 2ef83227..d764de66 100755
--- a/js/lib/rdge/materials/bump-metal-material.js
+++ b/js/lib/rdge/materials/bump-metal-material.js
@@ -107,16 +107,18 @@ var BumpMetalMaterial = function BumpMetalMaterial() {
107 this.init = function( world ) 107 this.init = function( world )
108 { 108 {
109 // save the world 109 // save the world
110 if (world) this.setWorld( world ); 110 if (world) {
111 this.setWorld( world );
112 }
111 113
112 // set up the shader 114 // set up the shader
113 this._shader = new jshader(); 115 this._shader = new RDGE.jshader();
114 this._shader.def = bumpMetalMaterialDef; 116 this._shader.def = bumpMetalMaterialDef;
115 this._shader.init(); 117 this._shader.init();
116 this._shader['default'].u_light0Diff.set( this.getLightDiff() ); 118 this._shader['default'].u_light0Diff.set( this.getLightDiff() );
117 119
118 // set up the material node 120 // set up the material node
119 this._materialNode = createMaterialNode( this.getShaderName() + "_" + world.generateUniqueNodeID() ); 121 this._materialNode = RDGE.createMaterialNode( this.getShaderName() + "_" + world.generateUniqueNodeID() );
120 this._materialNode.setShader(this._shader); 122 this._materialNode.setShader(this._shader);
121 123
122 // set some image maps 124 // set some image maps
@@ -131,7 +133,7 @@ var BumpMetalMaterial = function BumpMetalMaterial() {
131 if (material) 133 if (material)
132 { 134 {
133 var technique = material.shaderProgram['default']; 135 var technique = material.shaderProgram['default'];
134 var renderer = g_Engine.getContext().renderer; 136 var renderer = RDGE.globals.engine.getContext().renderer;
135 if (renderer && technique) 137 if (renderer && technique)
136 { 138 {
137 var texMapName = this._propValues[this._propNames[index]]; 139 var texMapName = this._propValues[this._propNames[index]];
@@ -205,7 +207,7 @@ var BumpMetalMaterial = function BumpMetalMaterial() {
205 exportStr += "lightDiff: " + this.getLightDiff() + "\n"; 207 exportStr += "lightDiff: " + this.getLightDiff() + "\n";
206 exportStr += "diffuseTexture: " + this.getDiffuseTexture() + "\n"; 208 exportStr += "diffuseTexture: " + this.getDiffuseTexture() + "\n";
207 exportStr += "specularTexture: " + this.getSpecularTexture() + "\n"; 209 exportStr += "specularTexture: " + this.getSpecularTexture() + "\n";
208 exportStr += "normalMap: " + this.getNormalTexture() + "\n"; 210 exportStr += "normalMap: " + this.getNormalTexture() + "\n";
209 211
210 // every material needs to terminate like this 212 // every material needs to terminate like this
211 exportStr += "endMaterial\n"; 213 exportStr += "endMaterial\n";