Sharder Graph - Texture or slider.

Hi,

So I don’t know if this is possible at all with Shader Graph currently, but I’d like to have it similar to how the standard shaders work, if I don’t have a map plugged into metalness (for instance) I will have a slider to control the value and if I were to plug a map in the slider would disappear/be greyed out/no longer have an effect.

I’m probably just being an idiot as I know there are logic features in there I just can’t seem to get my head around it.

Sorry if this has been answered somewhere else and thank in advance for any help you can offer.

Colin

Got something working, It isn’t perfect but it will do for now. Exposed a Boolean value into a branch node, the user can define if two specific map types are missing now and if they are use a slider to set a value.

As I said not perfect but works for what I am doing for now.

If you don’t want to expose a boolean to the user, I found you can create a custom function node that checks that the dimensions of a given texture are greater than 4x4 (which is apparently the default dimensions if you don’t give it a texture).

This is a cool hack, but I am concerned that dependent texture reads are expensive.
Also, the keyword approach means multiplying variants that need to be compiled and loaded at runtime.
I guess the real solution will be when custom inspectors are supported for shader graph materials, but I would love to see something sooner that doesn’t have a runtime performance impact.