You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Windows 10, Compatibility, NVIDIA GeForce GTX 1050 Ti (528.24)
Issue description
Setting the blend mode to something besides mix behaves the same as mix. This is the same whether is a ShaderMaterial or a StandarMaterial3D.
I think this should have been fixed by #75968 unless I misunderstood the PR, and it does seem to be included in this version (4.1 dev1). It does work if you set the Depth Draw Mode to Never though.
Steps to reproduce
Add a MeshInstance3D with a mesh of any type
Add a StandarMaterial3D
Set the blend mode to add (or any other than mix)
It won't work unless you set the depth draw mode to Never
Tagged as "good first issue" for clarity, this is a good first issue for someone with a little bit of OpenGL experience
Calinou
changed the title
Blend mode besides mix doesn't work in GL Compatibility renderer (3D)
OpenGL: Blend mode besides mix doesn't work unless Depth Draw Mode is set to Never
Apr 27, 2023
Calinou
changed the title
OpenGL: Blend mode besides mix doesn't work unless Depth Draw Mode is set to Never
OpenGL: Blend modes other than Mix don't work unless Depth Draw Mode is set to Never
Apr 27, 2023
This is a good first issue :) I was able to determine the problem by comparing the OpenGL renderer with the forward mobile and forward clustered renderers. It seems that the following was omitted in OpenGL's set_code(const String &p_code) function for BLEND_MODE_ADD, BLEND_MODE_SUB, and BLEND_MODE_MUL:
uses_blend_alpha = true; //force alpha used because of blend
I'll have a PR to fix this issue soon, but will need to go over the contribution guidelines first.
I have noticed that the OpenGL Subtract blend mode doesn't work no matter what other draw modes are selected. This appears to be because it was using GL_FUNC_REVERSE_SUBTRACT instead of GL_FUNC_SUBTRACT. I will include this fix in my PR as well to address all of the "Blend modes other than Mix don't work" cases.
The OpenGL renderer has always used GL_FUNC_REVERSE_SUBTRACT, but it looks like the other new renderers in Godot 4 use BLEND_OP_SUBTRACT instead of BLEND_OP_REVERSE_SUBTRACT. I'll open a different issue to discuss this inconsistency between renderers.
Godot version
v4.1.dev1.official [db13026]
System information
Windows 10, Compatibility, NVIDIA GeForce GTX 1050 Ti (528.24)
Issue description
Setting the blend mode to something besides mix behaves the same as mix. This is the same whether is a ShaderMaterial or a StandarMaterial3D.
I think this should have been fixed by #75968 unless I misunderstood the PR, and it does seem to be included in this version (4.1 dev1). It does work if you set the Depth Draw Mode to Never though.
Steps to reproduce
Minimal reproduction project
BlendAdd.zip
The text was updated successfully, but these errors were encountered: