diff options
author | pryazha <pryadeiniv@mail.ru> | 2025-06-15 16:11:31 +0500 |
---|---|---|
committer | pryazha <pryadeiniv@mail.ru> | 2025-06-15 16:11:31 +0500 |
commit | 9d944f26d359e4bc1ffd8e44350b0df9f0935b18 (patch) | |
tree | 9759a83a76ab741a587b99f00c2463eafd05d813 /advanced_lighting/8.deferred_shading/shaders/gbuffer.frag | |
parent | d65ddd07a43d5ffdcf2ddf90d6f86626cf9b92d8 (diff) |
something
Diffstat (limited to 'advanced_lighting/8.deferred_shading/shaders/gbuffer.frag')
-rw-r--r-- | advanced_lighting/8.deferred_shading/shaders/gbuffer.frag | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/advanced_lighting/8.deferred_shading/shaders/gbuffer.frag b/advanced_lighting/8.deferred_shading/shaders/gbuffer.frag new file mode 100644 index 0000000..5f82c0b --- /dev/null +++ b/advanced_lighting/8.deferred_shading/shaders/gbuffer.frag @@ -0,0 +1,23 @@ +#version 330 core + +in vert_t { + vec3 position; + vec3 normal; + vec2 tex_coords; +} vert; + +layout (location = 0) out vec3 position; +layout (location = 1) out vec3 normal; +layout (location = 2) out vec4 color_specular; + +uniform sampler2D texture_diffuse; + +void main() +{ + position = vert.position; + normal = vert.normal; + color_specular.rgb = texture(texture_diffuse, vert.tex_coords).rgb; + // TODO(pryazha): add specular texture + // color_specular.a = texture(texture_specular, vert.tex_coords).r; + color_specular.a = 1; +} |