From 7735037ef7eae066fa353bf133f0122b38a5ab2b 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 | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shaders/lighting.frag b/shaders/lighting.frag index f76f698..dfd4b76 100644 --- a/shaders/lighting.frag +++ b/shaders/lighting.frag @@ -39,6 +39,7 @@ uniform sampler2D gDiffuseP; uniform sampler2D gAmbientSpecular; uniform sampler2DArray sunShadowDepth; uniform samplerCubeArray pointShadowDepth; +uniform sampler2D ssao; out vec4 color; @@ -51,6 +52,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; // Данные об источнике относительно фрагмента @@ -79,8 +81,8 @@ void main() break; // Фоновая освещенность - color = vec4(ka, 1); - + color = vec4(ka, 1) * ssao_value; + // Расчет солнца, если его цвет не черный if (length(sun.color) > 0) {