Use 0.0 instead of 0.5 for t for palette lookups.

I realized it's pretty silly using colormap + palette when I can just
combine the two into one and have a 2D palette. This is in preparation for
that.
This commit is contained in:
Bill Currie 2012-01-14 20:51:43 +09:00
parent 2425498479
commit 928dd92276
7 changed files with 8 additions and 8 deletions

View file

@ -12,5 +12,5 @@ main (void)
pix = texture2D (texture, st).r;
if (pix == 1.0)
discard;
gl_FragColor = texture2D (palette, vec2 (pix, 0.5)) * color;
gl_FragColor = texture2D (palette, vec2 (pix, 0.0)) * color;
}

View file

@ -14,5 +14,5 @@ main (void)
float col;
col = texture2D (colormap, vec2 (pix, light * 4.0)).r;
gl_FragColor = texture2D (palette, vec2 (col, 0.5));
gl_FragColor = texture2D (palette, vec2 (col, 0.0));
}

View file

@ -21,5 +21,5 @@ main (void)
light = 255.0 - light;
light += d * shadelight;
col = texture2D (colormap, vec2 (pix, light / 255.0)).r;
gl_FragColor = texture2D (palette, vec2 (col, 0.5));
gl_FragColor = texture2D (palette, vec2 (col, 0.0));
}

View file

@ -6,5 +6,5 @@ main (void)
{
if (color == 1.0)
discard;
gl_FragColor = texture2D (palette, vec2 (pix, 0.5));
gl_FragColor = texture2D (palette, vec2 (pix, 0.0));
}

View file

@ -26,5 +26,5 @@ main (void)
st = direction.xy * len + flow * realtime / 16.0;
pix = texture2D (solid, st).r;
}
gl_FragColor = texture2D (palette, vec2 (pix, 0.5));
gl_FragColor = texture2D (palette, vec2 (pix, 0.0));
}

View file

@ -16,8 +16,8 @@ main (void)
pixb = texture2D (spriteb, stb).r;
if (pixa == 1.0 && pixb == 1.0)
discard;
cola = texture2D (palette, vec2 (pixa, 0.5)) * colora;
colb = texture2D (palette, vec2 (pixb, 0.5)) * colorb;
cola = texture2D (palette, vec2 (pixa, 0.0)) * colora;
colb = texture2D (palette, vec2 (pixb, 0.0)) * colorb;
col = mix (cola, colb, blend);
if (col.a == 0.0)
discard;

View file

@ -27,5 +27,5 @@ main (void)
st = turb_st (tst, realtime);
pix = texture2D (texture, st).r;
gl_FragColor = texture2D (palette, vec2 (pix, 0.5));
gl_FragColor = texture2D (palette, vec2 (pix, 0.0));
}