Hi ASE Community!
I created a shader that is drawn by Graphics.DrawMeshInstanced, and I need to have different variables for the instances. To differentiate in the shader I need to access UNITY_VERTEX_INPUT_INSTANCE_ID to use it as array index for my custom data.
How can I access UNITY_VERTEX_INPUT_INSTANCE_ID?
(https://docs.unity3d.com/Manual/GPUInstancing.html)
Best regards,
mrmcd
Access UNITY_VERTEX_INPUT_INSTANCE_ID
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Access UNITY_VERTEX_INPUT_INSTANCE_ID
Hello, thank you for getting in touch and for your support!
You're in luck, as we've just added an 'Instance ID' node in a build that was released this week:

Please ensure that you're using the latest version currently available from our website, and do let us know if you come across any issues.
You're in luck, as we've just added an 'Instance ID' node in a build that was released this week:

Please ensure that you're using the latest version currently available from our website, and do let us know if you come across any issues.
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Re: Access UNITY_VERTEX_INPUT_INSTANCE_ID
Oh wow, guess I'm super lucky. Thanks for the answer.
Out of curiosity, was it impossible before?
Out of curiosity, was it impossible before?
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Access UNITY_VERTEX_INPUT_INSTANCE_ID
No problem, happy to help!
I don't think that there was any way to access that data before, not even outside of the scope of our editor, which is also why I said in my previous reply that you were in luck.
Please let us know if you have any further questions, thanks!
I don't think that there was any way to access that data before, not even outside of the scope of our editor, which is also why I said in my previous reply that you were in luck.
Please let us know if you have any further questions, thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Re: Access UNITY_VERTEX_INPUT_INSTANCE_ID
Thanks for the information. Everything worked great!
- Amplify_Borba
- Posts: 1239
- Joined: Mon Jul 24, 2017 9:50 am
Re: Access UNITY_VERTEX_INPUT_INSTANCE_ID
Glad to help!
Have you had the chance to rate and review Amplify Shader Editor? It would be awesome if you could share your experience with the Unity community, every bit helps and your feedback is extremely valuable to us.
Feel free to get back in touch if you have further issues or questions, thanks!
Have you had the chance to rate and review Amplify Shader Editor? It would be awesome if you could share your experience with the Unity community, every bit helps and your feedback is extremely valuable to us.
Feel free to get back in touch if you have further issues or questions, thanks!
Customer Relations at Amplify Creations
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!
Learn more about our offering: Amplify Creations Products
Amplify Shader Editor won the Asset Store Best Tool Award - Thank you for your support!