- Home /
What's causing these strange shadow bugs?
I'm currently writing a prototype voxel engine, and I'm using Unity's default Directional Light to do shadows, but I keep getting strange shadow bugs on the edges of some voxels that look like this:
My best guess as to what's causing this is the directional light's X rotation axis not being exactly 90 degrees due to this bug, but I'm not honestly sure if that's what is causing this strange issue.
What is causing this, and how do I fix it?
This appears to be your standard shadow bias imprecision. Not much to do to help that. Take a peek at the documentation here:
http://docs.unity3d.com/$$anonymous$$anual/ShadowOverview.html
Basically TL;DR version is that each surface that casts a shadow actually starts casting the shadow just a tiny bit further away from itself (rather than immediately) to avoid heavy self-shadow artifacts.
Try toying around with the Bias value, see if it helps somewhat.
I don't see anything annormal, just simple shadows. Where is the error?
Seriously, i don't see any error. Just normal shadows in the marked area. Are you talking about the very little "brilliant" risks in the corner of the squares?
I think it may be a texture glitch or just a reflection miss in the directional light, but i don't know if it's possible to fix this and how. =C
It's difficult because they are a $$anonymous$$or bug in the cubes. If they WERE cubes, it would just be a shadow bug that could easily be fixed, but the problem is that they ARE in the cubes and it's in a specific area, rather than the entire prefab.
What? Eudaimonium already explained what the issue is: shadow bias imprecision.