From b5aa082842f798d1eec582428468a322bd5a017f Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 11 Apr 2012 17:11:43 -0700 Subject: Cloud material --- js/lib/rdge/materials/cloud-material.js | 2 ++ js/lib/rdge/texture.js | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/js/lib/rdge/materials/cloud-material.js b/js/lib/rdge/materials/cloud-material.js index c1dabce8..f253718a 100644 --- a/js/lib/rdge/materials/cloud-material.js +++ b/js/lib/rdge/materials/cloud-material.js @@ -188,6 +188,8 @@ var CloudMaterial = function CloudMaterial() { var material = this._materialNode; if (material) { + if (this._srcWorld) this._srcWorld.draw(); + var technique = material.shaderProgram['default']; var renderer = g_Engine.getContext().renderer; if (renderer && technique) { diff --git a/js/lib/rdge/texture.js b/js/lib/rdge/texture.js index 345effd6..569bc364 100644 --- a/js/lib/rdge/texture.js +++ b/js/lib/rdge/texture.js @@ -159,6 +159,8 @@ function Texture( dstWorld, texMapName, wrap, mips ) var __texCounter = 0; this.loadFromCanvas = function() { + var NJUtils = require("js/lib/NJUtils").NJUtils; + var srcCanvas = this._srcCanvas; var wrap = this._wrap; var mips = this._mips; @@ -175,7 +177,8 @@ function Texture( dstWorld, texMapName, wrap, mips ) // create the canvas and context to render into var doc = srcCanvas.ownerDocument; - this._renderCanvas = doc.createElement("texture_canvas"); + //this._renderCanvas = doc.createElement("texture_canvas"); + this._renderCanvas = NJUtils.makeNJElement("canvas", "texture_canvas", "shape", {"data-RDGE-id": NJUtils.generateRandom()}, true); this.render(); -- cgit v1.2.3