Static Switch without #else

Node-based Shader Editor
Post Reply
mortenblaa
Posts: 1
Joined: Wed Apr 03, 2019 2:57 pm

Static Switch without #else

Post by mortenblaa »

Hi,

Is it possible to use the Static Switch where it only acts as a #ifdef, without the #else part?

What I am trying to do, is to connect a value to the Opacity input, but only when a keyword is enabled. Basically I want the shader to behave as if there is nothing connected to Opacity, when the keyword is not enabled. I know I could just put in a value of 1.0, but it still influences the shader somehow.

I'm trying to make an "uber/mega" shader, which can change the render type.

Thanks!
User avatar
Amplify_Borba
Posts: 1239
Joined: Mon Jul 24, 2017 9:50 am

Re: Static Switch without #else

Post by Amplify_Borba »

Hello, thank you for getting in touch!

Our Static Switch node always creates an #if and #else, so you'll need to specify a default value for the #else, which corresponds to the False port, every time you need to use this node. Unfortunately it won't be possible to change this behavior.
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!
Post Reply