0
$\begingroup$

Question:

Does anyone know if there's a way to have a texture map use multiple colors or a color's values to control the speed of reading the light of a toon shader? For example: When the light reaches the cheek under the eye, and interacts with a certain texture color/value, the light slows down at a certain speed.

I've tried using animation nodes, map range > stepped interpolation, Nodify's shader animation node, and nothing. (No screenshots available since I didn't stick to the many approaches that just didn't work. Like at all). I just can't put my finger on what I am missing, maybe scripts or a particular animation node to texture? I might be totally wrong, but somehow I think it's possible. I just can't put my finger on what it could be.

My approaches that comes close to goal:

  1. Using addons involving editing vertex normals. However, there's issues experiencing distortions when you bend the anatomy or make facial expressions, and splits. Especially if the normals are averaged in one direction.

  2. This node setup for ILM maps is the second closest thing I can think about that can relate to the topic that can be visualized (which I hope to combine it with this question's idea) (VIDEO about ILM Maps). However, unlike ILMs, this questions revolves around the speed of the light. It's the second level to what seen in the video, but in the video when you apply ILM maps it's based on the degree of what is lit and unlit rather than simply paint the numerical timing of when something is lit.

Example appearances

Text

This is my original approach for years. Average normals+smooth edges of the body/face. However, when a character uses a shapekey/deformation, it'll fracture the normal's goals. But notice how the average normals pop on their own time then smoothed until another averaged normals create another poping moment? This is ideal. Sadly averaged+smooth vertex normals don't do well with deformations.

text

This second example is about how to perceive the question. If you take the ILM perspective (noted above) you'll think about masking (grey parts from image above). But if you visualize the red lines, you'll think about time (and can even include the ILM map sections). But if you paint the ILM map where the red lines are, you get portions lit where they shouldn't be because it's focus isn't as dynamic as the question is seeking for.

text

Third example is the visual concept to simplify everything. These color masks could represent a different speed responding to the light. Orange and red represent speed 0.1 and 0.15, base blue represents 0.2, ocean blue under the brow represents 0.001 speed, etc, etc. If anything, one can paint thick lines between each color to make a smooth gradation as seen in the gif example above. Then all a person has to do is paint, look at references, adjust, and find their sweet spot for their ideal anime shading design!

$\endgroup$

1 Answer 1

0
$\begingroup$

I think you're asking about changing the threshold of cell shading. In which case, yes, you can modulate that with a texture. The precise things you'd do would depend on how you're cell shading.

Let's consider the following cell shader, which uses shader-to-rgb to mix between colors on the basis of a diffuse response:

enter image description here

Where could we plug a texture in here? One place we could plug it would be into the diffuse shader that's measuring the light:

enter image description here

By painting part of that texture gray, I've told the shader that I want it to be less responsive to the light-- to adopt a position closer to my color ramp's left margin.

That's not the only place we could plug the texture. Let's try something else:

enter image description here

Here, rather than using the texture to modulate the first pass diffuse, I'm multiplying it into the output, using a MixRGB node set to multiply. (For a grayscale map like this, though, this is exactly the same thing.) And so that I could paint both white and black, to modulate the lighting, I'm using a gray image, then multiplying its value by 2-- so now, my white areas will be biased toward light blue, and my black areas will biased to dark blue, and my gray areas won't do anything different.

Blender does not actually model the speed of light (except via IOR, which is pretty much unheard of in cell shading), but again, I think you're asking about the threshold. If I misunderstood your goal, I apologize.

$\endgroup$
4
  • $\begingroup$ I appreciate the reply. Sadly that's a simpler version of the ILM map linked above... Do you know of any node that involves intensity or a Strength value (like seen in normal map node)? Maybe raycast that responds to each different color in the texture map? I'm learning that raycast is a reliable source when lights are involved. $\endgroup$
    – Marquis
    May 18, 2022 at 22:03
  • $\begingroup$ @Marquis You gotta be more specific in what you want. Nearly every node involves intensity or strength (or color, which can be decomposed into value.) $\endgroup$
    – Nathan
    May 18, 2022 at 22:06
  • $\begingroup$ My apologies. When I say strength/intensity I mean in the context of this topic, responding to light, hence why I mention the normal map node and it's strength value. But maybe it's nothing more than a transparency effect to fade in and out the normal map. I'm pretty new at the detail of some values, sorry. No real source to learn from in my area outside of asking in this forum... $\endgroup$
    – Marquis
    May 18, 2022 at 22:53
  • 1
    $\begingroup$ I understand; most people asking questions are new. What I'd recommend is being more concrete versus abstract. I'd recommend a picture (or animation, if necessary) of what you want, versus what you have. (Pictures you've provided so far are doable witht the technique I demonstrated above.) Providing a file of what you have is usually a good idea as well, because there are going to be variables that you don't yet realize are important. Basically all shader nodes interact with light. That's why we call them "shaders"-- they control how the light gets modulated across the surface. $\endgroup$
    – Nathan
    May 18, 2022 at 23:27

You must log in to answer this question.

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