Hello! I'm working on a label model that needs to render similarly to in-game nametags. For that, I needed two main things:
- A background (using AlphaBlend)
- A text layer (using AlphaTest)
Both should always render through blocks, with the text rendering on top of the background. To achieve this, I set both materials to use "depthFunc": "Always". However, I ran into an issue with how the game orders material rendering: the background always rendered through the text.
I'm not deeply experienced with custom materials, but after reading some discussions here on the server and experimenting with AI suggestions, I found a partial solution using a stencil mask. It got me close to the desired effect.
However, I’m still facing some inconsistencies:
- In certain conditions (e.g., rendering through nether portals), the layering gets buggy.
- Sometimes, text from one label renders through another, even though texts should not render through other texts that are in front of them.
I'd really appreciate if anyone with experience in material stencils could take a look at my current materials. I’d like to know if my approach makes sense, or if there’s a more reliable way to solve these rendering issues. I'm also searching for ways to optimize my materials in case there is any ambiguity.
Thanks in advance!