Basic palette swap shader with the potential to manage up to a 100 colors at the same time.

* New updated shader: Now it is possible to modify 766 different colors at a time.

GitHub: https://github.com/AlbertoLuviano/SHADER---PaletteSwap766

GitLab: https://gitlab.com/AlbGD/shader-palette-swap

BitBucket: https://bitbucket.org/AlbGD/shader-paletteswap/src/master/

Godot Asset Library: https://godotengine.org/asset-library/asset/671

Buy Me a Coffee at ko-fi.com

Download

Download NowName your own price

Click download now to get access to the following files:

GODOT - PaletteSwap.zip 283 kB
GODOT - PaletteSwapV2.zip 306 kB

Comments

Log in with itch.io to leave a comment.

(1 edit) (+1)

really really neat! but you can actually get up to 16777216 colors not that you would ever need that many. Still really cool though!

r + 256 * (g + 256 * b);

(+1)

Wow! that's amazing. Thank you very much for sharing the formula :) it's definitely worth a try... I mean, purely academic...

I don't know what Godot's array limit is, but I think 24-bit is very plausible. The bigger challenge would be having a texture that long, performance wise.

(1 edit)

You would want a 4096x4096 texture as 4096*4096 = 16777216 to index into that you can divide and mod the previous formula eg          x = value%4096 y =  floor(value/4096