-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Per-material shadow bias #19094
Comments
#18915 should hopefully lead to some improvements in this area without having to tweak individual materials. I think 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. |
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 |
@mrdoob nope, is there an example? |
Instead of moving shadow properties to materials, it's better to focus on #13108. Meaning investigating and introducing new shadow approaches for tweaking shadows (like |
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:
so this is definitely possible.
The text was updated successfully, but these errors were encountered: