Getting info from material A on how material B should look like

Hello. I need a way to control the “distance to nearest surface” from the object that is affecting distance fields. Basically what I have is a sphere (affect distance field lighting - true) and a plane(affect distance field lighting - false), the plane has this material on it


Right now the plane is detecting the changes the sphere is making in the distance fields and representing that with the blue rim around the sphere. But lets say I need different types of spheres, each needing their own custom look for the rim around them. How do I make it so that the sphere is the one to determine how its rim will look like?

A distance field is simply a value that stores the distance and sometimes direction of the nearest object but no information is stored in them about what that object is. While it’s technically possible to store more data in a distance field, like some kind of index of objects, Unreal does not. Probably because it would be expensive in terms of memory usage to track this.

You would need to tell it what kind of effect to apply where based on some other data that you can provide to the material yourself.

1 Like