Use scene lighting in material nodes for color mixing?

Hi there, I have a pretty simple shader to make some “toon” effects, but it requires the use of a color ramp, so the scene light color doesn’t affect the mesh whatsoever. While I’m at it, I suppose the intensity of the light doesn’t affect the mesh at all either, it’s purely reliant on whether the light exists or not.

I want to use a mix shader to add a slight change in the material depending on the color of the scene lighting, but I can’t seem to figure out a node/way to go about doing this. Secondarily, I’d like to make the light intensity actually matter, but that’s less impossible. Seems pretty simple so hopefully someone can help. Thanks.

i am not sure what exactly you want too archive.but you if you want to mix your colorramp with another color node,then put a color mix RGB node between colorramp output and emission shader.

afaik lightintensitys can not be read, because the closure shader thing,you have no access to it.

but you can play with the lightpath node.for example is shadowray as factor or other factors that can be usefull for your shader.

edit,if you want too mix your emissionshader with another shader,then place a mixshader between emission output and material output node

its important here to select the right node for the work,these are too different mix nodes.the color mix RGB node for colors(yellow sockets),and the mix shader for shader (green sockets)

if you’re using Eevee- which I’d recommend for toon shading anyways-- you can use a 1,1,1 white diffuse BSDF-> shader to RGB -> separate HSV to get the hue and saturation of your lighting. Recombine with combine HSV with a fixed value to nab the light color without nabbing the light intensity (other than the fact that if the light intensity is 0, the color will probably show up as red.)

I want the scene lighting to affect the color of the mesh. If I change the scene lighting to red, no red is reflected on the mesh because it uses only a color ramp and doesn’t account for scene lighting.

I’m sorry, I don’t understand how this gets the scene light color if I’m just using a diffuse node. Could you expand on that please?

If you light a white diffuse mesh with a red light, what color do you get?

the best would be ,you upload a small blend file,so we can have a look at your settings.and maybe post a screenshot what you get now,and what exactly you are missing.

Hello, I have the same concern as Cody38. I had reached almost the same conclusions as you did (except I was using RGB instead of the Hue value)
I would like to have one unique color which represents the overall lighting of the scene.

For instance : with a blue and a pink light, I would want the output to be completly purple.

But I’m facing 2 problems :

  • How can I make the average of the color on the surface of the object ? or blur it enough ?
  • What should I do about the parts that are completely black or white part(here, the shadow), whose hue is red by default ? It would rig the average.

(Edit: please tell me if I’d better have created a new topic. I will move this post)