I have hard shadows on an outdoor scene - distance is only 80, four cascades, High-res and still I have issues.
I need a very low bias to get rid of gaps between objects and their shadows (i.e hat and face).
But when bias is virtually 0 artifacts appear on the terrain (although not very close up - perhaps a mip-map or cascade issue).
Is this always the trade-off or is Unity not using the best shadow-map method?
(I have one directional light casting the shadows)
This is a problem for any shadow mapping algorithm: too large bias, and casters are “disconnected” from receivers (called “peter panning”). Too small bias, and surfaces start to self-shadow themselves (called “shadow acne”).
There’s no really good solution to this, except for “try to somehow make your scene/artwork to minimize the artifacts”. For example, maybe bake ambient occlusion for the character, so that the disconnect between hat head is not visible since it will be inside AO anyway?
Shadow caster shader usually comes from a fallback, e.g. see “shadowcaster” pass type in VertexLit shader. Shadow receiver shader part is generated automatically when compiling a surface shader; you can see the code that it generates by using “#pragma debug” in the shader and inspecting shader output.
I’m suffering shadow panning/acne problem too.
It isn’t natural enough to use artwork workaround.
I’ve searched for days to get the solution for this but in vain.
Please let me know more detailed workaround for this.
Thank you for the answer. But it doesn’t look natural and can’t handle the light direction change.
I’d like to know how other games like 2K baseball series solves this problem.
They seem to fix this issue.
Of course they fixed the problem, do you know what kind of resources 2K Games has? Sorry, but I don’t think Unity is at that point yet, but I’m pretty sure soon enough we’ll be looking back saying “…remember when Unity couldn’t do that?”
Thank you for the reply. But I never said “Unity can’t do this”.
I’m surprised everyday by the unity’s power and flexibility.
I know of course they can. But time matters.
What I’m gonna do is making AAA games like 2K series using Unity3D.
I just need it now because this is critical to my project.
This is still an issue.
As I’m using low poly graphics without textures I can’t just “change the artwork”
Also, for some reason it’s only a problem with soft shadows (hard shadows are ok but don’t match the aesthetic).
I can’t believe that it’s been over 5 years and this is still a problem…
a bit late but the only solution for us currently is to add geometry where the problem occurs. in every house the roof makes this error so we added a mesh to the prefab and set it to shadow only in some cases or separated the geometry in various meshes so to spread them in different draw calls ( that seems to be the problem calculating the shadow of edges of a big single entity). hope it helps
also Ambient occlusion is irrelevant to us, it draws only near edges, not on their shadows
Any better solution to this now in 2019? Still a problem 8 years later. Particularly seems to be a problem when a character is on a reflective surface or with multiple light sources.
And this is the problem with Unity. If you are starting a new project DO NOT use any render pipeline. Them being labelled as production ready is a blatant lie and probably wont be for a year. It doesn’t even support shadows for point lights yet…
HDRP isn’t production ready yet by any means, not until we get the option to make our own master nodes. Or until the documentation on manually coded shaders is actually made. Until that point, it’s a neat little demo, nothing more.
I see you need custom lighting. I’ve been doing that for a while actually in URP and HDRP. That’s what emission node is for. You can completely ignore Unity’s own lighting then. In my case I use a little of both Unity’s and my lighting.
Is there something stopping you in some way? Please make a new post if that’s the case.
I’ve locked this thread as it’s being pulled in different directions. Be sure to make a new thread for your own issues in a relevant graphics sub-forum.