diff options
author | Roxanne Skelly <roxie@lindenlab.com> | 2024-06-11 23:18:54 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-11 23:18:54 -0700 |
commit | 0f3c3563b0861e8ea82b201aab8343d99f993bbc (patch) | |
tree | 7ab124cd4852f2d36bf897090feff5cf29c3ebc7 /indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl | |
parent | 6a00609b0cede78f998971687a756b7fcf826c0f (diff) | |
parent | ed34782283aa2ae6a7a76c0492a2f9edc6bb3629 (diff) |
Merge pull request #1726 from secondlife/roxie/webrtc-voice
Merge from main.
Diffstat (limited to 'indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl')
-rw-r--r-- | indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl | 15 |
1 files changed, 6 insertions, 9 deletions
diff --git a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl index 63fa4ecc55..deb276ef9d 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl @@ -40,36 +40,33 @@ uniform sampler2D specularRect; uniform sampler2D diffuseRect; uniform sampler2D diffuseMap; -vec3 getNorm(vec2 screenpos); +vec4 getNorm(vec2 screenpos); float getDepth(vec2 pos_screen); float linearDepth(float d, float znear, float zfar); float linearDepth01(float d, float znear, float zfar); vec4 getPositionWithDepth(vec2 pos_screen, float depth); vec4 getPosition(vec2 pos_screen); -vec4 getNormalEnvIntensityFlags(vec2 screenpos, out vec3 n, out float envIntensity); float random (vec2 uv); float tapScreenSpaceReflection(int totalSamples, vec2 tc, vec3 viewPos, vec3 n, inout vec4 collectedColor, sampler2D source, float glossiness); -void main() +void main() { vec2 tc = vary_fragcoord.xy; float depth = linearDepth01(getDepth(tc), zNear, zFar); - float envIntensity; - vec3 n; - vec4 norm = getNormalEnvIntensityFlags(tc, n, envIntensity); // need `norm.w` for GET_GBUFFER_FLAG() + vec4 norm = getNorm(tc); // need `norm.w` for GET_GBUFFER_FLAG() vec3 pos = getPositionWithDepth(tc, getDepth(tc)).xyz; vec4 spec = texture(specularRect, tc); vec2 hitpixel; - + vec4 diffuse = texture(diffuseRect, tc); vec3 specCol = spec.rgb; vec4 fcol = texture(diffuseMap, tc); - if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR)) + if (GET_GBUFFER_FLAG(GBUFFER_FLAG_HAS_PBR)) { vec3 orm = specCol.rgb; float perceptualRoughness = orm.g; @@ -84,7 +81,7 @@ void main() vec4 collectedColor = vec4(0); - float w = tapScreenSpaceReflection(4, tc, pos, n, collectedColor, diffuseMap, 0); + float w = tapScreenSpaceReflection(4, tc, pos, norm.xyz, collectedColor, diffuseMap, 0); collectedColor.rgb *= specCol.rgb; |