summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2019-04-08 20:21:16 +0000
committerRider Linden <rider@lindenlab.com>2019-04-08 20:21:16 +0000
commitfd25781ecfdf4942bd2c6b82eea88cabdf4bf44f (patch)
tree027f9dc5f8785256e6889c23aa1efddb811e6ef6 /indra/newview
parent66aa3d390d78eab482ce51bc916789a35b6dd50f (diff)
parent759525040ac11a2edee541c944ad0c6e9cc04d0f (diff)
Merged in graham_linden/viewer-eep-fixes (pull request #342)
SL-10912
Diffstat (limited to 'indra/newview')
-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
-rw-r--r--indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl10
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl2
-rw-r--r--indra/newview/llsettingsvo.cpp4
7 files changed, 58 insertions, 7 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;
diff --git a/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl b/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl
index 7d699a4967..4d7cff37c6 100644
--- a/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl
+++ b/indra/newview/app_settings/shaders/class1/lighting/sumLightsV.glsl
@@ -34,7 +34,7 @@ vec3 scaleDownLight(vec3 light);
vec4 sumLights(vec3 pos, vec3 norm, vec4 color, vec4 baseLight)
{
- vec4 col;
+ vec4 col = vec4(0);
col.a = color.a;
col.rgb = light_diffuse[1].rgb * calcDirectionalLight(norm, light_position[1].xyz);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 12115082a9..8814587fbc 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -126,16 +126,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(scol, 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
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
index 40c521cd2c..f1398afb99 100644
--- a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
+++ b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
@@ -152,7 +152,7 @@ void calcFragAtmospherics(vec3 inPositionEye, float ambFactor, out vec3 sunlit,
+ tmpAmbient));
//brightness of surface both sunlight and ambient
- sunlit = vec3(sunlight.rgb* 0.5);
+ sunlit = vec3(sunlight.rgb);
amblit = vec3(tmpAmbient * .25);
additive = normalize(additive);
additive *= vec3(1.0 - exp(-temp2.z * distance_multiplier)) * 0.5;
diff --git a/indra/newview/llsettingsvo.cpp b/indra/newview/llsettingsvo.cpp
index 6556380f28..60f4cd3f5a 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -568,9 +568,11 @@ void LLSettingsVOSky::convertAtmosphericsToLegacy(LLSD& legacy, LLSD& settings)
F32 density_multiplier = legacyhaze[SETTING_DENSITY_MULTIPLIER].asReal();
density_multiplier = (density_multiplier < 0.0001f) ? 0.0001f : density_multiplier;
+ density_multiplier *= 0.9f / 2.0f; // take 0 - 2.0 range to 0 - 0.9 range
legacy[SETTING_DENSITY_MULTIPLIER] = LLSDArray(density_multiplier)(0.0f)(0.0f)(1.0f);
F32 distance_multiplier = legacyhaze[SETTING_DISTANCE_MULTIPLIER].asReal();
+ distance_multiplier *= 0.1f; // take 0 - 1000 range to 0 - 100 range
legacy[SETTING_DISTANCE_MULTIPLIER] = LLSDArray(distance_multiplier)(0.0f)(0.0f)(1.0f);
legacy[SETTING_HAZE_DENSITY] = LLSDArray(legacyhaze[SETTING_HAZE_DENSITY])(0.0f)(0.0f)(1.0f);
@@ -597,7 +599,7 @@ LLSD LLSettingsVOSky::convertToLegacy(const LLSettingsSky::ptr_t &psky, bool isA
legacy[SETTING_GLOW] = ensure_array_4(settings[SETTING_GLOW], 1.0);
legacy[SETTING_LIGHT_NORMAL] = ensure_array_4(psky->getLightDirection().getValue(), 0.0f);
legacy[SETTING_MAX_Y] = LLSDArray(settings[SETTING_MAX_Y])(0.0f)(0.0f)(1.0f);
- legacy[SETTING_STAR_BRIGHTNESS] = settings[SETTING_STAR_BRIGHTNESS];
+ legacy[SETTING_STAR_BRIGHTNESS] = settings[SETTING_STAR_BRIGHTNESS].asReal() / 250.0f; // convert from 0-500 -> 0-2 ala pre-FS-compat changes
legacy[SETTING_SUNLIGHT_COLOR] = ensure_array_4(settings[SETTING_SUNLIGHT_COLOR], 1.0f);
LLVector3 dir = psky->getLightDirection();