my first impression of it made me thought that it wasn’t static.
the static switch generates two permutations, and only executes one branch. but maybe the “if” node executes both and the condition could be a dynamic value. like the other “if” node with the A-B comparison.
Can only be static as there’s no way to make a dynamic boolean parameter in UE (to my knowledge at least). If you try to create one you’ll find that it’s just a static boolean exposed to the material instance and can’t be set at runtime.
Now, I thought perhaps you could use a custom node to return a boolean value and use that as the input, but it doesn’t seem to work either. Custom nodes can only return floats and material attributes and just using a 1/0 didn’t work. (plus I guess what good would it be if you had to use a custom node for it? At that point you may as well just stick the if statement in the custom node)… So I took a look at the generated code;
I’m not sure what the material preshade buffer is, but this definitely isn’t an “if”, and it’s just throwing away the nodes inputs so it doesn’t matter what you plug into it. I can only assume it’s broken, this is the first I’ve seen this node so I don’t even know how long it’s been in the editor, might be some relic from the UE3 days.
The material editor has a bunch of strange nodes that don’t make any real sense, dynamic branch is another one; It’s not a dynamic branch at all, it’s just the regular if node (which is a ternary op) in a trenchcoat.