godot
godot copied to clipboard
External shaders saved to `.gdshader` files are not converted by the project upgrade tool
Godot version
4.0.beta7
System information
Fedora 36, AMD Radeon RX 6900 XT
Issue description
External shaders saved to .gdshader
files are not converted by the 3to4 conversion tool. By contrast, shaders that are built-in to a scene are converted by this tool.
Both built-in and external scripts are correctly converted by 3to4.
Steps to reproduce
- Create a Godot 3.x project with a built-in shader on a node, and an external shader on another. In both files, use syntax that will be converted, such as
uniform sampler2D some_texture : hint_albedo
wherehint_albedo
will be converted bysource_color
. - Upgrade the project using the tool in the Godot 4.0 project manager.
- Notice how the built-in shader is updated, but not the external shader.
Minimal reproduction project
Before conversion (3.x): test_project_3.zip
After conversion (4.0): test_project_4.zip
I am also getting no materials in the material slot (now surface material override), so they all have to be manually reloaded. Not sure if this has been reported or not?
I am also getting no materials in the material slot (now surface material override), so they all have to be manually reloaded. Not sure if this has been reported or not?
Please open a separate issue for this, with MRPs pre-conversion and post-conversion included.
CC @qarmin How complex would it be to run the upgrader tool over .gdshader
files as well?
If I remember correctly, conversions already runs on .shader
files and convert them to .gdshader
with some simple renames - https://github.com/godotengine/godot/blob/44c0bfc94d81e758b39a8ee43df5915d64200ed6/editor/project_converter_3_to_4.cpp#L1400-L1416
So problem is with extension .gdshader
.
If this extension is valid in 3.x, then should be added to files that will be checked for conversion here - https://github.com/godotengine/godot/blob/44c0bfc94d81e758b39a8ee43df5915d64200ed6/editor/project_converter_3_to_4.cpp#L2391
Looks like the .gdshader
extension is allows in 3.x, so this should be a simple fix https://github.com/godotengine/godot/pull/49983