gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Graphics > To palette or not to palette?

#155651 - sgeos - Fri May 02, 2008 3:26 am

In this post, sajiimori wrote:
SDL is quite simple for PC development ... and there's not even a palette to deal with.

Sometimes you want a palette.

-Brendan

#155685 - Kyoufu Kawa - Fri May 02, 2008 7:52 pm

There can be a palette in SDL if you want it.

#155689 - tepples - Fri May 02, 2008 9:04 pm

On PC video cards from 2003 and later, what's a (hardware) palette useful for, other than perhaps palette-swapped game characters?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#155696 - gauauu - Fri May 02, 2008 10:04 pm

tepples wrote:
On PC video cards from 2003 and later, what's a (hardware) palette useful for, other than perhaps palette-swapped game characters?


Why something other than palette-swapping? That's a pretty strong reason in itself.

#155698 - Maxxie - Fri May 02, 2008 10:34 pm

Even palette swaps are pretty useless with modern (pc gfx) hardware tbh.

The reasoning behind them is to reduce cpu load (i.e. change the indices meaning instead of the indices themself) or to get the last piece out of the hardware (i.e. using more then 16/256 colors by changing the palette within drawing)

These reasons are no longer present when a) there is virtually no limiting in the coloring, and b) custom per pixel calculations on the gpu with no further cost even granting more dynamic (by applying more external or geometry parameter) to color manipulation at draw time then the palette swap.

#155704 - silent_code - Sat May 03, 2008 12:10 am

random post: you can also use alpha blending for colored parts of a model (i'm not going into detail, as this is a fairly easy technique), that would formerly have been changed with palette index changing.
maybe this doesn't always work, though i can't think of an example right now. ;^D

ps: Maxxie, sometimes there are situations where you want to quote yourself, but i agree, that i also hit the wrong button from times to times.

#155730 - sgeos - Sat May 03, 2008 12:53 pm

Maxxie wrote:
Even palette swaps are pretty useless with modern (pc gfx) hardware tbh.

Unless you want to color characters via algorithms.

Palette animations are another case where you want a palettes. When you want to fade from palette A to palette B or change the hue of an entire graphical object, you really want a palette.

-Brendan

#155732 - Maxxie - Sat May 03, 2008 1:36 pm

sgeos wrote:
Maxxie wrote:
Even palette swaps are pretty useless with modern (pc gfx) hardware tbh.

Unless you want to color characters via algorithms.


Then i'd want a shader, which really can apply algorithms on the coloring.

#155737 - tepples - Sat May 03, 2008 5:29 pm

sgeos wrote:
Maxxie wrote:
Even palette swaps are pretty useless with modern (pc gfx) hardware tbh.

Unless you want to color characters via algorithms.

In GL/D3D games, you don't color characters via algorithms as much as retexture them, or you can even replace parts of the model. This is true of Animal Crossing (clothes/face swapping on both versions, plus hair/hat swapping on the DS version) and Smash Bros. (check out how Brawl's Wario changes forms when you change his color). The last game where Luigi was a palette swap of Mario was Super Mario World; since then, he's a different model. Even NES games would change the equivalent of models: Samus in her suit vs. Samus out of her suit, or Mario vs. Luigi in SMB2.

Quote:
Palette animations are another case where you want a palettes. When you want to fade from palette A to palette B

In GL/D3D games, you'd do that by changing the lighting.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#155745 - sgeos - Sat May 03, 2008 7:47 pm

tepples wrote:
Quote:
Unless you want to color characters via algorithms.
In GL/D3D games, you don't color characters via algorithms as much as retexture them,

You can do some very interesting things if you palette animate your textures.

tepples wrote:
Quote:
Palette animations are another case where you want a palette. When you want to fade from palette A to palette B
In GL/D3D games, you'd do that by changing the lighting.

I suspect there must be a way to selectively change the colors of subcomponents on a 3D object.

#155792 - kusma - Sun May 04, 2008 11:09 am

Maxxie wrote:
sgeos wrote:
Maxxie wrote:
Even palette swaps are pretty useless with modern (pc gfx) hardware tbh.

Unless you want to color characters via algorithms.


Then i'd want a shader, which really can apply algorithms on the coloring.

Keep in mind that the texture-mapping hardware usually can perform four palette-lookups and bilinear interpolation between them in a single clock. That can in some cases be a good incentive to use them palettes rather than moving all of this out to the fragment shader.