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
When using the combination of the Oren-Nayar diffuse model and the Vertex Lighting flag, SpatialMaterial shaders fail to compile. This appears to be a simple case of a missing identifier, as the shader attempts to access diffuse_color which does not exist in its current scope (but diffuse does). I believe this bug may have been around for some time (years even?) but the combination of options is likely rare enough to not be used in that combination very often. scene.glsl:215 in 3.x
I have a s/diffuse_color/diffuse PR one-liner ready if you'd like, but I'll wait for the go-ahead from maintainers as the guideliness prefer PRs for the main dev branch and this appears to be a 3.x-specific issue.
I did try to get things up and running in 4.x dev, as the GLES3 scene shader there has the same code, but it appears that Oren-Nayar is no longer a diffuse mode option in 4.x since #45023 and thus that codepath is likely never hit by the preprocessor in 4.x. #49418 was the only similar reference I found, but I believe that was around forward-porting it into the new shaders for 4.x.
It then proceeds to spam the following line into eternity:
drivers/gles3/shader_gles3.h:432 - Condition "!version" is true. Returned: -1
Steps to reproduce
Create an OpenGL ES 3.0 project.
Create a 3D Scene.
Add a MeshInstance with any primitive type.
Add a SpatialMaterial to the Mesh or MeshInstance, and set the following properties on the material:
Parameters/Diffuse Mode: Oren Nayar
Flags/Vertex Lighting: On
At that point the mesh no longer renders and has a pure black unshaded surface. The Output should show the relevant shader compilation errors.
Any other combination of the 4 Diffuse Modes and the Vertex Lighting flag appear to be fine. I don't believe that any other flags or parameters are involved in this but in my reading of the preprocessor directives I certainly could have missed something.
Godot version
3.5-beta1
System information
MacOS 12.1, AMD Radeon Pro 5300M 4GB, GLES3
Issue description
When using the combination of the Oren-Nayar diffuse model and the Vertex Lighting flag, SpatialMaterial shaders fail to compile. This appears to be a simple case of a missing identifier, as the shader attempts to access
diffuse_color
which does not exist in its current scope (butdiffuse
does). I believe this bug may have been around for some time (years even?) but the combination of options is likely rare enough to not be used in that combination very often. scene.glsl:215 in 3.xI have a
s/diffuse_color/diffuse
PR one-liner ready if you'd like, but I'll wait for the go-ahead from maintainers as the guideliness prefer PRs for the main dev branch and this appears to be a 3.x-specific issue.I did try to get things up and running in 4.x dev, as the GLES3 scene shader there has the same code, but it appears that Oren-Nayar is no longer a diffuse mode option in 4.x since #45023 and thus that codepath is likely never hit by the preprocessor in 4.x. #49418 was the only similar reference I found, but I believe that was around forward-porting it into the new shaders for 4.x.
Screenshot w/bug, 3.5-beta1:
Screenshot w/shader patched 3.5-beta1:
Compilation log:
It then proceeds to spam the following line into eternity:
Steps to reproduce
Parameters/Diffuse Mode
:Oren Nayar
Flags/Vertex Lighting
:On
At that point the mesh no longer renders and has a pure black unshaded surface. The Output should show the relevant shader compilation errors.
Any other combination of the 4 Diffuse Modes and the Vertex Lighting flag appear to be fine. I don't believe that any other flags or parameters are involved in this but in my reading of the preprocessor directives I certainly could have missed something.
Minimal reproduction project
3.x repro with all Diffuse Mode x Vertex Lighting combinations, as in the screenshots in the description (sorry about the typo in the project name, should be
s/Nayer/Nayar
😢 )The text was updated successfully, but these errors were encountered: