diff options
Diffstat (limited to 'js/helper-classes/RDGE/src/core/script/jshader.js')
-rwxr-xr-x | js/helper-classes/RDGE/src/core/script/jshader.js | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/js/helper-classes/RDGE/src/core/script/jshader.js b/js/helper-classes/RDGE/src/core/script/jshader.js index f8d79580..123a53e4 100755 --- a/js/helper-classes/RDGE/src/core/script/jshader.js +++ b/js/helper-classes/RDGE/src/core/script/jshader.js | |||
@@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. | |||
31 | // RDGE namespaces | 31 | // RDGE namespaces |
32 | var RDGE = RDGE || {}; | 32 | var RDGE = RDGE || {}; |
33 | 33 | ||
34 | /* | 34 | /* |
35 | this API should be familiar to anyone who has worked with HLSL effect files. | 35 | this API should be familiar to anyone who has worked with HLSL effect files. |
36 | */ | 36 | */ |
37 | 37 | ||
@@ -45,27 +45,27 @@ RDGE.bindMap['vec2'] = function(ctx, a,b) { ctx.uniform2fv(a,b); }; | |||
45 | RDGE.bindMap['vec3'] = function(ctx, a,b) { ctx.uniform3fv(a,b); }; | 45 | RDGE.bindMap['vec3'] = function(ctx, a,b) { ctx.uniform3fv(a,b); }; |
46 | RDGE.bindMap['vec4'] = function(ctx, a,b) { ctx.uniform4fv(a,b); }; | 46 | RDGE.bindMap['vec4'] = function(ctx, a,b) { ctx.uniform4fv(a,b); }; |
47 | RDGE.bindMap['mat3'] = function(ctx, a,b) { ctx.uniformMatrix3fv(a,false,b); }; | 47 | RDGE.bindMap['mat3'] = function(ctx, a,b) { ctx.uniformMatrix3fv(a,false,b); }; |
48 | RDGE.bindMap['mat4'] = function(ctx, a,b) | 48 | RDGE.bindMap['mat4'] = function(ctx, a,b) |
49 | { | 49 | { |
50 | ctx.uniformMatrix4fv(a,false,b); | 50 | ctx.uniformMatrix4fv(a,false,b); |
51 | RDGE.globals.engine.getContext().debug.mat4CallCount++; | 51 | RDGE.globals.engine.getContext().debug.mat4CallCount++; |
52 | }; | 52 | }; |
53 | 53 | ||
54 | RDGE.bindMap['tex2d'] = function(ctx, a,b) | 54 | RDGE.bindMap['tex2d'] = function(ctx, a,b) |
55 | { | 55 | { |
56 | ctx.activeTexture(ctx.TEXTURE0+b[0]); | 56 | ctx.activeTexture(ctx.TEXTURE0+b[0]); |
57 | ctx.bindTexture(ctx.TEXTURE_2D, b[1]); | 57 | ctx.bindTexture(ctx.TEXTURE_2D, b[1]); |
58 | ctx.uniform1iv(a,[b[0]]); | 58 | ctx.uniform1iv(a,[b[0]]); |
59 | }; | 59 | }; |
60 | 60 | ||
61 | RDGE.bindMap['texCube']=function(ctx, a,b) | 61 | RDGE.bindMap['texCube']=function(ctx, a,b) |
62 | { | 62 | { |
63 | ctx.activeTexture(ctx.TEXTURE0+b[0]); | 63 | ctx.activeTexture(ctx.TEXTURE0+b[0]); |
64 | ctx.bindTexture(ctx.TEXTURE_CUBE_MAP, b[1]); | 64 | ctx.bindTexture(ctx.TEXTURE_CUBE_MAP, b[1]); |
65 | ctx.uniform1iv(a,[b[0]]); | 65 | ctx.uniform1iv(a,[b[0]]); |
66 | }; | 66 | }; |
67 | 67 | ||
68 | RDGE.lightDataMap = | 68 | RDGE.lightDataMap = |
69 | [ | 69 | [ |
70 | function(ctx, loc, lightNode) { ctx.uniform3fv(loc, lightNode.position); }, | 70 | function(ctx, loc, lightNode) { ctx.uniform3fv(loc, lightNode.position); }, |
71 | function(ctx, loc, lightNode) { ctx.uniform4fv(loc, lightNode.lightDiffuse); }, | 71 | function(ctx, loc, lightNode) { ctx.uniform4fv(loc, lightNode.lightDiffuse); }, |
@@ -410,7 +410,7 @@ RDGE.jshader = function (addr) { | |||
410 | // link up aliases | 410 | // link up aliases |
411 | for (var p in curTechnique[i].params) { | 411 | for (var p in curTechnique[i].params) { |
412 | if (typeof curTechnique[i].params[p] == 'string') { | 412 | if (typeof curTechnique[i].params[p] == 'string') { |
413 | // this just redirects to an already existing parameter. | 413 | // this just redirects to an already existing parameter. |
414 | this[t][p] = this[t].passes[i].params[p]; | 414 | this[t][p] = this[t].passes[i].params[p]; |
415 | } | 415 | } |
416 | } | 416 | } |
@@ -446,7 +446,7 @@ RDGE.jshader = function (addr) { | |||
446 | 446 | ||
447 | /* | 447 | /* |
448 | * Init a local parameter at any time during the life of the jshader. | 448 | * Init a local parameter at any time during the life of the jshader. |
449 | * This will add the parameter to the list of parameters to be bound | 449 | * This will add the parameter to the list of parameters to be bound |
450 | * before rendering | 450 | * before rendering |
451 | */ | 451 | */ |
452 | this.initLocalParameter = function (name, param) { | 452 | this.initLocalParameter = function (name, param) { |
@@ -518,7 +518,7 @@ RDGE.jshader = function (addr) { | |||
518 | source = vShaderDef; | 518 | source = vShaderDef; |
519 | } else { | 519 | } else { |
520 | var vshaderRequest = new XMLHttpRequest(); | 520 | var vshaderRequest = new XMLHttpRequest(); |
521 | var urlVertShader = vShaderDef; | 521 | var urlVertShader = vShaderDef; |
522 | vshaderRequest.open("GET", urlVertShader, false); | 522 | vshaderRequest.open("GET", urlVertShader, false); |
523 | vshaderRequest.send(null); | 523 | vshaderRequest.send(null); |
524 | source = vshaderRequest.responseText; | 524 | source = vshaderRequest.responseText; |