Basically, I'm implementing my own tilemap in it's own shader with features I doubt the engine will ever implement - palette swapping for one, but 4.0 tilemaps aren't really built for flipping and transposing tiles either (the alternate tiles system is just awful for my purposes). Doing it this way would also couple closer with actual shader effects in the shader, which are meant to mimic SNES-style scanline effects.
The shader has:
- a 1024x1024 tilemap texture (each pixel is one tile) representing all layers
- one palette texture of about 64 tables x 16 colors
- and another texture for actual tile graphics in indexed color for use with the palettes.
Think of it a bit like 16-bit fantasy console. The problem is that swapping tiles in and out of the tilemap each frame, for animation, say, would pass the whole 1024x1024 tilemap each frame, which is unreasonable.
What you're suggesting, in your latter paragraph, as I understand it, is that I have shaders on the Subviewports holding my textures, and that I pass an array holding instructions for each change, that I'd loop through and implement for for however each pixel is effected by each change, right? That makes sense. Only, I'm not sure how I could overdraw the render target with a transparent value if it's opaque underneath, or else, clear it, and still be able to draw what had been there before it was cleared if there are no changes to be made.