1
$\begingroup$

since you can't have multiple override material per renderlayer, I need to create one material that assigns different nodes depending on the ObjectID. At the moment I use a combination of 'mix' nodes with 'greater than' nodes driving the blend value. enter image description here This setup assigns colors for IDs 11-13 and renders everything else black. I would rather have a switch node where I plug in an integer at the top, and having color or material inputs for each number. Does such a thing exist? (Also could I use a custom attribute instead of ObjID? ...but that should probably a seperate question...) thx

$\endgroup$
  • $\begingroup$ I think the closest thing to a pre-built switch node would be the ColorRamp node, but it's only good for RGB, not image textures. By the looks of it, you're looking at matching values (object ids) with image textures and I haven't seen any node type that allows for a) pairing up values with image textures and b) allow for a variable number of inputs (which is what a "switch" node would need.) $\endgroup$ – Patrick Marchand Jun 9 '16 at 21:47
4
$\begingroup$

Since there is no switch node, I just created groups of the setup that I did earlier (switch shader and switch color). It's limited to 10 inputs, but that should be enough for what I'm doing...otherwise I will extend it. But a real switch node where you can set any number of inputs would be great...just sayin... enter image description here

$\endgroup$
1
$\begingroup$

I asked an almost identical question a few days ago, and came up with my own node group. Instead of using comparisons, it uses Mix Shaders (but could easily use MixRGB nodes instead) and Subtract nodes (this works because the Mix shader clips its Fac input).

mix-shader-multiplexer

Unfortunately, extending it requires editing the node group, but it's mostly just copy/paste, so it shouldn't be too bad. (You don't have to edit the numbers in the Subtract nodes at all.)

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.