summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class1/deferred
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class1/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl20
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl16
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl11
3 files changed, 44 insertions, 3 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 6e693bd33b..fb24927b26 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -190,7 +190,7 @@ void main()
calcFragAtmospherics(pos.xyz, 1.0, sunlit, amblit, additive, atten);
- vec2 abnormal = encode_normal(norm.xyz);
+ vec2 abnormal = encode_normal(norm.xyz);
vec3 light_dir = (sun_up_factor == 1) ? sun_dir: moon_dir;
float da = dot(norm.xyz, light_dir.xyz);
@@ -208,15 +208,23 @@ void main()
float ambient = da;
ambient *= 0.5;
ambient *= ambient;
- ambient = max(0.9, ambient); // keeps shadows dark
+ ambient = max(0.66, ambient); // keeps shadows dark
ambient = 1.0 - ambient;
vec3 sun_contrib = min(final_da, shadow) * sunlit;
color.rgb *= ambient;
+
+vec3 post_ambient = color.rgb;
+
color.rgb += sun_contrib;
+
+vec3 post_sunlight = color.rgb;
+
color.rgb *= diff.rgb;
+vec3 post_diffuse = color.rgb;
+
//color.rgb = mix(diff.rgb, color.rgb, final_alpha);
color.rgb = atmosFragLighting(color.rgb, additive, atten);
@@ -224,6 +232,8 @@ void main()
vec4 light = vec4(0,0,0,0);
+vec3 prelight_linearish_maybe = color.rgb;
+
#define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, diff.rgb, pos.xyz, norm, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, light_attenuation[i].w, shadow);
LIGHT_LOOP(1)
@@ -238,13 +248,19 @@ void main()
//
color.rgb += light.rgb;
+vec3 postlight_linear = color.rgb;
+
+color.rgb = prelight_linearish_maybe;
+
color.rgb = linear_to_srgb(color.rgb);
+
#endif
#ifdef WATER_FOG
color = applyWaterFogView(pos.xyz, color);
#endif
+
frag_color = color;
}
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index 4a47311eb7..4bb01824bf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -305,16 +305,24 @@ void main()
float ambient = da;
ambient *= 0.5;
ambient *= ambient;
- ambient = max(0.9, ambient);
+ ambient = max(0.66, ambient);
ambient = 1.0 - ambient;
vec3 sun_contrib = min(final_da, shadow) * sunlit;
col.rgb = amblit;
col.rgb *= ambient;
+
+vec3 post_ambient = col.rgb;
+
col.rgb += sun_contrib;
+
+vec3 post_sunlight = col.rgb;
+
col.rgb *= diffuse.rgb;
+vec3 post_diffuse = col.rgb;
+
float glare = 0.0;
if (spec.a > 0.0) // specular reflection
@@ -363,6 +371,8 @@ vec3 post_spec = col.rgb;
vec3 light = vec3(0,0,0);
+ vec3 prelight_linearish_maybe = col.rgb;
+
#define LIGHT_LOOP(i) light.rgb += calcPointLightOrSpotLight(light_diffuse[i].rgb, npos, diffuse.rgb, final_specular, pos.xyz, norm.xyz, light_position[i], light_direction[i].xyz, light_attenuation[i].x, light_attenuation[i].y, light_attenuation[i].z, glare, light_attenuation[i].w, shadow);
LIGHT_LOOP(1)
@@ -375,6 +385,8 @@ vec3 post_spec = col.rgb;
col.rgb += light.rgb;
+vec3 postlight_linear = col.rgb;
+
glare = min(glare, 1.0);
float al = max(diffcol.a,glare)*vertex_color.a;
@@ -384,6 +396,8 @@ vec3 post_spec = col.rgb;
al = temp.a;
#endif
+//col.rgb = prelight_linearish_maybe;
+
col.rgb = linear_to_srgb(col.rgb);
frag_color.rgb = col.rgb;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index 361ed40eaf..4b9e8290dd 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -112,15 +112,24 @@ void main()
float ambient = da;
ambient *= 0.5;
ambient *= ambient;
+ ambient = max(0.66, ambient);
ambient = 1.0 - ambient;
vec3 sun_contrib = final_da * sunlit;
col.rgb = amblit;
col.rgb *= ambient;
+
+vec3 post_ambient = col.rgb;
+
col.rgb += sun_contrib;
+
+vec3 post_sunlight = col.rgb;
+
col.rgb *= diffuse.rgb;
+vec3 post_diffuse = col.rgb;
+
vec3 refnormpersp = normalize(reflect(pos.xyz, norm.xyz));
if (spec.a > 0.0) // specular reflection
@@ -168,6 +177,8 @@ void main()
col = fogged.rgb;
bloom = fogged.a;
#endif
+
+//col.rgb = post_diffuse;
}
frag_color.rgb = col.rgb;