I feel like I’m close to a solution, but I can’t quite close the deal.
I am using a box mask 3d that takes position and bounds from a material parameter collection to mask hair material. The material parameter collection is currently updated from the ctor of my character bp.
This is working perfectly for if I only have 1 character, but obviously won’t do with more than 1 character (which I need).
So, instead of using a material parameter collection, I have experimented with dynamic mat instance parameters, but the only way I can think of to get this to work is to be constantly updating the parameters from the character’s tick function and this seems sub-optimal.
Any ideas on how to do this? Maybe there is some other way completely to achieve this?
My first idea was not to use a box mask, but to somehow mask any part of the hair that is between the helmet/hat and the camera. I have a material that is masked when the camera is too close (for trees/tall foliage/buildings), so I thought I might be able to do something like that, but I couldn’t figure out how to do it. (There seemed to be a possible solution here: https://www.reddit.com/r/unrealengine/submit but I couldn’t figure out how to make it work).
current reddit thread: (17) Using materials to stop hair from clipping through hats/helmets (top-down) : unrealengine (reddit.com)