Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question How to Calculate Physics Using Compute Shaders?

Discussion in 'Shaders' started by FGPArthurVII, Jan 13, 2021.

  1. FGPArthurVII

    FGPArthurVII

    Joined:
    Jan 5, 2015
    Posts:
    106
    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
     
  2. HeliosJack

    HeliosJack

    Joined:
    Aug 15, 2013
    Posts:
    41
    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
     
    FGPArthurVII likes this.