2019-03-28 03:59:54 +00:00
|
|
|
#version 300 es
|
|
|
|
|
|
|
|
in highp vec2 uv;
|
|
|
|
out highp vec4 color;
|
|
|
|
|
|
|
|
uniform sampler2D sampler1;
|
2019-04-19 01:23:51 +00:00
|
|
|
|
|
|
|
uniform int nearest;
|
|
|
|
uniform highp vec2 size;
|
|
|
|
|
|
|
|
uniform int nv;
|
2019-03-28 13:15:14 +00:00
|
|
|
uniform highp float nvGain;
|
2019-03-28 03:59:54 +00:00
|
|
|
|
|
|
|
void main()
|
|
|
|
{
|
2019-04-19 01:23:51 +00:00
|
|
|
if(nearest == 1)
|
|
|
|
color = texture(sampler1, uv);
|
|
|
|
else
|
|
|
|
color = texelFetch(sampler1, ivec2(uv * size), 0);
|
2019-03-30 13:08:52 +00:00
|
|
|
|
2019-03-28 13:15:14 +00:00
|
|
|
if (nv == 1)
|
2019-03-30 13:08:52 +00:00
|
|
|
{
|
|
|
|
highp float lumi = 1.0 - (0.2126 * color.r + 0.7152 * color.g + 0.0722 * color.b);
|
|
|
|
color *= 1.0 + lumi;
|
2019-03-28 13:15:14 +00:00
|
|
|
color *= nvGain;
|
2019-03-30 13:08:52 +00:00
|
|
|
}
|
2019-03-28 03:59:54 +00:00
|
|
|
}
|