Compression (Source 1): Difference between revisions
SirYodaJedi (talk | contribs) m (→Dedicated Server FastDL Compression: a 1280-byte RES file doesn't really need to be compressed) |
SirYodaJedi (talk | contribs) (→Texture Compression: fill out section) |
||
| Line 2: | Line 2: | ||
== Texture Compression == | == Texture Compression == | ||
* DXTn | Textures are one of the biggest potential sources of file size bloat. Additionally, higher quality textures can result in increased VRAM usage, which will increase a game or mod's minimum GPU requirements. | ||
* BGR565 | * Most textures should use '''DXT1''' or '''DXT5''' (depending on if they have an alpha channel). While older DXTn compressors introduced a green tint to textures, the modern compressors used in VTFEdit Reloaded and Vtex2 can reliably compress to these formats without noticeable color shift. | ||
* | * If an opaque texture is low-res enough that DXT1 compression artefacts are problematic, consider using 16-bit '''BGR565''' instead of 24-bit BGR888. The quality difference may | ||
* VTF 7.6 | * Formats with more than 8 bits per channel should be reserved for HDR skyboxes and cubemaps only; nobody is going to be able to tell a 48-bit normal map apart from a 24-bit one! | ||
The {{strata|4}}, notably used by {{p2ce}} and {{momentum}}, supports some additional texture formats and features: | |||
* '''BC7''' is much higher quality than DXT1 or DXT5, while maintaining the same GPU footprint as DXT5. This means it can be used where other engine branches would require a BGR565 or BGRA8888 texture. | |||
* '''ATI1N''' is a compressed greyscale format which is half the size of I8. While this is the same size as DXT1, it only has a single greyscale channel, making it superior for greyscale textures like decals using the [[Decals#DecalModulate|DecalModulate]] shader. {{confirm|Make sure the DecalModulate shader actually supports greyscale textures.}} | |||
* '''VTF 7.6''' supports [[Wikipedia:Deflate|deflate compression]]. While this does not reduce GPU footprint, it can greatly reduce filesize on the user's storage device. | |||
== Audio Compression == | == Audio Compression == | ||
Revision as of 17:26, 17 May 2023
Describe importance of compression here
Texture Compression
Textures are one of the biggest potential sources of file size bloat. Additionally, higher quality textures can result in increased VRAM usage, which will increase a game or mod's minimum GPU requirements.
- Most textures should use DXT1 or DXT5 (depending on if they have an alpha channel). While older DXTn compressors introduced a green tint to textures, the modern compressors used in VTFEdit Reloaded and Vtex2 can reliably compress to these formats without noticeable color shift.
- If an opaque texture is low-res enough that DXT1 compression artefacts are problematic, consider using 16-bit BGR565 instead of 24-bit BGR888. The quality difference may
- Formats with more than 8 bits per channel should be reserved for HDR skyboxes and cubemaps only; nobody is going to be able to tell a 48-bit normal map apart from a 24-bit one!
The
Strata Source, notably used by
and
, supports some additional texture formats and features:
- BC7 is much higher quality than DXT1 or DXT5, while maintaining the same GPU footprint as DXT5. This means it can be used where other engine branches would require a BGR565 or BGRA8888 texture.
- ATI1N is a compressed greyscale format which is half the size of I8. While this is the same size as DXT1, it only has a single greyscale channel, making it superior for greyscale textures like decals using the DecalModulate shader.
Confirm:Make sure the DecalModulate shader actually supports greyscale textures. - VTF 7.6 supports deflate compression. While this does not reduce GPU footprint, it can greatly reduce filesize on the user's storage device.
Audio Compression
- MP3
- ADPCM
- Ogg Vorbis?
Map Compression
Dedicated Server FastDL Compression
Source supports FastDL downloads to be compressed using BZip2 (BZ2). The files will be decompressed by the user client after downloading. It is recommended to compress most loose files that are larger than a couple kilobytes (VTF, WAV, MDL, etc). BSP files should be compressed with BZ2 if not already compressed with BSPZIP. MP3 files are already heavily compressed and do not substantially reduce in size from BZ2 compression; BZ2 compression of MP3s or BSPZIP-compressed BSPs may unnecessarily increase user client load times with negligible bandwidth savings.
File System Compression
User-side; last resort
- NTFS compression
- BTRFS compression