Skip to content
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

MODEL_NORMAL_MATRIX documented for fragment shaders but not present in GLSL #85586

Closed
itsybitesyspider opened this issue Dec 1, 2023 · 0 comments · Fixed by #86000
Closed

Comments

@itsybitesyspider
Copy link

Godot version

4.2

System information

Godot v4.2.stable.mono - Windows 10.0.22621 - Vulkan (Forward+) - dedicated AMD Radeon RX 6600 XT (Advanced Micro Devices, Inc.; 31.0.22011.4008) - AMD Ryzen 9 5900 12-Core Processor (24 Threads)

Issue description

I wrote a 3D fragment shader using MODEL_NORMAL_MATRIX, which is documented as one of the builtins available in fragment shaders.

(https://docs.godotengine.org/en/stable/tutorials/shaders/shader_reference/spatial_shader.html#fragment-built-ins)

The shader does not show any error within godot, however when I tried to run the project, I see this:

E 0:00:01:0437   _compile_variant: Failed parse:
WARNING: 0:81: '' : all default precisions are highp; use precision statements to quiet warning, e.g.:
         "precision mediump int; precision highp float;" 
ERROR: 0:2342: 'model_normal_matrix' : undeclared identifier 
ERROR: 0:2342: '' : compilation terminated 
ERROR: 2 compilation errors.  No code generated.

  <C++ Source>   servers/rendering/renderer_rd/shader_rd.cpp:294 @ _compile_variant()

(As an aside, the value I actually wanted was MODELVIEW_NORMAL_MATRIX which is not documented to be supported in fragment shaders at all.)

Steps to reproduce

Make a 3D fragment shader that uses MODEL_NORMAL_MATRIX and try to run the project that uses the shader.

Actual: Godot gives the above error. Observe that the shader editor does not show any error. Also observe that the documentation says that this should work.

Expected: The feedback from the shader editor, the documentation and the actual behavior should all match.

Minimal reproduction project

model-normal-matrix-demo-project.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants