Skip to content
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

Game using HDR texture fails to load it when exported (texture_format/bptc defaults to false) #73789

Closed
telmotrooper opened this issue Feb 22, 2023 · 6 comments · Fixed by #73829

Comments

@telmotrooper
Copy link

Godot version

4.0.rc3.official [7e79aea]

System information

OS: Arch Linux, CPU: i7-3770, GPU: Radeon RX 570

Issue description

Simple project using HDR texture as PanoramaSky exported to Linux crashes when opened. Might or might not be related to #73627 and #61948.

Output displayed in the console when opening the exported game:

Godot Engine v4.0.rc3.official.7e79aead9 - https://godotengine.org
Vulkan API 1.3.235 - Forward+ - Using Vulkan Device #0: AMD - AMD Radeon RX 570 Series
 
ERROR: Unable to open file: res://.godot/imported/casual_day_4k.hdr-e91263f32fd2699bdb025dc92151c608.bptc.ctex.
   at: _load_data (scene/resources/texture.cpp:846)
ERROR: Failed loading resource: res://.godot/imported/casual_day_4k.hdr-e91263f32fd2699bdb025dc92151c608.bptc.ctex. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:221)
ERROR: Failed loading resource: res://casual_day_4k.hdr. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:221)
ERROR: Can't load dependency: res://casual_day_4k.hdr.
   at: load (core/io/resource_format_binary.cpp:696)
ERROR: Failed loading resource: res://.godot/exported/133200997/export-3070c538c03ee49b7677ff960a3f5195-main.scn. Make sure resources have been imported by opening the project in the editor at least once.
   at: _load (core/io/resource_loader.cpp:221)
ERROR: Failed loading scene: res://main.tscn
   at: start (main/main.cpp:2954)
ERROR: 2 RID allocations of type 'N10RendererRD12LightStorage11ShadowAtlasE' were leaked at exit.
ERROR: 1 RID allocations of type 'N10RendererRD12LightStorage15ReflectionAtlasE' were leaked at exit.
ERROR: 1 RID allocations of type 'N10RendererRD14TextureStorage12RenderTargetE' were leaked at exit.
ERROR: 2 RID allocations of type 'N10RendererRD14TextureStorage7TextureE' were leaked at exit.
ERROR: 1 RID allocations of type 'N18RendererCanvasCull6CanvasE' were leaked at exit.
ERROR: 1 RID allocations of type 'N16RendererViewport8ViewportE' were leaked at exit.
ERROR: 1 RID allocations of type 'N17RendererSceneCull8ScenarioE' were leaked at exit.
WARNING: 4 RIDs of type "Texture" were leaked.
     at: finalize (drivers/vulkan/rendering_device_vulkan.cpp:9301)
WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
     at: cleanup (core/object/object.cpp:1982)

Steps to reproduce

Try to export the provided project.

Minimal reproduction project

New Godot 4 Project.zip

@Calinou Calinou added this to the 4.0 milestone Feb 22, 2023
@Calinou Calinou added the crash label Feb 22, 2023
@Calinou
Copy link
Member

Calinou commented Feb 22, 2023

Did you export the project using headless mode? There's a known issue with VRAM-compressed textures not being exported if exporting using --headless --export.

@telmotrooper
Copy link
Author

@Calinou No, directly from the Editor.

@clayjohn
Copy link
Member

The errors look suspiciously similar to the errors in #73267 which was closed as a duplicate of #72856 which was fixed by #73286

@akien-mga
Copy link
Member

I could reproduce the issue, which is caused by the export preset having texture_format/bptc set to false.

Setting it to true fixes the issue (note that in RC3, the import for the .exr file is extremely slow - this is fixed in RC4 by #73715.

The option should probably default to true, at least until we have a proper detection mechanism that lets users know that they are actually using BPTC and should therefore enable export it.

I'm not sure what's the purpose of this export preset option in the first place though. It should export what it needs.

@akien-mga akien-mga changed the title Game using HDR texture crashes when exported Game using HDR texture crashes when exported (texture_format/bptc defaults to false) Feb 23, 2023
@akien-mga akien-mga moved this from To Assess to In Progress in 4.x Priority Issues Feb 23, 2023
akien-mga added a commit to akien-mga/godot that referenced this issue Feb 23, 2023
This is now required after godotengine#72031 when using HDRs.

Could have further cleanup as I think these import options may not be needed
at all anymore, and etc/etc2 support doesn't seem to make much sense.
Likewise, the hardcoded "s3tc" in `get_platform_features` could maybe be
removed. But this is material for after 4.1.

Fixes godotengine#73789.
@akien-mga akien-mga changed the title Game using HDR texture crashes when exported (texture_format/bptc defaults to false) Game using HDR texture fails to load it when exported (texture_format/bptc defaults to false) Feb 23, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in 4.x Priority Issues Feb 23, 2023
@Regrad
Copy link

Regrad commented Feb 24, 2023

The bug is still present in the RC4 version. Importing an uncompressed HDRI texture solves the problem.

@akien-mga
Copy link
Member

akien-mga commented Feb 24, 2023

Yes, it's mentioned in the RC 4 blog post with the workaround: https://godotengine.org/article/release-candidate-godot-4-0-rc-4/#known-issues

The fix was merged after RC 4.

JeffVenancius pushed a commit to JeffVenancius/godot that referenced this issue Mar 3, 2023
This is now required after godotengine#72031 when using HDRs.

Could have further cleanup as I think these import options may not be needed
at all anymore, and etc/etc2 support doesn't seem to make much sense.
Likewise, the hardcoded "s3tc" in `get_platform_features` could maybe be
removed. But this is material for after 4.1.

Fixes godotengine#73789.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants