summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
diff options
context:
space:
mode:
authorRunitaiLinden <davep@lindenlab.com>2023-06-15 14:52:17 -0500
committerRunitaiLinden <davep@lindenlab.com>2023-06-15 14:52:17 -0500
commit6f767db34992b04d67cb25bf976581aee4acac78 (patch)
tree38aff025d05613899ce4cca1a6465550ad44f005 /indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
parent47be24e467a9fe5a2c0466a49f58769f6b81fdc4 (diff)
parent44f26248ec668635b5d5b161f4736a670d364792 (diff)
Merge branch 'DRTVWR-559' of github.com:secondlife/viewer into DRTVWR-559
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl34
1 files changed, 27 insertions, 7 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
index 53e15bd1a1..1b2a34ef01 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
@@ -35,6 +35,8 @@ uniform sampler2D sceneMap;
uniform int cube_snapshot;
uniform float max_probe_lod;
+uniform bool transparent_surface;
+
#define MAX_REFMAP_COUNT 256 // must match LL_MAX_REFLECTION_PROBE_COUNT
layout (std140) uniform ReflectionProbes
@@ -671,7 +673,7 @@ vec3 sampleProbeAmbient(vec3 pos, vec3 dir)
}
void doProbeSample(inout vec3 ambenv, inout vec3 glossenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness)
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent)
{
// TODO - don't hard code lods
float reflection_lods = max_probe_lod;
@@ -687,7 +689,16 @@ void doProbeSample(inout vec3 ambenv, inout vec3 glossenv,
if (cube_snapshot != 1 && glossiness >= 0.9)
{
vec4 ssr = vec4(0);
- float w = tapScreenSpaceReflection(1, tc, pos, norm, ssr, sceneMap, glossiness);
+ if (transparent)
+ {
+ tapScreenSpaceReflection(1, tc, pos, norm, ssr, sceneMap, 1);
+ ssr.a *= glossiness;
+ }
+ else
+ {
+ tapScreenSpaceReflection(1, tc, pos, norm, ssr, sceneMap, glossiness);
+ }
+
glossenv = mix(glossenv, ssr.rgb, ssr.a);
}
@@ -695,10 +706,10 @@ void doProbeSample(inout vec3 ambenv, inout vec3 glossenv,
}
void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv,
- vec2 tc, vec3 pos, vec3 norm, float glossiness)
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent)
{
preProbeSample(pos);
- doProbeSample(ambenv, glossenv, tc, pos, norm, glossiness);
+ doProbeSample(ambenv, glossenv, tc, pos, norm, glossiness, transparent);
}
void sampleReflectionProbesWater(inout vec3 ambenv, inout vec3 glossenv,
@@ -711,7 +722,7 @@ void sampleReflectionProbesWater(inout vec3 ambenv, inout vec3 glossenv,
// always include void probe on water
probeIndex[probeInfluences++] = 0;
- doProbeSample(ambenv, glossenv, tc, pos, norm, glossiness);
+ doProbeSample(ambenv, glossenv, tc, pos, norm, glossiness, false);
// fudge factor to get PBR water at a similar luminance ot legacy water
glossenv *= 0.4;
@@ -766,7 +777,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)
+ vec2 tc, vec3 pos, vec3 norm, float glossiness, float envIntensity, bool transparent)
{
float reflection_lods = max_probe_lod;
preProbeSample(pos);
@@ -790,7 +801,16 @@ void sampleReflectionProbesLegacy(inout vec3 ambenv, inout vec3 glossenv, inout
if (cube_snapshot != 1)
{
vec4 ssr = vec4(0);
- float w = tapScreenSpaceReflection(1, tc, pos, norm, ssr, sceneMap, glossiness);
+
+ if (transparent)
+ {
+ tapScreenSpaceReflection(1, tc, pos, norm, ssr, sceneMap, 1);
+ ssr.a *= glossiness;
+ }
+ else
+ {
+ tapScreenSpaceReflection(1, tc, pos, norm, ssr, sceneMap, glossiness);
+ }
glossenv = mix(glossenv, ssr.rgb, ssr.a);
legacyenv = mix(legacyenv, ssr.rgb, ssr.a);