Is it possible to output a color ramp node in a material to it's own compositor pass?
I need to mask out part of a material which is controlled by a colour ramp, so I can add filters to that specific part of the material only.
Is it possible to output a color ramp node in a material to it's own compositor pass?
I need to mask out part of a material which is controlled by a colour ramp, so I can add filters to that specific part of the material only.
You could try duplicating the entire scene. (Full copy) Then in the new scene change the material duplicate to an emission type, with the output being the grayscale of the color ramp. The new scene is also set to only render an emission pass.
Then in compositing output you can use the main scene for the render, and the duplicate scene's emission output as the masking pass. Not exactly what it's intended for (likely to need some adjustment), but I think this may be workable.
Also on the new scene, you can turn samples way down to speed it up a bit, since it's only being used as a mask.
The solutions was to mix in an emission with a mix shader, but have the factor extremely low so that the emission was imperceptible. Add a pass Id to the material. Then in the compositor use the MatID to mask off just the emission for that object (in case there is other emission in the scene), then multiply the result until the emission is bright, and then multiply the result by the render (so that only the brightly reflective parts get increased). Then subtract the render from the result, to leave just the amplified reflections, add glow to it, and then add it back to the final render.
A matID node which could be used within a material would make life massively easier, but this works.