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
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

GPU Skinning - Custom Skin shader

Discussion in 'Shaders' started by lhoyet, Aug 17, 2015.

  1. lhoyet

    lhoyet

    Joined:
    Apr 20, 2015
    Posts:
    6
    Hi,

    I am looking at implementing a shader for doing dual quaternion skinning, to try to get rid as much as possible of this old candy wrapper effect. To my knowledge, I could not find any option to use DQ in Unity, so I decided to go and code my own using matrix palette skinning...

    My main problem at the moment is that vertices that are sent to the vertex shader are actually already transformed by the bone transformation. I've tested multiplying the vertex position in the vertex shader by the VP matrix and the vertices are already transformed by the bone rotations, but not by the model's global position/orientation though...

    I was wondering if anyone had an idea of how to get the untransformed vertex positions in the vertex shader?

    Cheers,

    Ludovic

    (btw I do have GPU skinning enables in Unity)
     
    Last edited: Aug 18, 2015
  2. MXAdd

    MXAdd

    Joined:
    Apr 23, 2015
    Posts:
    74
    AFAIK for now it is impossible to do any skinning replacement in unity.
    For DX11 (and next-gen consoles ??) (when GPU skinning is enabled) Unity5 makes use of stream-out feature to process one vertex buffer into another and do skining (this is done once before frame is rendered).
    For all other platforms skinning is done on the CPU (in software, on multiple threads).

    So for now I see no way to override this and do won skinning ... sadly
     
  3. jistyles

    jistyles

    Joined:
    Nov 6, 2013
    Posts:
    34