Hi, thank you for the feedback.
Unfortunately, optimizing the shader is very tricky, as it has to go over every pixel on the screen and check for a matching color in the provided palette.
Reducing the size of the palette is a quick solution to minimize the performance toll, that's why this shader is best suited for pixel-art and sprites with a simpler color palette.
Improving its performance significantly might be challenging, especially considering I'm quite new to shader programming. However, I'm committed to continuing my efforts to optimize it further.
If anyone has ideas on how to enhance the shader's performance, I'm open to hearing them. Any insights could lead to valuable optimizations that I may not have considered.
Thank you again for bringing this to my attention, and I'll continue to explore ways to improve the shader's performance.