aboutsummaryrefslogtreecommitdiff
path: root/js/lib/rdge/materials/cloud-material.js
diff options
context:
space:
mode:
Diffstat (limited to 'js/lib/rdge/materials/cloud-material.js')
-rw-r--r--js/lib/rdge/materials/cloud-material.js20
1 files changed, 10 insertions, 10 deletions
diff --git a/js/lib/rdge/materials/cloud-material.js b/js/lib/rdge/materials/cloud-material.js
index 873059bc..47f4b647 100644
--- a/js/lib/rdge/materials/cloud-material.js
+++ b/js/lib/rdge/materials/cloud-material.js
@@ -225,7 +225,7 @@ var CloudMaterial = function CloudMaterial()
225 } 225 }
226 226
227 var technique, renderer, tex; 227 var technique, renderer, tex;
228 228
229 // update the cloud map material 229 // update the cloud map material
230 var material = this._materialNode; 230 var material = this._materialNode;
231 if (material) 231 if (material)
@@ -261,7 +261,7 @@ var CloudMaterial = function CloudMaterial()
261 { 261 {
262 // save the current RDGE context so we can reset it later 262 // save the current RDGE context so we can reset it later
263 var saveContext = RDGE.globals.engine.getContext(); 263 var saveContext = RDGE.globals.engine.getContext();
264 this.getWorld().stop(); 264 this.getWorld().stop();
265 265
266 // build a world to do the rendering 266 // build a world to do the rendering
267 if (!GLWorld) GLWorld = require("js/lib/drawing/world").World; 267 if (!GLWorld) GLWorld = require("js/lib/drawing/world").World;
@@ -349,7 +349,7 @@ var CloudMaterial = function CloudMaterial()
349 var hWidth = -z*(r-l)/(2.0*zn)*xFillNDC, 349 var hWidth = -z*(r-l)/(2.0*zn)*xFillNDC,
350 hHeight = -z*(t-b)/(2.0*zn)*yFillNDC; 350 hHeight = -z*(t-b)/(2.0*zn)*yFillNDC;
351 351
352 352
353 //this.createFill([x,y], 2*xFill, 2*yFill, tlRadius, blRadius, brRadius, trRadius, fillMaterial); 353 //this.createFill([x,y], 2*xFill, 2*yFill, tlRadius, blRadius, brRadius, trRadius, fillMaterial);
354 var ctr = [x,y], width = 2*hWidth, height = 2*hHeight; 354 var ctr = [x,y], width = 2*hWidth, height = 2*hHeight;
355 var cloudSize = width > height ? 0.25*width : 0.25*height; 355 var cloudSize = width > height ? 0.25*width : 0.25*height;
@@ -377,12 +377,12 @@ var CloudMaterial = function CloudMaterial()
377 this._adjustedZMin = zMin; 377 this._adjustedZMin = zMin;
378 this._adjustedZMax = zMax; 378 this._adjustedZMax = zMax;
379 379
380 380
381 // build the polygons 381 // build the polygons
382 var verts = [], 382 var verts = [],
383 normals = [ [0,0,1], [0,0,1], [0,0,1], [0,0,1] ], 383 normals = [ [0,0,1], [0,0,1], [0,0,1], [0,0,1] ],
384 uvs = [ [0,0], [1,0], [1,1], [0,1] ]; 384 uvs = [ [0,0], [1,0], [1,1], [0,1] ];
385 385
386 for ( i = 0; i < 20; i++ ) 386 for ( i = 0; i < 20; i++ )
387 { 387 {
388// var x = hWidth*2*(Math.random() - 0.5), 388// var x = hWidth*2*(Math.random() - 0.5),
@@ -496,17 +496,17 @@ var cloudMaterialDef =
496 ] 496 ]
497 } 497 }
498}; 498};
499 499
500// the cloud map material def is used to map the cloud image onto 500// the cloud map material def is used to map the cloud image onto
501// the destination geometry 501// the destination geometry
502var cloudMapMaterialDef = 502var cloudMapMaterialDef =
503{'shaders': 503{'shaders':
504 { 504 {
505 'defaultVShader':"assets/shaders/Basic.vert.glsl", 505 'defaultVShader':"assets/shaders/Basic.vert.glsl",
506 'defaultFShader':"assets/shaders/BasicTex.frag.glsl" 506 'defaultFShader':"assets/shaders/BasicTex.frag.glsl"
507 }, 507 },
508 'techniques': 508 'techniques':
509 { 509 {
510 'default': 510 'default':
511 [ 511 [
512 { 512 {
@@ -520,13 +520,13 @@ var cloudMapMaterialDef =
520 'texcoord' : { 'type' : 'vec2' } 520 'texcoord' : { 'type' : 'vec2' }
521 }, 521 },
522 // parameters 522 // parameters
523 'params' : 523 'params' :
524 { 524 {
525 'u_tex0' : { 'type' : 'tex2d' }, 525 'u_tex0' : { 'type' : 'tex2d' },
526 }, 526 },
527 527
528 // render states 528 // render states
529 'states' : 529 'states' :
530 { 530 {
531 'depthEnable' : true, 531 'depthEnable' : true,
532 'offset':[1.0, 0.1] 532 'offset':[1.0, 0.1]