Possible material cache optimization?

Here I’m guessing that sprites which share a material are best drawn in a batch.

My example is, I have factories that crank out alphabet glyph sprites. If I were to z-sort them in alphabetical order, would they draw faster?

Say that ‘a’ glyphs are farthest from the camera and ‘z’ glyphs are closest. When a frame is drawn, would all the 'a’s get drawn before the 'b’s? Would that help drawing from the cache?

You could put all of those sprite glyphs on their own render predicate and they should only be 1 draw call. Is your profiling bad atm?

2 Likes

It was a theoretical question, and I like your answer. Thank you. That’ll help me greatly in the future, but I would still like to know if z-order can be used to group sprite draws.

Yes indeed it can. Have a look at how we batch draw calls here:

2 Likes