diff options
author | Geenz Linden <geenz@lindenlab.com> | 2022-11-20 11:09:05 +0100 |
---|---|---|
committer | Geenz Linden <geenz@lindenlab.com> | 2022-11-20 11:09:05 +0100 |
commit | 34d3f94db6d2ab243f8ee63522e60cb1e22dedff (patch) | |
tree | 9d423242723553330eda21f6db5c8390d1340269 /indra/newview/app_settings/shaders/class1 | |
parent | ade79bc6f6b6269dbcb88f3dff2db6584d0c2f53 (diff) |
Fix for SSAO not behaving properly.
SL-18662
Diffstat (limited to 'indra/newview/app_settings/shaders/class1')
5 files changed, 9 insertions, 9 deletions
diff --git a/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl b/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl index f93ed6bc6d..37fe8287be 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/aoUtil.glsl @@ -50,7 +50,7 @@ float getDepthAo(vec2 pos_screen) vec4 getPositionAo(vec2 pos_screen) { float depth = getDepthAo(pos_screen); - vec2 sc = (pos_screen); + vec2 sc = getScreenCoordinateAo(pos_screen); vec4 ndc = vec4(sc.x, sc.y, 2.0*depth-1.0, 1.0); vec4 pos = inv_proj * ndc; pos /= pos.w; @@ -71,7 +71,7 @@ vec2 getKern(int i) kern[6] = vec2(-0.7071, 0.7071) * 0.875*0.875; kern[7] = vec2(0.7071, -0.7071) * 1.000*1.000; - return kern[i]; + return kern[i] / screen_res; } //calculate decreases in ambient lighting when crowded out (SSAO) @@ -79,8 +79,8 @@ float calcAmbientOcclusion(vec4 pos, vec3 norm, vec2 pos_screen) { float ret = 1.0; vec3 pos_world = pos.xyz; - vec2 noise_reflect = texture2D(noiseMap, pos_screen.xy).xy; - + vec2 noise_reflect = texture2D(noiseMap, pos_screen.xy * (screen_res / 128)).xy; + float angle_hidden = 0.0; float points = 0; @@ -91,7 +91,7 @@ float calcAmbientOcclusion(vec4 pos, vec3 norm, vec2 pos_screen) { vec2 samppos_screen = pos_screen + scale * reflect(getKern(i), noise_reflect); vec3 samppos_world = getPositionAo(samppos_screen).xyz; - + vec3 diff = pos_world - samppos_world; float dist2 = dot(diff, diff); diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl index 8feeff848b..6763e2de7b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiPointLightF.glsl @@ -76,7 +76,7 @@ void main() vec4 spec = texture2D(specularRect, frag.xy); vec3 diff = texture2D(diffuseRect, frag.xy).rgb; - float noise = texture2D(noiseMap, frag.xy / 128.0).b; + float noise = texture2D(noiseMap, frag.xy).b; vec3 npos = normalize(-pos); // As of OSX 10.6.7 ATI Apple's crash when using a variable size loop diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index 42a52d7908..e9dac711c3 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -172,7 +172,7 @@ void main() discard; } - float noise = texture2D(noiseMap, frag.xy/128.0).b; + float noise = texture2D(noiseMap, frag.xy).b; dist_atten *= noise; lv = proj_origin-pos.xyz; diff --git a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl index 40a4f86c37..f07ef92b26 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pointLightF.glsl @@ -86,7 +86,7 @@ void main() lv = normalize(lv); da = dot(norm, lv); - float noise = texture2D(noiseMap, frag.xy/128.0).b; + float noise = texture2D(noiseMap, frag.xy).b; vec3 col = texture2D(diffuseRect, frag.xy).rgb; diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 7f21a074bd..0376f42319 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -181,7 +181,7 @@ void main() vec4 spec = texture2D(specularRect, frag.xy); - float noise = texture2D(noiseMap, frag.xy/128.0).b; + float noise = texture2D(noiseMap, frag.xy).b; vec3 dlit = vec3(0, 0, 0); if (proj_tc.z > 0.0 && |