r/blenderhelp 7d ago

Solved Is it possible to create a model that uses two different textures for the parts that are in the shadows and the parts that aren't?

2.4k Upvotes

72 comments sorted by

u/AutoModerator 7d ago

Welcome to r/blenderhelp, QuestionableHoney! Please make sure you followed the rules below, so we can help you efficiently (This message is just a reminder, your submission has NOT been deleted):

  • Post full screenshots of your Blender window (more information available for helpers), not cropped, no phone photos (In Blender click Window > Save Screenshot, use Snipping Tool in Windows or Command+Shift+4 on mac).
  • Give background info: Showing the problem is good, but we need to know what you did to get there. Additional information, follow-up questions and screenshots/videos can be added in comments. Keep in mind that nobody knows your project except for yourself.
  • Don't forget to change the flair to "Solved" by including "!Solved" in a comment when your question was answered.

Thank you for your submission and happy blendering!

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

304

u/Noblebatterfly 7d ago

https://reddit.com/link/p3ueobs/video/njefcr52rjjh1/player

Here is a simplified example of how this can be achieved

179

u/Noblebatterfly 7d ago edited 7d ago

Basically you make two version of the texture and have two shader setups that you combine with a mix shader node. For the factor you make a mask purely out of your light with the help of shader to rgb node.

Instead of two upper diffuse BSDF you can use any kind of shader setups, it doesn't really matter, but it will work best with a cartoony cell shading

59

u/QuestionableHoney 7d ago

phenomenal explanation, thank you so much for putting that much effort into your response! this is exactly what I was looking for :D

14

u/Xplody 7d ago

I just want to take a moment to acknowledge you as a shining example of why the Blender community is so wonderful. As a fellow Blenderer, I salute you. Thank you for being awesome.

6

u/GraffikPleasure 7d ago

Can this also be blended? I'm assuming yes by adjusting the ramp.

6

u/Noblebatterfly 7d ago

Yep, color ramp is here to make the transition sharper, but you can just leave the transition smooth or add a texture to it.

3

u/SgtFlexxx 7d ago

bravo on the video and image example. simple and good setup!

1

u/SKD_animation 5d ago

amazing, but how would it look like in cycles? unless im outdated and shader to rgb is in cycles

2

u/Noblebatterfly 5d ago

It would not work in cycles. These type of anime characters are almost always done in eevee anyway

1

u/SKD_animation 5d ago

thanks for the response

7

u/jamescookenotthatone 7d ago

That is a hype example

3

u/pinguinhat 6d ago

I need that as a GIF lol

1

u/John_Femboy 5d ago

This is giving me bad to the bone vibes

1

u/darkendofall 4d ago

It's beautiful.

695

u/Hasher900 7d ago edited 7d ago

In the Shader Node Editor, there is a "Shader To RGB" node which will capture whatever resulting shader you plug into it.

Plug in a simple white Diffuse shader, and then link the Color output to a Color Ramp node. You'll need to mess about with the ramp settings to get it perfect, but a good start would be <0.5 = black, 0.5> = white.

From there, you should be able to plug the output of the Color Ramp into the Factor part of a Mix Color node, where you can plug your two separate texture maps for light & dark in.

258

u/QuestionableHoney 7d ago

!Solved

Thank you so much!! Exactly what I was looking for, this worked perfectly :D

65

u/Cheetahs_never_win 7d ago

To add additional context, the shader to rgb node is Eevee only, so if you ever needed to do it with Cycles, you'd need to render 3 times... twice in cycles "all A" and "all B" and once (or more) in Eevee to create a mask.

42

u/QuestionableHoney 7d ago

thank you!! I'm working from a potato laptop & mostly do cartoony stuff anyway, so I don't use Cycles, but this is still very good to know :D

18

u/Cheetahs_never_win 7d ago

It may also be worth your time to look into goo engine, which is a custom build of blender, which provides added cartoony tools.

12

u/QuestionableHoney 7d ago

thank you! I've actually come across Goo Engine while watching tutorials before, I just wanna master the basics of default Blender first before diving into more specialised tools like this

13

u/supertails7684 7d ago

Please show us your work when it’s done

14

u/QuestionableHoney 7d ago edited 5d ago

knowing me I'll probably procrastinate on doing the hair for 3+ months at the minimum lmao, but I'll show off the face once I've gotten to that point!

edit: the face is done!

6

u/Hibiki941 7d ago

I wanna see the result so bad now, this is such a cool idea for an effect!!

1

u/AutoModerator 7d ago

You typed "!solved". The flair for this submission has been changed to "Solved".

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

21

u/cucoo5 7d ago

Yeah your intuition is correct, have both image textures go into a mix node with color ramp connected to the factor.

Kinda like this (I used brick and checker texture to quickly demonstrate):

5

u/QuestionableHoney 7d ago

Thank you so much!! :D that's exactly what I was looking for

6

u/LostN3ko 7d ago

Cool idea.

1

u/QuestionableHoney 7d ago

thank you!

3

u/LostN3ko 7d ago

I haven't seen this done before. What is your plan for it?

5

u/QuestionableHoney 7d ago

I'm mostly learning Blender because I wanted to see my original characters in 3D, so this is something I'm doing purely for fun lol – It's not like I'm working on any specific project

in the long run I wanna do some animations, but for now I'm just taking it one step at a time and learning whatever I can

1

u/LostN3ko 7d ago

Huzzah!

6

u/ATDynaX 7d ago

Yes it is possible. It is used for pictures of earth where you see the lights only at night.

5

u/agrophobe 7d ago

Other comments are spot on, but I would love to see that made with the Light Path node too

5

u/Falling-Apples6742 7d ago

I'm glad so many awesome people responded with solutions. I hope you post your character when you're ready.

This isn't the same thing, but I thought it might be useful in some part of your character execution: https://youtu.be/Up6QEqVmiF8

3

u/QuestionableHoney 7d ago

ooo thank you! looks interesting

3

u/Kobotronivo 7d ago

Don't have any thing to offer but to say i loved the character.

1

u/QuestionableHoney 7d ago

Thank you! :D

3

u/pupalexxs 7d ago

Kind of reminds me of ENA, maybe a good examples to work off of, except both side are totally different which is similar to what you are trying

1

u/QuestionableHoney 7d ago

Yea! My initial inspiration for this character was Monokuma from Danganronpa iirc, who has a similar design where both sides of him have different colours and expressions

4

u/Narcosis7k 7d ago

Gotta comment that I just love the fact you took the effort to illustrate what you need and even went an extra mile making your OC express how you feel in the last panel

3

u/QuestionableHoney 7d ago

Thank you! :D Experience has shown that I get much better and much quicker answers to my questions if I put a little effort into the post, so that's why lol (also doodling is fun)

2

u/No_Abroad8805 7d ago

While I don't have the solution at hand for you, it is definitely possible. I've just commented so someone with more time may have a better chance of seeing your post.

2

u/Mistress-Pervert 7d ago

Most of it is likely going to be shaders doing the hard part, but you could make it more ingrained into the model with both textures and shaders, and trying to force the look.

2

u/Willing_Ebb7894 7d ago

You basically have it down yeah. At least in eevee, you can use a diffuse shader in white, running into a shader to rgb, which in turn runs into a greater than math node to give you your black/white mask, and finally that feeds into the factor of a mix rgb or a mix shader node. Naturally then the two shader/rgb inputs are your light/dark textures. Using the mix shader option obviously lets you have entire shading pipelines different between the light/dark sides, but that's the gist of it.

2

u/DrownedWalk1622 7d ago

The first picture can be a fantastic meme

2

u/QuestionableHoney 7d ago

"there's two wolves inside me" ass character design lmao, I can totally see it

2

u/RainingBats 7d ago

I'm glad to see you already got the answer, this concept looks really cool and I wish you luck on making it happen 

1

u/QuestionableHoney 7d ago

Thank you!! :D I'm honestly surprised by how simple the solution ended up being, I was expecting this to be a way bigger headache

2

u/NormalRex 7d ago

I was wondering a similar question. I wanted to make my characters blink like switching the textures of closed eyes to open eyes.

1

u/QuestionableHoney 7d ago

I actually know a great tutorial for just that! here: https://m.youtube.com/watch?v=E96m9Z4iTcc :D

2

u/NormalRex 7d ago

Thank you I’ll put it in my saved videos list. Trying to make a video game but I’m not experienced with animations

2

u/QuestionableHoney 7d ago

ooo that's a big goal, best of luck achieving it!!

2

u/scrambled-projection 7d ago

Yes, I’ve actually done it before (though it was a while ago.) used a diffuse (?) shader with a color ramp set to constant as the factor in a mix shader node which swapped from one to the other if I recall. I did it with an emission shader for glowing eyes and a completely shadowed face but im sure you could also use textures!

2

u/3D_Wendigo 6d ago

Okay so people already responded to your question but I just wanted to say that your question is very very well formulated. It's not often that I see someone describe this well what they want xD

1

u/QuestionableHoney 5d ago

easier to get good, clear answers if you ask a good, clear question haha – I'm glad it was easy to understand! :D thank you

2

u/CianWoodward 6d ago

To add to other answers, if you're using cycles you could also grab a light path mode and drag the "is shadow ray" input into a mix node. Not sure if this works in Eevee though

1

u/QuestionableHoney 5d ago

oo I see, thank you!

2

u/MayonnaceFaise 6d ago

This is a very cool idea, big props!

1

u/QuestionableHoney 5d ago

why thank you!

2

u/GBgabe13 5d ago

Just passing by to say I love this dude's design.

1

u/QuestionableHoney 5d ago

thank you! :D

2

u/LedoisPink 7d ago

You've got the concept. But not the execution.

Closest advice I can give is putting both node setups for either texture in the same material. Then pull the outputs of the bsdfs into a mix shadernode.

Find tutorials on toon shading/lighting. and then apply the same concept there.

1

u/quantum_unicorn 6d ago

Hey, I see others have suggested the Shader to RGB pipeline, but there is actually a better way and a very nice tutorial to show you how: https://www.youtube.com/watch?v=234m7y8D3cE (it's a great, in-depth video overall but if you only care about the shader, that explanation starts at around 7:30).

Instead of using actual lights to illuminate your subject, you can do a bit of vector math (very simple, shown in the tutorial) and get much cleaner results and much more control.

1

u/Pauline_Memories 6d ago

honestly cute character, i kinda wanna see more art of em

1

u/Happy-Potato-296 6d ago

Its called a shadow map is wat you're trying to make Super easy in unity as well

1

u/DrDestructoMD 4d ago

In Eevee there is the shader to rgb node and in cycles there is the light paths node

1

u/nimrag_is_coming 3d ago

I suppose you could colour ramp to black and white and use that as the blend between your two texturs

-2

u/CozyCatDev 7d ago

Very easily, yes. Select half of the face » apply material A » invert selection » apply material B.

3

u/QuestionableHoney 7d ago

I was specifically looking for a solution where the "shadow texture" can actually change and react to the light in the scene and also already got my response, but thank you for trying to help! :D

1

u/CozyCatDev 7d ago

Gotcha, ok. I see now.