Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

Maximum amount of different quads per component?

A topic by RubyDev created 33 days ago Views: 72 Replies: 6
Viewing posts 1 to 7
(1 edit)

Hey, could it be that there is a maximum amount of distinct/unique/different quads of 7 per component? Any time there are more than 7, the quads appear empty.

If I delete one, the next in line appears magically.

I can work around this by making multiple components, but I wanted to ask if this is intended or if I can change this limitation somehow?


I think I found out why my approach probably lead to this problem. I didn't use texture atlas for my icons. I bundled up some icons into a texture atlas now and that way I am not limited to 7 different ones.

I assume this is some sub-mesh or sub-material problem?

It's better practice to use texture-atlas anyways so I will just set it up that way. Still an interesting find, no? 馃槄

Developer (1 edit)

Huhhhhh that's new, too... I'll give this a look right after the current thing I'm on. Is this with UI text? Maybe there's a limit on materials for Unity UI (CanvasRenderer) or MeshRenderers that's being reached... Doing some quick research I can only find one person mentioning there might be a limit of 256, so I'm not too sure why this limit of 8 is being reached off the top of my head. Will dig into it soon, but for the time being using that workaround is the preferred usage anyway since it reduces material usage regardless. (But I'd like to figure out *why* this limit exists, and if it's not possible to fix, note the exact limits in the docs)

It was in a Screen Space - Camera canvas using Super Text Mesh, yep.

Developer (2 edits)

Hello! Finally got to look at this.


Are you seeing this repeated error in your console?






...Because that's the cause of this issue! Quads, font changes, the texture tag, the material tag... anything that causes STM to generate a new material will also generate a new submesh for that material... So for Unity UI, there seems to be a hard limit of 8 submeshes allowed on a single mesh.

Quads sharing the same texture will *not* create an additional material/sunmesh for each quad since they can share, so that is the ideal solution. It means less materials are being used on your project, too.

If this is completely unavoidable, look for "STMPagination" in the same scenes. (I've really got to upgrade this to the Utility folder already, it's a pretty steady feature), where you could lay out multiple STM objects and have them automatically feed into one another, While only needing to maintain the first one in the chain.

Edit: I don't know why my text got formatted like this after I inserted the image. Oops

I personally solved it via using texture atlas now. So it was very avoidable for me.

 

If you want me to double check I can go back and also produce it again and see if I get the warning. (I have so many warnings, I never check them, lol. But I can do for you if it helps.)

Developer

All good - but for sure check your warnings in the future lol... I think I was aware of this, but never put in my own warning since this one spells out the issue already.