I’ve been working on a modular sprite system where the player character is made up of a bunch of heavily layered sprites so that worn equipment can be reflected on the model. Currently I’m creating each equipment slot via a collection factory, parenting each sprite to their appropriate z-offset layer so everything renders in the right order, and storing references to each sprite url. It’s working well so far, but each sprite needs to be updated whenever an animation is played, and there’s obviously a ton of overdraw happening which isn’t too efficient.
I was thinking it should be possible to, whenever this slot configuration changes, pre-render all of the layering that would happen on the scale of the whole atlas to a render target. Then all I’d have to do every frame is animate one of these sprites to use its texcoords to draw from this render target. The big thing that has me stumped is how to draw the entire contents of an atlas, since its texcoords are already manipulated by the sprite component to be focused on its current animation frame.
I’d really appreciate if anyone could point me in the right direction here, or let me know if what I want to do is just not possible. Thank you!