Hey guys, dont know much about shaders so wanted to ask first before
starting to dig deeper into this. I am trying to add mud on hair and I
was thinking it might be a good idea to try a layered material. Is it
possible to convert the hair shader epic came out with to be used in a
layered material setup so i can add the mud on top as a second layer?
Thanks in advance
Replies
Because changing the dynamic properties of hair and cloth, from soft and flowing to clumped and heavy is not exactly easy or built into unreal. What physics solutions are you using? Apex Cloth? Nvidia Hairworks? Or... is the hair mostly helmet hair and you just need to change the helmet and you're not worried about dynamics?
2) How is the mud applied?
Does it splash on the hair and need some kind of hit detection to place it correctly? Is it universally applied, like the character jumps in mud, is fully submerged and comes out with a different hair style?
Unreal's hair shader is pretty tech heavy and designed to look really good up close and then quickly LOD out. It also uses a blend based on camera view angle that could be hard to layer properly. You might want to treat the mud clumps as separate objects and swap out pieces. Or go with a much more lightweight solution that will blend better. Opacity blending is some of the heaviest shader work you can do so it's going to ding your performance and could have some pretty big issues with things like fog, other translucent shaders.
Depending on how you animate the hair, you might want to add sockets for the hair/mud clumps, so you can spawn them in at the same location and even scale up the mud clumps so they start over take the hair over time. You can also add dynamics/physics to sockets so you get some secondary motion without having to do full on hair or cloth sim.
This might be helpful?
https://www.youtube.com/watch?v=Jq0pB2Um_pA
Sounds interesting, Good LUCK!