- Home /
Inaccurate shadows from objects close to each other
I'm having problems getting the shadows in my scene to look correct. I have a set of meshes that I use as basic level geometry (imported as .blend from Blender) with prop objects and a player character added at run-time.
The main problem is that shadows don't seem to work properly when objects are too close. Zero player shadow when the player is running on the ground, and objects that are stationary (or at least moving at the same speed, objects in parent-child relationships, etc.) have improper shadows.
I've tried turning the quality settings as high as possible, which makes everything look sharper but does nothing to fix the basic shadow problem.
I've been fiddling with the light settings to no avail.
Some images to show the problem... Image 1. See how the shadows of the crystal protrusion prop aren't accurate? The base casts no shadow, with only a section of the top of the crystal seeming to cast any shadow. It gets better as I raise the object away from the level geometry, but obviously by this point I'm getting accurate shadows at the expense of the level layout making any sense or looking as it should. Eventually the shadow is perfect, but the object is floating way off the ground. The player is fairly small compared to these props and casts no shadow on the ground at all, at least not until he is about 3/4 times his height from the floor.
This may be a simple problem to fix but I've exhausted all the options I can think of. Any help would be greatly appreciated.
Answer by jameskyle · Sep 29, 2013 at 05:20 PM
I found an answer to my question so I'm posting it here to mark it as solved.
It turns out the bias property on the light was way too high. I'd put it that high to avoid the self shadowing on the geometry but at such a high level it was offsetting the shadows from the meshes causing them. Pulling it down to a near-zero level fixed this.
Here's a few links to the source of my answer...
Answer by Inkinsarto · Sep 26, 2013 at 04:46 PM
I discovered a similar issue with my player not displaying a shadow at all. But when I built the project and ran it on a desktop, it worked perfectly. Would this help for you?
Sadly this hasn't helped. The shadows seem to be the same in the Windows x86_64 build as it is in the editor. I don't have any time to work ion it today but I'll see if I can figure it out tomorrow.