Is it possible to have an object with several material outputs?

Hi there. I’d like to know if there is a way (built in or using an addon) to create a material with multiple outputs or alternatively to assign multiple materials on an entire object. I want the entire object to use several materials (or outputs) rather than have an object with several regions, each one with a single material. Those materials would then be separated in the compositor and combined again, giving more freedom for the final effect compared to simply mixing colores/textures in Cycles nodes with a single output.

Some applications would be the ability to have different colors based on the shading (using the shadow pass to mix 2 or more different diffuse outputs) or the ability to apply a (simple) texture on top of the diffuse pass after doing compositor manipulations on that diffuse pass (while a texture inside the shader would also be affected by those manipulations).

Obviously i’m not interested in physically accurate results with this idea. It would probably be useful for NPR renders mostly. I’d like to do this with Cycles since BI will (most certainly) be dropped from 2.8.

I know a lot of this can already be done purely with the compositor but having some way to “pass” data from the material to the compositor rather than manually enter everything in a giant maze of a compositor graph would certainly help and i don’t think a texture can even be properly UV-mapped in a compositor node since the compositor works in image space rather than object space.

EDIT : I’m open to other options besides materials, such as custom data to store RGB values or Texture references that can be accessed from compositor nodes, but i really have no idea how to use custom data.

Material are assigned per faces
so yes !
but only one output per material!

happy bl

Well, that’s a no actually then

Thanks for the answer.

The only way to do something like that is to have several identical objects and change the material for each one. Then you can also have render layers for each object and use compositing later. You could use the duplicate linked, set the material to be on an object basis instead of mesh data basis, then you don’t have to worry about editing several objects but you’ve got one object and instances of it instead.

No multiple outputs. Cycles can’t mix materials, it mixes shaders and colors, and you could do switching with those by keyframing the mix for each frame, which would correspond to the different material variations you make. Might also want to run Blender with --enable-new-depsgraph parameter to have keyframes and even drivers working in the Cycles material nodes.

The keyframed mix factors could use stepped interpolation modifier in graph editor.

Render layers have material override option. Could use that to get material per render layer.

That doesn’t mean you can’t use Blender Render. All of the versions are still available

Blender Render can have an advantage over Cycles depending on what you’re doing. If you want to mix materials based on light direction, it can do that because it can mix materials, and it has lamp data node that can be used along with normal information. Often used for Cel shading.

It has its limitations but UV pass and UV map node can be used to get textures on objects without rendering again.