return early when LUT Colors == 0

closes #100
This commit is contained in:
hizzlekizzle 2019-06-06 22:10:54 -05:00 committed by GitHub
parent fc28962ff5
commit f281a47e5c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -61,6 +61,13 @@ vec4 mixfix(vec4 a, vec4 b, float c)
void main()
{
vec4 imgColor = COMPAT_TEXTURE(Source, vTexCoord.xy);
if (int(TNTC) == 0)
{
FragColor = imgColor;
return;
}
else
{
float red = ( imgColor.r * (LUT_Size - 1.0) + 0.499999 ) / (LUT_Size * LUT_Size);
float green = ( imgColor.g * (LUT_Size - 1.0) + 0.499999 ) / LUT_Size;
float blue1 = (floor( imgColor.b * (LUT_Size - 1.0) ) / LUT_Size) + red;
@ -102,3 +109,4 @@ void main()
FragColor = vec4(mix(imgColor.rgb, res.rgb, min(TNTC,1.0)),1.0);
}
}