+2 votes


I'm trying to make a retro-styled game and I want to do a Sprite that changes its colors simulating a palette like in NES games , I tried to find tutorials but none of them worked for me, I only know that I need to do a shader for the sprite, but I don't know how to simulate the palette.

Anyone can help me? Thanks.

in Engine by (14 points)

1 Answer

0 votes

Using a palette means you should not draw your sprites with arbitrary colors, but rather specific colors which you can then swap in a shader with a bit of math to map the original color to a palette texture coordinate, which you then use to replace the final color.

Did you see this technique? https://godotengine.org/qa/42640/wrote-shader-replace-palette-sprite-another-palette-optimize?show=42640#q42640

There are many other ways, but in any case it would help you a lot to learn shaders so you can find your preferred way.

by (28,740 points)

Thanks for answering my question. But I found an another method using "Color 1", "Replace 1", "Color 2", "Replace 2", etc.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to webmaster@godotengine.org with your username.