From 3a754133dbc138390503341fd2e9beba3e43aa4b Mon Sep 17 00:00:00 2001 From: Jose Antonio Marquez Date: Fri, 27 Jan 2012 12:05:17 -0800 Subject: Merged old FileIO --- js/helper-classes/RDGE/Materials/FlatMaterial.js | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 js/helper-classes/RDGE/Materials/FlatMaterial.js (limited to 'js/helper-classes/RDGE/Materials/FlatMaterial.js') diff --git a/js/helper-classes/RDGE/Materials/FlatMaterial.js b/js/helper-classes/RDGE/Materials/FlatMaterial.js old mode 100644 new mode 100755 -- cgit v1.2.3 From 805059d68087530721212a650412aefb85e98d1f Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 9 Feb 2012 10:26:57 -0800 Subject: Removed unused materials. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/RDGE/Materials/FlatMaterial.js | 53 ++++++++++++++---------- 1 file changed, 32 insertions(+), 21 deletions(-) (limited to 'js/helper-classes/RDGE/Materials/FlatMaterial.js') diff --git a/js/helper-classes/RDGE/Materials/FlatMaterial.js b/js/helper-classes/RDGE/Materials/FlatMaterial.js index a5c079a8..a250dc0a 100644 --- a/js/helper-classes/RDGE/Materials/FlatMaterial.js +++ b/js/helper-classes/RDGE/Materials/FlatMaterial.js @@ -26,8 +26,13 @@ function FlatMaterial() /////////////////////////////////////////////////////////////////////// // Property Accessors /////////////////////////////////////////////////////////////////////// - this.getColor = function() { return this._color; } - this.getShaderName = function() { return this._shaderName; } + this.getColor = function() { return this._color; } + this.getShaderName = function() { return this._shaderName; } + + this.isAnimated = function() { return false; } + this.hasVertexDeformation = function() { return true; } + this._hasVertexDeformation = true; + this._vertexDeformationTolerance = 0.2; //////////////////////////////////s///////////////////////////////////// // Methods @@ -48,6 +53,13 @@ function FlatMaterial() // set up the material node this._materialNode = createMaterialNode("flatMaterial"); this._materialNode.setShader(this._shader); + + // initialize the taper properties +// this._shader.colorMe.u_limit1.set( [0.25] ); +// this._shader.colorMe.u_limit2.set( [0.5] ); +// this._shader.colorMe.u_limit3.set( [0.75] ); +// this._shader.colorMe.u_center.set( [0.0] ); +// this._shader.colorMe.u_taperAmount.set( [0.5] ); } @@ -114,10 +126,11 @@ function FlatMaterial() return rtnStr; } -} -// used to create unique names -var flatMaterialCounter = 0; + this.update = function( time ) + { + } +} /////////////////////////////////////////////////////////////////////////////////////// // RDGE shader @@ -126,35 +139,33 @@ var flatMaterialCounter = 0; flatShaderDef = { 'shaders': { // shader files - 'defaultVShader': "\ - uniform mat4 u_mvMatrix;\ - uniform mat4 u_projMatrix;\ - attribute vec3 a_pos;\ - void main() {\ - gl_Position = u_projMatrix * u_mvMatrix * vec4(a_pos,1.0);\ - }", - 'defaultFShader': "\ - precision highp float;\ - uniform vec4 color;\ - void main() {\ - gl_FragColor = color;\ - }", + //'defaultVShader':"assets/shaders/Taper.vert.glsl", + 'defaultVShader':"assets/shaders/Basic.vert.glsl", + 'defaultFShader':"assets/shaders/Basic.frag.glsl", }, 'techniques': { // rendering control 'colorMe':[ // simple color pass { 'vshader' : 'defaultVShader', 'fshader' : 'defaultFShader', - + // attributes 'attributes' : { - 'a_pos' : { 'type' : 'vec3' } // only using position for this shader + 'vert' : { 'type' : 'vec3' }, + 'normal' : { 'type' : 'vec3' }, + 'texcoord' : { 'type' : 'vec2' }, }, // attributes 'params' : { - 'color' : { 'type' : 'vec4' } + 'color' : { 'type' : 'vec4' }, + + //'u_limit1': { 'type': 'float' }, + //'u_limit2': { 'type': 'float' }, + //'u_limit3': { 'type': 'float' }, + //'u_center': { 'type': 'float' }, + //'u_taperAmount': { 'type': 'float' } }, }, ] -- cgit v1.2.3 From 3ba2be686e1981c8af3054ead1c7bb59af8b5d66 Mon Sep 17 00:00:00 2001 From: Nivesh Rajbhandari Date: Thu, 9 Feb 2012 14:18:20 -0800 Subject: Updated linear and radial gradient materials import/export routines. Signed-off-by: Nivesh Rajbhandari --- js/helper-classes/RDGE/Materials/FlatMaterial.js | 45 +++++++++--------------- 1 file changed, 16 insertions(+), 29 deletions(-) (limited to 'js/helper-classes/RDGE/Materials/FlatMaterial.js') diff --git a/js/helper-classes/RDGE/Materials/FlatMaterial.js b/js/helper-classes/RDGE/Materials/FlatMaterial.js index a250dc0a..570e7f9e 100644 --- a/js/helper-classes/RDGE/Materials/FlatMaterial.js +++ b/js/helper-classes/RDGE/Materials/FlatMaterial.js @@ -26,11 +26,11 @@ function FlatMaterial() /////////////////////////////////////////////////////////////////////// // Property Accessors /////////////////////////////////////////////////////////////////////// - this.getColor = function() { return this._color; } - this.getShaderName = function() { return this._shaderName; } + this.getColor = function() { return this._color; }; + this.getShaderName = function() { return this._shaderName; }; - this.isAnimated = function() { return false; } - this.hasVertexDeformation = function() { return true; } + this.isAnimated = function() { return false; }; + this.hasVertexDeformation = function() { return true; }; this._hasVertexDeformation = true; this._vertexDeformationTolerance = 0.2; @@ -38,7 +38,7 @@ function FlatMaterial() // Methods /////////////////////////////////////////////////////////////////////// // duplcate method requirde - this.dup = function() { return new FlatMaterial(); } + this.dup = function() { return new FlatMaterial(); } ; this.init = function() { @@ -53,14 +53,7 @@ function FlatMaterial() // set up the material node this._materialNode = createMaterialNode("flatMaterial"); this._materialNode.setShader(this._shader); - - // initialize the taper properties -// this._shader.colorMe.u_limit1.set( [0.25] ); -// this._shader.colorMe.u_limit2.set( [0.5] ); -// this._shader.colorMe.u_limit3.set( [0.75] ); -// this._shader.colorMe.u_center.set( [0.0] ); -// this._shader.colorMe.u_taperAmount.set( [0.5] ); - } + }; /////////////////////////////////////////////////////////////////////// @@ -82,7 +75,7 @@ function FlatMaterial() if (this._shader && this._shader.colorMe) this._shader.colorMe[prop].set(value); } - } + }; /////////////////////////////////////////////////////////////////////// this.export = function() @@ -98,7 +91,7 @@ function FlatMaterial() exportStr += "endMaterial\n"; return exportStr; - } + }; this.import = function( importStr ) { @@ -125,11 +118,12 @@ function FlatMaterial() } return rtnStr; - } + }; this.update = function( time ) { - } + }; + } /////////////////////////////////////////////////////////////////////////////////////// @@ -139,9 +133,8 @@ function FlatMaterial() flatShaderDef = { 'shaders': { // shader files - //'defaultVShader':"assets/shaders/Taper.vert.glsl", 'defaultVShader':"assets/shaders/Basic.vert.glsl", - 'defaultFShader':"assets/shaders/Basic.frag.glsl", + 'defaultFShader':"assets/shaders/Basic.frag.glsl" }, 'techniques': { // rendering control 'colorMe':[ // simple color pass @@ -154,20 +147,14 @@ flatShaderDef = { 'vert' : { 'type' : 'vec3' }, 'normal' : { 'type' : 'vec3' }, - 'texcoord' : { 'type' : 'vec2' }, + 'texcoord' : { 'type' : 'vec2' } }, // attributes 'params' : { - 'color' : { 'type' : 'vec4' }, - - //'u_limit1': { 'type': 'float' }, - //'u_limit2': { 'type': 'float' }, - //'u_limit3': { 'type': 'float' }, - //'u_center': { 'type': 'float' }, - //'u_taperAmount': { 'type': 'float' } - }, - }, + 'color' : { 'type' : 'vec4' } + } + } ] } }; -- cgit v1.2.3