Skip to content

Conversation

@Calinou
Copy link
Member

@Calinou Calinou commented Mar 24, 2025

This performs a compression step for textures that have the VRAM Compressed, VRAM Uncompressed and Basis Universal compression modes.

This usually reduces file size for each compressed texture by a factor of 2, without affecting the memory taken by the texture after it's loaded. This can make for significantly smaller PCK sizes and therefore faster downloads.

Additionally, for image pixel formats that cannot be VRAM-compressed (such as HDR + alpha), this allows having some form of storage compression to reduce file size by a potentially much larger factor.

This can be disabled in the Project Settings if having the fastest possible import/load times is desired, at the cost of larger PCK sizes.

Testing project: test_vram_compress_lossless.zip

Preview

Using the testing project linked above.

.godot/imported folder size

Before After
36,355,412 bytes 29,468,402 bytes

Exported PCK size

Before After
36,365,088 bytes 29,478,096 bytes

Individual file sizes in .godot/imported

Before

Image

After

Image

This performs a compression step for textures that have the VRAM Compressed,
VRAM Uncompressed and Basis Universal compression modes.

This usually reduces file size for each compressed texture by a factor
of 2, without affecting the memory taken by the texture after it's loaded.
This can make for significantly smaller PCK sizes and therefore faster
downloads.

Additionally, for image pixel formats that cannot be VRAM-compressed
(such as HDR + alpha), this allows having some form of storage compression
to reduce file size by a potentially much larger factor.

This can be disabled in the Project Settings if having the fastest possible
import/load times is desired, at the cost of larger PCK sizes.

Co-authored-by: BlueCube3310 <53150244+BlueCube3310@users.noreply.github.com>
@BlueCube3310
Copy link
Contributor

Some backwards-compatibility system should probably be backported to 4.4 (maybe 4.3 also?) for reading disk-compressed textures, or at least throwing an error when encountering one. Currently, many compressed textures load properly, but are visually corrupted due to using the raw data

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Compress textures with storage compression on import to reduce .godot/ folder and exported PCK size

3 participants