Is it possible to create an "unshaded" material which still receives shadows from other meshes?

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By NoelAlbinson

I am working on a small game where most of the world is unshaded to create a simple Untitled Goose Game-like art style. I am wondering if it is possible to make the player, seen in the pictures below, darken in the spots that are blocked from the directional light source.

The player in sunlight

I have tried some toon shaders and have experimented with writing my own shaders, but as you can see in the next image this results in ugly self-shadowing.

Any and all help on the matter would be greatly appreciated!

( I found THIS POST from a person a while back that seems to have solved this problem, but he never explained how )

Did you try to add a pass to your material and uses “shadow to alpha” + blend mode to “mul”? Might be the way to go…

frankiezafe | 2020-07-03 17:59

Thank you for your reply! I tried your solution and it works great for shadows cast from other meshes. But I am still having a problem with the player mesh casting ugly shadows upon itself… The only simple solution I can think of is if it is possible to make a shader ignore shadows from specific materials or nodes.

Any more advice would be awesome!

NoelAlbinson | 2020-07-04 08:35

I apologize for bumping an old thread, but I’m having the same issue and searching led me here. Did you ever find a solution for this? Any documentation or tutorials that can point me in the right direction?

sprout.byte | 2023-03-08 15:01

:bust_in_silhouette: Reply From: BananaBread

Thank you @frankiezafe for the comment.

Did you try to add a pass to your material and uses “shadow to alpha” + blend mode to “mul”? Might be the way to go…

Set your main material to unshaded with your desired albedo color. This gives you the nice color you wanted – but try putting this on the ground. It doesn’t work at all, right.

This is where Next Pass comes in. At the top of the unshaded material, create a brand new material. This will be your next render pass.

On this second one,

  1. scroll down to Shadows and set shadow_to_opacity to true.

  2. scroll back up to Transparency and set the blend_mode to Multiply.