Any kind of "color key" node set-up?

Hi all.

I’ve been wondering if anybody has figured out a way to create a node group or set-up that targets specific colors of your material and allows for greater control over said color.
For example, if I have a bunch of procedural textures linked together to make a multi-colored material, are there any ways to pick out specific colors from the material afterward and swap its fac or hue, etc…

I’m still learning Blender as we speak, and I’m almost certain this kind of option isn’t possible, but it never hurts to ask.

Thank you.

You probably need to look at compositor for that type of thing.

Grrrrrrrrrrr

If I’m not misunderstanding the question, what you describe should be possible but not trivial.

For instance, if you had a set of procedural textures that generates a mosaic with 12 colors that you have plugged into your diffuse shader, you can definitely take that same output and check for matching a specific color. One method to do that - almost certainly not the most elegant - might look like:

  • Create an Input node for the “target” color. Split this into RGB.
  • Split your generated texture output into RGB as well.
  • Set a “tolerance” value that defines how close the texture has to be to the target color
  • For R, G, and B channels use math nodes to check if the texture is greater than target-tolerance and less than target+tolerance
  • Set up Multiply nodes to combine all of the above checks. If any are 0 it will return 0.
  • That final output can now be used as a factor for any transformations you want to do on your texture.

However, if you want to color-key the final render, then moony is correct and it has to be done in compositor.