Move towards pixel upscaling filter
This commit is contained in:
@@ -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); }
|
||||
}
|
||||
Reference in New Issue
Block a user