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

Add warning about export missing BPTC texture format (or change export settings) #7230

Closed
lostminds opened this issue Jul 7, 2023 · 4 comments · Fixed by godotengine/godot#88325

Comments

@lostminds
Copy link

Describe the project you are working on

A 3d game exported to multiple platforms, with VRAM compressed textures

Describe the problem or limitation you are having in your project

I'm not familiar with the details, but it seems that in 4.1 some things changed under the hood regarding compressed VRAM textures and the resource loader. For desktop there is a project setting that should be enabled (there's a nice warning for it) to enable S3TC/BPTC textures, and it seems that if you check the "high quality" checkbox on the texture import settings it will be compressed using BPTC, otherwise S3TC.

The issue is that in the export settings for Windows and Linux you can enable/disable BPTC and S3TC texture exports separately (not on macOS exports though?).
Screenshot 2023-07-07 at 12 12 13
And previous to 4.1 I think the default was that S3TC was enabled and BPTC disabled, and this worked fine. At least that was the export settings I had configured and used in 4.0.x previously.

However, if you try to export in 4.1 to windows without BPTC enabled in these settings the game will crash on launch if you have any textures with the "high quality" import option enabled. There will be a lot of logged errors (see example below) about the resourceloader failing to load the textures with "high quality" checked in the import settings shown scrolling by very fast for a second before the game crashes and it disappears.

Screenshot 2023-07-07 at 12 26 01

In other words, an export configuration that worked in 4.0.x will now produce a result that crashes on launch in a way where it's pretty difficult to understand what is going wrong.

There could very well be some sort of bug here as well, as it's at least not handling the missing texture formats very gracefully. But I'm not sure of this, so I'm putting this as a proposal to make it easier to configure the exports correctly, instead of handling the incorrect configuration better.

Describe the feature / enhancement and how it helps to overcome the problem or limitation

At least add a warning about not having both BPTC and S3TC enabled, and perhaps an error on export time if you have textures with the high quality setting set and S3TC/BPTC enabled in the settings.

Or perhaps if they will now always be used together make the export setting a single checkbox for both S3TC and BPTC like the project setting.

Or, even better maybe not have this export setting for texture formats at all, and just let the export destination and project settings control what texture formats are included in the export so the user can't make mistakes.

Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams

Just show the warning if S3TC is checked but not BPTC as this may cause problems.

Output an error to the log during export if a texture is encountered that is BPTC compressed but BPTC is not enabled in the export settings.

If this enhancement will not be used often, can it be worked around with a few lines of script?

No

Is there a reason why this should be core and not an add-on in the asset library?

It's export configuration settings

@lostminds lostminds changed the title Add warning about export missing texture format (or change export settings) Add warning about export missing BPTC texture format (or change export settings) Jul 7, 2023
@clayjohn
Copy link
Member

clayjohn commented Jul 8, 2023

This is the result of an underlying bug. The export options here actually make no sense. Godot doesn't even use ETC textures anymore (it uses ETC2 and ASTC). The export options should match the project settings. I.e. S3TC_BPTC + ETC2_ASTC.

That being said, IIRC, we left them like this to avoid compatibility breakage, but clearly just leaving them as is wasn't enough to maintain compatibility

See godotengine/godot#73829

@lostminds
Copy link
Author

The export options here actually make no sense.

Ah, yes, I suspected as much though I didn't know for sure. Changing them to be S3TC_BPTC + ETC2_ASTC like the project settings would be better. But is there even a reason to have this setting? As it's a setting available only on linux and windows, is there ever a reason to enable the mobile (only?) formats ETC2_ASTC or disable the desktop formats S3TC_BPTC?

@clayjohn
Copy link
Member

clayjohn commented Jul 9, 2023

Yes, certain desktop platforms support ETC2_ASTC and ETC2_ASTC are much better formats in general.

@cedahl
Copy link

cedahl commented Nov 3, 2023

Seconding this proposal. The same thing happened on my team's project - this export configuration, which worked in 4.0.x, suddenly stopped working after upgrading to 4.1. A simple warning on export would have saved several hours of investigating.

Ideally, we would have seen a warning in the export log for every resource that may fail to load due to the texture export settings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment