Distance To Nearest Surface flickers

I am triying to figure out what cause this issue with Distance To Nearest Surface node
This issue occurs very randomly, sometimes it can be seen from far away but it also happens up close too

Here is material

You’ll likely want to clamp that value or do something that does an approximation vs taking the raw calculation.

Using a power of 5 on an HDR value could be the culprit. Could be essentially going out of range and creating a NaN.

I concur with the previous poster. Try getting the value into the 0-1 range and clamping before the power.

Thanks for the coment, I`ve tried what you suggested, but issue is still there

For some reasone this issue ocurrs only in Play mode

I’m experiencing this issue as well - using distance to nearest surface for custom AO, and I see the flickering in Play mode, but not in editor. Does anyone have more insight on this?