Storing directions in distance fields

Hi all,

I’m looking into distance fields as a solution for some custom collisions.

Some of what I read has the distance field as a 3 dimensional array of signed distance float values, to calculate the position of the closest point on a surface given a point the field is sampled multiple times at that point with small deltas to get a gradient and determine the position from that.

Other than having 4x the data, is there any reason I couldn’t/shouldn’t have my distance field data be arrays of Vector4s, where x,y,z represents the vector from the point to the surface, using w for signed distance?

Rebuilding the distance field will also be that more expensive as well.

What sort of collisions are you looking into simulating that you need a distance field, and that you need this directions so readily available?

Along the lines of biasing particle movement towards static surfaces and bouncing them off.
In my case rebuilding will (usually) be offline so that shouldn’t be a problem but yeah that’s a good point in the general case. It’s just not something I’ve come across when googling, and I would have expected to.