Access UNITY_VERTEX_INPUT_INSTANCE_ID

Node-based Shader Editor

Access UNITY_VERTEX_INPUT_INSTANCE_ID

Postby mrmcd » Thu Jan 24, 2019 1:20 am

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
mrmcd
 
Posts: 3
Joined: Thu Jan 24, 2019 1:16 am

Re: Access UNITY_VERTEX_INPUT_INSTANCE_ID

Postby Amplify_Borba » Fri Jan 25, 2019 3:09 pm

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:

Image

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!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Access UNITY_VERTEX_INPUT_INSTANCE_ID

Postby mrmcd » Fri Jan 25, 2019 7:55 pm

Oh wow, guess I'm super lucky. Thanks for the answer.

Out of curiosity, was it impossible before?
mrmcd
 
Posts: 3
Joined: Thu Jan 24, 2019 1:16 am

Re: Access UNITY_VERTEX_INPUT_INSTANCE_ID

Postby Amplify_Borba » Mon Jan 28, 2019 4:33 pm

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!
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!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Access UNITY_VERTEX_INPUT_INSTANCE_ID

Postby mrmcd » Fri Feb 01, 2019 3:03 am

Thanks for the information. Everything worked great!
mrmcd
 
Posts: 3
Joined: Thu Jan 24, 2019 1:16 am

Re: Access UNITY_VERTEX_INPUT_INSTANCE_ID

Postby Amplify_Borba » Fri Feb 01, 2019 4:54 pm

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!
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!
User avatar
Amplify_Borba
 
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 113 guests