How to Calculate Physics Using Compute Shaders?

Hello, I’m very new to shader programming, my experience so far has only been Shader Graph. But now I have a character with a long hair for which I wanted to add physics. Since her hair is curly, I cannot use cloth physics because It would completelly undo and destroy the curls as It calculates the physics, so my best bet was to add bones (rigging) to the hair strands and apply Rope physics.

I’ve seen some tutorials for C# solutions for rope physics, which did work but I think It’s better to use the GPU for such a thing, specially considering the parallelism and all… Since C# cannot run in the GPU (to my knowledge at least) I’ve stumbled into Compute Shaders, which, to the findings, seems to be made for that purpose. So my question is, how can I access those bones and add rope physics to them using Compute Shader from scratch?

Thanks in Advance,
Arthur

Bummer there aren’t more answers here. good, up to date resources on getting started with compute shaders is exactly what I need to. Im going to start a similar thread

1 Like