diff options
author | RunitaiLinden <davep@lindenlab.com> | 2024-02-02 15:43:56 -0600 |
---|---|---|
committer | RunitaiLinden <davep@lindenlab.com> | 2024-02-02 15:43:56 -0600 |
commit | 5abc68ad438c1feb79f008aa8148dda77aae2af9 (patch) | |
tree | 1c3a8d9454cd416f8ae3fabbf6b4fd0d27750142 /indra/newview/app_settings | |
parent | 6846600e3ef1eec7fade19f61d2d45614ae1a8b0 (diff) |
#677 Move PBR mirror radiance mixing to reflectionProbeF so transparent PBR surfaces can be mirrors
Diffstat (limited to 'indra/newview/app_settings')
-rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl | 18 | ||||
-rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl | 13 |
2 files changed, 18 insertions, 13 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl index d9dc83bb10..fe2647452f 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl @@ -682,6 +682,12 @@ vec3 sampleProbeAmbient(vec3 pos, vec3 dir, vec3 amblit) return col[1]+col[0]; } + +#if defined(HERO_PROBES) +uniform vec4 clipPlane; +uniform samplerCubeArray heroProbes; +#endif + void doProbeSample(inout vec3 ambenv, inout vec3 glossenv, vec2 tc, vec3 pos, vec3 norm, float glossiness, bool transparent, vec3 amblit) { @@ -713,6 +719,18 @@ void doProbeSample(inout vec3 ambenv, inout vec3 glossenv, glossenv = mix(glossenv, ssr.rgb, ssr.a); } #endif + +#if defined(HERO_PROBES) + float clipDist = dot(pos.xyz, clipPlane.xyz) + clipPlane.w; + if (clipDist > 0.0 && clipDist < 0.1 && glossiness > 0.8) + { + vec3 refnormpersp = reflect(pos.xyz, norm.xyz); + if (dot(refnormpersp.xyz, clipPlane.xyz) > 0.0) + { + glossenv = textureLod(heroProbes, vec4(env_mat * refnormpersp, 0), (1.0-glossiness)*10).xyz; + } + } +#endif } void sampleReflectionProbes(inout vec3 ambenv, inout vec3 glossenv, diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl index be180b877f..a8cfc3537e 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl @@ -189,19 +189,6 @@ void main() float gloss = 1.0 - perceptualRoughness; sampleReflectionProbes(irradiance, radiance, tc, pos.xyz, norm.xyz, gloss, false, amblit_linear); - - #ifdef HERO_PROBES - float clipDist = dot(pos.xyz, clipPlane.xyz) + clipPlane.w; - if (clipDist > 0.0 && clipDist < 0.1 && perceptualRoughness < 0.2) - { - vec3 refnormpersp = reflect(pos.xyz, norm.xyz); - if (dot(refnormpersp.xyz, clipPlane.xyz) > 0.0) - { - radiance = textureLod(heroProbes, vec4(env_mat * refnormpersp, 0), perceptualRoughness*11).xyz; - } - } - #endif - adjustIrradiance(irradiance, ambocc); |