/** * @ Version: SCREEN SPACE SHADERS - UPDATE 22 * @ Description: SSS Disocclusion Blur * @ Modified time: 2024-11-14 00:12 * @ Author: https://www.moddb.com/members/ascii1457 * @ Mod: https://www.moddb.com/mods/stalker-anomaly/addons/screen-space-shaders */ #include "screenspace_common.h" Texture2D sss_image; uniform float4 blur_setup; float4 main ( p_screen I ) : SV_Target { float2 tc = I.tc0.xy; float2 buffer_pixel_size = 1.0f / screen_res.xy; float4 base_image = sss_image.SampleLevel(smp_nofilter, tc, 0); base_image.g += base_image.a; // Early out ( Low disocclusion mask ) if (base_image.g <= 0.1f) return float4(base_image.rgr, base_image.a); float blur = 0; float2 offset = base_image.gg; float r = 0.9f; for (int i = 0; i < 8; i++) { r += 1.0f / r; offset = mul(offset, pp_rotation_matrix); blur += sss_image.SampleLevel(smp_nofilter, tc + (offset * (r - 1.0f) * buffer_pixel_size), 0)[blur_setup.z]; } blur /= 8; return float4(base_image.rg, blur, base_image.a); }