-
-
Notifications
You must be signed in to change notification settings - Fork 21.5k
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
ALPHA and discard in light() have no effect in Compatibility or Forward+ renderers #85370
Comments
cc @clayjohn |
I can reproduce the bug, but not the fact that it would be a regression. With the MRP, the bug is reproducible in 4.2-rc2, 4.1.3-stable and 4.1-stable. |
You're right; that's strange. My 4.1.3-stable project worked fine. I moved the necessary code to |
another thing i am wondering is that, why is alpha a writable variable in |
Instead of for AR, I am drawing shadows onto a glassy reflective plane that is actually just holes in the ground*. Unfortunately, for that purpose, I've found that (* - That's a new shader I wrote since opening this issue, before discovering that this issue breaks that effect in OpenGL too.) |
The doc mentioned it pretty well "To write a light function, assign something to DIFFUSE_LIGHT or SPECULAR_LIGHT. Assigning nothing means no light is processed." ( https://docs.godotengine.org/en/latest/tutorials/shaders/shader_reference/spatial_shader.html#light-built-ins ) Three thoughts :
cc @clayjohn Any thoughts or suggestions ? I'm happy to help if the suggestions are appropriate. |
@jsjtxietian The documentation is misleading and something is wrong, because Can't the other two renderers operate the same way that Mobile does? |
@jsjtxietian It looks like this is an area that needs a lot of cleanup as there is a lot of leftovers from the 3.x era. First of all:
The compatibility renderer should us godot/drivers/gles3/shader_gles3.cpp Line 179 in 0bcc0e9
The usage define for godot/drivers/gles3/storage/material_storage.cpp Lines 1329 to 1330 in 0bcc0e9
Ity should also be removed from the other renderers as godot/servers/rendering/renderer_rd/forward_clustered/scene_shader_forward_clustered.cpp Lines 683 to 684 in 0bcc0e9
godot/servers/rendering/renderer_rd/forward_mobile/scene_shader_forward_mobile.cpp Lines 587 to 588 in 0bcc0e9
There is also godot/drivers/gles3/storage/material_storage.cpp Line 1181 in 0bcc0e9
|
Godot version
v4.2.rc2.official [1ba920f]
System information
Godot v4.2.rc2 - Windows 10.0.19045 - GLES3 (Compatibility) - NVIDIA GeForce GTX 1660 Ti (NVIDIA; 31.0.15.2802) - Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 Threads)
Issue description
Between 4.1.3 and 4.2, something changed so that writing to
ALPHA
in thelight()
function of a Spatial shader has no effect, if using the OpenGL Compatibility renderer. Writing toALPHA
still works in thefragment()
function, or when using a Vulkan renderer.EDIT: I failed to check for this before, but
discard
also similarly does nothing.Here is a comparison of my project in 4.1.3 and 4.2 rc2 (I've already fixed it now by moving things to
fragment()
):Steps to reproduce
ALPHA
to a value lower than1.0
in thelight()
functionALPHA
Minimal reproduction project
min-repro-11-25-23.zip
The text was updated successfully, but these errors were encountered: