You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -17,14 +17,54 @@ The processing of textures is configured through a specific texture profile. In
17
17
18
18
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.
19
19
20
-
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.
21
-
The Basis Universal format is a high quality but lossy format.
22
-
All images are also compressed using LZ4 for further reduction of file size when we store them into the game archive.
20
+
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) and [ASTC](https://www.khronos.org/opengl/wiki/ASTC_Texture_Compression) compression formats.
23
21
24
22
::: sidenote
25
23
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.
26
24
:::
27
25
26
+
### Basis Universal
27
+
28
+
Basis Universal (or BasisU for short) compresses the image into a intermediary format that 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.
29
+
All images are also compressed using LZ4 for further reduction of file size when stored in the game archive.
30
+
31
+
### ASTC
32
+
33
+
ASTC is a flexible and efficient texture compression format developed by ARM and standardized by the Khronos Group. It offers a wide range of block sizes and bit rates, allowing developers to balance image quality and memory usage effectively. ASTC supports various block sizes, from 4×4 to 12×12 texels, corresponding to bit rates ranging from 8 bits per texel down to 0.89 bits per texel. This flexibility enables fine-grained control over the trade-off between texture quality and storage requirements.
34
+
35
+
ASTC supports various block sizes, from 4×4 to 12×12 texels, corresponding to bit rates ranging from 8 bits per texel down to 0.89 bits per texel. This flexibility enables fine-grained control over the trade-off between texture quality and storage requirements. The following table shows the supported block sizes and their corresponding bit rates:
36
+
37
+
| Block Size (width x height) | Bits per pixel |
38
+
| --------------------------- | -------------- |
39
+
| 4x4 | 8.00 |
40
+
| 5x4 | 6.40 |
41
+
| 5x5 | 5.12 |
42
+
| 6x5 | 4.27 |
43
+
| 6x6 | 3.56 |
44
+
| 8x5 | 3.20 |
45
+
| 8x6 | 2.67 |
46
+
| 10x5 | 2.56 |
47
+
| 10x6 | 2.13 |
48
+
| 8x8 | 2.00 |
49
+
| 10x8 | 1.60 |
50
+
| 10x10 | 1.28 |
51
+
| 12x10 | 1.07 |
52
+
| 12x12 | 0.89 |
53
+
54
+
55
+
#### Supported devices
56
+
57
+
While ASTC provides great results, it is not supported by all graphics cards. Here is a small list of supported devices based on vendor:
| ARM (Mali) | All ARM Mali GPUs that support OpenGL ES 3.2 or Vulkan support ASTC. |
62
+
| Qualcomm (Adreno) | Adreno GPUs supporting OpenGL ES 3.2 or Vulkan support ASTC. |
63
+
| Apple | Apple GPUs since the A8 chip support ASTC. |
64
+
| NVIDIA | ASTC support is mostly for mobile GPUs (e.g., Tegra-based chips). |
65
+
| AMD (Radeon) | AMD GPUs that support Vulkan generally support ASTC via software. |
66
+
| Intel (Integrated) | ASTC is supported in modern Intel GPUs via software. |
67
+
28
68
## Texture profiles
29
69
30
70
Each project contains a specific *.texture_profiles* file that contains the configuration used when compressing textures. By default, this file is *builtins/graphics/default.texture_profiles* and it has a configuration matching every texture resource to a profile using RGBA with no hardware texture compression and using the default ZLib file compression.
@@ -101,22 +141,21 @@ The *Formats* added to a profile each have the following properties:
101
141
*Format*
102
142
: The format to use when encoding the texture. See below for all available texture formats.
103
143
104
-
*Compression*
105
-
: Selects the quality level for the resulting compressed image.
144
+
*Compressor*
145
+
: The compressor to use when encoding the texture.
|`NORMAL`| Default compression. Best image quality |
111
-
|`HIGH`| Slowest compression. Smaller file size |
112
-
|`BEST`| Slow compression. Smallest file size |
147
+
*Compressor Preset*
148
+
: Selects a compression preset to use for encoding the resulting compressed image. Each compressor preset is unique to the compressor and its settings depend on the compressor itself. To simplify these settings, the current compression presets come in four levels:
113
149
114
-
::: sidenote
115
-
Since 1.2.185 we've redefined these enums, since they are a bit ambiguous.
: Selects the type of compression used for the resulting compressed image, `COMPRESSION_TYPE_DEFAULT` or `COMPRESSION_TYPE_BASIS_UASTC`. See [Compression Types](#compression-types) below for more details.
157
+
Note that the `uncompressed` compressor only has one preset called `uncompressed`, which means no compression will be applied to the textures.
158
+
To see the list of available compressors, see [Compressors](#compressors)
120
159
121
160
## Texture formats
122
161
@@ -138,21 +177,40 @@ The following lossy compression formats are currently supported:
138
177
|`TEXTURE_FORMAT_LUMINANCE`| none | 1 channel gray-scale, no alpha. RGB channels multiplied into one. Alpha is discarded. |
139
178
|`TEXTURE_FORMAT_LUMINANCE_ALPHA`| none | 1 channel gray-scale and full alpha. RGB channels multiplied into one. |
140
179
180
+
For ASTC, the number of channels will always be 4 (RGB + alpha), and the format itself defines the size of the block compression.
181
+
Note that these formats are only compatible with an ASTC compressor - any other combination will produce a build error.
141
182
142
-
## Compression types
183
+
`TEXTURE_FORMAT_RGBA_ASTC_4X4`
184
+
`TEXTURE_FORMAT_RGBA_ASTC_5X4`
185
+
`TEXTURE_FORMAT_RGBA_ASTC_5X5`
186
+
`TEXTURE_FORMAT_RGBA_ASTC_6X5`
187
+
`TEXTURE_FORMAT_RGBA_ASTC_6X6`
188
+
`TEXTURE_FORMAT_RGBA_ASTC_8X5`
189
+
`TEXTURE_FORMAT_RGBA_ASTC_8X6`
190
+
`TEXTURE_FORMAT_RGBA_ASTC_8X8`
191
+
`TEXTURE_FORMAT_RGBA_ASTC_10X5`
192
+
`TEXTURE_FORMAT_RGBA_ASTC_10X6`
193
+
`TEXTURE_FORMAT_RGBA_ASTC_10X8`
194
+
`TEXTURE_FORMAT_RGBA_ASTC_10X10`
195
+
`TEXTURE_FORMAT_RGBA_ASTC_12X10`
196
+
`TEXTURE_FORMAT_RGBA_ASTC_12X12`
143
197
144
-
The following software image compression types are supported. The data is uncompressed when the texture file is loaded into memory.
198
+
199
+
## Compressors
200
+
201
+
The following texture compressors are supported by default. The data is uncompressed when the texture file is loaded into memory.
0 commit comments