1
$\begingroup$

I'm making a very particular toon shader, where instead of using a color ramp solely as the color and texture, I'm using the color ramp as a mask between a "light" texture and a "shaded" texture. I'd like them to be colored by the light illuminating them, too, but I can't figure how to get it perfectly flat like the mask itself is. I.e, I want a red light to cast a red tinted version of the "light" texture over the dark texture where the light touches it, and for it to be tinted red the same amount all across.

My graph is set up that a Diffuse BDSF goes through a Shader to RGB which is passed into a constant color ramp and used as the factor for a mix node between the two textures.

I figure I'll have to have a mix node of a sort affecting each individual texture before they are combined, but I don't know how to get the Color of the light affecting the original diffuse, and in such a way that it is clamped into one single color to mix with the textures. Image of node graph as explained above.

Edit:

Here is the effect I have, where the character is Lit correctly but not tinted by the light: Image of character and cube in front of them. There is a red light illuminating them both. The cube is bright red from the light, but the character, while shaded correctly from the light's direction, is not red tinted.

Here is the effect I am looking for, faked by manually tinting the texture a similar color as the light: Image of character and cube again, where the red light hits the character and the character's light texture is shown is manually tinted red.

And here is the kind of effect I'm trying to Avoid where in the "lit" area it is lit like a normal object with smooth lighting: Character in red light but the light texture area is lit normally by the red light, where it is most intense closest to the light and fades away.

$\endgroup$
1
  • $\begingroup$ Hello and welcome. Please don't write in all caps in the title or body of any posts, it is the written equivalent of shouting, is harder to read and may be considered rude. Please use the edit button below the post to change you text into regular case. $\endgroup$ Apr 12 at 21:01

1 Answer 1

1
$\begingroup$

I've used this setup before to get different toon shading based on the colour of lights before! Maybe it can help you find a solution. enter image description here

enter image description here

You could also try adding in a principled BSDF shader after your mix shader and plugging the colour output of the Mix into the colour input of the Principled BSDF, this will let you use your toon shading mix but still use some context from the lights around it! Does affect the whole toon shaded look however so use this as a last ditch effort. Let me know if it works! Posting an image of the particular look you want and the look you currently have might help add context for others as well :)

$\endgroup$
1
  • $\begingroup$ Thank you for responding! I'll try this out and come back to this thread, in the mean time I can edit the post to share the effect I have and a (faked) version of the kind of effect I'm looking for! $\endgroup$ Apr 13 at 21:04

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .