aboutsummaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorhwc4872012-03-27 10:39:34 -0700
committerhwc4872012-03-27 10:39:34 -0700
commit2acd77dac475a5197cb67b0257c758c357dfd443 (patch)
tree417a00605631977b6310f96a4f4e5eba63b548bb /js
parentd7269673dc1f5caf6df3765c6b669d3d1a93bdb1 (diff)
downloadninja-2acd77dac475a5197cb67b0257c758c357dfd443.tar.gz
texture abstraction integration
Diffstat (limited to 'js')
-rw-r--r--js/lib/rdge/materials/pulse-material.js4
-rw-r--r--js/lib/rdge/materials/relief-tunnel-material.js7
2 files changed, 8 insertions, 3 deletions
diff --git a/js/lib/rdge/materials/pulse-material.js b/js/lib/rdge/materials/pulse-material.js
index e3490134..b12e9dd5 100644
--- a/js/lib/rdge/materials/pulse-material.js
+++ b/js/lib/rdge/materials/pulse-material.js
@@ -4,7 +4,6 @@
4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved. 4 (c) Copyright 2011 Motorola Mobility, Inc. All Rights Reserved.
5 </copyright> */ 5 </copyright> */
6 6
7var MaterialParser = require("js/lib/rdge/materials/material-parser").MaterialParser;
8var Texture = require("js/lib/rdge/texture").Texture; 7var Texture = require("js/lib/rdge/texture").Texture;
9var Material = require("js/lib/rdge/materials/material").Material; 8var Material = require("js/lib/rdge/materials/material").Material;
10/////////////////////////////////////////////////////////////////////// 9///////////////////////////////////////////////////////////////////////
@@ -220,7 +219,7 @@ var PulseMaterial = function PulseMaterial()
220 } 219 }
221 } 220 }
222 221
223 222 /*
224 this.export = function() { 223 this.export = function() {
225 // every material needs the base type and instance name 224 // every material needs the base type and instance name
226 var exportStr = "material: " + this.getShaderName() + "\n"; 225 var exportStr = "material: " + this.getShaderName() + "\n";
@@ -261,6 +260,7 @@ var PulseMaterial = function PulseMaterial()
261 260
262 return rtnStr; 261 return rtnStr;
263 } 262 }
263 */
264}; 264};
265 265
266/////////////////////////////////////////////////////////////////////////////////////// 266///////////////////////////////////////////////////////////////////////////////////////
diff --git a/js/lib/rdge/materials/relief-tunnel-material.js b/js/lib/rdge/materials/relief-tunnel-material.js
index 52c40543..24fc885f 100644
--- a/js/lib/rdge/materials/relief-tunnel-material.js
+++ b/js/lib/rdge/materials/relief-tunnel-material.js
@@ -6,8 +6,10 @@
6 6
7 7
8var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; 8var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial;
9var Texture = require("js/lib/rdge/texture").Texture;
9 10
10var ReliefTunnelMaterial = function ReliefTunnelMaterial() { 11var ReliefTunnelMaterial = function ReliefTunnelMaterial()
12{
11 /////////////////////////////////////////////////////////////////////// 13 ///////////////////////////////////////////////////////////////////////
12 // Instance variables 14 // Instance variables
13 /////////////////////////////////////////////////////////////////////// 15 ///////////////////////////////////////////////////////////////////////
@@ -62,6 +64,9 @@ var ReliefTunnelMaterial = function ReliefTunnelMaterial() {
62 this._shader['default'].u_time.set( [this._time] ); 64 this._shader['default'].u_time.set( [this._time] );
63 } 65 }
64 66
67 var texMapName = this._propValues[this._propNames[0]];
68 this._glTex = new Texture( world, texMapName );
69
65 // set the shader values in the shader 70 // set the shader values in the shader
66 this.updateTexture(); 71 this.updateTexture();
67 this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); 72 this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] );