These artifacts also show up, it may has to do with the same problem (the pants, the blocks on the armor is due to a low shadow quality setting, as this model is made for a mobile game):
I have been trying to fix this by letting Unity generate a lightmap for my character model, but that doesn’t seem to fix the problem. I tried making changes to the model so the head doesn’t touch the head, but that also sadly doesn’t fix it. I also tried changing the Bias of the light, and setting it to 0 fixes this issue, but creates a lot of other artifacts in the scene that are not desirable.
This is the only light in the scene:
I know this is a complicated issue that probably has to do with either my lighting setup or my 3D model, but does anyone know what the problem is and how I can fix this? I would be very grateful.
Yep. Basically you have to play with the bias until you get as close as you can get without other artifacts showing up. If you look at a lot of AAA games you’ll see this same problem show up (albeit much less obviously so).
For example, Fallout 76:
Notice the line of sunlight across his forehead? Or the lack of shadowing at the point the shirt color and jacket overlap? Fallout 76 has comically thick hats, in part so they fit on a large variety of heads & hair, but also to minimize that shadow biasing artifact.
But, okay, that’s Fallout 76. What about a really high quality single player game? Like Red Dead Redemption 2?
This is an official screenshot used for the game’s marketing. Notice anything odd on the woman’s forehead just below the hat where here hair is?
Or the ear in this image?
RDR2 uses state of the art shadow mapping, and still has the problem.
Technically the problem has been fixed in the past. Crysis 2 used a technique called screen space self-shadowing, and there’s a few assets on the store that do this, but they’re expensive to render.
Wow, this was not the kind of answer I expected at all, but that’s really, really interesting! The screenshots you posted really suprised me, especially the ones from Red Dead Redemption 2. Thanks, I’ll go tinker with the bias, and if that doesn’t work, I will look for some kind of graphics hack (maybe disable shadow casting on the head, but still make it cast on the rest of the scene, I think that will look good enough becase the lighting in my game won’t be that dramatic).
Alright, I got it working as I want! I decreased the bias to 0.02 (that works best for my situation). I fixed the other artifacts I had on the hat by adding some more geometry so shadows can be mapped better.
Here are my results:
As you can see, there is a small band that’s a little bit lighter, but I don’t want the bias to be 0.