summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRider Linden <rider@lindenlab.com>2019-04-05 23:41:59 +0000
committerRider Linden <rider@lindenlab.com>2019-04-05 23:41:59 +0000
commit570814a767fa04e78e18cbd8ae266418467bb299 (patch)
tree56e0e3aa9c09a61ea5f3e5f996e0ce97b0a349b5 /indra/newview
parentdde88112380939071a90dca502afaa4909f71201 (diff)
parentfe589170d3faa5ca681baca7b9a664e2d851cd6e (diff)
Merged in graham_linden/viewer-eep-fixes (pull request #340)
SL-10821, SL-10896, SL-10901
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl5
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/materialF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/waterF.glsl7
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl3
-rw-r--r--indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl2
-rw-r--r--indra/newview/llsettingsvo.cpp2
-rw-r--r--indra/newview/llviewershadermgr.cpp4
-rw-r--r--indra/newview/pipeline.cpp1
9 files changed, 21 insertions, 18 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
index 1bc576a4ec..6e693bd33b 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/alphaF.glsl
@@ -194,7 +194,8 @@ void main()
vec3 light_dir = (sun_up_factor == 1) ? sun_dir: moon_dir;
float da = dot(norm.xyz, light_dir.xyz);
-
+ da = clamp(da, -1.0, 1.0);
+
float final_da = da;
final_da = clamp(final_da, 0.0f, 1.0f);
final_da = pow(final_da, 1.0/1.3);
@@ -204,7 +205,7 @@ void main()
color.rgb = amblit;
color.a = final_alpha;
- float ambient = abs(da);
+ float ambient = da;
ambient *= 0.5;
ambient *= ambient;
ambient = max(0.9, ambient); // keeps shadows dark
diff --git a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
index 4e24e61018..4a47311eb7 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/materialF.glsl
@@ -296,12 +296,13 @@ void main()
vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir;
float da = dot(norm.xyz, light_dir.xyz);
+ da = clamp(da, -1.0, 1.0);
float final_da = da;
final_da = clamp(final_da, 0.0, 1.0);
final_da = pow(final_da, 1.0 / 1.3);
- float ambient = abs(da);
+ float ambient = da;
ambient *= 0.5;
ambient *= ambient;
ambient = max(0.9, ambient);
diff --git a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
index e44b441727..361ed40eaf 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/softenLightF.glsl
@@ -86,13 +86,15 @@ void main()
float envIntensity = norm.z;
norm.xyz = getNorm(tc);
+ float light_gamma = 1.0/1.3;
vec3 light_dir = (sun_up_factor == 1) ? sun_dir : moon_dir;
float da = dot(normalize(norm.xyz), light_dir.xyz);
- da = clamp(da, 0.0, 1.0);
+ da = clamp(da, -1.0, 1.0);
- float light_gamma = 1.0/1.3;
- da = pow(da, light_gamma);
+ float final_da = da;
+ final_da = clamp(final_da, 0.0, 1.0);
+ final_da = pow(final_da, light_gamma);
vec4 diffuse = texture2DRect(diffuseRect, tc);
@@ -107,12 +109,12 @@ void main()
calcFragAtmospherics(pos.xyz, 1.0, sunlit, amblit, additive, atten);
- float ambient = min(abs(da), 1.0);
+ float ambient = da;
ambient *= 0.5;
ambient *= ambient;
ambient = 1.0 - ambient;
- vec3 sun_contrib = da * sunlit;
+ vec3 sun_contrib = final_da * sunlit;
col.rgb = amblit;
col.rgb *= ambient;
diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
index c3c8683f6b..e0af521511 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
@@ -153,12 +153,9 @@ void main()
vec4 pos = vary_position;
- //color.rgb = atmosTransport(color.rgb);
- //color.rgb = scaleSoftClipFrag(color.rgb) * 0;
-
vec3 screenspacewavef = normalize((norm_mat*vec4(wavef, 1.0)).xyz);
- frag_data[0] = vec4(color.rgb, 1); // diffuse
- frag_data[1] = vec4(specular * 0.4, 0.75); // speccolor, spec
+ frag_data[0] = vec4(color.rgb, 0.25); // diffuse
+ frag_data[1] = vec4(specular * 0.15, 0.5); // speccolor, spec
frag_data[2] = vec4(encode_normal(screenspacewavef.xyz), 0.05, 0);// normalxy, 0, 0
}
diff --git a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
index 92888e0fd2..12115082a9 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/softenLightF.glsl
@@ -99,6 +99,7 @@ void main()
vec2 scol_ambocc = texture2DRect(lightMap, vary_fragcoord.xy).rg;
float da = dot(normalize(norm.xyz), light_dir.xyz);
+ da = clamp(da, -1.0, 1.0);
vec4 diffuse = texture2DRect(diffuseRect, tc);
@@ -122,7 +123,7 @@ void main()
calcFragAtmospherics(pos.xyz, ambocc, sunlit, amblit, additive, atten);
- float ambient = abs(da);
+ float ambient = da;
ambient *= 0.5;
ambient *= ambient;
ambient = max(0.9, ambient);
diff --git a/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl b/indra/newview/app_settings/shaders/class2/windlight/atmosphericsF.glsl
index 7bfdb9f753..40c521cd2c 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 = srgb_to_linear(sunlight.rgb);
+ sunlit = vec3(sunlight.rgb* 0.5);
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 10a0527fe2..6556380f28 100644
--- a/indra/newview/llsettingsvo.cpp
+++ b/indra/newview/llsettingsvo.cpp
@@ -719,7 +719,7 @@ LLSettingsSky::parammapping_t LLSettingsVOSky::getParameterMap() const
param_map[SETTING_CLOUD_VARIANCE] = DefaultParam(LLShaderMgr::CLOUD_VARIANCE, sky_defaults[SETTING_CLOUD_VARIANCE]);
param_map[SETTING_GLOW] = DefaultParam(LLShaderMgr::GLOW, sky_defaults[SETTING_GLOW]);
param_map[SETTING_MAX_Y] = DefaultParam(LLShaderMgr::MAX_Y, sky_defaults[SETTING_MAX_Y]);
- param_map[SETTING_SUNLIGHT_COLOR] = DefaultParam(LLShaderMgr::SUNLIGHT_COLOR, sky_defaults[SETTING_SUNLIGHT_COLOR]);
+ //param_map[SETTING_SUNLIGHT_COLOR] = DefaultParam(LLShaderMgr::SUNLIGHT_COLOR, sky_defaults[SETTING_SUNLIGHT_COLOR]);
param_map[SETTING_MOON_BRIGHTNESS] = DefaultParam(LLShaderMgr::MOON_BRIGHTNESS, sky_defaults[SETTING_MOON_BRIGHTNESS]);
param_map[SETTING_SKY_MOISTURE_LEVEL] = DefaultParam(LLShaderMgr::MOISTURE_LEVEL, sky_defaults[SETTING_SKY_MOISTURE_LEVEL]);
param_map[SETTING_SKY_DROPLET_RADIUS] = DefaultParam(LLShaderMgr::DROPLET_RADIUS, sky_defaults[SETTING_SKY_DROPLET_RADIUS]);
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index 952ff3ec9f..c6d727430c 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -2110,7 +2110,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredSoftenProgram.mFeatures.hasTransport = true;
gDeferredSoftenProgram.mFeatures.hasGamma = true;
gDeferredSoftenProgram.mFeatures.isDeferred = true;
- gDeferredSoftenProgram.mFeatures.hasShadows = true;
+ gDeferredSoftenProgram.mFeatures.hasShadows = use_sun_shadow;
gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightV.glsl", GL_VERTEX_SHADER_ARB));
gDeferredSoftenProgram.mShaderFiles.push_back(make_pair("deferred/softenLightF.glsl", GL_FRAGMENT_SHADER_ARB));
@@ -2143,7 +2143,7 @@ BOOL LLViewerShaderMgr::loadShadersDeferred()
gDeferredSoftenWaterProgram.mFeatures.hasTransport = true;
gDeferredSoftenWaterProgram.mFeatures.hasGamma = true;
gDeferredSoftenWaterProgram.mFeatures.isDeferred = true;
- gDeferredSoftenWaterProgram.mFeatures.hasShadows = true;
+ gDeferredSoftenWaterProgram.mFeatures.hasShadows = use_sun_shadow;
if (gSavedSettings.getBOOL("RenderDeferredSSAO"))
{ //if using SSAO, take screen space light map into account as if shadows are enabled
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 260292d3fb..7139788c18 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -8612,6 +8612,7 @@ void LLPipeline::renderDeferredLighting(LLRenderTarget* screen_target)
LLEnvironment& environment = LLEnvironment::instance();
soften_shader.uniform1i(LLShaderMgr::SUN_UP_FACTOR, environment.getIsSunUp() ? 1 : 0);
+ soften_shader.uniform4fv(LLShaderMgr::LIGHTNORM, 1, environment.getClampedLightNorm().mV);
{
LLGLDepthTest depth(GL_FALSE);