The material used in my asset is inexplicably fading out depending on the distance. How can I fix this?
Looking at the material nodes, it just seems like the mask image is connected to the opacity mask, and there doesn’t appear to be any distance-based processing.
This material wasn’t created by me, so please don’t ask me what I did.
Hello there @FairboyMarx!
From what I can see on your material setup, the opacity texture map is going straight to the opacity mask slot, meaning the other nodes are not affecting it’s result. The only parameter to play around here would be the mask’s clip value, which you can find by select M_TSPine in the graph, going into Details > Advanced:
Default value should be 0.3333, I would suggest testing around a range from 0.1 to 0.2, then test if the foliage still dissapears. Besides that, there’s no more possible cultrips to check here, the material is not using any other node that could trigger a culling effect (like DepthFade, PixelDepth, DistanceCullFade, etc).
And looking at your screenshots, the result looks a bit more like an aggressive LOD taking over the asset. The leafs are not fading, they are losing all their geo, only the branches are left. I suggest checking your static mesh LOD settings, by opening the asset, going into Details > LOD settings, and check how many levels are applied on it. Re-adjust them, so they don’t cull the leaves at that distance:
Also, if you are placing these using the foliage tool, said tool has its own culling parameters as well. When you select the foliage type, check your values for Cull Distance, and adjust them accordingly:
Changing the Opacity Mask clip value definitely had an effect.However, the fade-out effect still occurs even if the distance changes.This doesn’t happen with other materials, so it feels strange.
Regarding LOD, the settings are the same for both the leaves and the trunk, so it’s probably unrelated.I edited it in Blender and then imported it as an FBX file at the same time.I’m simply enabling Nanite without using LOD.
Hello again!
Glad to hear the opacity change helped here, even if it didn’t fix the scenario it all together.
Now, since you are using Nanite, the issue is a bit more clear. What Nanite does, is simplify geo by turning it into micro triangles, in relation with screen size and distance. The leafs are composed of cards, or flat planes, with very little geo. At a certain distance, Nanite will just cull the leaves entirely.
And the reason for this, is that your material is Masked, which does not get along with Nanite at all times. The other materials, that have no issue here, are most likely set to Opaque. So, a possible solution here would be to disable Nanite support on this particular mesh/material combo, and allow LODs to handle the geo.
Alternatively, if you must keep Nanite enabled for this, then please test by opening the affected mesh, and in Nanite Settings, change the Shape Preservation from “None” to “Preserve Area”

The problem persists even after changing the Shape Preservation settings or disabling Nanite.It’s hard to tell from the image, but the entire mesh doesn’t disappear; rather, it blurs and becomes invisible depending on the distance.
Do all masked materials have the same problem?
Hello again!
And no, not all masked materials have this. It’s a matter of understating how this material was setup, something we are making progress on. Now we know that both Nanite and LODs have no impact on the fading effect, meaning it has to be solely tied to the opacity mask, and what makes it degrade at distance.
Since we already tinkered with the clip value before, what’s left to check is the texture sample being used for the mask. And in particular, how mip maps values are set. Please open the texture asset in editor, and review the following:
-
Check the Compression settings, it should be set to “Masks (no sRGB)”
-
That change should set sRGB off on it’s own, but please make sure it is
-
Now, look for Mip Gen Settings, and experiment with the values, from NoMipMaps at all, to different levels of Sharpen
-
Finally, set the texture to “Never stream”
It appears to be completely fixed for now!
I would never have realized that the problem was with the texture, not the material.
Thank you for helping me solve it.