feat (wip): real-time gui with rendering in opengl

This commit is contained in:
2025-01-03 19:57:10 +01:00
parent c92d0bc2a9
commit c23a33ebef
22 changed files with 656 additions and 62 deletions

View File

@@ -0,0 +1,19 @@
#version 330 core
out vec4 FragColor;
in vec2 TexCoords;
uniform sampler2D currentFrameTex;
uniform sampler2D lastFrameTex;
uniform int frameCount;
#define MAX_FRAMES 500.0f
void main()
{
vec3 col = texture(currentFrameTex, TexCoords).rgb;
vec3 col2 = texture(lastFrameTex, TexCoords).rgb;
col = mix(col, col2, min(frameCount/MAX_FRAMES,1.0f));
FragColor = vec4(col, 1.0);
}

View File

@@ -0,0 +1,11 @@
#version 330 core
layout(location = 0) in vec2 aPos;
layout(location = 1) in vec2 aTexCoords;
out vec2 TexCoords;
void main()
{
TexCoords = aTexCoords;
gl_Position = vec4(aPos.x, aPos.y, 0.0, 1.0);
}

View File

@@ -0,0 +1,12 @@
#version 330 core
out vec4 FragColor;
in vec2 TexCoords;
uniform sampler2D screenTexture;
void main()
{
vec3 col = texture(screenTexture, TexCoords).rgb;
FragColor = vec4(col, 1.0);
}

View File

@@ -0,0 +1,11 @@
#version 330 core
layout(location = 0) in vec2 aPos;
layout(location = 1) in vec2 aTexCoords;
out vec2 TexCoords;
void main()
{
TexCoords = aTexCoords;
gl_Position = vec4(aPos.x, aPos.y, 0.0, 1.0);
}