I’ve been looking into ways to use the DistanceToNearestSurface node for a variety of uses. Most prominently, within my water/ocean shader. I’ve got a few ideas about how I might use the node within the same material, but ideally I would have the distance fields of certain objects effect the material in different ways to other objects. Is there any way of achieving this?
For example, one object might create a blue glow around it, while another would give off a red one? Simple example, as the intended effect would be far more complex than just a re-colour, but the idea is the same.
Obviously, if it were just a re-colour, I could use the object position in a Collection Parameter to colour the distance field in it’s local area, but that doesn’t quite cut it, as these effects could potentially overlap, and I don’t want to store the position of every potential object that could interact with the material (which could be hundreds). Another example would be: Some objects create ripples in the material, others only affect a flow map, and so on.
Any advice here would be greatly appreciated.