DistanceToNearestSurface material flickering

The recalculation happens at the model level like as in when you open a static mesh in its own window. Any scaling there, on import, will allow the DF to be generated correctly. The problem is that AFTER you do that and drag the mesh into your leve, if you then non-uniformly scale the mesh in the level, it can break it.

Yeah, ideally, the editor would give an option to rebake them, after scaling adjustements within the level, but then you run into the problem of having 3000 starter cubes being scaled 3000 different ways, which means 3000 unique distance fields being generated and having to be stored in memory vs only having one for them all.

It’s a static baked texture that gets created on import. When you see it say “32x32x32” or something, it literally means 32 slices of 32x32 texture information.

I’ll test it out and edit this post, but I don’t think I’ve personally had this problem and I’ve made dozens of shaders like these for shore effects on water planes that are at Z=0.

1 Like