diff options
author | Ananya Sen | 2012-04-17 18:11:55 -0700 |
---|---|---|
committer | Ananya Sen | 2012-04-17 18:11:55 -0700 |
commit | 35abad196cc9feb76ef50c1b63032a38233a6d51 (patch) | |
tree | 914689c66d4ab6c6e088b571eade0a0e35082916 /js/helper-classes/RDGE/src/core/script/precompiled.js | |
parent | 1f891c58bad0b7746659aa4138001b5ee76d9a0e (diff) | |
parent | 616a8532099fec2a15855eac97cd85cb60c4451c (diff) | |
download | ninja-35abad196cc9feb76ef50c1b63032a38233a6d51.tar.gz |
Merge branch 'refs/heads/ninja-internal-master' into Codeview-improvements
Diffstat (limited to 'js/helper-classes/RDGE/src/core/script/precompiled.js')
-rwxr-xr-x | js/helper-classes/RDGE/src/core/script/precompiled.js | 123 |
1 files changed, 64 insertions, 59 deletions
diff --git a/js/helper-classes/RDGE/src/core/script/precompiled.js b/js/helper-classes/RDGE/src/core/script/precompiled.js index bed94e4e..03e0bc0e 100755 --- a/js/helper-classes/RDGE/src/core/script/precompiled.js +++ b/js/helper-classes/RDGE/src/core/script/precompiled.js | |||
@@ -5,65 +5,70 @@ No rights, expressed or implied, whatsoever to this software are provided by Mot | |||
5 | </copyright> */ | 5 | </copyright> */ |
6 | 6 | ||
7 | /* | 7 | /* |
8 | * A list of shared parameters that all shaders can support (the engine always try to bind these uniforms) | 8 | * A list of shared parameters that all shaders can support (the engine always try to bind these uniforms) |
9 | * These parameters are compiled into all jshaders and can be set from any jshader | 9 | * These parameters are compiled into all jshaders and can be set from any jshader |
10 | * with a call to jshader.global.u_matDiffuse.set([1,0,0,1]) if the jshader depends on that parameter. | 10 | * with a call to jshader.global.u_matDiffuse.set([1,0,0,1]) if the jshader depends on that parameter. |
11 | * To set directly call rdgeGlobalParameters.'param'.set(x), for example rdgeGlobalParameters.u_lightPos.set([1,1,1]) | 11 | * To set directly call rdgeGlobalParameters.'param'.set(x), for example rdgeGlobalParameters.u_lightPos.set([1,1,1]) |
12 | * The values can be added to a jshaders params list - this will creating local jshader memory that binds to the parameter | 12 | * The values can be added to a jshaders params list - this will creating local jshader memory that binds to the parameter |
13 | * this parameter can be used to set the value for that shader but will not override the global setting | 13 | * this parameter can be used to set the value for that shader but will not override the global setting |
14 | * The values set here are the default global values. | 14 | * The values set here are the default global values. |
15 | * note: the rdge_lights substructure can be ignored, the final parameter list contains only the uniform objects | 15 | * note: the rdge_lights substructure can be ignored, the final parameter list contains only the uniform objects |
16 | */ | 16 | */ |
17 | 17 | ||
18 | rdgeGlobalParameters = | 18 | var RDGE = RDGE || {}; |
19 | |||
20 | |||
21 | |||
22 | RDGE.rdgeGlobalParameters = | ||
19 | { | 23 | { |
20 | "u_projMatrix": {'type': 'mat4', 'data': mat4.identity()}, | 24 | "u_projMatrix": { 'type': 'mat4', 'data': RDGE.mat4.identity() }, |
21 | "u_mvMatrix": {'type': 'mat4', 'data': mat4.identity()}, | 25 | "u_mvMatrix": { 'type': 'mat4', 'data': RDGE.mat4.identity() }, |
22 | "u_invMvMatrix": {'type': 'mat4', 'data': mat4.identity()}, | 26 | "u_invMvMatrix": { 'type': 'mat4', 'data': RDGE.mat4.identity() }, |
23 | "u_normalMatrix": {'type': 'mat4', 'data': mat4.identity()}, | 27 | "u_normalMatrix": { 'type': 'mat4', 'data': RDGE.mat4.identity() }, |
24 | "u_worldMatrix": {'type': 'mat4', 'data': mat4.identity()}, | 28 | "u_worldMatrix": { 'type': 'mat4', 'data': RDGE.mat4.identity() }, |
25 | "u_viewMatrix": {'type': 'mat4', 'data': mat4.identity()}, | 29 | "u_viewMatrix": { 'type': 'mat4', 'data': RDGE.mat4.identity() }, |
26 | "u_invViewMatrix": {'type': 'mat4', 'data': mat4.identity()}, | 30 | "u_invViewMatrix": { 'type': 'mat4', 'data': RDGE.mat4.identity() }, |
27 | "u_invWorldMatrix": {'type': 'mat4', 'data': mat4.identity()}, | 31 | "u_invWorldMatrix": { 'type': 'mat4', 'data': RDGE.mat4.identity() }, |
28 | "u_inv_viewport_width": {'type': 'float', 'data': [1]}, | 32 | "u_inv_viewport_width": { 'type': 'float', 'data': [1] }, |
29 | "u_inv_viewport_height":{'type': 'float', 'data': [1]}, | 33 | "u_inv_viewport_height": { 'type': 'float', 'data': [1] }, |
30 | "u_lightPos": {'type': 'vec3', 'data': [-20.0, 50.0, 20.0]}, | 34 | "u_lightPos": { 'type': 'vec3', 'data': [-20.0, 50.0, 20.0] }, |
31 | "u_lightDiff": {'type': 'vec4', 'data': [0.8, 0.8, 0.8, 1]}, | 35 | "u_lightDiff": { 'type': 'vec4', 'data': [0.8, 0.8, 0.8, 1] }, |
32 | "u_lightAmb": {'type': 'vec4', 'data': [1.0000, 1.0000, 1.0000, 1.0]}, | 36 | "u_lightAmb": { 'type': 'vec4', 'data': [1.0000, 1.0000, 1.0000, 1.0] }, |
33 | "rdge_lights": { | 37 | "rdge_lights": { |
34 | "u_light0Pos": {'type': 'vec3', 'data': [-20.0, 50.0, 20.0]}, | 38 | "u_light0Pos": { 'type': 'vec3', 'data': [-20.0, 50.0, 20.0] }, |
35 | "u_light0Diff": {'type': 'vec4', 'data': [0.8, 0.8, 0.8, 1]}, | 39 | "u_light0Diff": { 'type': 'vec4', 'data': [0.8, 0.8, 0.8, 1] }, |
36 | "u_light0Amb": {'type': 'vec4', 'data': [0.0008, 0.0008, 0.0008, 1.0]}, | 40 | "u_light0Amb": { 'type': 'vec4', 'data': [0.0008, 0.0008, 0.0008, 1.0] }, |
37 | "u_light0Spec": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}, | 41 | "u_light0Spec": { 'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0] }, |
38 | "u_light1Pos": {'type': 'vec3', 'data': [0.0, 0.0, 0.0]}, | 42 | "u_light1Pos": { 'type': 'vec3', 'data': [0.0, 0.0, 0.0] }, |
39 | "u_light1Diff": {'type': 'vec4', 'data': [0.0, 0.0, 0.0, 0.0]}, | 43 | "u_light1Diff": { 'type': 'vec4', 'data': [0.0, 0.0, 0.0, 0.0] }, |
40 | "u_light1Amb": {'type': 'vec4', 'data': [0.5, 0.5, 0.5, 1.0]}, | 44 | "u_light1Amb": { 'type': 'vec4', 'data': [0.5, 0.5, 0.5, 1.0] }, |
41 | "u_light1Spec": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}, | 45 | "u_light1Spec": { 'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0] }, |
42 | "u_light2Pos": {'type': 'vec3', 'data': [0.0, 0.0, 0.0]}, | 46 | "u_light2Pos": { 'type': 'vec3', 'data': [0.0, 0.0, 0.0] }, |
43 | "u_light2Diff": {'type': 'vec4', 'data': [0.0, 0.0, 0.0, 1.0]}, | 47 | "u_light2Diff": { 'type': 'vec4', 'data': [0.0, 0.0, 0.0, 1.0] }, |
44 | "u_light2Amb": {'type': 'vec4', 'data': [0.5, 0.5, 0.5, 1.0]}, | 48 | "u_light2Amb": { 'type': 'vec4', 'data': [0.5, 0.5, 0.5, 1.0] }, |
45 | "u_light2Spec": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}, | 49 | "u_light2Spec": { 'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0] }, |
46 | "u_light3Pos": {'type': 'vec3', 'data': [0.0, 0.0, 0.0]}, | 50 | "u_light3Pos": { 'type': 'vec3', 'data': [0.0, 0.0, 0.0] }, |
47 | "u_light3Diff": {'type': 'vec4', 'data': [0.8, 0.8, 0.8, 1]}, | 51 | "u_light3Diff": { 'type': 'vec4', 'data': [0.8, 0.8, 0.8, 1] }, |
48 | "u_light3Amb": {'type': 'vec4', 'data': [0.5, 0.5, 0.5, 1.0]}, | 52 | "u_light3Amb": { 'type': 'vec4', 'data': [0.5, 0.5, 0.5, 1.0] }, |
49 | "u_light3Spec": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}}, | 53 | "u_light3Spec": { 'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0] } |
50 | "colMap": {'type': 'tex2d', 'data': "assets/images/white.png"}, | 54 | }, |
51 | //"envMap": {'type': 'tex2d', 'data': null}, | 55 | "colMap": { 'type': 'tex2d', 'data': "assets/images/white.png" }, |
52 | //"normalMap": {'type': 'tex2d', 'data': null}, | 56 | //"envMap": {'type': 'tex2d', 'data': null}, |
53 | //"glowMap": {'type': 'tex2d', 'data': "assets/images/black.png"}, | 57 | //"normalMap": {'type': 'tex2d', 'data': null}, |
54 | //"u_shadowDepthMap": {'type': 'tex2d', 'data': null}, | 58 | //"glowMap": {'type': 'tex2d', 'data': "assets/images/black.png"}, |
55 | //"u_depthMap": {'type': 'tex2d', 'data': null}, | 59 | //"u_shadowDepthMap": {'type': 'tex2d', 'data': null}, |
56 | "u_matAmbient": {'type': 'vec4', 'data': [1.00,1.00,1.00, 1]}, | 60 | //"u_depthMap": {'type': 'tex2d', 'data': null}, |
57 | "u_matDiffuse": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}, | 61 | "u_matAmbient": { 'type': 'vec4', 'data': [1.00, 1.00, 1.00, 1] }, |
58 | "u_matSpecular": {'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0]}, | 62 | "u_matDiffuse": { 'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0] }, |
59 | "u_matShininess": {'type': 'float', 'data': [128.0]}, | 63 | "u_matSpecular": { 'type': 'vec4', 'data': [1.0, 1.0, 1.0, 1.0] }, |
60 | "u_matEmission": {'type': 'float', 'data': [0.0, 0.0, 0.0, 1.0]}, | 64 | "u_matShininess": { 'type': 'float', 'data': [128.0] }, |
61 | "u_frustumFarZ": {'type': 'float', 'data': [1000.0]}, | 65 | "u_matEmission": { 'type': 'float', 'data': [0.0, 0.0, 0.0, 1.0] }, |
62 | "u_shadowLightWorld": {'type': 'mat4', 'data': mat4.identity()}, | 66 | "u_frustumFarZ": { 'type': 'float', 'data': [1000.0] }, |
63 | "u_shadowBiasMatrix": {'type': 'mat4', 'data': mat4.identity()}, | 67 | "u_shadowLightWorld": { 'type': 'mat4', 'data': RDGE.mat4.identity() }, |
64 | "u_vShadowLight": {'type': 'mat4', 'data': mat4.identity()}, | 68 | "u_shadowBiasMatrix": { 'type': 'mat4', 'data': RDGE.mat4.identity() }, |
65 | "u_shadowBPV": {'type': 'mat4', 'data': mat4.identity()}, | 69 | "u_vShadowLight": { 'type': 'mat4', 'data': RDGE.mat4.identity() }, |
66 | "u_farZ": {'type': 'float', 'data': [1000]}, | 70 | "u_shadowBPV": { 'type': 'mat4', 'data': RDGE.mat4.identity() }, |
67 | "u_shadowLightFarZ": {'type': 'float', 'data': [1000]}, | 71 | "u_farZ": { 'type': 'float', 'data': [1000] }, |
68 | "u_cameraFTR": {'type': 'vec3', 'data':[0.0, 0.0, 0.0]} | 72 | "u_shadowLightFarZ": { 'type': 'float', 'data': [1000] }, |
73 | "u_cameraFTR": { 'type': 'vec3', 'data': [0.0, 0.0, 0.0] } | ||
69 | }; | 74 | }; |