I really love this outline it gives a very neat effect even with a flat unlit material!
01 - Get the shadow information: I used a dot product between the world normal and the directional light direction. I also added parameter to change the offset and sharpness to have better control!
02 - I used this information as a mask to lerp a texture with a white color to have the hatching only in the shadows.
I used triplanar mapping because its more convenient for this example. If you use it, don't forget to change the triplanar parameter to object space!
03 - I multiplied a color to the result to get a Base Color for the material.
I also multiplied the shadow information the result so I can have a slightly darker color where the hatching are!
04 - Use the dot product you made at first and create 2 new parameters to control offset and sharpness to create a 2nd mask!
And then use this mask in a lerp with a highlight color!
(for the screenshot I created new nodes for the dot product, use the one from step 01)
05 - I multiplied 2 maps after the highlight : a hatching detail map and a mask. The mask erase some of the details.
The bottom multiply is linked to the dot product highlight mask, so details will also be erased in highlights!
Again I used triplanar mapping for convenience.
06 - To this last multiply you can also link an other detail mask.
For this one I choose ink spots!
07 - Back to the beginning of the graph I added a fresnel and used it to erase the shadow mask on the sides, to create a rim light.
08 - Finally I used this fresnel as a mask in a lerp to add a rim light color to the final results!
The first dot product mask is used to attenuate a bit the rim light color when it's in the shadows.
FINAL - Here is the full graph image of the shader if you want to have a look !
Even though some stuff can probably be optimized I'm quite happy with the results 🙌
• • •
Missing some Tweet in this thread? You can try to
force a refresh
just to show a bit more of my shader, it's not just a texture I created specifically for the hollow knight model! It works on any kind of 3D model : I blend 3 different textures that I mask with the lighting and other parameters 🖌️