Various touchups in preparation for a first release.

This commit is contained in:
Marisa the Magician 2019-01-24 01:59:35 +01:00
commit 5c368503e5
20 changed files with 279 additions and 78 deletions

View file

@ -1,3 +1,7 @@
/*
RetroFX palette reduction from MariENB
(C)2012-2019 Marisa Kirisame
*/
void main()
{
#define d(x) x/64.0
@ -16,7 +20,13 @@ void main()
vec2 coord = TexCoord;
vec2 sfact = textureSize(InputTexture,0);
vec4 res = texture(InputTexture,coord);
res.rgb += paldither*dither8[int(coord.x*sfact.x)%8+int(coord.y*sfact.y)%8*8]-paldither*0.5;
if ( res.r <= 0.0 ) res.r -= paldither;
if ( res.g <= 0.0 ) res.g -= paldither;
if ( res.b <= 0.0 ) res.b -= paldither;
if ( res.r >= 1.0 ) res.r += paldither;
if ( res.g >= 1.0 ) res.g += paldither;
if ( res.b >= 1.0 ) res.b += paldither;
res.rgb += paldither*dither8[int(coord.x*sfact.x)%8+int(coord.y*sfact.y)%8*8]-0.5*paldither;
vec3 lc = clamp(floor(res.rgb*64),0,63);
ivec2 lcoord = ivec2(lc.r,lc.g+lc.b*64);
lcoord.x += 64*palnum;