2021-08-12 05:53:35 +00:00
|
|
|
#version 300 es
|
2023-03-08 22:20:01 +00:00
|
|
|
#extension GL_OES_EGL_image_external_essl3 : enable
|
|
|
|
|
2023-03-05 03:10:21 +00:00
|
|
|
precision highp float;
|
2021-08-12 05:53:35 +00:00
|
|
|
|
|
|
|
in vec2 fragCoord;
|
|
|
|
out vec4 fragColor;
|
|
|
|
|
2023-03-08 22:20:01 +00:00
|
|
|
uniform sampler2D sampler1;
|
2021-08-12 05:53:35 +00:00
|
|
|
uniform vec3 uConfig;
|
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
|
|
|
float pixelSize = uConfig.x;
|
|
|
|
float vOffset = uConfig.y;
|
|
|
|
float hOffset = uConfig.z;
|
|
|
|
|
2023-03-08 22:20:01 +00:00
|
|
|
vec2 inRes = vec2(textureSize(sampler1, 0));
|
2021-08-12 05:53:35 +00:00
|
|
|
ivec2 point = ivec2(
|
|
|
|
(floor((fragCoord * inRes) / pixelSize) * pixelSize) +
|
|
|
|
pixelSize / 2.0f
|
|
|
|
);
|
|
|
|
|
|
|
|
point.x += int(pixelSize * hOffset);
|
|
|
|
point.y += int(pixelSize * vOffset);
|
|
|
|
|
2023-03-08 22:20:01 +00:00
|
|
|
fragColor = texelFetch(sampler1, point, 0);
|
2021-08-12 05:53:35 +00:00
|
|
|
}
|