summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class2/deferred
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/app_settings/shaders/class2/deferred')
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl6
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl9
-rw-r--r--indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl8
3 files changed, 10 insertions, 13 deletions
diff --git a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
index da5f997429..3a251af240 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/alphaF.glsl
@@ -85,7 +85,7 @@ float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen);
float getAmbientClamp();
void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent);
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit_linear);
vec3 calcPointLightOrSpotLight(vec3 light_col, vec3 diffuse, vec3 v, vec3 n, vec4 lp, vec3 ln, float la, float fa, float is_pointlight, float ambiance)
{
@@ -251,7 +251,7 @@ void main()
vec3 irradiance;
vec3 glossenv;
vec3 legacyenv;
- sampleReflectionProbesLegacy(irradiance, glossenv, legacyenv, frag, pos.xyz, norm.xyz, 0.0, 0.0, true);
+ sampleReflectionProbesLegacy(irradiance, glossenv, legacyenv, frag, pos.xyz, norm.xyz, 0.0, 0.0, true, amblit_linear);
float da = dot(norm.xyz, light_dir.xyz);
@@ -266,7 +266,7 @@ void main()
vec3 sun_contrib = min(final_da, shadow) * sunlit_linear;
- color.rgb = max(amblit, irradiance);
+ color.rgb = irradiance;
color.rgb += sun_contrib;
diff --git a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
index e8db856b1f..be66b6feb2 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/pbralphaF.glsl
@@ -92,7 +92,7 @@ void calcHalfVectors(vec3 lv, vec3 n, vec3 v, out vec3 h, out vec3 l, out float
float calcLegacyDistanceAttenuation(float distance, float falloff);
float sampleDirectionalShadow(vec3 pos, vec3 norm, vec2 pos_screen);
void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent);
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent, vec3 amblit_linear);
void waterClip(vec3 pos);
@@ -224,11 +224,8 @@ void main()
float gloss = 1.0 - perceptualRoughness;
vec3 irradiance = vec3(0);
vec3 radiance = vec3(0);
- sampleReflectionProbes(irradiance, radiance, vary_position.xy*0.5+0.5, pos.xyz, norm.xyz, gloss, true);
- // Take maximium of legacy ambient vs irradiance sample as irradiance
- // NOTE: ao is applied in pbrIbl (see pbrBaseLight), do not apply here
- irradiance = max(amblit,irradiance);
-
+ sampleReflectionProbes(irradiance, radiance, vary_position.xy*0.5+0.5, pos.xyz, norm.xyz, gloss, true, amblit);
+
vec3 diffuseColor;
vec3 specularColor;
calcDiffuseSpecular(col.rgb, metallic, diffuseColor, specularColor);
diff --git a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
index aa6f5a3b62..52e71edcac 100644
--- a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
+++ b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl
@@ -34,7 +34,7 @@ uniform mat3 env_mat;
vec3 srgb_to_linear(vec3 c);
void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent)
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent, vec3 amblit_linear)
{
ambenv = vec3(reflection_probe_ambiance * 0.25);
@@ -44,9 +44,9 @@ void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
}
void sampleReflectionProbesWater(inout vec3 ambenv, inout vec3 glossenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness)
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, vec3 amblit_linear)
{
- sampleReflectionProbes(ambenv, glossenv, tc, pos, norm, glossiness, false);
+ sampleReflectionProbes(ambenv, glossenv, tc, pos, norm, glossiness, false, amblit_linear);
}
vec4 sampleReflectionProbesDebug(vec3 pos)
@@ -56,7 +56,7 @@ vec4 sampleReflectionProbesDebug(vec3 pos)
}
void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout vec3 legacyenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent)
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent, vec3 amblit_linear)
{
ambenv = vec3(reflection_probe_ambiance * 0.25);