indexing color, palette swap, indexed palette swapping
Shadowblitz16 opened this issue · 3 comments
I'm submitting a...
- Bug report.
- Feature request.
Feature request
Describe the problem you're trying to solve.
it would be nice to have the following shaders..
- Indexed Color allows you to limit every pixel on screen to a palette.
- Palette Swap allows you to swap colors that are on screen for different colors.
- Indexed Palette Swap indexes the colors to the original palette and then swaps them depending on order.
I would just suggest that it be made a shader
Tell us which solutions you've explored, the solution you would pick, and why you think it would be the best for everyone.
I am currently trying to get help on the discord to implement a Indexed Color shader but it might be nice to beable to swap colors later
I think it would be good for retro games regardless if they are 2d or 3d
The best approach I've found is to convert sprite colors into evenly distributed grayscale values and use single-channel value as an index. Because color values go from 0.0 to 1.0 and same is with texture position from one edge to the other.
I created free html5 tool SpritePalettizer that converts sprite to grayscale and allows to create color palettes. In the help section, it has an example shader code and links to the GitHub repository of the example projects. Maybe GDQuest wants to include that project?
If you have a palette swap shader that's MIT-licensed you want to share, sure, feel free to open a PR. Note we're specifically looking for shaders and not tools for this repo. Also, each new shader should have at least a minimal demo showing it in action.
Let me know if you need a hand with anything.
@NathanLovato That is an accompanying example project to show an implementation of assets created with the tool. I'll create a PR soon.