From 6589012435c02a9aa821eeec24d0d9869223d5b6 Mon Sep 17 00:00:00 2001 From: "re.kovalev" Date: Wed, 23 Nov 2022 14:25:09 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D1=8B=D1=85=D0=BE=D0=B4=D0=BD=D1=8B?= =?UTF-8?q?=D0=B5=20=D0=B4=D0=B0=D0=BD=D0=BD=D1=8B=D0=B5=20=D0=BE=D1=82=20?= =?UTF-8?q?=D1=84=D1=80=D0=B0=D0=B3=D0=BC=D0=B5=D0=BD=D1=82=D0=BD=D0=BE?= =?UTF-8?q?=D0=B3=D0=BE=20=D1=88=D0=B5=D0=B9=D0=B4=D0=B5=D1=80=D0=B0=20?= =?UTF-8?q?=D0=B1=D1=83=D1=84=D0=B5=D1=80=D0=B0=20=D0=BA=D0=B0=D0=B4=D1=80?= =?UTF-8?q?=D0=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- shaders/shader.frag | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/shaders/shader.frag b/shaders/shader.frag index 4126191..b4c468b 100644 --- a/shaders/shader.frag +++ b/shaders/shader.frag @@ -24,7 +24,8 @@ uniform sampler2D tex_diffuse; uniform sampler2D tex_ambient; uniform sampler2D tex_specular; -out vec4 color; +layout (location = 0) out vec4 colors; +layout (location = 1) out vec4 normals; void main() { @@ -36,6 +37,7 @@ void main() // Зеркальная составляющая float specular = pow(max(dot(H, N), 0.0), p*4); // скалярное произведение с отсеканием значений < 0 в степени p - color = vec4(light_f.color*ka, 1)*texture(tex_ambient, texCoord) + vec4(light_f.color*kd*diffuse, 1)*texture(tex_diffuse, texCoord) + vec4(light_f.color*ks*specular, 1)*texture(tex_specular, texCoord); + colors = vec4(light_f.color*ka, 1)*texture(tex_ambient, texCoord) + vec4(light_f.color*kd*diffuse, 1)*texture(tex_diffuse, texCoord) + vec4(light_f.color*ks*specular, 1)*texture(tex_specular, texCoord); + normals = vec4(N, 1.0); } \ No newline at end of file