summaryrefslogtreecommitdiff
path: root/indra/newview/app_settings/shaders
diff options
context:
space:
mode:
authorJonathan "Geenz" Goodman <geenz@geenzo.com>2023-06-27 20:01:52 -0700
committerJonathan "Geenz" Goodman <geenz@geenzo.com>2023-06-27 20:01:52 -0700
commitd8dd4d9c0cd4554704cbe15b5502f4d87a4674ad (patch)
treea359cdd5b39994cf04a4370718bcaeb8a73a9613 /indra/newview/app_settings/shaders
parentdb485adbeb1c7a7d64fbddd124f7f4c73214ef99 (diff)
Just about got hero reflection maps working.
DRTVWR-583
Diffstat (limited to 'indra/newview/app_settings/shaders')
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl8
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl12
2 files changed, 18 insertions, 2 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
index 1b2a34ef01..298ddf92a7 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl
@@ -31,6 +31,7 @@ float tapScreenSpaceReflection(int totalSamples, vec2 tc, vec3 viewPos, vec3 n,
uniform samplerCubeArray reflectionProbes;
uniform samplerCubeArray irradianceProbes;
+
uniform sampler2D sceneMap;
uniform int cube_snapshot;
uniform float max_probe_lod;
@@ -70,6 +71,9 @@ layout (std140) uniform ReflectionProbes
// number of reflection probes present in refSphere
int refmapCount;
+
+ vec4 heroPosition[1];
+ int heroProbeCount;
};
// Inputs
@@ -513,6 +517,10 @@ vec3 tapRefMap(vec3 pos, vec3 dir, out float w, out float dw, float lod, vec3 c,
v = env_mat * v;
+#if defined(HERO_PROBES)
+ vec3 mirror = textureLod(heroProbes, vec4(v.xyz, 0), lod).rgb;
+#endif
+
vec4 ret = textureLod(reflectionProbes, vec4(v.xyz, refIndex[i].x), lod) * refParams[i].y;
return ret.rgb;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index 4ef003e0cb..a63d445115 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -32,6 +32,14 @@ uniform sampler2D specularRect;
uniform sampler2D normalMap;
uniform sampler2D emissiveRect; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl
+uniform samplerCubeArray heroProbes;
+
+layout (std140) uniform HeroProbeData
+{
+ vec4 heroPosition[1];
+ int heroProbeCount;
+};
+
const float M_PI = 3.14159265;
#if defined(HAS_SUN_SHADOW) || defined(HAS_SSAO)
@@ -290,7 +298,7 @@ void main()
vec4 fogged = applyWaterFogViewLinear(pos.xyz, vec4(color, bloom));
color = fogged.rgb;
#endif
-
- frag_color.rgb = max(color.rgb, vec3(0)); //output linear since local lights will be added to this shader's results
+ frag_color.rgb = textureLod(heroProbes, vec4(norm.xyz, 0), 0).rgb;
+ //frag_color.rgb = max(color.rgb, vec3(0)); //output linear since local lights will be added to this shader's results
frag_color.a = 0.0;
}