Page 1 of 1

How to change Render Type via script?

PostPosted: Sat Jan 19, 2019 7:49 am
by 2rawkets
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!

Re: How to change Render Type via script?

PostPosted: Mon Jan 21, 2019 5:10 pm
by Amplify_Borba
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.

Re: How to change Render Type via script?

PostPosted: Mon Jan 21, 2019 10:01 pm
by 2rawkets
Awesome, thank you for the reply! I'll look into those options!

Re: How to change Render Type via script?

PostPosted: Tue Jan 22, 2019 9:27 am
by Amplify_Borba
No problem, please let us know if you have any further questions!