Hey! I’m having some trouble here with unity light system! I know it’s a 3d system and 2d support for it is lacking. I’m currently using normal maps for my characters, and I am loving the result so far, the only problem I have right now is that walls don’t block out the light(cast shadows). So I tried adding a 3d cube on the walls with the mesh cast shadows option set to shadows only, so it is invisible anyways. the problem is that sprites are not receiving shadow even though they receive light .
Every sprite has a diffuse shader and in debug mode, I set the receive shadow option to true.
Here is a quick pick of my setup with a normal cube for reference.
Is unity able to manage shadow casting on sprite?
For sprites to receive shadow you’ll need the shader to support Cutout - as this is technically opaque. Transparent shadows are not supported in Unity at the moment.
But cutout should immediately solve it. If you don’t want to use cutout (ie you want gradual transparency) then…
There’s a number of assets which are designed for transparent shadows like Unity Asset Store - The Best Assets for Game Making (inexpensive) or free version here: https://www.assetstore.unity3d.com/en/#!/content/24083
There are others, just I did a quick search for you.
Hey! thanks a lot for the quick answer. I have tried the free version you linked before, but it is not using the unity light system. I would need to use 2 different light system and make them work together smoothly since I use normal maps for characters. This is something I want to stay away from. The cutout might be good, I would draw a wall over a cube so it can cast a shadow on the sprites I guess. the problem is that the wall itself won’t be affected by light since it’s higher, or am I understanding it wrong?
What would a basic setup using cutout be like, I am trying to use a cutout shader on both the caster and the receiver but it is not working
If it isn’t working with cutout you probably made a boo boo somewhere (this is the most common issue) ie didn’t set mesh to cast or receive shadows, or your light or mesh excludes those layers.
Or you’re just using a really crap cutout shader that doesn’t correctly use “RenderType” = “TransparentCutout” tags. Solid geo doesn’t need cutout though.
Just mess about til it works with trial and error. Cutout, if correctly used, will act like solid (opaque) geometry and correctly work with light and shadow.
As for things not having depth, that’s a problem for you to solve ![]()
So what would be a correct setup? having a mesh with a cutout shader, and a sprite with what? the normal diffuse one or one of its custom adaptations? I am sorry, I’m having trouble finding information on coutout shaders and sprites.
Here is my setup!
I am using the unity cutout standard shader, which (I HOPE ahaha) should work. my sprite are using the normal diffuse shader here is the sprite picture
here is the light used!
shadows are enabled in the project and 3d object use them when I test it.
EDIT:the cutout might be the problem, 3d object are not interacting with the cutout wall as well…
Try moving the light around until you see the problem, looks like its all flat to me and has nothing to cast on from it’s point of view.
Here is a picture with a 3d cube unaffected by the wall
when alphacutoff is set to 0, it is receiving
I’m sorry, this thread is turning 3d a bit ahaha I really don’t know what’s going on. maybe cutout is used if you want holes in your mesh that are responsive to the light system? in which case I won’t be able to use them for this invisible wall casting shadow thing. Even in opaque, the shadows are not casting on the sprites,ugh.