Change to DistanceToNearestSurface in 5.5?

Just wondering if anyone has noticed a difference in the ‘Distance To Nearest Surface’ node in the material editor? In 5.4, my material would only show emissive when overlapped by a mesh with ‘Effect Distance Field Lighting’, but now it is creating a kind of glowing AO effect all the time.

All meshes shown here have ‘Effect Distance Field Lighting’ off, yet it appears the node is still generating white.

I can’t test it right now, but if no fields are present, I’m guessing this node returns 0, which after the 1-x will give 1? ( I think :slight_smile: )

I use distance fields all then time to give AO for objects placed on the ground, nothing seems to have changed.

1 Like

Sorry, yes it will return 0 if there is no other mesh in the level effecting distance fields, but I do have some (they just aren’t in range).

Interestingly, this effect is not visible unless the node is attached to emissive (as in ex image) and level lighting is low (say 1 Lux or less on the DL). It is also not visible if I pipe the same nodes into the base color and check Unlit render view.

Just tried this:.

  • Fresh 5.5 project: Blank init level with landscape deleted and DL set to 1 Lux.
  • Added 3 shapes:
    • Cube (as floor) with ‘Affect Distance Field Lighting’ Off and a dark grey material
    • Sphere 1 (as DF effected) with ‘Affect Distance Field Lighting’ Off and mat setup in example image
    • Sphere 2 (as DF effector) with ‘Affect Distance Field Lighting’ On

If I bring Sphere 2 near Sphere 1, the expected thing happens: emissive is ‘revealed’ on Sphere 1. But this ‘AO glow’ between Sphere 1 and Cube remains unless I move Sphere 1 far from Cube, and Sphere 2 seems to have zero bearing on the effect.

The white glow on the cube is the same effect as in the first image, just becoming more diffused the further I move Sphere 1 away from Cube.

1 Like

And the emissive is about -4 by my guess there… :star_struck:

I just read there’s an option ‘allow negative emissive color’, does it still exist? do you have it set? ( not at a machine rn ).

1 Like

Thanks for helping - the mystery is solved. User error as usual.

I forgot I’d enabled HW raytracing recently, which means ‘affect distance field lighting’ has no effect on Lumen. Had to turn it off with a seperate switch on the static meshes : ‘Visible in Raytracing’.

Solution credit goes to @Harlist on the Unreal Source discord!

1 Like

Is it me, or is the engine starting to get a bit too complicated? :rofl:

1 Like

:sweat_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.