-
-
Notifications
You must be signed in to change notification settings - Fork 21.6k
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
Low-alpha transparent objects don't cast shadows even with opaque pre-pass #31661
Comments
The threshold for alpha when using opaque prepass is indeed 0.1, it is found here: godot/drivers/gles3/rasterizer_scene_gles3.cpp Line 4893 in 0985d5f
Opaque prepass is only supposed to capture the opaque parts of a partially transparent mesh, hence the cutoff of 0.1. I am not sure why 0.1 was chosen. Maybe it could be made configurable in the material? |
It does make sense not to render shadows of almost invisible objects, but it would be nice if it was documented or configurable. |
Right now I don't think there is any way to render transparent shadows below an alpha of 0.1. But it should be possible to add a way to configure this threshold. |
Should the alpha scissor threshold stored in the material be reused as the shadow alpha threshold for opaque prepass? We can add another property to the material, but I'd prefer if we reused existing properties when it makes sense to do so. |
This was implemented in #45372 Now you can use a lower threshold by overriding it with alpha scissor |
Godot version:
3.2.dev 6d6d437
OS/device including version:
Linux Mint 19.2 x86_64
Issue description:
Shadows of objects with a transparent material and Opaque Pre-pass enabled disappear when alpha drops below 0.1. In the picture below, on the left, alpha is 0.099 (down to 0), on the right it is 0.1 (up to 1).
Steps to reproduce:
Minimal reproduction project:
TransparentShadow.zip
This project contains a propeller which can spin at high speeds. A MultiMeshInstance is used to instance several duplicates with reduced opacity to create a "volumetric motion blur" effect.
Opacity of each instance depends on the number of instances, a single instance is fully opaque, and 100 instances results in an alpha value of 0.1. Any number of instances above that will cause the shadows to disappear.
While in the editor, the original mesh is visible, setting the PropMat material's alpha to values lower than 0.1 will also exhibit the issue while in the editor.
Unrelated to this specific issue but still about transparency, the picture below shows discrepancies to the rendering of transparent objects when depth draw is set to opaque only (left) or opaque pre-pass (right), should I open a new issue for this or is it expected behavior?
The text was updated successfully, but these errors were encountered: