Access "Engine Scalability Settings" in Material?


I’m using the DistanceToNearestSurface node in a material to achieve a smooth transition between my landscape and static meshes that are placed partially inside the landscape.

This is the result:

Now the problem:

The DistanceToNearestSurface node only works, if the shadow quality is set to at least high. On medium and low quality settings it will output 0, which results in the material always thinking it’s close to the landscape.

I’d like to have a simple fallback for this case. Is there anything like the Quality Switch and the Feature Level Switch for the Engine Scalability Settings? If not, is there a way to assign a different material for low/medium settings, or any other workaround?