Node question: "Lightpass is indirect diffuse but not reflection" etc

I like to split some material values via nodes.

Goal is to get the diffuse indirect light passes and the reflection passes.

Tried various things but did not get it so far.

I am after something like:

  • if it is a Diffuse pass greater 0 (this seems to be indirect light) do something;
  • but if it is a Reflection pass do something else;
  • if it is a Direct diffuse pass (this seems to be pass 0) do again something different.

I mainly want to mix shaders with different color saturation values with this.

Is that possible?

Maybe this will help: passes.blend (704.0 KB)

The cube has a blue material for which I’ve set the pass index to 1 (in the Material tab/Settings). The sphere has a yellow metal material with a pass index of 2. I’ve enable MaterialID in the RenderLayers tab. I’ve also enable the Diffuse Direct/Indirect/Color and Glossy Direct/Indirect/Color passes in the RenderLayers tab. You cant do this per material, but you can use the MaterialIDs to separate them in the compositor

In the compositor currently the GlossyDirect pass goes to a HSL node, with an IDMask set to 2 (the sphere’s material ID) used as fac input so any adjustments will only affect the sphere.

Alternatively render the image as OpenEXR Mulitlayer and open it in image editing software. When I did this there’s a little dropdown under the file type that says codec and I changed it from zip to none. I don’t know if this is necessary but I could open the resulting file in Krita as a layered image.

Interesting, thanks for that. I will have a look. Anyway opened the Compositor yesterday for the first time (noob with Blender). The intel denoiser node did a great job in that.

Would it be possible to catch the passes in the shader editor directly with material nodes?. I understand the node setup for catching individual Lightpasses (e.g. “is direct pass 0”, “is camera pass” etc. but I am struggling in setting up a logic like “is diffuse indirect but not reflection”.