It currently sits in the light, but as it happens the same value of bias would fix one object in the scene while causing problems for another. How hard would it be to add an optional bias to the material, and will this work for e g #12919
Looking at the code, it is just passed as the uniform parameter, so altering it should not be a problem?

Ok no, looks like those are some different uniforms, for shadow pass or something. It is not on material uniforms in onBeforeCompile :(
It is actually in param.uniforms.directionalLights.value[0]
Ok, so I was able to do this hack:
material.onBeforeCompile = function(stuff) {
var chunk = THREE.ShaderChunk.shadowmap_pars_fragment
.split ('z += shadowBias')
.join ('z += shadowBias - 0.001');
stuff.fragmentShader = stuff.fragmentShader
.split ('#include <shadowmap_pars_fragment>')
.join (chunk);
};
so this is definitely possible.
ideally the user wouldn't have to modify shadow properties per material
ideally I should not set the bias either - I should just enable shadows and have nice shadows. this ticket, however, was born out of the situation that was far from ideal.
ideally I should not set the bias either
Even engines like Unity can't provide perfect shadows automatically. If you closely study how shadow mapping works, it should be clear that manual adjustments are inevitable.
Regarding the feature request itself: I do not vote for supporting shadow properties on material level. Unity also provides shadow bias and shadow normal bias only on lights level. That should be sufficient.
Maybe it should be, but it is not. Unfortunately.
...that said, I do not insist on this feature, as long as the onBeforeCompile is there we can hack any feature we want in. If you do feel like this is too much work for making people lives only so much easier, feel free to close the ticket.
@makc Have you tried the new normalBias?
@mrdoob nope, is there an example?
I don't think so. It's a new property in the shadow.
You can try it in the editor:
shadow.normalBias = 0:

shadow.normalBias = 0.05:
