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

Exclude unsupported textures from Pico packages #586

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

felipeerias
Copy link
Contributor

Pico devices use PNG files to paint their skybox.

This PR adds a filter to exclude unsupported textures (KTX format) from Pico packages.

Unfortunately, "ignoreAssetsPattern" (Gradle) only supports a basic syntax so we have to list each individual file name.

This is a partial fix for issue #522.

Pico devices use PNG files to paint their skybox.

This PR adds a filter to exclude unsupported textures (KTX format)
from Pico packages.

Unfortunately, "ignoreAssetsPattern" (Gradle) only supports a basic syntax
so we have to list each individual file name.

This is a partial fix for issue #522.
@felipeerias
Copy link
Contributor Author

Removing these unused KTX files makes the Wolvic package 7 MB lighter.

Including all the textures: 114.6 MB.

pico assets including ktx

Excluding the unused textures: 107.2 MB.

pico assets excluding ktx

@felipeerias
Copy link
Contributor Author

This PR removes the need for #537

@svillar
Copy link
Member

svillar commented Mar 29, 2023

I don't think we want to follow this path. We should ideally only use KTX textures. We added the PNG ones as fallback and I'd very much prefer to keep that status.

I know you invested a lot trying to make them work, but perhaps the issue is that the non-SRGB versions were incorrectly generated. I remember that I had a lot of issues creating them with the proper size, IIRC I could not even use the compression tool that we have in the sources and had to use another external tool. Perhaps that's the way to go.

@felipeerias
Copy link
Contributor Author

@svillar It seems that the textures for the "cyberpunk" environment are different from the earlier ones for the "wolvic" environment.

  • Textures for the "Wolvic" environment:
❯ ktxinfo negx_srgb.ktx
Header

identifier: «KTX 11»\r\n\x1A\n
endianness: 0x4030201
glType: 0
glTypeSize: 1
glFormat: 0
glInternalformat: 0x9275
glBaseInternalformat: 0x1907
pixelWidth: 1024
pixelHeight: 1024
pixelDepth: 0
numberOfArrayElements: 0
numberOfFaces: 1
numberOfMipLevels: 1
bytesOfKeyValueData: 0

No Key/Value data.

Total data size = 524288
  • Textures for the "Cyberpunk" environment:
❯ ktxinfo negx_srgb.ktx
Header

identifier: «KTX 11»\r\n\x1A\n
endianness: 0x4030201
glType: 0x1401
glTypeSize: 1
glFormat: 0
glInternalformat: 0x9275
glBaseInternalformat: 0x1907
pixelWidth: 1024
pixelHeight: 1024
pixelDepth: 0
numberOfArrayElements: 0
numberOfFaces: 1
numberOfMipLevels: 1
bytesOfKeyValueData: 0
The KTX 1 file pHeader is invalid:
  it has invalid data such as bad glTypSize, improper dimensions,
improper number of faces or too many levels.

So this is something that we should fix.

Nevertheless, there might be something else going on because the older textures also use the wrong colors.

Both the sRGB textures (GL_COMPRESSED_SRGB8_ETC2) and the RGB textures (GL_COMPRESSED_RGB8_ETC2) look like this:

picoSkyboxFiles branch GL_COMPRESSED_RGB8_ETC2 texture

Configuration: RGB textures, GL_COMPRESSED_RGB8_ETC2

However, what is really weird is that the screenshot with sRGB textures looks correct 😨

picoSkyboxFiles branch

Configuration: sRGB textures, GL_COMPRESSED_SRGB8_ETC2

@svillar
Copy link
Member

svillar commented Apr 7, 2023

Yeah, I understand they're different because I used different tools to generate them from the PNGs. The older ones used a tool which is in the sources, but that didn't work when generating the ones for cyberpunk so I had to use an alternate solution (don't remember which one right now)

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

Successfully merging this pull request may close these issues.

None yet

2 participants