Download

Easiest (or any) way to tell if a vertex is "inside" another mesh?

I am looking into ways to “fake” some soft-body collisions with volume preservation on skeletal meshes, like a fat-bellied character getting hit in the belly, or thighs squashing/expanding when a character is sitting on a bench.

It seems like WorldPositionOffsets in a material would be good for this, but how can one tell if a pixel or vertex is “inside” another mesh? I imagine there’s something you could do using pixel WorldPositions and surface normals, but is there a more straightforward way to get that data?

Would DepthFade help you? it’s value is dependent on the overlap between objects… we use that to “simulate” shore on a simple water volume

Problem though: it’s dependant of the view

It might, since I guess you’d only care about “fake” deformations like that when objects are in view. I thought DepthFade only worked with Translucent materials though, am I mistaken?

Yes, it only works with them
The other thing you could use is the Distance Field… but i couldn’t use it due to our project being a 2d and one of the dimensiones having no width, so the distance field was almost null.