2019-03-28 04:53:15 +00:00
|
|
|
#version 300 es
|
2023-03-05 03:10:21 +00:00
|
|
|
precision highp float;
|
2019-03-28 04:53:15 +00:00
|
|
|
|
2021-08-11 10:41:56 +00:00
|
|
|
in vec2 uv;
|
|
|
|
out vec4 color;
|
2019-03-28 04:53:15 +00:00
|
|
|
|
|
|
|
uniform sampler2D sampler1;
|
2021-10-22 12:19:56 +00:00
|
|
|
uniform float scale;
|
2019-03-28 04:53:15 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2021-10-22 12:19:56 +00:00
|
|
|
vec4 tmp;
|
|
|
|
if (scale > 1.0)
|
|
|
|
{
|
|
|
|
vec2 ts = vec2(textureSize(sampler1, 0));
|
|
|
|
vec2 px = (uv - (0.5 / ts)) * ts;
|
|
|
|
if (px.x < 0.0 || px.y < 0.0)
|
|
|
|
discard;
|
|
|
|
|
|
|
|
tmp = texelFetch(sampler1, ivec2(px), 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
tmp = texture(sampler1, uv);
|
|
|
|
|
2019-03-28 04:53:15 +00:00
|
|
|
if (tmp.rgb == vec3(0.0, 0.0, 0.0))
|
|
|
|
discard;
|
2021-10-22 12:19:56 +00:00
|
|
|
|
2019-03-28 04:53:15 +00:00
|
|
|
color = tmp;
|
|
|
|
}
|