How to change Render Type via script?

Node-based Shader Editor

How to change Render Type via script?

Postby 2rawkets » Sat Jan 19, 2019 7:49 am

Hello,

I'm currently trying to create Diablo style fading walls where if the player is obscured the wall fades out so they can see and if the obstruction is no longer blocking then it fades back in.

I understand that I need to use the Transparent render type under the Blend Mode options so that I may access the Opacity.

But what if the Render Type of my shader that is on the pillar or wall is not set to Transparent? Is there a way I can change the Render Type via script to Transparent and add a float node at runtime to change the opacity for when the object is fading out and fading in and then change it back once its fully faded in and remove the float node controlling the opacity?

I've also tried creating an entirely new shader that can be swapped while an obstruction is fading in and fading out but I'm not sure if that is an efficient way to solve this problem.

I'm brand new to using Amplify Shader Editor so please forgive me if I'm going about this a roundabout way!

Thanks!
2rawkets
 
Posts: 2
Joined: Sat Jan 19, 2019 7:33 am

Re: How to change Render Type via script?

Postby Amplify_Borba » Mon Jan 21, 2019 5:10 pm

Hello, thank you for getting in touch and for your support!

There are a few ways to approach this, you could consider using replacement shaders, use a masking solution or just having the walls set as transparent with opacity of 1, then manipulate their opacity value through script according to your needs without using replacement shaders.
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: How to change Render Type via script?

Postby 2rawkets » Mon Jan 21, 2019 10:01 pm

Awesome, thank you for the reply! I'll look into those options!
2rawkets
 
Posts: 2
Joined: Sat Jan 19, 2019 7:33 am

Re: How to change Render Type via script?

Postby Amplify_Borba » Tue Jan 22, 2019 9:27 am

No problem, please let us know if you have any further questions!
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 1 guest