Преглед изворни кода

Merge pull request #179 from defold/basisu-doc-fixes

Added documentation about Basis Universal texture compression
Mathias Westerdahl пре 4 година
родитељ
комит
672480d391
1 измењених фајлова са 24 додато и 27 уклоњено
  1. 24 27
      docs/en/manuals/texture-profiles.md

+ 24 - 27
docs/en/manuals/texture-profiles.md

@@ -17,7 +17,9 @@ The processing of textures is configured through a specific texture profile. In
 
 Since all available hardware texture compression is lossy, you will get artifacts in your texture data. These artifacts are highly dependent on how your source material looks and what compression method is used. You should test your source material and experiment to get the best results. Google is your friend here.
 
-You can select what software image compression is applied on the final texture data (compressed or raw) in the bundle archives. Defold supports WebP or ZLib (default). WebP supports both lossy and lossless compression and usually results in significantly better compression than ZLib, which is a general data compression algorithm
+You can select what software image compression is applied on the final texture data (compressed or raw) in the bundle archives. Defold supports [Basis Universal](https://github.com/BinomialLLC/basis_universal) texture compression, which compresses the image into a intermediary format. This format is transcoded at runtime to a hardware format appropriate for the current device's GPU.
+The Basis Universal format is a high quality but lossy format.
+All images are also compressed using LZ4 for further reduction of file size when we store them into the game archive.
 
 ::: sidenote
 Compression is a resource intensive and time consuming operation that can cause _very_ long build times depending on the number of texture images to compress and also the chosen texture formats and type of software compression.
@@ -109,12 +111,20 @@ The *Formats* added to a profile each have the following properties:
 
 Graphics hardware textures can be processed into uncompressed or *lossy* compressed data with various numbers of channels and bit depths. Hardware compression that is fixed means that the resulting image will be of a fixed size, regardless of the image content. This means that the quality loss during compression depends on the content of the original texture.
 
-The following lossy compression formats are currently supported.
+Since Basis Universal compression transcoding is dependent on the device's GPU capabilities, the recommended formats for use with the Basis Universal compression is the generic formats like:
+`TEXTURE_FORMAT_RGB`, `TEXTURE_FORMAT_RGBA`, `TEXTURE_FORMAT_RGB_16BPP`, `TEXTURE_FORMAT_RGBA_16BPP`, `TEXTURE_FORMAT_LUMINANCE` and `TEXTURE_FORMAT_LUMINANCE_ALPHA`.
 
-<!--
-DXT
-: Also called S3 Texture Compression. It can be generated on Windows platform only, but macOS supports reading it and it's possible to install support for it on Linux. The format divides the image into 4x4 pixel blocks with 4 colors set to the pixels within each block.
--->
+The Basis Universal transcoder supports many output formats, like `ASTC4x4`, `BCx`, `ETC2`, `ETC1` and `PVRTC1`.
+For a complete, up-to-date list, see
+
+::: sidenote
+The hardware specific output formats are currently disable due to the recent upgrade to our usage of Basis Universal encoder.
+
+We are currently looking into how to reintroduce support for both these formats, as well as readding support for WEBP compression.
+Our current long running task of introducing content pipeline plugins aim to fix this.
+:::
+
+The following lossy compression formats are currently supported:
 
 PVRTC
 : Textures are compressed in blocks. In 4 bit mode (4BPP) each block is 4×4 pixels. In 2 bit mode (2BPP) each block is 8×4 pixels. Each block always occupies 64 bits (8 bytes) of memory space.  The format is used in all generations of the iPhone, iPod Touch, and iPad. (certain Android devices, that use PowerVR GPUs, also support the format). Defold supports PVRTC1, as indicated by the suffix "V1" in the format identifiers.
@@ -136,35 +146,22 @@ ETC
 | `TEXTURE_FORMAT_RGBA_PVRTC4BPPV1` | 1:8 fixed. | Pre-multiplied alpha. Requires square images. Non square images will be resized. |
 | `TEXTURE_FORMAT_RGB_ETC1`         | 1:6 fixed  | No alpha |
 
-<!---
-| TEXTURE_FORMAT_RGB_DTX1
-| 1:8 fixed
-| No alpha
-| Can be compressed on Windows only
-
-| TEXTURE_FORMAT_RGBA_DTX1
-| 1:8 fixed
-| 1 bit alpha
-| Can be compressed on Windows only
-
-| TEXTURE_FORMAT_RGBA_DXT3
-| 1:4 fixed
-| 4 bit fixed alpha
-| Can be compressed on Windows only
-
-| TEXTURE_FORMAT_RGBA_DXT5
-| 1:4 fixed
-| Interpolated smooth alpha
-| Can be compressed on Windows only
--->
 
 ## Compression types
 
 The following software image compression types are supported. The data is uncompressed when the texture file is loaded into memory.
 
+::: sidenote
+Currently the `WEBP` compression will always fallback to `BASIS_UASTC` compression.
+
+We are currently looking into how to reintroduce support for both these formats, as well as readding support for WEBP compression.
+Our current long running task of introducing content pipeline plugins aim to fix this.
+:::
+
 | Type                              | Formats                   | Note |
 | --------------------------------- | ------------------------- | ---- |
 | `COMPRESSION_TYPE_DEFAULT`        | All formats               | Generic lossless data compression. Default. |
+| `COMPRESSION_TYPE_BASIS_UASTC`    | All RGB/RGBA formats      | Basis Universal high quality, lossy compression. Lower quality level results in smaller size. |
 | `COMPRESSION_TYPE_WEBP`           | All formats               | WebP lossless compression. Higher quality level results in smaller size. |
 | `COMPRESSION_TYPE_WEBP_LOSSY`     | All non hardware compressed formats. | WebP lossy compression. Lower quality level results in smaller size. |