-
-
Notifications
You must be signed in to change notification settings - Fork 21.8k
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
Adding a uniform starting by '_' in a shader breaks rendering #12880
Comments
If |
Looks to me your problem start here: Thats hardly a Godot issue, seems OpenGL itself doesn't like you starting variable names with an underscore. I guess Godot could automatically rename things that are reserved or maybe detect them in editor an already highlight that you can't use that name... |
Is because Godot adds a |
My shader is valid GLSL, Godot made it wrong, and didn't highlight it to me anyways, so I think it's either a bug or at least bad UX :p |
Ah, now the double _ makes sense. So the first _ is your code and the second is added by Godot. Yeah its not something people will grasp. I never used snake case before I started working in Godot so I never ran into this :) |
Still reproducible in 3.0 stable version Apparently Godot renames variables adding Godot uses 3.3 GLSL version. This citation is from GLSL 3.3 specification (page 13):
And from 4.4 (page 22) it stop being treated as an error:
I think that godot should add just However, apparently the error only happened on Windows to me. Linux version is fine. (why?) |
This issue also affects VisualShaders as some variables in the auto-generated code have a leading underscore. |
Cherry-picked for 3.0.7. |
Godot 3.0 alpha2
Windows 10 64 bits
nVidia 940M
Repro:
The log is spammed by this:
It took me some lucky scrolling to find out that the issue was only caused by the '_' at the beginning of my uniform.
The text was updated successfully, but these errors were encountered: