How to fix z-fighting between sprites and meshes

Hi folks,

In my app, I use zOffsetUnits a lot to ensure proper layering without blinking on large scenes when zoomed out. Unfortunately Sprites do not seem to support zOffset parameters. Do you have any suggestions on how I could help the engine arbitrate which to put in front between a mesh and a sprite?

Below is an example of the effect I’m trying to avoid, the icon (a sprite) needs to be on top (like in the 1st pic), but it gets sent to the bottom when zoomed out (2nd pic).

Help me save Bob (the fictional guy in the picture).

Thanks in advance!

You can try changing the renderingGroupId or alphaIndex if the sprites have alpha (doc).

If it still doesn’t work, then a repro is needed. Hope it helps.

3 Likes

Thanks a lot, i’ll try that and post the outcome :slight_smile:

renderingGroupId worked like a charm, and Bob is safe.

Thanks a lot @phaselock :v:

3 Likes

I’m happy for Bob :smiley:

3 Likes