mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-08-09 20:24:14 +00:00
[client] egl: add new downscale filter
This commit is contained in:
26
client/renderers/EGL/shader/downscale.frag
Normal file
26
client/renderers/EGL/shader/downscale.frag
Normal file
@@ -0,0 +1,26 @@
|
||||
#version 300 es
|
||||
precision mediump float;
|
||||
|
||||
in vec2 fragCoord;
|
||||
out vec4 fragColor;
|
||||
|
||||
uniform sampler2D texture;
|
||||
uniform vec3 uConfig;
|
||||
|
||||
void main()
|
||||
{
|
||||
float pixelSize = uConfig.x;
|
||||
float vOffset = uConfig.y;
|
||||
float hOffset = uConfig.z;
|
||||
|
||||
vec2 inRes = vec2(textureSize(texture, 0));
|
||||
ivec2 point = ivec2(
|
||||
(floor((fragCoord * inRes) / pixelSize) * pixelSize) +
|
||||
pixelSize / 2.0f
|
||||
);
|
||||
|
||||
point.x += int(pixelSize * hOffset);
|
||||
point.y += int(pixelSize * vOffset);
|
||||
|
||||
fragColor = texelFetch(texture, point, 0);
|
||||
}
|
Reference in New Issue
Block a user