Tilemap with palette swap with grayscale texture

So i have a grayscale tilemap 8x8 and on top of it i have tilemap i have with pallete swap shader. It’s pretty simple – pallete tilemap swaps grayscale with its own texture based on UV.x coordinate. The only problem i have is that i can’t preview my pallete tile because it uses screen_texture. Is there some sort of hack so i can preview my pallete texture or maybe there is a better solution for pallete swapping on tilemap?

Here is a video of a problem

I would imagine you’d want more of a material approach, where the material would include the palette and it’d take the base tile texture and apply it to that, and using Alternate Tiles setup in your TileSet(s) you can do that, or even apply custom data per tile that the material would utilize to shift palette.

Problem with Alternative Tiles approach is that the tiles are in one single column and it’s impossible to find right one

I can create another atlas with same texture and palette applied to every tile on it, but it would be impossible to swap them on the fly

Yeah, that is tricky, I know tiles can have custom data, I just don’t know if you can apply those to individual tiles, and if that data could be read by the material and used as an ‘index’ for the palette you wanted for that one tile.

Maybe tileset proxies would help, haven’t looked too much into them.