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

AnimFrame and AnimBlend in Custom Vertex Streams when using with GPU Instancing is very confusing.

Discussion in 'General Graphics' started by AhSai, Feb 11, 2022.

  1. AhSai

    AhSai

    Joined:
    Jun 25, 2017
    Posts:
    129
    After spending a long time trying to figure out how to write a custom shader to work with texture sheet animation blending in particle system that support both GPU instancing and non GPU instancing, here is what I found very confusing.
    When GPU instancing is on, it requires "AnimFrame" in custom vertex stream, and when GPU instancing is off, it requires "UV2" and "AnimBlend". Although the custom vertex stream can be changed with a C# script so that I can check if the device support GPU instancing and set the vertex streams to the correct ones, but is this the way that Unity expect us to do it? or am I missing something? Is there a more convenient or a "general" way to do this?