aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials
diff options
context:
space:
mode:
authorhwc4872012-04-12 06:24:46 -0700
committerhwc4872012-04-12 06:24:46 -0700
commit1fa8516bcd0fb0277c13a7081b5a51ce041d3496 (patch)
tree11f80ddc57a6cc47d7a57ff8091b5cb435d6d253 /js/lib/rdge/materials
parentb5aa082842f798d1eec582428468a322bd5a017f (diff)
downloadninja-1fa8516bcd0fb0277c13a7081b5a51ce041d3496.tar.gz
Cloud material
Diffstat (limited to 'js/lib/rdge/materials')
-rw-r--r--js/lib/rdge/materials/cloud-material.js15
-rwxr-xr-xjs/lib/rdge/materials/flat-material.js2
2 files changed, 11 insertions, 6 deletions
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() {
31 31
32 // parameter initial values 32 // parameter initial values
33 this._time = 0.0; 33 this._time = 0.0;
34 this._surfaceAlpha = 0.5; 34 this._surfaceAlpha = 1.0;
35 this._zmin = 0.1; 35 this._zmin = 0.1;
36 this._zmax = 10.0; 36 this._zmax = 10.0;
37 37
@@ -125,6 +125,7 @@ var CloudMaterial = function CloudMaterial() {
125 // build a world to do the rendering 125 // build a world to do the rendering
126 this._srcWorld = new GLWorld( this._srcCanvas, true ); 126 this._srcWorld = new GLWorld( this._srcCanvas, true );
127 var srcWorld = this._srcWorld; 127 var srcWorld = this._srcWorld;
128 this._srcCanvas.__GLWorld = srcWorld;
128 129
129 // build the geometry 130 // build the geometry
130 var prim = this.buildGeometry(); 131 var prim = this.buildGeometry();
@@ -174,11 +175,15 @@ var CloudMaterial = function CloudMaterial() {
174 if (renderer && technique) { 175 if (renderer && technique) {
175 var texMapName = this._propValues[this._propNames[0]]; 176 var texMapName = this._propValues[this._propNames[0]];
176 var wrap = 'REPEAT', mips = true; 177 var wrap = 'REPEAT', mips = true;
177 var tex = this.loadTexture( texMapName, wrap, mips ); 178 //var tex = this.loadTexture( texMapName, wrap, mips );
178 179 if (this._glTex)
179 if (tex) { 180 {
180 technique.u_tex0.set( tex ); 181 this._glTex.render();
182 var tex = this._glTex.getTexture();
183 if (tex)
184 technique.u_tex0.set( tex );
181 } 185 }
186
182 } 187 }
183 } 188 }
184 }; 189 };
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() {
26 this.getShaderName = function() { return this._shaderName; }; 26 this.getShaderName = function() { return this._shaderName; };
27 27
28 this.isAnimated = function() { return false; }; 28 this.isAnimated = function() { return false; };
29 this.hasVertexDeformation = function() { return true; }; 29 this.hasVertexDeformation = function() { return false; };
30 this._hasVertexDeformation = true; 30 this._hasVertexDeformation = true;
31 this._vertexDeformationTolerance = 0.2; 31 this._vertexDeformationTolerance = 0.2;
32 32