From 648ee61ae84216d0236e0dbc211addc13b2cfa3a Mon Sep 17 00:00:00 2001 From: Kris Kowal Date: Fri, 6 Jul 2012 11:52:06 -0700 Subject: Expand tabs --- js/helper-classes/RDGE/src/core/script/jshader.js | 60 +++++++++++------------ 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'js/helper-classes/RDGE/src/core/script/jshader.js') diff --git a/js/helper-classes/RDGE/src/core/script/jshader.js b/js/helper-classes/RDGE/src/core/script/jshader.js index b9170857..f8d79580 100755 --- a/js/helper-classes/RDGE/src/core/script/jshader.js +++ b/js/helper-classes/RDGE/src/core/script/jshader.js @@ -31,46 +31,46 @@ POSSIBILITY OF SUCH DAMAGE. // RDGE namespaces var RDGE = RDGE || {}; -/* +/* this API should be familiar to anyone who has worked with HLSL effect files. */ /* - * A map of types to uniform 'binding' functions + * A map of types to uniform 'binding' functions */ RDGE.bindMap={}; -RDGE.bindMap['int'] = function(ctx, a,b) { ctx.uniform1iv(a,b); }; -RDGE.bindMap['float'] = function(ctx, a,b) { ctx.uniform1fv(a,b); }; -RDGE.bindMap['vec2'] = function(ctx, a,b) { ctx.uniform2fv(a,b); }; -RDGE.bindMap['vec3'] = function(ctx, a,b) { ctx.uniform3fv(a,b); }; -RDGE.bindMap['vec4'] = function(ctx, a,b) { ctx.uniform4fv(a,b); }; -RDGE.bindMap['mat3'] = function(ctx, a,b) { ctx.uniformMatrix3fv(a,false,b); }; -RDGE.bindMap['mat4'] = function(ctx, a,b) +RDGE.bindMap['int'] = function(ctx, a,b) { ctx.uniform1iv(a,b); }; +RDGE.bindMap['float'] = function(ctx, a,b) { ctx.uniform1fv(a,b); }; +RDGE.bindMap['vec2'] = function(ctx, a,b) { ctx.uniform2fv(a,b); }; +RDGE.bindMap['vec3'] = function(ctx, a,b) { ctx.uniform3fv(a,b); }; +RDGE.bindMap['vec4'] = function(ctx, a,b) { ctx.uniform4fv(a,b); }; +RDGE.bindMap['mat3'] = function(ctx, a,b) { ctx.uniformMatrix3fv(a,false,b); }; +RDGE.bindMap['mat4'] = function(ctx, a,b) { - ctx.uniformMatrix4fv(a,false,b); - RDGE.globals.engine.getContext().debug.mat4CallCount++; + ctx.uniformMatrix4fv(a,false,b); + RDGE.globals.engine.getContext().debug.mat4CallCount++; }; -RDGE.bindMap['tex2d'] = function(ctx, a,b) +RDGE.bindMap['tex2d'] = function(ctx, a,b) { - ctx.activeTexture(ctx.TEXTURE0+b[0]); - ctx.bindTexture(ctx.TEXTURE_2D, b[1]); - ctx.uniform1iv(a,[b[0]]); + ctx.activeTexture(ctx.TEXTURE0+b[0]); + ctx.bindTexture(ctx.TEXTURE_2D, b[1]); + ctx.uniform1iv(a,[b[0]]); }; RDGE.bindMap['texCube']=function(ctx, a,b) { - ctx.activeTexture(ctx.TEXTURE0+b[0]); - ctx.bindTexture(ctx.TEXTURE_CUBE_MAP, b[1]); - ctx.uniform1iv(a,[b[0]]); + ctx.activeTexture(ctx.TEXTURE0+b[0]); + ctx.bindTexture(ctx.TEXTURE_CUBE_MAP, b[1]); + ctx.uniform1iv(a,[b[0]]); }; RDGE.lightDataMap = [ - function(ctx, loc, lightNode) { ctx.uniform3fv(loc, lightNode.position); }, - function(ctx, loc, lightNode) { ctx.uniform4fv(loc, lightNode.lightDiffuse); }, - function(ctx, loc, lightNode) { ctx.uniform4fv(loc, lightNode.lightAmbient); }, - function(ctx, loc, lightNode) { ctx.uniform4fv(loc, lightNode.lightSpecular); } + function(ctx, loc, lightNode) { ctx.uniform3fv(loc, lightNode.position); }, + function(ctx, loc, lightNode) { ctx.uniform4fv(loc, lightNode.lightDiffuse); }, + function(ctx, loc, lightNode) { ctx.uniform4fv(loc, lightNode.lightAmbient); }, + function(ctx, loc, lightNode) { ctx.uniform4fv(loc, lightNode.lightSpecular); } ]; RDGE.paramTypeNameMapping = null; @@ -120,7 +120,7 @@ RDGE.jshader = function (addr) { } /* - * private helper functions + * private helper functions */ this.bindParameters = function (pass) { var params = pass.defParamsList; // global parameters to start with @@ -177,7 +177,7 @@ RDGE.jshader = function (addr) { }; /* - * helper function for setting up a texture + * helper function for setting up a texture */ createJShaderTexture = function (ctx, param) { var texHandle = null; @@ -310,9 +310,9 @@ RDGE.jshader = function (addr) { defaultTech = t; var curTechnique = techniques[t]; this[t] = - { - 'passes': [] - }; + { + 'passes': [] + }; var numPasses = curTechnique.length; var i = 0; while (i < numPasses) { @@ -445,7 +445,7 @@ RDGE.jshader = function (addr) { }; /* - * Init a local parameter at any time during the life of the jshader. + * Init a local parameter at any time during the life of the jshader. * This will add the parameter to the list of parameters to be bound * before rendering */ @@ -587,7 +587,7 @@ RDGE.jshader = function (addr) { }; /* - * Set the light nodes used by this jshader + * Set the light nodes used by this jshader * array item 0 corresponds to light 0, item 1 tp light 1 and so on * place null for lights that are not there */ @@ -601,7 +601,7 @@ RDGE.jshader = function (addr) { }; /* - * Called by the system to add material textures settings to the jshader + * Called by the system to add material textures settings to the jshader */ this.setTextureContext = function (textureList) { var passCount = this.technique.passes.length; -- cgit v1.2.3