From a7aa51e6b91623772eef54b827616432838b560e Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 13 Jun 2012 13:56:10 -0700 Subject: Material bug fixes - reset texture array. --- js/lib/rdge/materials/bump-metal-material.js | 4 ++-- js/lib/rdge/materials/deform-material.js | 3 +++ js/lib/rdge/materials/flag-material.js | 3 +++ js/lib/rdge/materials/fly-material.js | 3 +++ js/lib/rdge/materials/keleidoscope-material.js | 3 +++ js/lib/rdge/materials/radial-blur-material.js | 3 +++ js/lib/rdge/materials/relief-tunnel-material.js | 3 +++ js/lib/rdge/materials/square-tunnel-material.js | 3 +++ js/lib/rdge/materials/star-material.js | 3 +++ js/lib/rdge/materials/tunnel-material.js | 3 +++ js/lib/rdge/materials/twist-material.js | 3 +++ js/lib/rdge/materials/uber-material.js | 3 +++ js/lib/rdge/materials/water-material.js | 3 +++ js/lib/rdge/materials/z-invert-material.js | 3 +++ js/lib/rdge/texture.js | 2 +- 15 files changed, 42 insertions(+), 3 deletions(-) (limited to 'js/lib') diff --git a/js/lib/rdge/materials/bump-metal-material.js b/js/lib/rdge/materials/bump-metal-material.js index f73f1d34..4604a89d 100755 --- a/js/lib/rdge/materials/bump-metal-material.js +++ b/js/lib/rdge/materials/bump-metal-material.js @@ -24,8 +24,8 @@ var BumpMetalMaterial = function BumpMetalMaterial() { this._defaultSpecularTexture = "assets/images/silver.png"; this._defaultNormalTexture = "assets/images/normalMap.png"; - // keep the array of initialized textures - this._textures = []; + // array textures indexed by shader uniform name + this._glTextures = []; this._speed = 1.0; diff --git a/js/lib/rdge/materials/deform-material.js b/js/lib/rdge/materials/deform-material.js index 91202b24..7ff5b3e3 100644 --- a/js/lib/rdge/materials/deform-material.js +++ b/js/lib/rdge/materials/deform-material.js @@ -19,6 +19,9 @@ var DeformMaterial = function DeformMaterial() { this._time = 0.0; this._dTime = 0.01; + // array textures indexed by shader uniform name + this._glTextures = []; + /////////////////////////////////////////////////////////////////////// // Properties /////////////////////////////////////////////////////////////////////// diff --git a/js/lib/rdge/materials/flag-material.js b/js/lib/rdge/materials/flag-material.js index a8c319e4..d0bf522f 100644 --- a/js/lib/rdge/materials/flag-material.js +++ b/js/lib/rdge/materials/flag-material.js @@ -27,6 +27,9 @@ var FlagMaterial = function FlagMaterial() { this._hasVertexDeformation = true; + // array textures indexed by shader uniform name + this._glTextures = []; + /////////////////////////////////////////////////////////////////////// // Properties /////////////////////////////////////////////////////////////////////// diff --git a/js/lib/rdge/materials/fly-material.js b/js/lib/rdge/materials/fly-material.js index 7b880a2e..8fa2b614 100644 --- a/js/lib/rdge/materials/fly-material.js +++ b/js/lib/rdge/materials/fly-material.js @@ -19,6 +19,9 @@ var FlyMaterial = function FlyMaterial() { this._time = 0.0; this._dTime = 0.01; + // array textures indexed by shader uniform name + this._glTextures = []; + /////////////////////////////////////////////////////////////////////// // Properties /////////////////////////////////////////////////////////////////////// diff --git a/js/lib/rdge/materials/keleidoscope-material.js b/js/lib/rdge/materials/keleidoscope-material.js index 2754420f..0696063d 100644 --- a/js/lib/rdge/materials/keleidoscope-material.js +++ b/js/lib/rdge/materials/keleidoscope-material.js @@ -19,6 +19,9 @@ var KeleidoscopeMaterial = function KeleidoscopeMaterial() { this._time = 0.0; this._dTime = 0.01; + // array textures indexed by shader uniform name + this._glTextures = []; + /////////////////////////////////////////////////////////////////////// // Properties /////////////////////////////////////////////////////////////////////// diff --git a/js/lib/rdge/materials/radial-blur-material.js b/js/lib/rdge/materials/radial-blur-material.js index 57f4a6e0..0eb13631 100644 --- a/js/lib/rdge/materials/radial-blur-material.js +++ b/js/lib/rdge/materials/radial-blur-material.js @@ -19,6 +19,9 @@ var RadialBlurMaterial = function RadialBlurMaterial() { this._time = 0.0; this._dTime = 0.01; + // array textures indexed by shader uniform name + this._glTextures = []; + /////////////////////////////////////////////////////////////////////// // Property Accessors /////////////////////////////////////////////////////////////////////// diff --git a/js/lib/rdge/materials/relief-tunnel-material.js b/js/lib/rdge/materials/relief-tunnel-material.js index 9404e359..0390337e 100644 --- a/js/lib/rdge/materials/relief-tunnel-material.js +++ b/js/lib/rdge/materials/relief-tunnel-material.js @@ -21,6 +21,9 @@ var ReliefTunnelMaterial = function ReliefTunnelMaterial() this._time = 0.0; this._dTime = 0.01; + // array textures indexed by shader uniform name + this._glTextures = []; + /////////////////////////////////////////////////////////////////////// // Material Property Accessors /////////////////////////////////////////////////////////////////////// diff --git a/js/lib/rdge/materials/square-tunnel-material.js b/js/lib/rdge/materials/square-tunnel-material.js index bffae254..df2193c4 100644 --- a/js/lib/rdge/materials/square-tunnel-material.js +++ b/js/lib/rdge/materials/square-tunnel-material.js @@ -19,6 +19,9 @@ var SquareTunnelMaterial = function SquareTunnelMaterial() { this._time = 0.0; this._dTime = 0.01; + // array textures indexed by shader uniform name + this._glTextures = []; + /////////////////////////////////////////////////////////////////////// // Material Property Accessors /////////////////////////////////////////////////////////////////////// diff --git a/js/lib/rdge/materials/star-material.js b/js/lib/rdge/materials/star-material.js index 9f94b8c3..c99a1639 100644 --- a/js/lib/rdge/materials/star-material.js +++ b/js/lib/rdge/materials/star-material.js @@ -19,6 +19,9 @@ var StarMaterial = function StarMaterial() { this._time = 0.0; this._dTime = 0.01; + // array textures indexed by shader uniform name + this._glTextures = []; + /////////////////////////////////////////////////////////////////////// // Property Accessors /////////////////////////////////////////////////////////////////////// diff --git a/js/lib/rdge/materials/tunnel-material.js b/js/lib/rdge/materials/tunnel-material.js index b833a251..ec5eff99 100644 --- a/js/lib/rdge/materials/tunnel-material.js +++ b/js/lib/rdge/materials/tunnel-material.js @@ -20,6 +20,9 @@ var TunnelMaterial = function TunnelMaterial() { this._time = 0.0; this._dTime = 0.001; + // array textures indexed by shader uniform name + this._glTextures = []; + /////////////////////////////////////////////////////////////////////// // Material Property Accessors /////////////////////////////////////////////////////////////////////// diff --git a/js/lib/rdge/materials/twist-material.js b/js/lib/rdge/materials/twist-material.js index 35f7eda2..9a78914d 100644 --- a/js/lib/rdge/materials/twist-material.js +++ b/js/lib/rdge/materials/twist-material.js @@ -21,6 +21,9 @@ var TwistMaterial = function TwistMaterial() { this._time = 0.0; this._dTime = 0.01; + // array textures indexed by shader uniform name + this._glTextures = []; + /////////////////////////////////////////////////////////////////////// // Material Property Accessors /////////////////////////////////////////////////////////////////////// diff --git a/js/lib/rdge/materials/uber-material.js b/js/lib/rdge/materials/uber-material.js index 0fef78f6..9aa0f7ea 100755 --- a/js/lib/rdge/materials/uber-material.js +++ b/js/lib/rdge/materials/uber-material.js @@ -41,6 +41,9 @@ var UberMaterial = function UberMaterial() { this._MAX_LIGHTS = 4; + // array textures indexed by shader uniform name + this._glTextures = []; + /////////////////////////////////////////////////////////////////////// // Material Property Accessors /////////////////////////////////////////////////////////////////////// diff --git a/js/lib/rdge/materials/water-material.js b/js/lib/rdge/materials/water-material.js index 3e63ddb6..1dd127fc 100644 --- a/js/lib/rdge/materials/water-material.js +++ b/js/lib/rdge/materials/water-material.js @@ -24,6 +24,9 @@ var WaterMaterial = function WaterMaterial() this._time = 0.0; this._dTime = 0.01; + // array textures indexed by shader uniform name + this._glTextures = []; + this.isAnimated = function() { return true; }; this.getShaderDef = function() { return waterMaterialDef; }; diff --git a/js/lib/rdge/materials/z-invert-material.js b/js/lib/rdge/materials/z-invert-material.js index 99b835b3..f1526b39 100644 --- a/js/lib/rdge/materials/z-invert-material.js +++ b/js/lib/rdge/materials/z-invert-material.js @@ -20,6 +20,9 @@ var ZInvertMaterial = function ZInvertMaterial() { this._time = 0.0; this._dTime = 0.01; + // array textures indexed by shader uniform name + this._glTextures = []; + this.isAnimated = function() { return true; }; this.getShaderDef = function() { return zInvertMaterialDef; }; diff --git a/js/lib/rdge/texture.js b/js/lib/rdge/texture.js index 616729f6..37658580 100644 --- a/js/lib/rdge/texture.js +++ b/js/lib/rdge/texture.js @@ -171,7 +171,7 @@ function Texture( dstWorld, texMapName, wrap, mips ) this._srcCanvas = null; // only load if something has changed - if (this._texMapName !== texMapName) // does RDGE allow us to change wrap or mips? + //if (this._texMapName !== texMapName) // does RDGE allow us to change wrap or mips? { var texMapName = this._texMapName; var wrap = this._wrap; -- cgit v1.2.3