Animate Shader Materials

Node-based Shader Editor

Animate Shader Materials

Postby Yoshinjo » Wed May 02, 2018 6:20 am

Hello,

I'm still learning quite a bit of Amplify Shader, so this might be a mundane/dumb question. I've been searching the internet and came up with very little and thus I thought I would cut to the chase and ask other users or devs of Amplify Shader.

Question: Is there a way to animate the shader's material properties through the animator and not through coding? I know obviously for programmers, this would be the easiest solution however I am an artist and want to keyframe other elements to sync with the shader setting changes.

Your help is greatly appreciated! Thanks in advance.
Yoshinjo
 
Posts: 11
Joined: Tue Mar 20, 2018 8:51 pm

Re: Animate Shader Materials

Postby Amplify_Borba » Wed May 02, 2018 4:06 pm

Hey there, there's no such thing as mundane questions, we're always happy to help!

It's possible to animate values through the animator, but you need to have them set to property first, so that the value becomes available in the properties of the material that uses the shader and can be changed in the material inspector or by script, and then you may add them to your animation through Add Property.

PropertyAnimate.jpg
PropertyAnimate.jpg (147.73 KiB) Viewed 3102 times


Please let me know if this helps, 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: Animate Shader Materials

Postby Yoshinjo » Wed May 02, 2018 7:42 pm

Hey Borba,
I appreciate the fast response! I probably should have been more explicit about what I'm trying to do.. Basically I want to have a UI image with a material shader attached to the image and be able to animate the properties through the animation editor. As far as I know (from my internet research and tinkering in Unity) I have been unable to access the material properties in animation, unless I use the process you proposed. For 3D objects this works fine, you can access the material properties through the mesh renderer in the animation editor, but for UI I can't figure out how to accomplish this because you can't access the properties through the animation editor.
Yoshinjo
 
Posts: 11
Joined: Tue Mar 20, 2018 8:51 pm

Re: Animate Shader Materials

Postby Ricardo Teixeira » Thu May 03, 2018 10:31 am

Yoshinjo wrote:Hey Borba,
I appreciate the fast response! I probably should have been more explicit about what I'm trying to do.. Basically I want to have a UI image with a material shader attached to the image and be able to animate the properties through the animation editor. As far as I know (from my internet research and tinkering in Unity) I have been unable to access the material properties in animation, unless I use the process you proposed. For 3D objects this works fine, you can access the material properties through the mesh renderer in the animation editor, but for UI I can't figure out how to accomplish this because you can't access the properties through the animation editor.


Hello,

Unfortunately, you can't animate UI material properties; this is the case with all shaders, not just with content created with ASE. However, you can create a simple script that feeds values directly into your shader and animate that.

I recommend checking the smear sample, it's a great starting point!

Thanks!
Sales & 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
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm

Re: Animate Shader Materials

Postby Yoshinjo » Thu May 03, 2018 6:25 pm

@Ricardo Teixeira,

Thank you for the reply! I figured this was the case. I need to learn how to code :D I was thinking of an alternative... Basically make the material shader have a input for transition time and animate the game object active/inactive state. I'm playing around with this now (just for expanding my knowledge of shaders, probably not the most efficient, as you said a script would probably be the way to go). Thanks again!
Yoshinjo
 
Posts: 11
Joined: Tue Mar 20, 2018 8:51 pm

Re: Animate Shader Materials

Postby Ricardo Teixeira » Fri May 04, 2018 11:22 am

Yoshinjo wrote:@Ricardo Teixeira,

Thank you for the reply! I figured this was the case. I need to learn how to code :D I was thinking of an alternative... Basically make the material shader have a input for transition time and animate the game object active/inactive state. I'm playing around with this now (just for expanding my knowledge of shaders, probably not the most efficient, as you said a script would probably be the way to go). Thanks again!


No problem, happy to help!

I hope you find a viable solution, in the meantime feel free to use the attached sample as a starting point.

Don't forget to review and rate ASE, your feedback is extremely important to us.

Thanks!
Attachments
UISample.unitypackage
(7.7 KiB) Downloaded 262 times
Sales & 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
Ricardo Teixeira
 
Posts: 954
Joined: Fri Aug 09, 2013 2:26 pm


Return to Amplify Shader Editor

Who is online

Users browsing this forum: No registered users and 52 guests

cron