Move towards pixel upscaling filter

This commit is contained in:
2025-11-25 11:04:06 +00:00
parent f5a972d9e2
commit c0cfadbdd3
13 changed files with 107 additions and 49 deletions
+21
View File
@@ -0,0 +1,21 @@
#version 450 core
in vec2 vTexPos;
out vec4 fColor;
layout (location = 0) uniform vec2 screensize;
layout(binding = 0) uniform sampler2D screenTexture;
float xoff = 2 / screensize.x;
float yoff = 2 / screensize.y;
vec3 f (float x, float y)
{ return texture(screenTexture, vTexPos + vec2(x*xoff,y*yoff)).xyz;
}
void main()
{
vec3 tl = f(-1, 1);
vec3 tt = f( 0, 1);
vec3 tr = f( 1, 1);
vec3 mr = f( 1, 0);
vec3 br = f( 1,-1);
if (tl == tt && tt == tr && tr == mr && mr == br)
{ fColor = vec4(tl,1);}
else {fColor = texture(screenTexture, vTexPos); }
}