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
If a ShaderMaterial uses a Sampler2d type global shader variable and the material is referenced in a GDscript, then the values of the material's regular shader parameters will get reset to defaults after the editor is restarted.
Note: the GDscript that references the material doesn't even have to be attached to anything.
The material on disk does still contain the parameter info such as an assigned texture, but in the editor the same parameter appears to be blank.
If the .godot folder is deleted, then the material will correctly display the parameter values temporarily but only the first time the editor is launched. Upon restarting the editor again, the parameters are blank again.
The output window does show errors about the global variable being missing from the project settings, even though it's there.
Please see below video in which I demonstrate all of this (with audio):
Global_Var_Bug.mp4
Steps to reproduce
Open the attached project file
Assign a texture and edit the shader parameters of the Mat2_Globals.tres material (assigned to the sphere on the right)
Save and restart the editor
Observe that the values of the parameters on the material are now blank
Godot version
4.0 Beta 12
System information
Windows 10, Vulkan, Nvidia RTX 3060 Ti
Issue description
If a ShaderMaterial uses a Sampler2d type global shader variable and the material is referenced in a GDscript, then the values of the material's regular shader parameters will get reset to defaults after the editor is restarted.
Note: the GDscript that references the material doesn't even have to be attached to anything.
The material on disk does still contain the parameter info such as an assigned texture, but in the editor the same parameter appears to be blank.
If the .godot folder is deleted, then the material will correctly display the parameter values temporarily but only the first time the editor is launched. Upon restarting the editor again, the parameters are blank again.
The output window does show errors about the global variable being missing from the project settings, even though it's there.
Please see below video in which I demonstrate all of this (with audio):
Global_Var_Bug.mp4
Steps to reproduce
Minimal reproduction project
Global_Shader_Bug.zip
The text was updated successfully, but these errors were encountered: