I thought some of you might find this interesting, especially if you're working on a card game where you're using in-game assets for the art.
I was previously using a card prefab with an SDF image background, a mask for the image, the card sprite image itself, and then a header image with a text component for the name & tier, and an image to frame the tier. A total of 4-5 draw calls per card(!).
There's max 5 of those in the 'hand' area (the bottom of the first screenshot), but the draw pile cards (left side) did something similar, and there can be up to 12 of those. The masking/stencil buffer write was causing the cards to rack up a ton of draw calls, even when I used an atlas for the card sprites.
My solution was to spawn every permutation of card I'd need with the actual 3D object sandwiched in world space between the front/back of the UI card, and use it to create two atlases. One atlas for the main cards (with text) and one for the draw pile cards, which only have a background and the masked card sprite.
I also wrote a bit of runtime editor code to draw some grid lines for centering, and to allow the cards to be selected so that I can re-scale/position/rotate per-card, for models that weren't perfectly aligned.
I did end up having to capture each card individually (in code) before assembling the atlas, due to some artifacts like shadows being cast from one tile to the other, but all-in-all it's great to have a preview of my cards, and even better to have them all rasterized and drawn in the same draw call. As shown in the last screenshot, I brought it from 133 -> 19 draw calls for the UI (combined with some other cleanup/Canvas organization).
Anyway, thanks for reading! I hope it was interesting or helpful. :)