horrible flickering artifacts show up in distant text

7335298--891355--Screenshot 2021-07-17 034611.png

These ugly artifcats show up in a flickering fashion similar to z-fighting at a viewing distance of around 10 units with a 60 degree fov. The flickering is very rapid and distracting, and sometimes the whole text mesh gets blacked out completely.

I’ve tried playing around with sample point size and padding, but that hasn’t had any effect on the issue. Also tried changing size in the debug settings to no avail.

These are my font and text mesh settings:

It is possible that the issue is caused by the very small scale that you are using which forces you to use a point size of 0.24 on the text object. This in turn may affect the SDF Scale computation where we could be running into floating point precision.

Just for testing, see if switching to the “TextMeshPro/Mobile/Distance Field SSD” shader resolves the issue?

1 Like

Thanks for your help! I tried the shader you suggested, it does not make any difference.

Are you using UPR or HDRP or is the with the normal render pipeline?

See if adjusting the scale of your objects / scene has any affect on this? Just trying to rule out potential scaling type issue?

Is the in the editor?

Do you get this with all font assets or just a specific one?

I’m using the builtin render pipeline, all fonts cause the issue, and scale only affects the distance at which the artifacts start appearing. The artifacts don’t show up in the editor for some reason, neither in the scene nor the game view. I checked if antialiasing had something to do with it since that’s not applied to the editor views, but the artifacts show up in the build even if there is no antialiasing.

Found the culprit! Sorry for the confusion, this actually had nothing to do with TMP at all.

The artifacts look like z-fighting because they are z-fighting! The front and back face of the paper model behind the text mesh are too close together, which coincidentally only becomes apparent at about the same distance where individual letters in the text start flickering because they’re taking up less than a pixel.

Since the color and the bounds of the artifacts match the text mesh pretty much exactly I didn’t even consider the paper behind it being the problem. It makes sense though, the back face is completely black thanks to the shadowmap and the paper mesh has a completely flat rectangular face in the center which just so happens to align perfectly with the text.