Possible way to make palettes with shaders?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By The_Duskitty
:warning: Old Version Published before Godot 3 was released.

So my question would be

For example in the street fighter series, you can select a character with a certain button, you get a certain palette,

Would it be possible using shaders to get only a specific colour on a sprite and change it to however you’d like without changing the colour of the rest of it?

:bust_in_silhouette: Reply From: KRL

You don’t have to use shader for that.

  1. Create sprite with alpha in places you want to have customized color.
  2. Put a sprite with white at customizable places behind your main sprite
  3. Just modify background sprite base color via modulate parameter

The problem with this is that these sprites are already premade with colours so it would be a pain in the ass to do this

The_Duskitty | 2016-03-26 16:27

Then use get_pixel() and put_pixel() to find and replaces the pixels that interest you

KRL | 2016-03-26 21:36