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-09 09:15:42 +00:00
|
|
|
#include "color_blind.h"
|
|
|
|
|
2021-10-22 12:19: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;
|
|
|
|
uniform int cbMode;
|
2020-11-08 19:59:54 +00:00
|
|
|
|
2019-03-28 04:53:15 +00:00
|
|
|
void main()
|
|
|
|
{
|
2021-10-22 12:19:56 +00:00
|
|
|
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;
|
|
|
|
|
|
|
|
color = texelFetch(sampler1, ivec2(px), 0);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
color = texture(sampler1, uv);
|
2020-11-08 19:59:54 +00:00
|
|
|
|
|
|
|
if (cbMode > 0)
|
2021-08-09 09:15:42 +00:00
|
|
|
color = cbTransform(color, cbMode);
|
2019-03-28 04:53:15 +00:00
|
|
|
}
|