Toggle Normals on/off in Materials

Essentially, I have a scalar parameter that I use for the Normals ‘strength’ control.
When that is set too low it messes with how the material is rendered (<0 values).
So I simply want to use a switch/if that decides whether or not to provide a normal map at all to the Material Output node. (Since just setting it to 0 is a problem)

Problem is, there are no logic switches in Materials from what I saw, is there a way to create a switch that will provide the normal map or will not provide ANYTHING (as if there was no input connected to the normal pin)?

I was thinking of just creating a material function, that takes as an input the scalar for strength and returns a bool for further use to switch between using and not using the normal map… but how does one not provide an input to a connected pin?

1 Like

You can use a static switch, but you can’t change that at runtime.

image

You could expose the normal map as a parameter, and change it to a blank normal?

1 Like

A blank normal?
As far as I am aware you need to have a preview texture selected, and that gets used if nothing is provided (I noticed this since the normal map is a parameter).

image

1 Like

Excellent that’s pretty much exactly the result I wanted, good to know there already exists a texture for that. Thanks!

Also as a side node, I didn’t want to change it at run time, only limit for whoever uses the material not to go into negative/inverted normals territory.

1 Like