From 1fa8516bcd0fb0277c13a7081b5a51ce041d3496 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Thu, 12 Apr 2012 06:24:46 -0700 Subject: Cloud material --- js/lib/rdge/materials/cloud-material.js | 15 ++++++++++----- js/lib/rdge/materials/flat-material.js | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) (limited to 'js/lib/rdge/materials') diff --git a/js/lib/rdge/materials/cloud-material.js b/js/lib/rdge/materials/cloud-material.js index f253718a..cec00696 100644 --- a/js/lib/rdge/materials/cloud-material.js +++ b/js/lib/rdge/materials/cloud-material.js @@ -31,7 +31,7 @@ var CloudMaterial = function CloudMaterial() { // parameter initial values this._time = 0.0; - this._surfaceAlpha = 0.5; + this._surfaceAlpha = 1.0; this._zmin = 0.1; this._zmax = 10.0; @@ -125,6 +125,7 @@ var CloudMaterial = function CloudMaterial() { // build a world to do the rendering this._srcWorld = new GLWorld( this._srcCanvas, true ); var srcWorld = this._srcWorld; + this._srcCanvas.__GLWorld = srcWorld; // build the geometry var prim = this.buildGeometry(); @@ -174,11 +175,15 @@ var CloudMaterial = function CloudMaterial() { if (renderer && technique) { var texMapName = this._propValues[this._propNames[0]]; var wrap = 'REPEAT', mips = true; - var tex = this.loadTexture( texMapName, wrap, mips ); - - if (tex) { - technique.u_tex0.set( tex ); + //var tex = this.loadTexture( texMapName, wrap, mips ); + if (this._glTex) + { + this._glTex.render(); + var tex = this._glTex.getTexture(); + if (tex) + technique.u_tex0.set( tex ); } + } } }; diff --git a/js/lib/rdge/materials/flat-material.js b/js/lib/rdge/materials/flat-material.js index 5030cc88..ddea9d9e 100755 --- a/js/lib/rdge/materials/flat-material.js +++ b/js/lib/rdge/materials/flat-material.js @@ -26,7 +26,7 @@ var FlatMaterial = function FlatMaterial() { this.getShaderName = function() { return this._shaderName; }; this.isAnimated = function() { return false; }; - this.hasVertexDeformation = function() { return true; }; + this.hasVertexDeformation = function() { return false; }; this._hasVertexDeformation = true; this._vertexDeformationTolerance = 0.2; -- cgit v1.2.3