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. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Modifying shader for compute skinning?

Discussion in 'Graphics for ECS' started by thelebaron, Jan 2, 2023.

  1. thelebaron


    Jun 2, 2013
    I'm trying to modify my custom shader(not shadergraph) for using compute skinning. I did the same for vertex skinning working (successfully) for the now defunct com.unity.animation package, by digging into the shadergraph code, so I don't feel that this should be outside the realm of possibility.

    I've basically attempted the same, however my results are either garbled. Not really sure why, but here is what Ive done. I am a bit unsure of the exact names of each of these subsections so I've just gone and taken screenshots of everything I think is relevant.

    Ive added this to the properties

    Modified attributes for the vertex id

    Added to this section

    here is a part which I am unsure about with the instanced properties, this define seemed odd to me? rider64_GgHXoTNunF.png

    function and structured buffer are also part of the shader

    finally use this inside of the vertex program

    however my current results look like

    Could definitely use some advice as to areas I may be overlooking
  2. DreamingImLatios


    Jun 3, 2017
    First off, which version of Unity are you using, and are you using URP or HDRP? The reason I ask is because in 2022.2, there's some new behavior for handling motion vectors on HDRP that you have to watch out for. So that may be part of the issue.

    It is hard to understand what is going wrong with the skinning without seeing what a still of the animation looks like as a GameObject or using Linear Blend Skinning. It is weird, because some of the vertices seem to follow, and some don't, which to me seems like the compute shader part of compute skinning isn't skinning all the vertices.
  3. thelebaron


    Jun 2, 2013
    Ok so it was my mistake:
    That was actually the unconverted gameobject, didnt realize I hadn't put it in a subscene, so during edit time it was invisible, and I expected it to remain so during playmode, but during playmode it "rendered".

    Relieved that the shader works - for context what it looks like