From 947bad893335e1023bcbe177ff8db454c27c4bf8 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Fri, 30 Mar 2012 06:23:53 -0700 Subject: converted materials to new texture structure --- js/lib/rdge/materials/julia-material.js | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'js/lib/rdge/materials/julia-material.js') diff --git a/js/lib/rdge/materials/julia-material.js b/js/lib/rdge/materials/julia-material.js index a85bd6f7..c1eb2b6d 100644 --- a/js/lib/rdge/materials/julia-material.js +++ b/js/lib/rdge/materials/julia-material.js @@ -5,6 +5,7 @@ */ var PulseMaterial = require("js/lib/rdge/materials/pulse-material").PulseMaterial; +var Texture = require("js/lib/rdge/texture").Texture; var JuliaMaterial = function JuliaMaterial() { /////////////////////////////////////////////////////////////////////// @@ -59,6 +60,10 @@ var JuliaMaterial = function JuliaMaterial() { this._shader['default'].u_time.set( [this._time] ); } + // set up the texture + var texMapName = this._propValues[this._propNames[0]]; + this._glTex = new Texture( world, texMapName ); + // set the shader values in the shader this.setResolution( [world.getViewportWidth(),world.getViewportHeight()] ); this.update( 0 ); -- cgit v1.2.3 From 5a1965bf2ed9a54601ca16fd67555335c510ce08 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Thu, 26 Apr 2012 16:40:05 -0700 Subject: Update materials to the new texture model. Create local world for deleted source canvases --- js/lib/rdge/materials/julia-material.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) (limited to 'js/lib/rdge/materials/julia-material.js') diff --git a/js/lib/rdge/materials/julia-material.js b/js/lib/rdge/materials/julia-material.js index e35062a0..a06b1771 100644 --- a/js/lib/rdge/materials/julia-material.js +++ b/js/lib/rdge/materials/julia-material.js @@ -29,17 +29,19 @@ var JuliaMaterial = function JuliaMaterial() { /////////////////////////////////////////////////////////////////////// // duplcate method requirde this.dup = function( world ) { - // allocate a new uber material - var newMat = new JuliaMaterial(); + // get the current values; + var propNames = [], propValues = [], propTypes = [], propLabels = []; + this.getAllProperties(propNames, propValues, propTypes, propLabels); + + // allocate a new material + var newMat = new JuliaMaterial(); // copy over the current values; - var propNames = [], propValues = [], propTypes = [], propLabels = []; - this.getAllProperties( propNames, propValues, propTypes, propLabels); - var n = propNames.length; - for (var i=0; i