godotengine / godot

Godot Engine – Multi-platform 2D and 3D game engine
https://godotengine.org
MIT License
90.11k stars 21.16k forks source link

Godot headless export does not include a png texture that is part of a shader #55711

Open guysoft opened 2 years ago

guysoft commented 2 years ago

Godot version

3.4 stable

System information

windows, linux,html5

Issue description

I have a reproduction project, that when exported via the editor it creates a .import asset for grid.ong and its visible in the exported binary. however, when using the godot headless binary to export it misses that asset and the texture is missing. The issue also happends in the github action in the project which uses the headless build.

I suspect its because its part of a shader.

I have made a repo, that reproduces the issue:

https://github.com/guysoft/godot_import_action_reproduce/issues/1

Steps to reproduce

See: https://github.com/guysoft/godot_import_action_reproduce/issues/1

Use the github action or the command lised in the example project issue

Minimal reproduction project

https://github.com/guysoft/godot_import_action_reproduce

Images and more description: https://github.com/guysoft/godot_import_action_reproduce/issues/1 Pasting here so you can see too: When using the godot editor and running/exporting the scene looks like this. This is the expected result: expected

When using the gihub actions the grid.png is not imported and the scene looks like this. This is the actual result.

How to reproduce in commandline:

Godot_v3.4-stable_linux_headless.64 --export Linux/X11 builds/LinuxX11/Energy-source-linux.x86_64 --verbose

(there is also a windows export that gives the same issue)

This also happens if you export this project using the godot headless script which this github action uses: actual

Binaries are available in the release page from the action: https://github.com/guysoft/godot_import_action_reproduce/releases

rainerweston commented 2 years ago

I've had a bit of a poke around and it seems Godot headless fails to correctly detect imported textures for use as 3D VRAM textures. All textures will have metadata={ "vram_texture": false } and none of the correct import flags are enabled. In the instance above, the texture has been loaded using the standard 2D settings with repeat disabled.

Opening the project once in editor solves the issue. Obviously unideal if you're automating builds through github actions.

godot project.godot --editor --quit seems unreliable and I didn't have much luck with it.

I also tried the solution listed here too but couldn't seem to get it to work: https://github.com/Kersoph/open-sequential-logic-simulation/pull/4

The work around I've found is overriding the texture import options to import everything for 3D. In our instance this is okay as the project is VR but perhaps not a solution for all.

fire commented 2 years ago

Is this fixed by https://github.com/godotengine/godot/pull/56048?

guysoft commented 2 years ago

@fire Is there a way to test it on 3.x? Or is there a way to import the test project in to 4?