Copyright © 2026 Unity Technologies
Severe visual artifacts on the WorldSpace Label Text on a specific project
I found a precision in the UIE_BRANCH() code path.
Since the Texture index is a half, is it not always correctly forwarded as an exact number
and can sometime suffer from precision issue. Since we are comparing value using less than operation and do not round any values, a value of 0x3F7FFFFF will be computed as less than 1.0f which will cause an invalid texture selection. If the value next to is exactly 0x3F800000 which will not be < 1.0f will have a correct texture selection. This cause a flickering pixel in the texture sampling which should always be the same for a primitive.
To fix the issue globally, we instead compare with X - 0.5f to have a leeway.
Here is the new code to backport in UIE_BRANCH:
index < X converts to index < X - 0.5
#define UIE_BRANCH(OP) \ [branch] if (index < 3.5 || _UIE_TEXTURE_SLOT_COUNT <= 4) \ { \ [branch] if (index < 1.5 || _UIE_TEXTURE_SLOT_COUNT <= 2) \ { \ [branch] if (index < 0.5 || _UIE_TEXTURE_SLOT_COUNT <= 1) \ {OP(0)} \ else \ {OP(1)} \ } \ else \ { \ [branch] if (index < 2.5) \ {OP(2)} \ else \ {OP(3)} \ } \ } \ else \ { \ [branch] if (index < 5.5) \ { \ [branch] if (index < 4.5) \ {OP(4)} \ else \ {OP(5)} \ } \ else \ { \ [branch] if (index < 6.5) \ {OP(6)} \ else \ {OP(7)} \ } \ }
To reproduce the issue see project in duplicate case:
[Internal link]
Issues you vote on will appear here