opengl-deferred/assets/shader/deferred/deferred.fs
2024-10-12 04:03:59 +02:00

27 lines
610 B
GLSL

#version 460 core
uniform sampler2D s_albedo;
uniform sampler2D s_normal;
uniform sampler2D s_specular;
uniform sampler2D s_roughness;
uniform sampler2D s_metalic;
in vec3 pos;
in vec3 norm;
in vec2 tex;
layout (location = 0) out vec3 albedo;
layout (location = 1) out vec3 normal;
layout (location = 2) out vec3 material;
layout (location = 3) out vec3 position;
void main() {
position = pos;
albedo = texture(s_albedo, tex).rgb;
normal = texture(s_normal, tex).rgb;
material.x = texture(s_specular, tex).x;
material.y = texture(s_roughness, tex).y;
material.z = texture(s_metalic, tex).z;
}