From 7b5e51c14ecbce45c2a95dbd57d6f3b94f2625c9 Mon Sep 17 00:00:00 2001 From: "re.kovalev" Date: Sun, 15 Jan 2023 03:40:31 +0300 Subject: [PATCH] =?UTF-8?q?=D0=A3=D1=87=D0=B5=D1=82=20SSAO=20=D0=BF=D1=80?= =?UTF-8?q?=D0=B8=20=D1=80=D0=B0=D1=81=D1=87=D0=B5=D1=82=D0=B0=D1=85=20?= =?UTF-8?q?=D0=BE=D1=81=D0=B2=D0=B5=D1=89=D0=B5=D0=BD=D0=B8=D1=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shaders/lighting.frag | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/shaders/lighting.frag b/shaders/lighting.frag index 71d0e6c..004aa61 100644 --- a/shaders/lighting.frag +++ b/shaders/lighting.frag @@ -38,6 +38,7 @@ uniform sampler2D gDiffuseP; uniform sampler2D gAmbientSpecular; uniform sampler2DArray sunShadowDepth; uniform samplerCubeArray pointShadowDepth; +uniform sampler2D ssao; out vec4 color; @@ -50,6 +51,7 @@ void main() vec3 ka = texture(gAmbientSpecular, texCoord).rgb; float ks = texture(gAmbientSpecular, texCoord).a; float p = texture(gDiffuseP, texCoord).a; + float ssao_value = texture(ssao, texCoord).r; // Переменные используемые в цикле: vec3 L_vertex; // Расположение источника относительно фрагмента @@ -77,7 +79,7 @@ void main() break; // Фоновая освещенность - color = vec4(ka, 1); + color = vec4(ka, 1) * ssao_value; // Расчет солнца, если его цвет не черный if (length(Sun_color) > 0)