diff options
author | Jacek Antonelli | 2009-04-30 13:04:20 -0500 |
---|---|---|
committer | Jacek Antonelli | 2009-04-30 13:07:16 -0500 |
commit | ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e (patch) | |
tree | 8348301d0ac44a524f1819b777686bf086907d76 /linden/indra/newview/app_settings/shaders | |
parent | Second Life viewer sources 1.22.11 (diff) | |
download | meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.zip meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.gz meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.bz2 meta-impy-ca8149ca6d157eb4b5fc8ba0e5ba3a6e56f72e7e.tar.xz |
Second Life viewer sources 1.23.0-RC
Diffstat (limited to 'linden/indra/newview/app_settings/shaders')
35 files changed, 1732 insertions, 6 deletions
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl new file mode 100644 index 0000000..a91e9fa --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl | |||
@@ -0,0 +1,88 @@ | |||
1 | /** | ||
2 | * @file alphaF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | #extension GL_ARB_texture_rectangle : enable | ||
9 | |||
10 | uniform sampler2D diffuseMap; | ||
11 | uniform sampler2DShadow shadowMap0; | ||
12 | uniform sampler2DShadow shadowMap1; | ||
13 | uniform sampler2DShadow shadowMap2; | ||
14 | uniform sampler2DShadow shadowMap3; | ||
15 | uniform sampler2D noiseMap; | ||
16 | uniform sampler2DRect positionMap; | ||
17 | |||
18 | uniform mat4 shadow_matrix[4]; | ||
19 | uniform vec4 shadow_clip; | ||
20 | uniform vec2 screen_res; | ||
21 | |||
22 | vec3 atmosLighting(vec3 light); | ||
23 | vec3 scaleSoftClip(vec3 light); | ||
24 | |||
25 | varying vec3 vary_ambient; | ||
26 | varying vec3 vary_directional; | ||
27 | varying vec3 vary_fragcoord; | ||
28 | varying vec3 vary_position; | ||
29 | |||
30 | uniform float alpha_soften; | ||
31 | |||
32 | void main() | ||
33 | { | ||
34 | vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; | ||
35 | frag *= screen_res; | ||
36 | |||
37 | vec3 samp_pos = texture2DRect(positionMap, frag).xyz; | ||
38 | |||
39 | float shadow = 1.0; | ||
40 | vec4 pos = vec4(vary_position, 1.0); | ||
41 | |||
42 | if (pos.z > -shadow_clip.w) | ||
43 | { | ||
44 | if (pos.z < -shadow_clip.z) | ||
45 | { | ||
46 | vec4 lpos = shadow_matrix[3]*pos; | ||
47 | shadow = shadow2DProj(shadowMap3, lpos).x; | ||
48 | shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); | ||
49 | } | ||
50 | else if (pos.z < -shadow_clip.y) | ||
51 | { | ||
52 | vec4 lpos = shadow_matrix[2]*pos; | ||
53 | shadow = shadow2DProj(shadowMap2, lpos).x; | ||
54 | } | ||
55 | else if (pos.z < -shadow_clip.x) | ||
56 | { | ||
57 | vec4 lpos = shadow_matrix[1]*pos; | ||
58 | shadow = shadow2DProj(shadowMap1, lpos).x; | ||
59 | } | ||
60 | else | ||
61 | { | ||
62 | vec4 lpos = shadow_matrix[0]*pos; | ||
63 | shadow = shadow2DProj(shadowMap0, lpos).x; | ||
64 | } | ||
65 | } | ||
66 | |||
67 | vec4 col = vec4(vary_ambient + vary_directional.rgb*shadow, gl_Color.a); | ||
68 | vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy) * col; | ||
69 | |||
70 | color.rgb = atmosLighting(color.rgb); | ||
71 | |||
72 | color.rgb = scaleSoftClip(color.rgb); | ||
73 | |||
74 | if (samp_pos.z != 0.0) | ||
75 | { | ||
76 | float dist_factor = alpha_soften; | ||
77 | float a = gl_Color.a; | ||
78 | a *= a; | ||
79 | dist_factor *= 1.0/(1.0-a); | ||
80 | color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); | ||
81 | } | ||
82 | |||
83 | //gl_FragColor = gl_Color; | ||
84 | gl_FragColor = color; | ||
85 | //gl_FragColor = vec4(1,0,1,1); | ||
86 | |||
87 | } | ||
88 | |||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl new file mode 100644 index 0000000..b496bd6 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/alphaV.glsl | |||
@@ -0,0 +1,69 @@ | |||
1 | /** | ||
2 | * @file alphaV.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); | ||
9 | void calcAtmospherics(vec3 inPositionEye); | ||
10 | |||
11 | float calcDirectionalLight(vec3 n, vec3 l); | ||
12 | float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); | ||
13 | |||
14 | vec3 atmosAmbient(vec3 light); | ||
15 | vec3 atmosAffectDirectionalLight(float lightIntensity); | ||
16 | vec3 scaleDownLight(vec3 light); | ||
17 | vec3 scaleUpLight(vec3 light); | ||
18 | |||
19 | varying vec3 vary_ambient; | ||
20 | varying vec3 vary_directional; | ||
21 | varying vec3 vary_fragcoord; | ||
22 | varying vec3 vary_position; | ||
23 | |||
24 | uniform float near_clip; | ||
25 | |||
26 | void main() | ||
27 | { | ||
28 | //transform vertex | ||
29 | gl_Position = ftransform(); | ||
30 | |||
31 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; | ||
32 | |||
33 | vec4 pos = (gl_ModelViewMatrix * gl_Vertex); | ||
34 | vec3 norm = normalize(gl_NormalMatrix * gl_Normal); | ||
35 | vary_position = pos.xyz; | ||
36 | |||
37 | calcAtmospherics(pos.xyz); | ||
38 | |||
39 | //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); | ||
40 | vec4 col; | ||
41 | col.a = gl_Color.a; | ||
42 | |||
43 | // Add windlight lights | ||
44 | col.rgb = atmosAmbient(vec3(0.)); | ||
45 | col.rgb = scaleUpLight(col.rgb); | ||
46 | |||
47 | // Collect normal lights (need to be divided by two, as we later multiply by 2) | ||
48 | col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); | ||
49 | col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); | ||
50 | col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); | ||
51 | col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); | ||
52 | col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); | ||
53 | col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); | ||
54 | col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); | ||
55 | col.rgb = scaleDownLight(col.rgb); | ||
56 | |||
57 | vary_ambient = col.rgb*gl_Color.rgb; | ||
58 | vary_directional.rgb = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); | ||
59 | |||
60 | col.rgb = min(col.rgb*gl_Color.rgb, 1.0); | ||
61 | |||
62 | gl_FrontColor = col; | ||
63 | |||
64 | gl_FogFragCoord = pos.z; | ||
65 | |||
66 | pos = gl_ModelViewProjectionMatrix * gl_Vertex; | ||
67 | vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); | ||
68 | |||
69 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaF.glsl new file mode 100644 index 0000000..6c94f5c --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaF.glsl | |||
@@ -0,0 +1,68 @@ | |||
1 | /** | ||
2 | * @file avatarAlphaF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | uniform sampler2D diffuseMap; | ||
9 | uniform sampler2DShadow shadowMap0; | ||
10 | uniform sampler2DShadow shadowMap1; | ||
11 | uniform sampler2DShadow shadowMap2; | ||
12 | uniform sampler2DShadow shadowMap3; | ||
13 | uniform sampler2D noiseMap; | ||
14 | |||
15 | uniform mat4 shadow_matrix[4]; | ||
16 | uniform vec4 shadow_clip; | ||
17 | |||
18 | vec3 atmosLighting(vec3 light); | ||
19 | vec3 scaleSoftClip(vec3 light); | ||
20 | |||
21 | varying vec3 vary_ambient; | ||
22 | varying vec3 vary_directional; | ||
23 | varying vec4 vary_position; | ||
24 | varying vec3 vary_normal; | ||
25 | |||
26 | void main() | ||
27 | { | ||
28 | float shadow = 1.0; | ||
29 | vec4 pos = vary_position; | ||
30 | vec3 norm = normalize(vary_normal); | ||
31 | |||
32 | vec3 nz = texture2D(noiseMap, gl_FragCoord.xy/128.0).xyz; | ||
33 | |||
34 | if (pos.z > -shadow_clip.w) | ||
35 | { | ||
36 | |||
37 | if (pos.z < -shadow_clip.z) | ||
38 | { | ||
39 | vec4 lpos = shadow_matrix[3]*pos; | ||
40 | shadow = shadow2DProj(shadowMap3, lpos).x; | ||
41 | } | ||
42 | else if (pos.z < -shadow_clip.y) | ||
43 | { | ||
44 | vec4 lpos = shadow_matrix[2]*pos; | ||
45 | shadow = shadow2DProj(shadowMap2, lpos).x; | ||
46 | } | ||
47 | else if (pos.z < -shadow_clip.x) | ||
48 | { | ||
49 | vec4 lpos = shadow_matrix[1]*pos; | ||
50 | shadow = shadow2DProj(shadowMap1, lpos).x; | ||
51 | } | ||
52 | else | ||
53 | { | ||
54 | vec4 lpos = shadow_matrix[0]*pos; | ||
55 | shadow = shadow2DProj(shadowMap0, lpos).x; | ||
56 | } | ||
57 | } | ||
58 | |||
59 | |||
60 | vec4 col = vec4(vary_ambient + vary_directional*shadow, gl_Color.a); | ||
61 | vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy) * col; | ||
62 | |||
63 | color.rgb = atmosLighting(color.rgb); | ||
64 | |||
65 | color.rgb = scaleSoftClip(color.rgb); | ||
66 | |||
67 | gl_FragColor = color; | ||
68 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl new file mode 100644 index 0000000..c1988d3 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/avatarAlphaV.glsl | |||
@@ -0,0 +1,78 @@ | |||
1 | /** | ||
2 | * @file avatarAlphaV.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | vec4 calcLighting(vec3 pos, vec3 norm, vec4 color, vec4 baseCol); | ||
9 | mat4 getSkinnedTransform(); | ||
10 | void calcAtmospherics(vec3 inPositionEye); | ||
11 | |||
12 | float calcDirectionalLight(vec3 n, vec3 l); | ||
13 | float calcPointLight(vec3 v, vec3 n, vec4 lp, float la); | ||
14 | |||
15 | vec3 atmosAmbient(vec3 light); | ||
16 | vec3 atmosAffectDirectionalLight(float lightIntensity); | ||
17 | vec3 scaleDownLight(vec3 light); | ||
18 | vec3 scaleUpLight(vec3 light); | ||
19 | |||
20 | varying vec4 vary_position; | ||
21 | varying vec3 vary_ambient; | ||
22 | varying vec3 vary_directional; | ||
23 | varying vec3 vary_normal; | ||
24 | |||
25 | void main() | ||
26 | { | ||
27 | gl_TexCoord[0] = gl_MultiTexCoord0; | ||
28 | |||
29 | vec4 pos; | ||
30 | vec3 norm; | ||
31 | |||
32 | mat4 trans = getSkinnedTransform(); | ||
33 | pos.x = dot(trans[0], gl_Vertex); | ||
34 | pos.y = dot(trans[1], gl_Vertex); | ||
35 | pos.z = dot(trans[2], gl_Vertex); | ||
36 | pos.w = 1.0; | ||
37 | |||
38 | norm.x = dot(trans[0].xyz, gl_Normal); | ||
39 | norm.y = dot(trans[1].xyz, gl_Normal); | ||
40 | norm.z = dot(trans[2].xyz, gl_Normal); | ||
41 | norm = normalize(norm); | ||
42 | |||
43 | gl_Position = gl_ProjectionMatrix * pos; | ||
44 | vary_position = pos; | ||
45 | vary_normal = norm; | ||
46 | |||
47 | calcAtmospherics(pos.xyz); | ||
48 | |||
49 | //vec4 color = calcLighting(pos.xyz, norm, gl_Color, vec4(0.)); | ||
50 | vec4 col; | ||
51 | col.a = gl_Color.a; | ||
52 | |||
53 | // Add windlight lights | ||
54 | col.rgb = atmosAmbient(vec3(0.)); | ||
55 | col.rgb = scaleUpLight(col.rgb); | ||
56 | |||
57 | // Collect normal lights (need to be divided by two, as we later multiply by 2) | ||
58 | col.rgb += gl_LightSource[2].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[2].position, gl_LightSource[2].linearAttenuation); | ||
59 | col.rgb += gl_LightSource[3].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[3].position, gl_LightSource[3].linearAttenuation); | ||
60 | col.rgb += gl_LightSource[4].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[4].position, gl_LightSource[4].linearAttenuation); | ||
61 | col.rgb += gl_LightSource[5].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[5].position, gl_LightSource[5].linearAttenuation); | ||
62 | col.rgb += gl_LightSource[6].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[6].position, gl_LightSource[6].linearAttenuation); | ||
63 | col.rgb += gl_LightSource[7].diffuse.rgb*calcPointLight(pos.xyz, norm, gl_LightSource[7].position, gl_LightSource[7].linearAttenuation); | ||
64 | col.rgb += gl_LightSource[1].diffuse.rgb*calcDirectionalLight(norm, gl_LightSource[1].position.xyz); | ||
65 | col.rgb = scaleDownLight(col.rgb); | ||
66 | |||
67 | vary_ambient = col.rgb*gl_Color.rgb; | ||
68 | vary_directional = gl_Color.rgb*atmosAffectDirectionalLight(max(calcDirectionalLight(norm, gl_LightSource[0].position.xyz), (1.0-gl_Color.a)*(1.0-gl_Color.a))); | ||
69 | |||
70 | col.rgb = min(col.rgb*gl_Color.rgb, 1.0); | ||
71 | |||
72 | gl_FrontColor = col; | ||
73 | |||
74 | gl_FogFragCoord = pos.z; | ||
75 | |||
76 | } | ||
77 | |||
78 | |||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl new file mode 100644 index 0000000..58aa5a9 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/avatarF.glsl | |||
@@ -0,0 +1,20 @@ | |||
1 | /** | ||
2 | * @file avatarF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | uniform sampler2D diffuseMap; | ||
9 | |||
10 | varying vec3 vary_normal; | ||
11 | varying vec4 vary_position; | ||
12 | |||
13 | void main() | ||
14 | { | ||
15 | gl_FragData[0] = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy); | ||
16 | gl_FragData[1] = vec4(0,0,0,0); | ||
17 | gl_FragData[2] = vec4(normalize(vary_normal), 0.0); | ||
18 | gl_FragData[3] = vary_position; | ||
19 | } | ||
20 | |||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl new file mode 100644 index 0000000..27c09db --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/avatarShadowF.glsl | |||
@@ -0,0 +1,15 @@ | |||
1 | /** | ||
2 | * @file avatarShadowF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | uniform sampler2D diffuseMap; | ||
9 | |||
10 | |||
11 | void main() | ||
12 | { | ||
13 | gl_FragColor = vec4(1,1,1,gl_Color.a * texture2D(diffuseMap, gl_TexCoord[0].xy)); | ||
14 | } | ||
15 | |||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl new file mode 100644 index 0000000..14da6b1 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/avatarShadowV.glsl | |||
@@ -0,0 +1,38 @@ | |||
1 | /** | ||
2 | * @file avatarShadowV.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | mat4 getSkinnedTransform(); | ||
9 | |||
10 | attribute vec4 weight; | ||
11 | |||
12 | void main() | ||
13 | { | ||
14 | gl_TexCoord[0] = gl_MultiTexCoord0; | ||
15 | |||
16 | vec4 pos; | ||
17 | vec3 norm; | ||
18 | |||
19 | mat4 trans = getSkinnedTransform(); | ||
20 | pos.x = dot(trans[0], gl_Vertex); | ||
21 | pos.y = dot(trans[1], gl_Vertex); | ||
22 | pos.z = dot(trans[2], gl_Vertex); | ||
23 | pos.w = 1.0; | ||
24 | |||
25 | norm.x = dot(trans[0].xyz, gl_Normal); | ||
26 | norm.y = dot(trans[1].xyz, gl_Normal); | ||
27 | norm.z = dot(trans[2].xyz, gl_Normal); | ||
28 | norm = normalize(norm); | ||
29 | |||
30 | pos = gl_ProjectionMatrix * pos; | ||
31 | //smash geometry against near clip plane | ||
32 | pos.z = max(pos.z, -1.0); | ||
33 | gl_Position = pos; | ||
34 | |||
35 | gl_FrontColor = gl_Color; | ||
36 | } | ||
37 | |||
38 | |||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl new file mode 100644 index 0000000..12a7ff7 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/avatarV.glsl | |||
@@ -0,0 +1,42 @@ | |||
1 | /** | ||
2 | * @file avatarV.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | mat4 getSkinnedTransform(); | ||
9 | |||
10 | attribute vec4 weight; | ||
11 | |||
12 | varying vec3 vary_normal; | ||
13 | varying vec4 vary_position; | ||
14 | |||
15 | void main() | ||
16 | { | ||
17 | gl_TexCoord[0] = gl_MultiTexCoord0; | ||
18 | |||
19 | vec4 pos; | ||
20 | vec3 norm; | ||
21 | |||
22 | mat4 trans = getSkinnedTransform(); | ||
23 | pos.x = dot(trans[0], gl_Vertex); | ||
24 | pos.y = dot(trans[1], gl_Vertex); | ||
25 | pos.z = dot(trans[2], gl_Vertex); | ||
26 | pos.w = 1.0; | ||
27 | |||
28 | norm.x = dot(trans[0].xyz, gl_Normal); | ||
29 | norm.y = dot(trans[1].xyz, gl_Normal); | ||
30 | norm.z = dot(trans[2].xyz, gl_Normal); | ||
31 | norm = normalize(norm); | ||
32 | |||
33 | vary_position = pos; | ||
34 | vary_normal = norm; | ||
35 | |||
36 | gl_Position = gl_ProjectionMatrix * pos; | ||
37 | //gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; | ||
38 | |||
39 | gl_FrontColor = gl_Color; | ||
40 | } | ||
41 | |||
42 | |||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl new file mode 100644 index 0000000..3c6700a --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/blurLightF.glsl | |||
@@ -0,0 +1,48 @@ | |||
1 | /** | ||
2 | * @file blurLightF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | #extension GL_ARB_texture_rectangle : enable | ||
9 | |||
10 | uniform sampler2DRect positionMap; | ||
11 | uniform sampler2DRect normalMap; | ||
12 | uniform sampler2DRect lightMap; | ||
13 | |||
14 | uniform float blur_size; | ||
15 | uniform vec2 delta; | ||
16 | uniform vec3 kern[32]; | ||
17 | uniform int kern_length; | ||
18 | uniform float kern_scale; | ||
19 | |||
20 | varying vec2 vary_fragcoord; | ||
21 | |||
22 | void main() | ||
23 | { | ||
24 | vec3 norm = texture2DRect(normalMap, vary_fragcoord.xy).xyz; | ||
25 | vec3 pos = texture2DRect(positionMap, vary_fragcoord.xy).xyz; | ||
26 | vec2 ccol = texture2DRect(lightMap, vary_fragcoord.xy).rg; | ||
27 | |||
28 | vec2 dlt = kern_scale * delta / (1.0+norm.xy*norm.xy); | ||
29 | |||
30 | vec2 defined_weight = kern[0].xy; // special case the first (centre) sample's weight in the blur; we have to sample it anyway so we get it for 'free' | ||
31 | vec2 col = defined_weight * ccol; | ||
32 | |||
33 | for (int i = 1; i < kern_length; i++) | ||
34 | { | ||
35 | vec2 tc = vary_fragcoord.xy + kern[i].z*dlt; | ||
36 | vec3 samppos = texture2DRect(positionMap, tc).xyz; | ||
37 | float d = dot(norm.xyz, samppos.xyz-pos.xyz);// dist from plane | ||
38 | if (d*d <= 0.003) | ||
39 | { | ||
40 | col += texture2DRect(lightMap, tc).rg*kern[i].xy; | ||
41 | defined_weight += kern[i].xy; | ||
42 | } | ||
43 | } | ||
44 | |||
45 | col /= defined_weight; | ||
46 | |||
47 | gl_FragColor = vec4(col.r, col.g, 0.0, 1.0); | ||
48 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl new file mode 100644 index 0000000..b7f07e5 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/blurLightV.glsl | |||
@@ -0,0 +1,17 @@ | |||
1 | /** | ||
2 | * @file blurLightF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | varying vec2 vary_fragcoord; | ||
9 | uniform vec2 screen_res; | ||
10 | |||
11 | void main() | ||
12 | { | ||
13 | //transform vertex | ||
14 | gl_Position = ftransform(); | ||
15 | vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; | ||
16 | vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; | ||
17 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl new file mode 100644 index 0000000..a8712bc --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/bumpF.glsl | |||
@@ -0,0 +1,29 @@ | |||
1 | /** | ||
2 | * @file bumpF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | uniform sampler2D diffuseMap; | ||
9 | uniform sampler2D bumpMap; | ||
10 | |||
11 | varying vec3 vary_mat0; | ||
12 | varying vec3 vary_mat1; | ||
13 | varying vec3 vary_mat2; | ||
14 | varying vec4 vary_position; | ||
15 | |||
16 | void main() | ||
17 | { | ||
18 | vec3 col = texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; | ||
19 | vec3 norm = texture2D(bumpMap, gl_TexCoord[0].xy).rgb * 2.0 - 1.0; | ||
20 | |||
21 | vec3 tnorm = vec3(dot(norm,vary_mat0), | ||
22 | dot(norm,vary_mat1), | ||
23 | dot(norm,vary_mat2)); | ||
24 | |||
25 | gl_FragData[0].rgb = gl_Color.rgb*col; | ||
26 | gl_FragData[1] = vec4(col*(gl_Color.a*1.5), gl_Color.a); | ||
27 | gl_FragData[2] = vec4(normalize(tnorm), 0.0); | ||
28 | gl_FragData[3] = vary_position; | ||
29 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl new file mode 100644 index 0000000..ba18092 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/bumpV.glsl | |||
@@ -0,0 +1,30 @@ | |||
1 | /** | ||
2 | * @file bumpV.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | varying vec3 vary_mat0; | ||
9 | varying vec3 vary_mat1; | ||
10 | varying vec3 vary_mat2; | ||
11 | varying vec4 vary_position; | ||
12 | |||
13 | void main() | ||
14 | { | ||
15 | //transform vertex | ||
16 | gl_Position = ftransform(); | ||
17 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; | ||
18 | |||
19 | vary_position = gl_ModelViewMatrix * gl_Vertex; | ||
20 | |||
21 | vec3 n = normalize(gl_NormalMatrix * gl_Normal); | ||
22 | vec3 b = normalize(gl_NormalMatrix * gl_MultiTexCoord2.xyz); | ||
23 | vec3 t = cross(b, n); | ||
24 | |||
25 | vary_mat0 = vec3(t.x, b.x, n.x); | ||
26 | vary_mat1 = vec3(t.y, b.y, n.y); | ||
27 | vary_mat2 = vec3(t.z, b.z, n.z); | ||
28 | |||
29 | gl_FrontColor = gl_Color; | ||
30 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl index 14e6361..f2ba2df 100644 --- a/linden/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/diffuseF.glsl | |||
@@ -8,9 +8,13 @@ | |||
8 | uniform sampler2D diffuseMap; | 8 | uniform sampler2D diffuseMap; |
9 | 9 | ||
10 | varying vec3 vary_normal; | 10 | varying vec3 vary_normal; |
11 | varying vec4 vary_position; | ||
11 | 12 | ||
12 | void main() | 13 | void main() |
13 | { | 14 | { |
14 | gl_FragColor = gl_Color * texture2D(diffuseMap, gl_TexCoord[0].xy); | 15 | vec3 col = texture2D(diffuseMap, gl_TexCoord[0].xy).rgb; |
15 | gl_FragColor.rgb = vary_normal*0.5+0.5; | 16 | gl_FragData[0] = vec4(gl_Color.rgb*col, 1.0); |
17 | gl_FragData[1] = vec4(col*(gl_Color.a*1.5), gl_Color.a); | ||
18 | gl_FragData[2] = vec4(normalize(vary_normal), 0.0); | ||
19 | gl_FragData[3] = vary_position; | ||
16 | } | 20 | } |
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl index 8e90693..3413a7f 100644 --- a/linden/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/diffuseV.glsl | |||
@@ -6,7 +6,7 @@ | |||
6 | */ | 6 | */ |
7 | 7 | ||
8 | varying vec3 vary_normal; | 8 | varying vec3 vary_normal; |
9 | varying vec3 vary_position; | 9 | varying vec4 vary_position; |
10 | 10 | ||
11 | void main() | 11 | void main() |
12 | { | 12 | { |
@@ -14,7 +14,7 @@ void main() | |||
14 | gl_Position = ftransform(); | 14 | gl_Position = ftransform(); |
15 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; | 15 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; |
16 | 16 | ||
17 | vary_position = (gl_ModelViewMatrix * gl_Vertex).xyz; | 17 | vary_position = gl_ModelViewMatrix * gl_Vertex; |
18 | 18 | ||
19 | vary_normal = normalize(gl_NormalMatrix * gl_Normal); | 19 | vary_normal = normalize(gl_NormalMatrix * gl_Normal); |
20 | 20 | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl new file mode 100644 index 0000000..2a811c5 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/fullbrightF.glsl | |||
@@ -0,0 +1,63 @@ | |||
1 | /** | ||
2 | * @file fullbrightF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | #extension GL_ARB_texture_rectangle : enable | ||
9 | |||
10 | uniform sampler2D diffuseMap; | ||
11 | uniform sampler2DShadow shadowMap0; | ||
12 | uniform sampler2DShadow shadowMap1; | ||
13 | uniform sampler2DShadow shadowMap2; | ||
14 | uniform sampler2DShadow shadowMap3; | ||
15 | uniform sampler2D noiseMap; | ||
16 | uniform sampler2DRect positionMap; | ||
17 | |||
18 | uniform mat4 shadow_matrix[4]; | ||
19 | uniform vec4 shadow_clip; | ||
20 | uniform vec2 screen_res; | ||
21 | |||
22 | vec3 fullbrightAtmosTransport(vec3 light); | ||
23 | vec3 fullbrightScaleSoftClip(vec3 light); | ||
24 | |||
25 | varying vec3 vary_ambient; | ||
26 | varying vec3 vary_directional; | ||
27 | varying vec4 vary_position; | ||
28 | varying vec3 vary_normal; | ||
29 | varying vec3 vary_fragcoord; | ||
30 | |||
31 | uniform float alpha_soften; | ||
32 | |||
33 | void main() | ||
34 | { | ||
35 | vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; | ||
36 | frag *= screen_res; | ||
37 | |||
38 | vec3 samp_pos = texture2DRect(positionMap, frag).xyz; | ||
39 | |||
40 | float shadow = 1.0; | ||
41 | vec4 pos = vary_position; | ||
42 | |||
43 | vec4 color = texture2D(diffuseMap, gl_TexCoord[0].xy)*gl_Color; | ||
44 | |||
45 | color.rgb = fullbrightAtmosTransport(color.rgb); | ||
46 | |||
47 | color.rgb = fullbrightScaleSoftClip(color.rgb); | ||
48 | |||
49 | if (samp_pos.z != 0.0) | ||
50 | { | ||
51 | float dist_factor = alpha_soften; | ||
52 | float a = gl_Color.a; | ||
53 | a *= a; | ||
54 | dist_factor *= 1.0/(1.0-a); | ||
55 | color.a *= min((pos.z-samp_pos.z)*dist_factor, 1.0); | ||
56 | } | ||
57 | |||
58 | //gl_FragColor = gl_Color; | ||
59 | gl_FragColor = color; | ||
60 | //gl_FragColor = vec4(1,0,1,1); | ||
61 | |||
62 | } | ||
63 | |||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl new file mode 100644 index 0000000..6381a1c --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/fullbrightV.glsl | |||
@@ -0,0 +1,41 @@ | |||
1 | /** | ||
2 | * @file fullbrightV.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | void calcAtmospherics(vec3 inPositionEye); | ||
9 | |||
10 | vec3 atmosAmbient(vec3 light); | ||
11 | vec3 atmosAffectDirectionalLight(float lightIntensity); | ||
12 | vec3 scaleDownLight(vec3 light); | ||
13 | vec3 scaleUpLight(vec3 light); | ||
14 | |||
15 | varying vec4 vary_position; | ||
16 | varying vec3 vary_ambient; | ||
17 | varying vec3 vary_directional; | ||
18 | varying vec3 vary_normal; | ||
19 | varying vec3 vary_fragcoord; | ||
20 | uniform float near_clip; | ||
21 | |||
22 | void main() | ||
23 | { | ||
24 | //transform vertex | ||
25 | gl_Position = ftransform(); | ||
26 | |||
27 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; | ||
28 | |||
29 | vec4 pos = (gl_ModelViewMatrix * gl_Vertex); | ||
30 | vary_position = pos; | ||
31 | |||
32 | calcAtmospherics(pos.xyz); | ||
33 | |||
34 | gl_FrontColor = gl_Color; | ||
35 | |||
36 | gl_FogFragCoord = pos.z; | ||
37 | |||
38 | pos = gl_ModelViewProjectionMatrix * gl_Vertex; | ||
39 | vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); | ||
40 | |||
41 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl new file mode 100644 index 0000000..20a3f3d --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/impostorF.glsl | |||
@@ -0,0 +1,20 @@ | |||
1 | /** | ||
2 | * @file impostorF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | uniform sampler2D diffuseMap; | ||
9 | uniform sampler2D normalMap; | ||
10 | uniform sampler2D specularMap; | ||
11 | |||
12 | varying vec4 vary_position; | ||
13 | |||
14 | void main() | ||
15 | { | ||
16 | gl_FragData[0] = texture2D(diffuseMap, gl_TexCoord[0].xy); | ||
17 | gl_FragData[1] = texture2D(specularMap, gl_TexCoord[0].xy); | ||
18 | gl_FragData[2] = vec4(texture2D(normalMap, gl_TexCoord[0].xy).xyz, vary_position.z); | ||
19 | gl_FragData[3] = vary_position; | ||
20 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl new file mode 100644 index 0000000..9c5ae31 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/impostorV.glsl | |||
@@ -0,0 +1,19 @@ | |||
1 | /** | ||
2 | * @file impostorV.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | varying vec4 vary_position; | ||
9 | |||
10 | void main() | ||
11 | { | ||
12 | //transform vertex | ||
13 | gl_Position = ftransform(); | ||
14 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; | ||
15 | |||
16 | vary_position = gl_ModelViewMatrix * gl_Vertex; | ||
17 | |||
18 | gl_FrontColor = gl_Color; | ||
19 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl new file mode 100644 index 0000000..3689d12 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl | |||
@@ -0,0 +1,83 @@ | |||
1 | /** | ||
2 | * @file multiPointLightF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | #extension GL_ARB_texture_rectangle : enable | ||
9 | |||
10 | uniform sampler2DRect diffuseRect; | ||
11 | uniform sampler2DRect specularRect; | ||
12 | uniform sampler2DRect positionMap; | ||
13 | uniform sampler2DRect normalMap; | ||
14 | uniform samplerCube environmentMap; | ||
15 | uniform sampler2DRect lightMap; | ||
16 | uniform sampler2D noiseMap; | ||
17 | |||
18 | uniform vec3 env_mat[3]; | ||
19 | uniform float sun_wash; | ||
20 | |||
21 | uniform int light_count; | ||
22 | |||
23 | uniform vec4 light[16]; | ||
24 | uniform vec4 light_col[16]; | ||
25 | |||
26 | varying vec3 vary_fragcoord; | ||
27 | uniform vec2 screen_res; | ||
28 | |||
29 | void main() | ||
30 | { | ||
31 | vec2 frag = (vary_fragcoord.xy*0.5+0.5)*screen_res; | ||
32 | vec3 pos = texture2DRect(positionMap, frag.xy).xyz; | ||
33 | vec3 norm = normalize(texture2DRect(normalMap, frag.xy).xyz); | ||
34 | vec4 spec = texture2DRect(specularRect, frag.xy); | ||
35 | vec3 diff = texture2DRect(diffuseRect, frag.xy).rgb; | ||
36 | float noise = texture2D(noiseMap, frag.xy/128.0).b; | ||
37 | vec3 out_col = vec3(0,0,0); | ||
38 | |||
39 | for (int i = 0; i < light_count; ++i) | ||
40 | { | ||
41 | vec3 lv = light[i].xyz-pos; | ||
42 | float dist2 = dot(lv,lv); | ||
43 | if (dist2 > light[i].w) | ||
44 | { | ||
45 | continue; | ||
46 | } | ||
47 | |||
48 | float da = dot(norm, lv); | ||
49 | if (da < 0.0) | ||
50 | { | ||
51 | continue; | ||
52 | } | ||
53 | |||
54 | lv = normalize(lv); | ||
55 | da = dot(norm, lv); | ||
56 | |||
57 | float fa = light_col[i].a+1.0; | ||
58 | float dist_atten = clamp(1.0-(dist2-light[i].w*(1.0-fa))/(light[i].w*fa), 0.0, 1.0); | ||
59 | dist_atten *= noise; | ||
60 | |||
61 | float lit = da * dist_atten; | ||
62 | |||
63 | vec3 col = light_col[i].rgb*lit*diff; | ||
64 | |||
65 | if (spec.a > 0.0) | ||
66 | { | ||
67 | vec3 ref = reflect(normalize(pos), norm); | ||
68 | float sa = dot(ref,lv); | ||
69 | sa = max(sa, 0.0); | ||
70 | sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); | ||
71 | sa *= noise; | ||
72 | col += da*sa*light_col[i].rgb*spec.rgb; | ||
73 | } | ||
74 | |||
75 | out_col += col; | ||
76 | } | ||
77 | |||
78 | //attenuate point light contribution by SSAO component | ||
79 | out_col *= texture2DRect(lightMap, frag.xy).g; | ||
80 | |||
81 | gl_FragColor.rgb = out_col; | ||
82 | gl_FragColor.a = 0.0; | ||
83 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl new file mode 100644 index 0000000..52bad1f --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl | |||
@@ -0,0 +1,75 @@ | |||
1 | /** | ||
2 | * @file pointLightF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | #extension GL_ARB_texture_rectangle : enable | ||
9 | |||
10 | uniform sampler2DRect diffuseRect; | ||
11 | uniform sampler2DRect specularRect; | ||
12 | uniform sampler2DRect positionMap; | ||
13 | uniform sampler2DRect normalMap; | ||
14 | uniform samplerCube environmentMap; | ||
15 | uniform sampler2DRect lightMap; | ||
16 | uniform sampler2D noiseMap; | ||
17 | |||
18 | uniform vec3 env_mat[3]; | ||
19 | uniform float sun_wash; | ||
20 | |||
21 | varying vec4 vary_light; | ||
22 | |||
23 | varying vec3 vary_fragcoord; | ||
24 | uniform vec2 screen_res; | ||
25 | |||
26 | void main() | ||
27 | { | ||
28 | vec2 frag = vary_fragcoord.xy/vary_fragcoord.z*0.5+0.5; | ||
29 | frag *= screen_res; | ||
30 | vec3 pos = texture2DRect(positionMap, frag).xyz; | ||
31 | vec3 lv = vary_light.xyz-pos; | ||
32 | float dist2 = dot(lv,lv); | ||
33 | if (dist2 > vary_light.w) | ||
34 | { | ||
35 | discard; | ||
36 | } | ||
37 | |||
38 | vec3 norm = texture2DRect(normalMap, frag).xyz; | ||
39 | float da = dot(norm, lv); | ||
40 | if (da < 0.0) | ||
41 | { | ||
42 | discard; | ||
43 | } | ||
44 | |||
45 | norm = normalize(norm); | ||
46 | lv = normalize(lv); | ||
47 | da = dot(norm, lv); | ||
48 | |||
49 | float noise = texture2D(noiseMap, frag/128.0).b; | ||
50 | |||
51 | vec3 col = texture2DRect(diffuseRect, frag).rgb; | ||
52 | float fa = gl_Color.a+1.0; | ||
53 | float dist_atten = clamp(1.0-(dist2-vary_light.w*(1.0-fa))/(vary_light.w*fa), 0.0, 1.0); | ||
54 | float lit = da * dist_atten * noise; | ||
55 | |||
56 | col = gl_Color.rgb*lit*col; | ||
57 | |||
58 | vec4 spec = texture2DRect(specularRect, frag); | ||
59 | if (spec.a > 0.0) | ||
60 | { | ||
61 | vec3 ref = reflect(normalize(pos), norm); | ||
62 | float sa = dot(ref,lv); | ||
63 | sa = max(sa, 0.0); | ||
64 | sa = pow(sa, 128.0 * spec.a*spec.a/dist_atten)*min(dist_atten*4.0, 1.0); | ||
65 | sa *= noise; | ||
66 | col += da*sa*gl_Color.rgb*spec.rgb; | ||
67 | } | ||
68 | |||
69 | //attenuate point light contribution by SSAO component | ||
70 | col *= texture2DRect(lightMap, frag.xy).g; | ||
71 | |||
72 | |||
73 | gl_FragColor.rgb = col; | ||
74 | gl_FragColor.a = 0.0; | ||
75 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl new file mode 100644 index 0000000..a4edb88 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/pointLightV.glsl | |||
@@ -0,0 +1,28 @@ | |||
1 | /** | ||
2 | * @file pointLightF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | varying vec4 vary_light; | ||
9 | varying vec3 vary_fragcoord; | ||
10 | |||
11 | uniform vec2 screen_res; | ||
12 | uniform float near_clip; | ||
13 | |||
14 | void main() | ||
15 | { | ||
16 | //transform vertex | ||
17 | gl_Position = ftransform(); | ||
18 | |||
19 | vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; | ||
20 | vary_fragcoord.xyz = pos.xyz + vec3(0,0,near_clip); | ||
21 | |||
22 | vec4 tex = gl_MultiTexCoord0; | ||
23 | tex.w = 1.0; | ||
24 | |||
25 | vary_light = gl_MultiTexCoord0; | ||
26 | |||
27 | gl_FrontColor = gl_Color; | ||
28 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl new file mode 100644 index 0000000..b3758c3 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/shadowF.glsl | |||
@@ -0,0 +1,14 @@ | |||
1 | /** | ||
2 | * @file shadowF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | uniform sampler2D diffuseMap; | ||
9 | |||
10 | |||
11 | void main() | ||
12 | { | ||
13 | gl_FragColor = vec4(1,1,1,texture2D(diffuseMap, gl_TexCoord[0].xy).a * gl_Color.a); | ||
14 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl new file mode 100644 index 0000000..aae1bee --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/shadowV.glsl | |||
@@ -0,0 +1,17 @@ | |||
1 | /** | ||
2 | * @file shadowV.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | void main() | ||
9 | { | ||
10 | //transform vertex | ||
11 | vec4 pos = gl_ModelViewProjectionMatrix*gl_Vertex; | ||
12 | //smash geometry against the near clip plane (great for ortho projections) | ||
13 | pos.z = max(pos.z, -1.0); | ||
14 | gl_Position = pos; | ||
15 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; | ||
16 | gl_FrontColor = gl_Color; | ||
17 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl new file mode 100644 index 0000000..d5671a6 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl | |||
@@ -0,0 +1,279 @@ | |||
1 | /** | ||
2 | * @file softenLightF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | #extension GL_ARB_texture_rectangle : enable | ||
9 | |||
10 | uniform sampler2DRect diffuseRect; | ||
11 | uniform sampler2DRect specularRect; | ||
12 | uniform sampler2DRect positionMap; | ||
13 | uniform sampler2DRect normalMap; | ||
14 | uniform sampler2DRect depthMap; | ||
15 | uniform sampler2DRect lightMap; | ||
16 | uniform sampler2D noiseMap; | ||
17 | uniform samplerCube environmentMap; | ||
18 | |||
19 | uniform float blur_size; | ||
20 | uniform float blur_fidelity; | ||
21 | |||
22 | // Inputs | ||
23 | uniform vec4 morphFactor; | ||
24 | uniform vec3 camPosLocal; | ||
25 | //uniform vec4 camPosWorld; | ||
26 | uniform vec4 gamma; | ||
27 | uniform vec4 lightnorm; | ||
28 | uniform vec4 sunlight_color; | ||
29 | uniform vec4 ambient; | ||
30 | uniform vec4 blue_horizon; | ||
31 | uniform vec4 blue_density; | ||
32 | uniform vec4 haze_horizon; | ||
33 | uniform vec4 haze_density; | ||
34 | uniform vec4 cloud_shadow; | ||
35 | uniform vec4 density_multiplier; | ||
36 | uniform vec4 distance_multiplier; | ||
37 | uniform vec4 max_y; | ||
38 | uniform vec4 glow; | ||
39 | uniform float scene_light_strength; | ||
40 | uniform vec3 env_mat[3]; | ||
41 | uniform mat4 shadow_matrix[3]; | ||
42 | uniform vec4 shadow_clip; | ||
43 | uniform mat3 ssao_effect_mat; | ||
44 | |||
45 | varying vec4 vary_light; | ||
46 | varying vec2 vary_fragcoord; | ||
47 | |||
48 | vec3 vary_PositionEye; | ||
49 | |||
50 | vec3 vary_SunlitColor; | ||
51 | vec3 vary_AmblitColor; | ||
52 | vec3 vary_AdditiveColor; | ||
53 | vec3 vary_AtmosAttenuation; | ||
54 | |||
55 | vec3 getPositionEye() | ||
56 | { | ||
57 | return vary_PositionEye; | ||
58 | } | ||
59 | vec3 getSunlitColor() | ||
60 | { | ||
61 | return vary_SunlitColor; | ||
62 | } | ||
63 | vec3 getAmblitColor() | ||
64 | { | ||
65 | return vary_AmblitColor; | ||
66 | } | ||
67 | vec3 getAdditiveColor() | ||
68 | { | ||
69 | return vary_AdditiveColor; | ||
70 | } | ||
71 | vec3 getAtmosAttenuation() | ||
72 | { | ||
73 | return vary_AtmosAttenuation; | ||
74 | } | ||
75 | |||
76 | |||
77 | void setPositionEye(vec3 v) | ||
78 | { | ||
79 | vary_PositionEye = v; | ||
80 | } | ||
81 | |||
82 | void setSunlitColor(vec3 v) | ||
83 | { | ||
84 | vary_SunlitColor = v; | ||
85 | } | ||
86 | |||
87 | void setAmblitColor(vec3 v) | ||
88 | { | ||
89 | vary_AmblitColor = v; | ||
90 | } | ||
91 | |||
92 | void setAdditiveColor(vec3 v) | ||
93 | { | ||
94 | vary_AdditiveColor = v; | ||
95 | } | ||
96 | |||
97 | void setAtmosAttenuation(vec3 v) | ||
98 | { | ||
99 | vary_AtmosAttenuation = v; | ||
100 | } | ||
101 | |||
102 | void calcAtmospherics(vec3 inPositionEye, float ambFactor) { | ||
103 | |||
104 | vec3 P = inPositionEye; | ||
105 | setPositionEye(P); | ||
106 | |||
107 | //(TERRAIN) limit altitude | ||
108 | if (P.y > max_y.x) P *= (max_y.x / P.y); | ||
109 | if (P.y < -max_y.x) P *= (-max_y.x / P.y); | ||
110 | |||
111 | vec3 tmpLightnorm = lightnorm.xyz; | ||
112 | |||
113 | vec3 Pn = normalize(P); | ||
114 | float Plen = length(P); | ||
115 | |||
116 | vec4 temp1 = vec4(0); | ||
117 | vec3 temp2 = vec3(0); | ||
118 | vec4 blue_weight; | ||
119 | vec4 haze_weight; | ||
120 | vec4 sunlight = sunlight_color; | ||
121 | vec4 light_atten; | ||
122 | |||
123 | //sunlight attenuation effect (hue and brightness) due to atmosphere | ||
124 | //this is used later for sunlight modulation at various altitudes | ||
125 | light_atten = (blue_density * 1.0 + vec4(haze_density.r) * 0.25) * (density_multiplier.x * max_y.x); | ||
126 | //I had thought blue_density and haze_density should have equal weighting, | ||
127 | //but attenuation due to haze_density tends to seem too strong | ||
128 | |||
129 | temp1 = blue_density + vec4(haze_density.r); | ||
130 | blue_weight = blue_density / temp1; | ||
131 | haze_weight = vec4(haze_density.r) / temp1; | ||
132 | |||
133 | //(TERRAIN) compute sunlight from lightnorm only (for short rays like terrain) | ||
134 | temp2.y = max(0.0, tmpLightnorm.y); | ||
135 | temp2.y = 1. / temp2.y; | ||
136 | sunlight *= exp( - light_atten * temp2.y); | ||
137 | |||
138 | // main atmospheric scattering line integral | ||
139 | temp2.z = Plen * density_multiplier.x; | ||
140 | |||
141 | // Transparency (-> temp1) | ||
142 | // ATI Bugfix -- can't store temp1*temp2.z*distance_multiplier.x in a variable because the ati | ||
143 | // compiler gets confused. | ||
144 | temp1 = exp(-temp1 * temp2.z * distance_multiplier.x); | ||
145 | |||
146 | //final atmosphere attenuation factor | ||
147 | setAtmosAttenuation(temp1.rgb); | ||
148 | |||
149 | //compute haze glow | ||
150 | //(can use temp2.x as temp because we haven't used it yet) | ||
151 | temp2.x = dot(Pn, tmpLightnorm.xyz); | ||
152 | temp2.x = 1. - temp2.x; | ||
153 | //temp2.x is 0 at the sun and increases away from sun | ||
154 | temp2.x = max(temp2.x, .03); //was glow.y | ||
155 | //set a minimum "angle" (smaller glow.y allows tighter, brighter hotspot) | ||
156 | temp2.x *= glow.x; | ||
157 | //higher glow.x gives dimmer glow (because next step is 1 / "angle") | ||
158 | temp2.x = pow(temp2.x, glow.z); | ||
159 | //glow.z should be negative, so we're doing a sort of (1 / "angle") function | ||
160 | |||
161 | //add "minimum anti-solar illumination" | ||
162 | temp2.x += .25; | ||
163 | |||
164 | //increase ambient when there are more clouds | ||
165 | vec4 tmpAmbient = ambient + (vec4(1.) - ambient) * cloud_shadow.x * 0.5; | ||
166 | |||
167 | /* decrease value and saturation (that in HSV, not HSL) for occluded areas | ||
168 | * // for HSV color/geometry used here, see http://gimp-savvy.com/BOOK/index.html?node52.html | ||
169 | * // The following line of code performs the equivalent of: | ||
170 | * float ambAlpha = tmpAmbient.a; | ||
171 | * float ambValue = dot(vec3(tmpAmbient), vec3(0.577)); // projection onto <1/rt(3), 1/rt(3), 1/rt(3)>, the neutral white-black axis | ||
172 | * vec3 ambHueSat = vec3(tmpAmbient) - vec3(ambValue); | ||
173 | * tmpAmbient = vec4(RenderSSAOEffect.valueFactor * vec3(ambValue) + RenderSSAOEffect.saturationFactor *(1.0 - ambFactor) * ambHueSat, ambAlpha); | ||
174 | */ | ||
175 | tmpAmbient = vec4(mix(ssao_effect_mat * tmpAmbient.rgb, tmpAmbient.rgb, ambFactor), tmpAmbient.a); | ||
176 | |||
177 | //haze color | ||
178 | setAdditiveColor( | ||
179 | vec3(blue_horizon * blue_weight * (sunlight*(1.-cloud_shadow.x) + tmpAmbient) | ||
180 | + (haze_horizon.r * haze_weight) * (sunlight*(1.-cloud_shadow.x) * temp2.x | ||
181 | + tmpAmbient))); | ||
182 | |||
183 | //brightness of surface both sunlight and ambient | ||
184 | setSunlitColor(vec3(sunlight * .5)); | ||
185 | setAmblitColor(vec3(tmpAmbient * .25)); | ||
186 | setAdditiveColor(getAdditiveColor() * vec3(1.0 - temp1)); | ||
187 | } | ||
188 | |||
189 | vec3 atmosLighting(vec3 light) | ||
190 | { | ||
191 | light *= getAtmosAttenuation().r; | ||
192 | light += getAdditiveColor(); | ||
193 | return (2.0 * light); | ||
194 | } | ||
195 | |||
196 | vec3 atmosTransport(vec3 light) { | ||
197 | light *= getAtmosAttenuation().r; | ||
198 | light += getAdditiveColor() * 2.0; | ||
199 | return light; | ||
200 | } | ||
201 | vec3 atmosGetDiffuseSunlightColor() | ||
202 | { | ||
203 | return getSunlitColor(); | ||
204 | } | ||
205 | |||
206 | vec3 scaleDownLight(vec3 light) | ||
207 | { | ||
208 | return (light / scene_light_strength ); | ||
209 | } | ||
210 | |||
211 | vec3 scaleUpLight(vec3 light) | ||
212 | { | ||
213 | return (light * scene_light_strength); | ||
214 | } | ||
215 | |||
216 | vec3 atmosAmbient(vec3 light) | ||
217 | { | ||
218 | return getAmblitColor() + light / 2.0; | ||
219 | } | ||
220 | |||
221 | vec3 atmosAffectDirectionalLight(float lightIntensity) | ||
222 | { | ||
223 | return getSunlitColor() * lightIntensity; | ||
224 | } | ||
225 | |||
226 | vec3 scaleSoftClip(vec3 light) | ||
227 | { | ||
228 | //soft clip effect: | ||
229 | light = 1. - clamp(light, vec3(0.), vec3(1.)); | ||
230 | light = 1. - pow(light, gamma.xxx); | ||
231 | |||
232 | return light; | ||
233 | } | ||
234 | |||
235 | void main() | ||
236 | { | ||
237 | vec2 tc = vary_fragcoord.xy; | ||
238 | vec3 pos = texture2DRect(positionMap, tc).xyz; | ||
239 | vec3 norm = texture2DRect(normalMap, tc).xyz; | ||
240 | vec3 nz = texture2D(noiseMap, vary_fragcoord.xy/128.0).xyz; | ||
241 | |||
242 | float da = max(dot(norm.xyz, vary_light.xyz), 0.0); | ||
243 | |||
244 | vec4 diffuse = vec4(texture2DRect(diffuseRect, tc).rgb, 1.0); | ||
245 | vec4 spec = texture2DRect(specularRect, vary_fragcoord.xy); | ||
246 | |||
247 | vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg; | ||
248 | float scol = scol_ambocc.r; | ||
249 | float ambocc = scol_ambocc.g; | ||
250 | |||
251 | calcAtmospherics(pos.xyz, ambocc); | ||
252 | |||
253 | vec3 col = atmosAmbient(vec3(0)); | ||
254 | col += atmosAffectDirectionalLight(min(da, scol)); | ||
255 | |||
256 | col *= diffuse.rgb; | ||
257 | |||
258 | if (spec.a > 0.2) | ||
259 | { | ||
260 | vec3 ref = reflect(pos.xyz, norm.xyz); | ||
261 | vec3 rc; | ||
262 | rc.x = dot(ref, env_mat[0]); | ||
263 | rc.y = dot(ref, env_mat[1]); | ||
264 | rc.z = dot(ref, env_mat[2]); | ||
265 | |||
266 | vec3 refcol = textureCube(environmentMap, rc).rgb; | ||
267 | col.rgb += refcol * spec.rgb; | ||
268 | } | ||
269 | |||
270 | col = atmosLighting(col); | ||
271 | col = scaleSoftClip(col); | ||
272 | |||
273 | gl_FragColor.rgb = col; | ||
274 | gl_FragColor.a = 0.0; | ||
275 | //gl_FragColor.rg = scol_ambocc.rg; | ||
276 | //gl_FragColor.rgb = norm.rgb*0.5+0.5; | ||
277 | //gl_FragColor.rgb = vec3(ambocc); | ||
278 | //gl_FragColor.rgb = vec3(scol); | ||
279 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl new file mode 100644 index 0000000..ad8af47 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/softenLightV.glsl | |||
@@ -0,0 +1,24 @@ | |||
1 | /** | ||
2 | * @file softenLightF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | uniform vec2 screen_res; | ||
9 | |||
10 | varying vec4 vary_light; | ||
11 | varying vec2 vary_fragcoord; | ||
12 | void main() | ||
13 | { | ||
14 | //transform vertex | ||
15 | gl_Position = ftransform(); | ||
16 | |||
17 | vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; | ||
18 | vary_fragcoord = (pos.xy*0.5+0.5)*screen_res; | ||
19 | |||
20 | vec4 tex = gl_MultiTexCoord0; | ||
21 | tex.w = 1.0; | ||
22 | |||
23 | vary_light = gl_MultiTexCoord0; | ||
24 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl new file mode 100644 index 0000000..d43fe6c --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/sunLightF.glsl | |||
@@ -0,0 +1,139 @@ | |||
1 | /** | ||
2 | * @file sunLightF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | #extension GL_ARB_texture_rectangle : enable | ||
9 | |||
10 | uniform sampler2DRect positionMap; | ||
11 | uniform sampler2DRect normalMap; | ||
12 | uniform sampler2DRect depthMap; | ||
13 | uniform sampler2DShadow shadowMap0; | ||
14 | uniform sampler2DShadow shadowMap1; | ||
15 | uniform sampler2DShadow shadowMap2; | ||
16 | uniform sampler2DShadow shadowMap3; | ||
17 | uniform sampler2D noiseMap; | ||
18 | |||
19 | // Inputs | ||
20 | uniform mat4 shadow_matrix[4]; | ||
21 | uniform vec4 shadow_clip; | ||
22 | uniform float ssao_radius; | ||
23 | uniform float ssao_max_radius; | ||
24 | uniform float ssao_factor; | ||
25 | uniform float ssao_factor_inv; | ||
26 | |||
27 | varying vec2 vary_fragcoord; | ||
28 | varying vec4 vary_light; | ||
29 | |||
30 | //calculate decreases in ambient lighting when crowded out (SSAO) | ||
31 | float calcAmbientOcclusion(vec4 pos, vec3 norm) | ||
32 | { | ||
33 | vec2 kern[8]; | ||
34 | // exponentially (^2) distant occlusion samples spread around origin | ||
35 | kern[0] = vec2(-1.0, 0.0) * 0.125*0.125; | ||
36 | kern[1] = vec2(1.0, 0.0) * 0.250*0.250; | ||
37 | kern[2] = vec2(0.0, 1.0) * 0.375*0.375; | ||
38 | kern[3] = vec2(0.0, -1.0) * 0.500*0.500; | ||
39 | kern[4] = vec2(0.7071, 0.7071) * 0.625*0.625; | ||
40 | kern[5] = vec2(-0.7071, -0.7071) * 0.750*0.750; | ||
41 | kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; | ||
42 | kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; | ||
43 | |||
44 | vec2 pos_screen = vary_fragcoord.xy; | ||
45 | vec3 pos_world = pos.xyz; | ||
46 | vec2 noise_reflect = texture2D(noiseMap, vary_fragcoord.xy/128.0).xy; | ||
47 | |||
48 | float angle_hidden = 0.0; | ||
49 | int points = 0; | ||
50 | |||
51 | float scale = min(ssao_radius / -pos_world.z, ssao_max_radius); | ||
52 | |||
53 | // it was found that keeping # of samples a constant was the fastest, probably due to compiler optimizations (unrolling?) | ||
54 | for (int i = 0; i < 8; i++) | ||
55 | { | ||
56 | vec2 samppos_screen = pos_screen + scale * reflect(kern[i], noise_reflect); | ||
57 | vec3 samppos_world = texture2DRect(positionMap, samppos_screen).xyz; | ||
58 | |||
59 | vec3 diff = pos_world - samppos_world; | ||
60 | float dist2 = dot(diff, diff); | ||
61 | |||
62 | // assume each sample corresponds to an occluding sphere with constant radius, constant x-sectional area | ||
63 | // --> solid angle shrinking by the square of distance | ||
64 | //radius is somewhat arbitrary, can approx with just some constant k * 1 / dist^2 | ||
65 | //(k should vary inversely with # of samples, but this is taken care of later) | ||
66 | |||
67 | //if (dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) // -0.05*norm to shift sample point back slightly for flat surfaces | ||
68 | // angle_hidden += min(1.0/dist2, ssao_factor_inv); // dist != 0 follows from conditional. max of 1.0 (= ssao_factor_inv * ssao_factor) | ||
69 | angle_hidden = angle_hidden + float(dot((samppos_world - 0.05*norm - pos_world), norm) > 0.0) * min(1.0/dist2, ssao_factor_inv); | ||
70 | |||
71 | // 'blocked' samples (significantly closer to camera relative to pos_world) are "no data", not "no occlusion" | ||
72 | points = points + int(diff.z > -1.0); | ||
73 | } | ||
74 | |||
75 | angle_hidden = min(ssao_factor*angle_hidden/float(points), 1.0); | ||
76 | |||
77 | return 1.0 - (float(points != 0) * angle_hidden); | ||
78 | } | ||
79 | |||
80 | void main() | ||
81 | { | ||
82 | vec2 pos_screen = vary_fragcoord.xy; | ||
83 | vec4 pos = vec4(texture2DRect(positionMap, pos_screen).xyz, 1.0); | ||
84 | vec3 norm = texture2DRect(normalMap, pos_screen).xyz; | ||
85 | |||
86 | /*if (pos.z == 0.0) // do nothing for sky *FIX: REMOVE THIS IF/WHEN THE POSITION MAP IS BEING USED AS A STENCIL | ||
87 | { | ||
88 | gl_FragColor = vec4(0.0); // doesn't matter | ||
89 | return; | ||
90 | }*/ | ||
91 | |||
92 | float shadow = 1.0; | ||
93 | float dp_directional_light = max(0.0, dot(norm, vary_light.xyz)); | ||
94 | |||
95 | if (dp_directional_light == 0.0) | ||
96 | { | ||
97 | // if we know this point is facing away from the sun then we know it's in shadow without having to do a squirrelly shadow-map lookup | ||
98 | shadow = 0.0; | ||
99 | } | ||
100 | else if (pos.z > -shadow_clip.w) | ||
101 | { | ||
102 | if (pos.z < -shadow_clip.z) | ||
103 | { | ||
104 | vec4 lpos = shadow_matrix[3]*pos; | ||
105 | shadow = shadow2DProj(shadowMap3, lpos).x; | ||
106 | shadow += max((pos.z+shadow_clip.z)/(shadow_clip.z-shadow_clip.w)*2.0-1.0, 0.0); | ||
107 | } | ||
108 | else if (pos.z < -shadow_clip.y) | ||
109 | { | ||
110 | vec4 lpos = shadow_matrix[2]*pos; | ||
111 | shadow = shadow2DProj(shadowMap2, lpos).x; | ||
112 | } | ||
113 | else if (pos.z < -shadow_clip.x) | ||
114 | { | ||
115 | vec4 lpos = shadow_matrix[1]*pos; | ||
116 | shadow = shadow2DProj(shadowMap1, lpos).x; | ||
117 | } | ||
118 | else | ||
119 | { | ||
120 | vec4 lpos = shadow_matrix[0]*pos; | ||
121 | shadow = shadow2DProj(shadowMap0, lpos).x; | ||
122 | } | ||
123 | |||
124 | // take the most-shadowed value out of these two: | ||
125 | // * the blurred sun shadow in the light (shadow) map | ||
126 | // * an unblurred dot product between the sun and this norm | ||
127 | // the goal is to err on the side of most-shadow to fill-in shadow holes and reduce artifacting | ||
128 | shadow = min(shadow, dp_directional_light); | ||
129 | } | ||
130 | else | ||
131 | { | ||
132 | // more distant than the shadow map covers - just use directional shading as shadow | ||
133 | shadow = dp_directional_light; | ||
134 | } | ||
135 | |||
136 | gl_FragColor[0] = shadow; | ||
137 | gl_FragColor[1] = calcAmbientOcclusion(pos, norm); | ||
138 | //gl_FragColor[2] is unused as of August 2008, may be used for debugging | ||
139 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl new file mode 100644 index 0000000..5081485 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/sunLightV.glsl | |||
@@ -0,0 +1,25 @@ | |||
1 | /** | ||
2 | * @file sunLightF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | varying vec4 vary_light; | ||
9 | varying vec2 vary_fragcoord; | ||
10 | |||
11 | uniform vec2 screen_res; | ||
12 | |||
13 | void main() | ||
14 | { | ||
15 | //transform vertex | ||
16 | gl_Position = ftransform(); | ||
17 | vec4 pos = gl_ModelViewProjectionMatrix * gl_Vertex; | ||
18 | vary_fragcoord = (pos.xy * 0.5 + 0.5)*screen_res; | ||
19 | vec4 tex = gl_MultiTexCoord0; | ||
20 | tex.w = 1.0; | ||
21 | |||
22 | vary_light = gl_MultiTexCoord0; | ||
23 | |||
24 | gl_FrontColor = gl_Color; | ||
25 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl new file mode 100644 index 0000000..211b2e0 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/terrainF.glsl | |||
@@ -0,0 +1,36 @@ | |||
1 | /** | ||
2 | * @file terrainF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | uniform sampler2D detail_0; | ||
9 | uniform sampler2D detail_1; | ||
10 | uniform sampler2D detail_2; | ||
11 | uniform sampler2D detail_3; | ||
12 | uniform sampler2D alpha_ramp; | ||
13 | |||
14 | varying vec3 vary_normal; | ||
15 | varying vec4 vary_position; | ||
16 | |||
17 | void main() | ||
18 | { | ||
19 | /// Note: This should duplicate the blending functionality currently used for the terrain rendering. | ||
20 | |||
21 | vec4 color0 = texture2D(detail_0, gl_TexCoord[0].xy); | ||
22 | vec4 color1 = texture2D(detail_1, gl_TexCoord[0].xy); | ||
23 | vec4 color2 = texture2D(detail_2, gl_TexCoord[0].xy); | ||
24 | vec4 color3 = texture2D(detail_3, gl_TexCoord[0].xy); | ||
25 | |||
26 | float alpha1 = texture2D(alpha_ramp, gl_TexCoord[0].zw).a; | ||
27 | float alpha2 = texture2D(alpha_ramp,gl_TexCoord[1].xy).a; | ||
28 | float alphaFinal = texture2D(alpha_ramp, gl_TexCoord[1].zw).a; | ||
29 | vec4 outColor = mix( mix(color3, color2, alpha2), mix(color1, color0, alpha1), alphaFinal ); | ||
30 | |||
31 | gl_FragData[0] = vec4(outColor.rgb, 1.0); | ||
32 | gl_FragData[1] = vec4(outColor.rgb*0.2, 0.2); | ||
33 | gl_FragData[2] = vec4(normalize(vary_normal), 0.0); | ||
34 | gl_FragData[3] = vary_position; | ||
35 | } | ||
36 | |||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl new file mode 100644 index 0000000..e9d6dca --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/terrainV.glsl | |||
@@ -0,0 +1,41 @@ | |||
1 | /** | ||
2 | * @file terrainV.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | varying vec3 vary_normal; | ||
9 | varying vec4 vary_position; | ||
10 | |||
11 | vec4 texgen_object(vec4 vpos, vec4 tc, mat4 mat, vec4 tp0, vec4 tp1) | ||
12 | { | ||
13 | vec4 tcoord; | ||
14 | |||
15 | tcoord.x = dot(vpos, tp0); | ||
16 | tcoord.y = dot(vpos, tp1); | ||
17 | tcoord.z = tc.z; | ||
18 | tcoord.w = tc.w; | ||
19 | |||
20 | tcoord = mat * tcoord; | ||
21 | |||
22 | return tcoord; | ||
23 | } | ||
24 | |||
25 | void main() | ||
26 | { | ||
27 | //transform vertex | ||
28 | gl_Position = gl_ModelViewProjectionMatrix * gl_Vertex; | ||
29 | |||
30 | vary_position = gl_ModelViewMatrix * gl_Vertex; | ||
31 | vary_normal = normalize(gl_NormalMatrix * gl_Normal); | ||
32 | |||
33 | // Transform and pass tex coords | ||
34 | gl_TexCoord[0].xy = texgen_object(gl_Vertex, gl_MultiTexCoord0, gl_TextureMatrix[0], gl_ObjectPlaneS[0], gl_ObjectPlaneT[0]).xy; | ||
35 | |||
36 | vec4 t = gl_MultiTexCoord1; | ||
37 | |||
38 | gl_TexCoord[0].zw = t.xy; | ||
39 | gl_TexCoord[1].xy = t.xy-vec2(2.0, 0.0); | ||
40 | gl_TexCoord[1].zw = t.xy-vec2(1.0, 0.0); | ||
41 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl new file mode 100644 index 0000000..bc2c981 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/treeF.glsl | |||
@@ -0,0 +1,20 @@ | |||
1 | /** | ||
2 | * @file treeF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | uniform sampler2D diffuseMap; | ||
9 | |||
10 | varying vec3 vary_normal; | ||
11 | varying vec4 vary_position; | ||
12 | |||
13 | void main() | ||
14 | { | ||
15 | vec4 col = texture2D(diffuseMap, gl_TexCoord[0].xy); | ||
16 | gl_FragData[0] = gl_Color*col; | ||
17 | gl_FragData[1] = vec4(0,0,0,0); | ||
18 | gl_FragData[2] = vec4(normalize(vary_normal), 0.0); | ||
19 | gl_FragData[3] = vary_position; | ||
20 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl new file mode 100644 index 0000000..9131d7c --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/treeV.glsl | |||
@@ -0,0 +1,22 @@ | |||
1 | /** | ||
2 | * @file treeV.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | varying vec3 vary_normal; | ||
9 | varying vec4 vary_position; | ||
10 | |||
11 | void main() | ||
12 | { | ||
13 | //transform vertex | ||
14 | gl_Position = ftransform(); | ||
15 | gl_TexCoord[0] = gl_TextureMatrix[0] * gl_MultiTexCoord0; | ||
16 | |||
17 | vary_position = gl_ModelViewMatrix * gl_Vertex; | ||
18 | |||
19 | vary_normal = normalize(gl_NormalMatrix * gl_Normal); | ||
20 | |||
21 | gl_FrontColor = gl_Color; | ||
22 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl new file mode 100644 index 0000000..0a1f019 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl | |||
@@ -0,0 +1,157 @@ | |||
1 | /** | ||
2 | * @file waterF.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | vec3 scaleSoftClip(vec3 inColor); | ||
9 | vec3 atmosTransport(vec3 inColor); | ||
10 | |||
11 | uniform sampler2D bumpMap; | ||
12 | uniform sampler2D screenTex; | ||
13 | uniform sampler2D refTex; | ||
14 | uniform sampler2DShadow shadowMap0; | ||
15 | uniform sampler2DShadow shadowMap1; | ||
16 | uniform sampler2DShadow shadowMap2; | ||
17 | uniform sampler2DShadow shadowMap3; | ||
18 | uniform sampler2D noiseMap; | ||
19 | |||
20 | uniform mat4 shadow_matrix[4]; | ||
21 | uniform vec4 shadow_clip; | ||
22 | |||
23 | uniform float sunAngle; | ||
24 | uniform float sunAngle2; | ||
25 | uniform vec3 lightDir; | ||
26 | uniform vec3 specular; | ||
27 | uniform float lightExp; | ||
28 | uniform float refScale; | ||
29 | uniform float kd; | ||
30 | uniform vec2 screenRes; | ||
31 | uniform vec3 normScale; | ||
32 | uniform float fresnelScale; | ||
33 | uniform float fresnelOffset; | ||
34 | uniform float blurMultiplier; | ||
35 | |||
36 | |||
37 | //bigWave is (refCoord.w, view.w); | ||
38 | varying vec4 refCoord; | ||
39 | varying vec4 littleWave; | ||
40 | varying vec4 view; | ||
41 | varying vec4 vary_position; | ||
42 | |||
43 | void main() | ||
44 | { | ||
45 | vec4 color; | ||
46 | float dist = length(view.xy); | ||
47 | |||
48 | //normalize view vector | ||
49 | vec3 viewVec = normalize(view.xyz); | ||
50 | |||
51 | //get wave normals | ||
52 | vec3 wave1 = texture2D(bumpMap, vec2(refCoord.w, view.w)).xyz*2.0-1.0; | ||
53 | vec3 wave2 = texture2D(bumpMap, littleWave.xy).xyz*2.0-1.0; | ||
54 | vec3 wave3 = texture2D(bumpMap, littleWave.zw).xyz*2.0-1.0; | ||
55 | //get base fresnel components | ||
56 | |||
57 | vec3 df = vec3( | ||
58 | dot(viewVec, wave1), | ||
59 | dot(viewVec, (wave2 + wave3) * 0.5), | ||
60 | dot(viewVec, wave3) | ||
61 | ) * fresnelScale + fresnelOffset; | ||
62 | df *= df; | ||
63 | |||
64 | vec2 distort = (refCoord.xy/refCoord.z) * 0.5 + 0.5; | ||
65 | |||
66 | float dist2 = dist; | ||
67 | dist = max(dist, 5.0); | ||
68 | |||
69 | float dmod = sqrt(dist); | ||
70 | |||
71 | vec2 dmod_scale = vec2(dmod*dmod, dmod); | ||
72 | |||
73 | //get reflected color | ||
74 | vec2 refdistort1 = wave1.xy*normScale.x; | ||
75 | vec2 refvec1 = distort+refdistort1/dmod_scale; | ||
76 | vec4 refcol1 = texture2D(refTex, refvec1); | ||
77 | |||
78 | vec2 refdistort2 = wave2.xy*normScale.y; | ||
79 | vec2 refvec2 = distort+refdistort2/dmod_scale; | ||
80 | vec4 refcol2 = texture2D(refTex, refvec2); | ||
81 | |||
82 | vec2 refdistort3 = wave3.xy*normScale.z; | ||
83 | vec2 refvec3 = distort+refdistort3/dmod_scale; | ||
84 | vec4 refcol3 = texture2D(refTex, refvec3); | ||
85 | |||
86 | vec4 refcol = refcol1 + refcol2 + refcol3; | ||
87 | float df1 = df.x + df.y + df.z; | ||
88 | refcol *= df1 * 0.333; | ||
89 | |||
90 | vec3 wavef = (wave1 + wave2 * 0.4 + wave3 * 0.6) * 0.5; | ||
91 | wavef.z *= max(-viewVec.z, 0.1); | ||
92 | wavef = normalize(wavef); | ||
93 | |||
94 | float df2 = dot(viewVec, wavef) * fresnelScale+fresnelOffset; | ||
95 | |||
96 | vec2 refdistort4 = wavef.xy*0.125; | ||
97 | refdistort4.y -= abs(refdistort4.y); | ||
98 | vec2 refvec4 = distort+refdistort4/dmod; | ||
99 | float dweight = min(dist2*blurMultiplier, 1.0); | ||
100 | vec4 baseCol = texture2D(refTex, refvec4); | ||
101 | refcol = mix(baseCol*df2, refcol, dweight); | ||
102 | |||
103 | //get specular component | ||
104 | float spec = clamp(dot(lightDir, (reflect(viewVec,wavef))),0.0,1.0); | ||
105 | |||
106 | //harden specular | ||
107 | spec = pow(spec, 128.0); | ||
108 | |||
109 | //figure out distortion vector (ripply) | ||
110 | vec2 distort2 = distort+wavef.xy*refScale/max(dmod*df1, 1.0); | ||
111 | |||
112 | vec4 fb = texture2D(screenTex, distort2); | ||
113 | |||
114 | //mix with reflection | ||
115 | // Note we actually want to use just df1, but multiplying by 0.999999 gets around and nvidia compiler bug | ||
116 | color.rgb = mix(fb.rgb, refcol.rgb, df1 * 0.99999); | ||
117 | |||
118 | float shadow = 1.0; | ||
119 | vec4 pos = vary_position; | ||
120 | |||
121 | vec3 nz = texture2D(noiseMap, gl_FragCoord.xy/128.0).xyz; | ||
122 | |||
123 | if (pos.z > -shadow_clip.w) | ||
124 | { | ||
125 | vec4 spos = pos; | ||
126 | |||
127 | if (pos.z < -shadow_clip.z) | ||
128 | { | ||
129 | vec4 lpos = (shadow_matrix[3]*spos); | ||
130 | shadow = shadow2DProj(shadowMap3, lpos).x; | ||
131 | } | ||
132 | else if (pos.z < -shadow_clip.y) | ||
133 | { | ||
134 | vec4 lpos = (shadow_matrix[2]*spos); | ||
135 | shadow = shadow2DProj(shadowMap2, lpos).x; | ||
136 | } | ||
137 | else if (pos.z < -shadow_clip.x) | ||
138 | { | ||
139 | vec4 lpos = (shadow_matrix[1]*spos); | ||
140 | shadow = shadow2DProj(shadowMap1, lpos).x; | ||
141 | } | ||
142 | else | ||
143 | { | ||
144 | vec4 lpos = (shadow_matrix[0]*spos); | ||
145 | shadow = shadow2DProj(shadowMap0, lpos).x; | ||
146 | } | ||
147 | } | ||
148 | |||
149 | spec *= shadow; | ||
150 | color.rgb += spec * specular; | ||
151 | |||
152 | color.rgb = atmosTransport(color.rgb); | ||
153 | color.rgb = scaleSoftClip(color.rgb); | ||
154 | color.a = spec * sunAngle2; | ||
155 | |||
156 | gl_FragColor = color; | ||
157 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl b/linden/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl new file mode 100644 index 0000000..b45e5c5 --- /dev/null +++ b/linden/indra/newview/app_settings/shaders/class1/deferred/waterV.glsl | |||
@@ -0,0 +1,76 @@ | |||
1 | /** | ||
2 | * @file waterV.glsl | ||
3 | * | ||
4 | * Copyright (c) 2007-$CurrentYear$, Linden Research, Inc. | ||
5 | * $License$ | ||
6 | */ | ||
7 | |||
8 | void calcAtmospherics(vec3 inPositionEye); | ||
9 | |||
10 | uniform vec2 d1; | ||
11 | uniform vec2 d2; | ||
12 | uniform float time; | ||
13 | uniform vec3 eyeVec; | ||
14 | uniform float waterHeight; | ||
15 | |||
16 | varying vec4 refCoord; | ||
17 | varying vec4 littleWave; | ||
18 | varying vec4 view; | ||
19 | |||
20 | varying vec4 vary_position; | ||
21 | |||
22 | float wave(vec2 v, float t, float f, vec2 d, float s) | ||
23 | { | ||
24 | return (dot(d, v)*f + t*s)*f; | ||
25 | } | ||
26 | |||
27 | void main() | ||
28 | { | ||
29 | //transform vertex | ||
30 | vec4 position = gl_Vertex; | ||
31 | mat4 modelViewProj = gl_ModelViewProjectionMatrix; | ||
32 | |||
33 | vec4 oPosition; | ||
34 | |||
35 | //get view vector | ||
36 | vec3 oEyeVec; | ||
37 | oEyeVec.xyz = position.xyz-eyeVec; | ||
38 | |||
39 | float d = length(oEyeVec.xy); | ||
40 | float ld = min(d, 2560.0); | ||
41 | |||
42 | position.xy = eyeVec.xy + oEyeVec.xy/d*ld; | ||
43 | view.xyz = oEyeVec; | ||
44 | |||
45 | d = clamp(ld/1536.0-0.5, 0.0, 1.0); | ||
46 | d *= d; | ||
47 | |||
48 | oPosition = position; | ||
49 | oPosition.z = mix(oPosition.z, max(eyeVec.z*0.75, 0.0), d); | ||
50 | vary_position = gl_ModelViewMatrix * oPosition; | ||
51 | oPosition = modelViewProj * oPosition; | ||
52 | |||
53 | refCoord.xyz = oPosition.xyz + vec3(0,0,0.2); | ||
54 | |||
55 | //get wave position parameter (create sweeping horizontal waves) | ||
56 | vec3 v = position.xyz; | ||
57 | v.x += (cos(v.x*0.08/*+time*0.01*/)+sin(v.y*0.02))*6.0; | ||
58 | |||
59 | //push position for further horizon effect. | ||
60 | position.xyz = oEyeVec.xyz*(waterHeight/oEyeVec.z); | ||
61 | position.w = 1.0; | ||
62 | position = position*gl_ModelViewMatrix; | ||
63 | |||
64 | calcAtmospherics((gl_ModelViewMatrix * gl_Vertex).xyz); | ||
65 | |||
66 | |||
67 | //pass wave parameters to pixel shader | ||
68 | vec2 bigWave = (v.xy) * vec2(0.04,0.04) + d1 * time * 0.055; | ||
69 | //get two normal map (detail map) texture coordinates | ||
70 | littleWave.xy = (v.xy) * vec2(0.45, 0.9) + d2 * time * 0.13; | ||
71 | littleWave.zw = (v.xy) * vec2(0.1, 0.2) + d1 * time * 0.1; | ||
72 | view.w = bigWave.y; | ||
73 | refCoord.w = bigWave.x; | ||
74 | |||
75 | gl_Position = oPosition; | ||
76 | } | ||
diff --git a/linden/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl b/linden/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl index dbdfe11..5d7af2c 100644 --- a/linden/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl +++ b/linden/indra/newview/app_settings/shaders/class1/effects/glowExtractF.glsl | |||
@@ -20,8 +20,8 @@ void main() | |||
20 | 20 | ||
21 | /// CALCULATING LUMINANCE (Using NTSC lum weights) | 21 | /// CALCULATING LUMINANCE (Using NTSC lum weights) |
22 | /// http://en.wikipedia.org/wiki/Luma_%28video%29 | 22 | /// http://en.wikipedia.org/wiki/Luma_%28video%29 |
23 | float lum = smoothstep(minLuminance, 1.0, dot(col.rgb, lumWeights ) ); | 23 | float lum = smoothstep(minLuminance, minLuminance+1.0, dot(col.rgb, lumWeights ) ); |
24 | float warmth = smoothstep(minLuminance, 1.0, max(col.r * warmthWeights.r, max(col.g * warmthWeights.g, col.b * warmthWeights.b)) ); | 24 | float warmth = smoothstep(minLuminance, minLuminance+1.0, max(col.r * warmthWeights.r, max(col.g * warmthWeights.g, col.b * warmthWeights.b)) ); |
25 | 25 | ||
26 | gl_FragColor.rgb = col.rgb; | 26 | gl_FragColor.rgb = col.rgb; |
27 | gl_FragColor.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha); | 27 | gl_FragColor.a = max(col.a, mix(lum, warmth, warmthAmount) * maxExtractAlpha); |
diff --git a/linden/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/linden/indra/newview/app_settings/shaders/class1/environment/waterF.glsl index bd9b30a..7e17886 100644 --- a/linden/indra/newview/app_settings/shaders/class1/environment/waterF.glsl +++ b/linden/indra/newview/app_settings/shaders/class1/environment/waterF.glsl | |||
@@ -7,6 +7,7 @@ | |||
7 | 7 | ||
8 | vec3 scaleSoftClip(vec3 inColor); | 8 | vec3 scaleSoftClip(vec3 inColor); |
9 | vec3 atmosTransport(vec3 inColor); | 9 | vec3 atmosTransport(vec3 inColor); |
10 | vec3 applyWaterFog(vec4 inColor); | ||
10 | 11 | ||
11 | uniform sampler2D diffuseMap; | 12 | uniform sampler2D diffuseMap; |
12 | uniform sampler2D bumpMap; | 13 | uniform sampler2D bumpMap; |