Hair Simulation WebGPU

This is exactly what I needed! I have adapted the WGSL compute setup (still very messy) to get updated vertex properties for hair roots. Here’s a POC you can never unsee (the code is even uglier than the abomination in the scene):

EDIT: I did observe that unlike in the Alien example, on my project’s character mesh some bones’ influences are off-kilter:

I deviated from the ComputeShaderBoundingHelper implementation in that I’m not updating the shader at all each frame (I’m setting buffers and bindings for bones only at the initialization time). Do you know off the top of your head if bone related buffers need to be updated each frame for the correct result (in which case I just got lucky with the alien, and need to add the per-frame updates)? In any case I will take another look next time I can work on this.

@CodingCrusader this is a great trick too, I think it factors only single bone (so, accurate for vertices with only one contributor bone) right? I think I can use it to good effect for adding spheroid-based collision to my physics sim (as the general head movement should be approximable with a single bone attachment).

7 Likes