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. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

what is the usage of UNITY_VERTEX_INPUT_INSTANCE_ID?

Discussion in 'Shaders' started by JohnSonLi, Jan 31, 2018.

  1. JohnSonLi

    JohnSonLi

    Joined:
    Apr 15, 2012
    Posts:
    586
    I seen this definition like
    CGIncludes\UnityInstancing.cginc: #define DEFAULT_UNITY_VERTEX_INPUT_INSTANCE_ID uint instanceID;
    Anyone could tell me what this variable is? When and how should I use it?
     
  2. Balikk

    Balikk

    Joined:
    Oct 23, 2014
    Posts:
    49
    Hi,

    It's for the GPU instancing, you can find more informations and example in unity doc here.
     
  3. JohnSonLi

    JohnSonLi

    Joined:
    Apr 15, 2012
    Posts:
    586
    Thank you so much!
     
    Balikk likes this.