Implement double frame buffering

This commit is contained in:
2024-12-27 22:22:32 +00:00
parent 9de54d016d
commit 68cc990650
3 changed files with 124 additions and 4 deletions

18
shaders/pp_frag.glsl Normal file
View File

@@ -0,0 +1,18 @@
#version 330 core
struct Material {
sampler2D diffuse1;
sampler2D specular1;
float shininess;
};
in vec2 uv_coords;
uniform Material material;
// uniform sampler2D image_texture;
out vec4 color;
void main() {
color = vec4(vec3(texture(material.diffuse1, uv_coords)), 1.0);
}

12
shaders/pp_vert.glsl Normal file
View File

@@ -0,0 +1,12 @@
#version 330 core
layout(location=0) in vec3 position;
layout(location=1) in vec3 normal;
layout(location=2) in vec2 uv;
out vec2 uv_coords;
void main() {
gl_Position = vec4(position.x, position.y, 0.0, 1.0);
uv_coords = uv;
}