Image and RawImage, correct usage

I’m putting together an app that is basically all UI. I’m trying to figure out the best (most efficient) way to set things up. In the UI I have a fair amount of static backgrounds, headers, symbols, etc (maybe 50 of these images), but then there are about 10 images that change based on the current state.

Initially I made all my images RawImage as I’d read they were lighter weight to set up than Images (which are Sprites.) But diving in to the docs, I see that every RawImage causes a draw call.

So I think perhaps at this point I want to leave the images that will change as RawImage so I can easily assign new textures to them, and convert all the static images to Image so they render more optimally. Is this a correct architecture or am I misunderstanding? Thanks!

If you use sprites then they can all be stored in a sprite sheet/atlas which Unity can generate for you. This allows for a potential single draw call. Using raw image will often be a draw call per image. Sprite is generally going to be your best choice. There are some good UI talks from Unite on youtube with various tips to help you. Things like using Rect mask instead of a normal mask, using multiple canvases to reduce the work when a single change occurs etc.

1 Like

Thank you Karl! I’ll look for the talks, I don’t suppose you have any specific ones in mind?