guide a noob with shadow and outline shader

HI! Totally new to shaders, I played a bit following a few tutorials and I have no clue how to achieve the following:
( it’s a 2d game, isometric view)
-It’s going to have a lot of trees so I want to display the part of the sprite that can not be seen of a diferent color and probably and outline.
-The shades cast by the sprites should not overlap. i.e. when the player under a tree the shades should not multiply.

I’m just looking for some tips to know where to start.

Thank you in advance

Do you mean you want to show tress through “walls” or when otherwise occluded by something in front of them? It sounds like you want an “x-ray” shader, though a 2d game makes this a little more interesting since 2d games don’t usually do any depth writes which almost all x-ray shaders use. You’re probably going to be a bit more specific about what you’re trying to do, preferably with example images of what you have and approximately what you want.

Fake 2d shadowing is an interesting problem. There should be a couple of threads on the forum for this, and a few assets on the store.

The easiest way I can think of to do this would be using a custom shader with a named GrabPass and BlendOp Min.

The shader would read the grabpass, multiply it by your shadow sprite, and then blend with the scene using BlendOp Min.

You’d have to setup your scene like this:

  • Render all of the ground (the stuff you want shadows to cast on).
  • Render all the shadow sprites using the custom shadow material.
  • Render everything else, like trees.

It makes casting shadows on characters a little harder though.

OK here an image.

So yeah, the first effect I’m looking for is an xray effect. The kids head (on the right) should be shown through the tree tops. To illustrate the second idea we can compare the tree shadows on the bottom left where they blend vs the upper right where they overlap.
I think this is what you where thinking of.

Following your idea for the shadows effect, how do I get to specify which sprites are drawn first?
I guess for now characters could use vertex lighting based on some other info in the scene.