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

ResourceImporterLayeredTexture mismatched compress options #42043

Closed
arccoza opened this issue Sep 14, 2020 · 5 comments · Fixed by #42045
Closed

ResourceImporterLayeredTexture mismatched compress options #42043

arccoza opened this issue Sep 14, 2020 · 5 comments · Fixed by #42045

Comments

@arccoza
Copy link

arccoza commented Sep 14, 2020

Godot version:

3.2.2

OS/device including version:

N/A

Issue description:

In a recent update the 'Lossy (WebP)' compress option was added to the importer options for ResourceImporterLayeredTexture, but neither the compress enum nor the _save_tex function were updated to match.

The option is added in get_import_options on this line.

But the enum doesn't have that option.

Nor does the _save_tex method.

We've now got a mismatch, where choosing Lossy WebP in the importer UI actually generates Video RAM textures, choosing Video RAM generates Uncompressed, and Uncompressed errors.

UI Option Actual Option
Lossless (PNG) Lossless (PNG)
Lossy (WebP) Video RAM (S3TC/ETC/BPTC)
Video RAM (S3TC/ETC/BPTC) Uncompressed
Uncompressed Errors

Steps to reproduce:

  1. Select a texture to import as a TextureArray or Texture3D
  2. Choose Video RAM compression
  3. Check the .import folder for the generated platform specific textures

Minimal reproduction project:

ResourceImporterLayeredTexture mismatched compress options.zip

@arccoza
Copy link
Author

arccoza commented Sep 14, 2020

There are two ways to fix this: The quick and easy way is to remove the Lossy (WebP) option. The longer way is to actually add lossy compression to the enum and _save_tex method. Which would be preferred?

FYI the importer in 4.0 is quite different, but does include lossy compression.
Also missing from 3.2.2 if lossy is wanted is an option to set the quality of the compression.

@akien-mga
Copy link
Member

Removing the extra option should be the way to go for now.

@akien-mga akien-mga added this to the 3.2 milestone Sep 14, 2020
@arccoza
Copy link
Author

arccoza commented Sep 14, 2020

Ok, would you like a PR against 3.2? It's a very small change.

@akien-mga
Copy link
Member

Yes, that would be great :)

arccoza added a commit to awkwardpolygons/godot that referenced this issue Sep 14, 2020
akien-mga added a commit that referenced this issue Sep 14, 2020
…r-options

Fix #42043, mismatched compress options in ResourceImporterLayeredTex…
@akien-mga
Copy link
Member

Fixed by #42045.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants