-
-
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
Shader no longer supports 1f, 0f ... float literal syntax #59316
Comments
Is Using |
Looks like it's not supported by glsl. Although I wonder why it was working fine before. |
I think I've fixed that syntax in #55623. I also think that it should not be returned. |
This results in a breaking change... fine for 4.x but seems unnecessary in 3.x. I mean if someone needs to strictly enforce the specification shouldn't that be up to them, considering the long history of this being valid syntax? I know Godot "loosely" follows semantic versioning but that's a lot of broken shaders |
Well, it's very simple to fix the old projects. |
I think it's fine to keep this change as long as it's mentioned in the 3.5 changelog. Fixing old shaders can be done with |
I understand your concern, if we could easily backport the warning system in shaders, this would have been better implementation as a warning in 3.5 and an error in 4.0
Yes and no. Our goal with Godot is that the same code runs on all supported platforms. We don't expect that users know the GLSL spec, accordingly, we need to ensure that shaders that ship with Godot projects will actually run on all target devices. Without this change, there is a risk that users will write shader code that breaks randomly on some devices. While that wouldn't necessarily happen frequently, it would be very hard to debug for many users. At the time of merging, the cost of updating shaders appeared to be outweighed by the risk of shaders breaking randomly for some users. On the other hand, I understand how frustrating it is for a tool to suddenly decide that something that was valid is no longer valid. If it helps, previously we only allowed the Since it sounds like you have a project in development, could you please let me know approximately how much effort is involved with updating your shaders? My intuition is like Calinous above, that this can be fixed up with some regex pretty quickly, but if it is a difficult and labour intensive process for most users then we may want to rethink the error. |
and strictly compatible with GLSL! godotengine/godot#59316
and strictly compatible with GLSL! godotengine/godot#59316
I agree that the shader language should be 'correct' IMO more complicated method which transforms 0f to 0.0 inside the godot shader code would be ideal for 3.5, with a breaking change in 4.0 (but that would be adding complication etc and may not be trivial). My challenges when updating shaders is that shader code can appear (sometimes embedded) in a few different file types (.shader, .tres, .tscn) so 'write a regex' is not as trivial as it sounds.. I agree it's worth it to be correct in this case, even if there's only a small chance of a driver rejecting shader compilation due to this issue. It's extremely important to me to avoid any errors that only appear at runtime on diverse hardware. |
I just upgraded from 3.4.2 to 3.5 and hit this issue. While it was inconvenient for my shader code to break I would rather be compatible with GLSL given what I'm trying to do on my project. That said, I think it would be worthwhile to add this to the list of known issues for 3.5. After all, the known issue list on the announcement page states:
It would have been nice to know up front what I was in for instead of having to Google around to find out what happend. |
Done. |
Thanks @Calinou. If there is a way to ensure it gets put on future v3 releases as well (v3.5 rc1, v3.6, etc) we should probably do that too. |
This is not a "Known issue", it's an intentional change. It should be added to the CHANGELOG in the "Changes" section, not as a regression in the release notes. "Known issues" are either regressions that we found out before the release and couldn't fix, or that we found out after the release and which are critical enough to be mentioned in the release notes. This is not a regression but a breaking change. |
I put it in the "Removed" section so it's more prominent as compat breaking, and not just behavior changing. Fixed by #65459. |
Thanks for the clarification @akien-mga . It's better to have it in a more permanent place. I can't see it in the removed section for 3.5. Does the change log need to be regenerated or something? |
The changelog in the blog post is separate from the CHANGELOG.md file, which is being edited by #65459. |
… shaders Fixes godotengine#59316. (cherry picked from commit 968af50)
@Calinou Can you please drop a link about the changelog you are referring to? I'm expecting to see it in either this curated changelog or this chronological changelog but I can't. I want to ensure that as I take on new builds I know up front what issues I'm going to have with my project. |
https://github.com/godotengine/godot/blob/3.5/CHANGELOG.md This was committed by the PR linked above 2 days ago, it can't be retroactively added to the 3.5-stable tag from August without rewriting the whole Git history. |
OK great. Thanks folks. |
If someone want a Regex for this I used:
The sequence is important. |
I don't think these regexes are correct, what you want to replace is: |
Godot version
3.5 beta2
System information
Windows 10, GLES3
Issue description
Shader no longer supports 1f, 0f ... float literal syntax.
produces error:
error(16): Invalid (float) numeric constant
Steps to reproduce
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: