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
Describe the problem or limitation you are having in your project
We flag shader functions as high-end (only usable from RD backends) or low end (can be used in any backend). If a user writes a shader and includes a high-end function while using the gl_compatibility renderer, the shader editor will provide an error and explain that the function is not supported.
The issue arises for users who develop using an RD-based backend (Forward+ or Mobile) and then export using gl_compatibility (for example if the export to web). The error in that case will arise in the exported project but not in the editor.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
I suggest that we add a project setting like emulate_low_end that make the shader compiler provide errors as if it were using a low end renderer. That way users can author their shaders in a way that will be supported on all devices regardless of what renderer they have selected while authoring.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
I think this could be helpful for cases like those discussed in godotengine/godot#72016 . However, emulate_low_end sounds to me like it would not just show warnings about unsupported features. Perhaps it could be called something more descriptive like shader_editor_show_low_end_compatibility_warnings if that's what it will actually do?
Even better would be if these warnings could also include hints on how to make fallbacks (like making an instance uniform a constant) if possible for the shader in gl_compatibility mode to make it compile there while still keeping the advanced feature in use when supported.
show_low_end_warnings would imho be the compromise name that would not be too wordy (unlike what @lostminds proposed) and better reflect what happens in editor.
Describe the project you are working on
The Godot Engine
Describe the problem or limitation you are having in your project
We flag shader functions as high-end (only usable from RD backends) or low end (can be used in any backend). If a user writes a shader and includes a high-end function while using the gl_compatibility renderer, the shader editor will provide an error and explain that the function is not supported.
The issue arises for users who develop using an RD-based backend (Forward+ or Mobile) and then export using gl_compatibility (for example if the export to web). The error in that case will arise in the exported project but not in the editor.
Describe the feature / enhancement and how it helps to overcome the problem or limitation
I suggest that we add a project setting like
emulate_low_end
that make the shader compiler provide errors as if it were using a low end renderer. That way users can author their shaders in a way that will be supported on all devices regardless of what renderer they have selected while authoring.Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
We could implement it by changing this line:
https://github.com/godotengine/godot/blob/44c0bfc94d81e758b39a8ee43df5915d64200ed6/servers/rendering/shader_language.cpp#L3093
to:
emulate_low_end
would be a variable that is set based on the project setting.If this enhancement will not be used often, can it be worked around with a few lines of script?
No
Is there a reason why this should be core and not an add-on in the asset library?
It requires core changes
The text was updated successfully, but these errors were encountered: