1
$\begingroup$

I'm making a shader for people that relies heavily on the ability to take incoming light and use it as a way of blending 2 materials. For Eevee, it works perfectly. Take a diffuse shader, plug it into a shader to RGB, and go to town using it as a mask for all sorts of things. It works just as intended. So that half of the shader is done.

Unfortunately, as far as Cycles is concerned, it doesn't work. Shader to RGB isn't supported at all (which is understandable). So I'm after a solution to this problem. Like the post says, is there any way in Cycles to take incoming light, and turn it into a black and white mask to blend things?

I should specify that it shouldn't rely on drivers from the lights, or baking. Ideally I want this shader to be plug and play without requiring any real tweaking from the end-user apart from messing around with the shader parameters.

I'm sure there's some halfway-functional roundabout way of getting some kind of light mask out of Cycles. It doesn't have to be a perfect solution either, even something that approximates it would be decent enough. Any help would be greatly appreciated.

I've taken a look at these two answers:

How can I mix two materials based on incoming light

I want to mix Cycles shaders based on self shadow

And they seem like they'd do the job, but it doesn't seem like it would work with multiple lights, won't work with indirect light (which isn't a huge dealbreaker), and seems kind of involved a process to expect for an end user of the shader.

As said before, any help would be appreciated, and the result doesn't have to be perfect. I realize I'm asking something that's generally considered "impossible" as far as cycles is concerned, but I do think there's some way to get something working. Even if it's a bit hacked together.

$\endgroup$
  • $\begingroup$ blender.stackexchange.com/questions/86775/… $\endgroup$ – Duarte Farrajota Ramos Oct 21 at 12:35
  • $\begingroup$ Would you be willing to do it in compositing? $\endgroup$ – Leander Oct 27 at 16:12
  • $\begingroup$ No. "Ideally I want this shader to be plug and play without requiring any real tweaking from the end-user apart from messing around with the shader parameters." Making the end-user set up a bunch of extra compositing nodes and probably another whole scene wouldn't work. $\endgroup$ – AxiomDes Oct 28 at 20:23

Your Answer

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

Browse other questions tagged or ask your own question.