-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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 parameters specified in the inspector are not included when exporting a project in headless mode #66842
Comments
Git bisect indicates that this bug was introduced in commit ef17c46. |
It seems like shader parameters get lost when scene files are converted to binary during export. A workaround is to disable 'convert text resources to binary' in the project settings. |
I've had the same problem, I changed the default params of the shader to reflect what I wanted directly in the shader file.
For future reference, this option is under Editor -> Export, you need to activate the Advanced Settings switch. |
I spent a lot of time investigating this tonight It seems like this code is problematic in headless mode: godot/editor/export/editor_export_platform.cpp Lines 742 to 773 in 4dcf2c5
My working theory (as a total godot codebase noob) is that when we instantiate the node in headless mode, certain things (i.e. shader parameters) are ignored since they're unnecessary. This makes sense when we're running the game, but not when we're exporting. I plan to continue working on this issue, but I figured I'd leave some notes here for myself and anyone interested. |
I think I've narrowed down the problem, but I'm not really sure what a good impl for a fix looks like here. godot/scene/resources/shader.cpp Lines 117 to 121 in a7276f1
This function gets called in the path of exporting now, which, in headless mode, ends up calling this function:
Since the headless rendering server doesn't keep track of shader parameters, they get lost when we instantiate the tree. |
Can confirm that the issue is still present in 4.0.3 and the workaround still works. |
Fix shader parameters specified in the inspector are not included when exporting a project godotengine/godot#66842
I think it needs to be reopen. |
Reproducible in 4.4 dev 3 so basically this makes CI/CD build kinda broken for my environment, any updates on this? |
@jupiterbjy Do you have a new MRP for testing? (or @Tichau?) I can't reproduce the issue with 4.3 using the MRP from the OP. |
@clayjohn Not mre yet but have proof here which I'm making as part of company work: So ground tile there is simple shader that has instance parameters for grid cell size, and as you see one with so TL;DR instance param still seems to be broken. I'll try making MRE in free time, sorry I can't directly show you code of this haha |
Our team is currently experiencing this issue as of 4.3 binary release: CapsCollective/sunflower#45 Setting |
So it looks like both instance uniforms and global uniforms are missed when doing a headless export. It should not be too much work to add them to the dummy rendering server as well |
Godot version
4.0.beta2.official.f8745f2f7
System information
Void linux
Issue description
When exporting a project using
--headless --export-pack
, any shader parameters/uniforms specified in the inspector are not included in the exported project. All shader parameters are reverted to their default values (or null).Steps to reproduce
Project setup:
Export without
--headless
option:Export with
--headless
option:The behavior can be reproduced on Godot 4.0 alpha 16 through Godot 4.0 beta 2.
Minimal reproduction project
ShaderParameterHeadless.zip
The text was updated successfully, but these errors were encountered: