Distance to nearest surface node not working at higher rendering distance.



Hi guys, I haver simple material with distance to nearest surface node to make some waves at the shore, problem is that it renders only in limited distance (cube) around viewport camera. I have been searching around internet but found nothing. Please help

1 Like

(post deleted by author)

I’d remove the oneminus… and try setting ‘edge balance’ between 50 and 100.

1 Like



Nope, oneminus just inverts mask and Edge_Balance parameter is for softening it. I think it has something to do with DistanceToNearestSurface node and its renderable distance around camera, but I can’t find those settings anywhere even in Project Settings. Thanks for your will to help though :pray:

1 Like

Pretty sure there is a world setting to control the distance which distance fields are sampled for these purposes but I’m not in a position to look it up what it’s called.

1 Like

Keep in mind that I’m not sure if this has any quality ramifications. Like with volumetrics, if you increase the range, it will lower the overall voxel density. I’m not sure if the global distance field memory pool tries to stay at some fixed size or not or if by increasing this distance, it also increases how much memory it uses. You’ll need to experiment.

I had a similar issue with a shoreline water material effect and this doesn’t completely fix the problem, but mostly mitigates it.

EDIT: Here is an example from a random terrian


The camera wasn’t moved and this is a view of the global distance field. It looks like it does drop in quality some, but not really in any meaningful way(look at the foreground cliffs area near the bottom-right of the images and notice how they are smoother vs the 20k version)

2 Likes

Thank you very much! It indeed was this setting that helped. Although It didn’t help straight away, I had to turn ON Support Hardware Ray Tracing first.