Ive done the above but still dont see shadows? any ideas?
edit: All i have is two sprites, a directional light, and a terrain. I see no shadow casted by the sprite on to the terrain, but the terrain itself has shading.
edit: turns out my shadow distance in the settings was too low!
It worked Trial, and thanks! Right now I’m trying to get it to cast on an invisible plane though, because my sprites ‘face’ at an angle (like isometric, but not so much). I need the shadow to basically start from their legs not bottom of the feet (otherwise they look like they are floating). I was looking at this shader, and it works on OSX but doesn’t on iOS:
[quote=“trialforce, post:7, topic: 599284, username:trialforce”]
Did it work? I’m glad I can help.
[/quote]
I won’t say it doesn’t work, but still despite the fact I’ve done everything according to instructions, it does not.
Do you know what’s the problem? Shadows cast only on 3D objects, but not on 2D sprites.
I’ve placed an
Object sprite
Cube
Background sprite
As you can see (pic related) Object’s shadow is only on the cube.
Every element has it’s cast/receiveShadow On (I’ve turned it on in the Inspector Debug mode). Spotlight has enabled shadows as well.
I would appreciate any help
P.S. I have no transparency on any of my PNGs, but they are still semitransparent.
Put it in a script attached to the sprite, in the Awake() or Start() callback. You need to enable the shadows via code since it isn’t exposed in the editor.
Hi, you can set shadow receiver/caster even without script. If you click on small menu icon in almost top-right corner (next to pad lock) and select Debug then you can set both these properties:
You should use a cutout shader if you want to receive shadows. Because transparent pass cannot due to being rendered after geometry pass for sorting purposes. It’s a well known common issue with GPU design.