From 9e812f35ffa751e9215c5427c0c44005bd357924 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 7 Mar 2012 17:18:38 -0800 Subject: Fixed a few problems with Plasma material. --- js/lib/rdge/materials/plasma-material.js | 30 +++++++----------------------- 1 file changed, 7 insertions(+), 23 deletions(-) (limited to 'js/lib/rdge/materials') diff --git a/js/lib/rdge/materials/plasma-material.js b/js/lib/rdge/materials/plasma-material.js index 62d0db70..86b1a93c 100644 --- a/js/lib/rdge/materials/plasma-material.js +++ b/js/lib/rdge/materials/plasma-material.js @@ -17,8 +17,6 @@ var PlasmaMaterial = function PlasmaMaterial() { this._dTime = 0.01; this._speed = 1.0; - this._color = [1,0,0,1]; - /////////////////////////////////////////////////////////////////////// // Property Accessors @@ -30,20 +28,12 @@ var PlasmaMaterial = function PlasmaMaterial() { /////////////////////////////////////////////////////////////////////// // Material Property Accessors /////////////////////////////////////////////////////////////////////// - this._propNames = ["color"]; - this._propLabels = ["Color"]; - this._propTypes = ["color"]; - this._propValues = []; - - this._propValues[ this._propNames[0] ] = this._color; - - this.setProperty = function( prop, value ) { - // make sure we have legitimate imput - if (this.validateProperty( prop, value )) { - this._color = value.slice(0); - this._shader['default'][prop].set(value); - } + + this.setProperty = function( prop, value ) + { + // plasma has no properties }; + /////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////// @@ -65,8 +55,7 @@ var PlasmaMaterial = function PlasmaMaterial() { // set the default value this._time = 0; - this._shader['default'].u_time = this._time; - this.setProperty( "color", [this._time, 0, 0, 1] ); + this._shader['default'].u_time.set( [this._time] ); // set up the material node this._materialNode = createMaterialNode("plasmaMaterial" + "_" + world.generateUniqueNodeID()); @@ -74,11 +63,7 @@ var PlasmaMaterial = function PlasmaMaterial() { }; this.update = function( time ) { - this._shader['default'].u_time = this._time; - var color = this.getProperty( "color" ); - color[0] = this._time; - this.setProperty( "color", color ); - //console.log( "update color to: " + color ); + this._shader['default'].u_time.set( [this._time] ); this._time += this._dTime; } @@ -112,7 +97,6 @@ var plasmaShaderDef = 'params' : { 'u_time' : { 'type' : 'float' }, - 'color' : { 'type' : 'vec4' } }, // render states -- cgit v1.2.3