From 86a801c057fc3b0580d6130be5740c2ee503444f Mon Sep 17 00:00:00 2001 From: hwc487 Date: Fri, 27 Jan 2012 15:52:36 -0800 Subject: updated from old repo --- js/helper-classes/RDGE/Materials/FlatMaterial.js | 2 ++ 1 file changed, 2 insertions(+) (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 5177a8a0..db66ca42 100644 --- a/js/helper-classes/RDGE/Materials/FlatMaterial.js +++ b/js/helper-classes/RDGE/Materials/FlatMaterial.js @@ -29,6 +29,8 @@ function FlatMaterial() this.getColor = function() { return this._color; } this.getShaderName = function() { return this._shaderName; } + this.isAnimated = function() { return true; } + //////////////////////////////////s///////////////////////////////////// // Methods /////////////////////////////////////////////////////////////////////// -- cgit v1.2.3 From 8e43a46e3d79323fe06dc7771bc611a2c3c85c5c Mon Sep 17 00:00:00 2001 From: hwc487 Date: Mon, 30 Jan 2012 16:15:12 -0800 Subject: Renderer startup handling of non-animated materials. Changed zoom from the document bar to keep the location center of the viewable portion of the document fixed. --- js/helper-classes/RDGE/Materials/FlatMaterial.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (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 db66ca42..f342eef8 100644 --- a/js/helper-classes/RDGE/Materials/FlatMaterial.js +++ b/js/helper-classes/RDGE/Materials/FlatMaterial.js @@ -29,7 +29,7 @@ function FlatMaterial() this.getColor = function() { return this._color; } this.getShaderName = function() { return this._shaderName; } - this.isAnimated = function() { return true; } + this.isAnimated = function() { return false; } //////////////////////////////////s///////////////////////////////////// // Methods -- cgit v1.2.3 From b2ce8b819cc85a558d862c04965b7e65a6ce8640 Mon Sep 17 00:00:00 2001 From: hwc487 Date: Wed, 1 Feb 2012 13:05:32 -0800 Subject: changes to allow minimal rendering ofnon-animated materials. --- js/helper-classes/RDGE/Materials/FlatMaterial.js | 41 +++++++++++++----------- 1 file changed, 22 insertions(+), 19 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 f342eef8..3e3ae25e 100644 --- a/js/helper-classes/RDGE/Materials/FlatMaterial.js +++ b/js/helper-classes/RDGE/Materials/FlatMaterial.js @@ -50,6 +50,12 @@ 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_taperAmount.set( [0.5] ); } @@ -102,10 +108,11 @@ function FlatMaterial() var rtnStr = importStr.substr( index ); return rtnStr; } -} -// used to create unique names -var flatMaterialCounter = 0; + this.update = function( time ) + { + } +} /////////////////////////////////////////////////////////////////////////////////////// // RDGE shader @@ -114,35 +121,31 @@ 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/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_taperAmount': { 'type': 'float' } }, }, ] -- cgit v1.2.3