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

Vertex Position in Shader Graph Using RGB Texture

Discussion in 'Universal Render Pipeline' started by darkwingfart, Aug 22, 2021.

  1. darkwingfart

    darkwingfart

    Joined:
    Oct 13, 2018
    Posts:
    78
    I'm trying to get rid of my SkinnedMeshRenderers, so I'm baking vertex animations to textures.

    I've been able to encode the XYZ position data for the vertices of my SkinnedMeshRenderer, but I can't figure out how to get that data into the Vertex Position. If I were writing a normal shader I'd do something like
    Code (CSharp):
    1. v2f vert (appdata v) {
    2.     v2f o;
    3.     o.pos = v.vertex;
    4.     o.pos.x = v.color.r;
    5.     o.pos.y = v.color.g;
    6.     o.pos.z = v.color.b;
    7.     o.pos = mul( UNITY_MATRIX_MVP, o.pos );
    8.     return o;
    9.     };
    Here is my Shadergraph. AnimationTexture outputs a Vector3 based on the pixel I've selected.
    upload_2021-8-22_2-43-15.png

    Any help would be much appreciated as I'm not very familiar with Shader Graph.