Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Modifying shader for compute skinning?

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

  1. thelebaron

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    851
    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
    rider64_ezOcHZAqM4.png

    Modified attributes for the vertex id
    rider64_oa8MT5t7Lt.png

    Added to this section
    rider64_vFbF9R2kyF.png

    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
    rider64_TfP6GTrAKd.png


    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
     
    Egad_McDad likes this.
  2. DreamingImLatios

    DreamingImLatios

    Joined:
    Jun 3, 2017
    Posts:
    4,222
    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

    thelebaron

    Joined:
    Jun 2, 2013
    Posts:
    851
    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

    Unity_lcEha3NeHl.gif