From d4205dd825cd26723fed3570437dc1d5cbabb72d Mon Sep 17 00:00:00 2001 From: Mark Lundin Date: Thu, 12 Oct 2023 20:29:26 +0100 Subject: [PATCH 1/4] Updated documentation with information about AVIF/WEBP textures --- content/en/user-manual/assets/textures/index.md | 6 ++++-- content/en/user-manual/optimization/load-time.md | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/content/en/user-manual/assets/textures/index.md b/content/en/user-manual/assets/textures/index.md index 406db021ed..350f5cad08 100644 --- a/content/en/user-manual/assets/textures/index.md +++ b/content/en/user-manual/assets/textures/index.md @@ -18,6 +18,8 @@ Supported image formats are: * JPG * PNG +* AVIF +* WEBP * GIF * TGA * BMP @@ -25,7 +27,7 @@ Supported image formats are: * HDR * EXR -Imported JPG and PNG files remain in their original format. +Imported JPG, PNG, AVIF and WEBP files remain in their original format. GIF, TGA, BMP and TIF image types will be converted to JPG or PNG on import. If the imported image has transparency, it will be converted to PNG. Otherwise, it will be converted to JPG. @@ -71,7 +73,7 @@ Whereas on a Samsung S7 mobile device, only 4096x4096 is supported. Samsung S7 WebGL report -If the engine attempts to utilize a texture that exceeds the max texture size reported by WebGL, it will resize it down to this maximum size at runtime. Note that this is only done for texture loaded from images (PNG, JPG, GIF). Compressed textures cannot be resized at runtime and will simply fail to render if they are too large for the device. +If the engine attempts to utilize a texture that exceeds the max texture size reported by WebGL, it will resize it down to this maximum size at runtime. Note that this is only done for texture loaded from images (PNG, JPG, AVIF, WEBP, GIF). Compressed textures cannot be resized at runtime and will simply fail to render if they are too large for the device. If you would like to avoid downsizing at runtime, at the time of writing (Fri 23 Oct 2020), 4096x4096 is very widely supported with some developers even opting for 2048x2048 which is guaranteed to work everywhere. diff --git a/content/en/user-manual/optimization/load-time.md b/content/en/user-manual/optimization/load-time.md index 0c7ac1b7b2..5155898447 100644 --- a/content/en/user-manual/optimization/load-time.md +++ b/content/en/user-manual/optimization/load-time.md @@ -8,7 +8,7 @@ Optimizing isn't just related to improving frame rate. Fast load times are also Here are some tips to achieve super-fast load times: -* In general, prefer JPG format for textures over PNG. Exceptions are when you require an alpha channel or when JPG compression produces noticeable artifacts (with normal maps or gloss maps, for example). +* In general, AVIF images produce smaller files than WEBP, JPG, or PNG for the same image quality. It also supports an alpha channels like WEBP and PNG. However [not all browsers currently support AVIF](https://caniuse.com/avif) so use it where it makes sense for your project. If you can't use AVIF, [WEBP has much wider support](https://caniuse.com/webp) and produces smaller files than JPEG or PNG with similar quality, but we encourage you to test with different formats. * Look for opportunities to downsample certain texture images. For example, a 2048x2048 texture that is used on a small graphical object may look almost exactly the same at 1024x1024 or even 512x512. * Don't preload assets which can be loaded asynchronously. For example, it may not be necessary for your game music to play immediately at game start, so consider unchecking the Preload option for that asset in the Inspector panel. * If you have a prefiltered cubemap and are not displaying the top-level mipmap for the skybox, you can uncheck preload for all the 6 face images. From cad4c36443d1976aadae471006b485d1ed52de8c Mon Sep 17 00:00:00 2001 From: Mark Lundin Date: Mon, 16 Oct 2023 09:21:11 +0100 Subject: [PATCH 2/4] Update content/en/user-manual/assets/textures/index.md Co-authored-by: Will Eastcott --- content/en/user-manual/assets/textures/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/user-manual/assets/textures/index.md b/content/en/user-manual/assets/textures/index.md index 350f5cad08..9958c0630c 100644 --- a/content/en/user-manual/assets/textures/index.md +++ b/content/en/user-manual/assets/textures/index.md @@ -27,7 +27,7 @@ Supported image formats are: * HDR * EXR -Imported JPG, PNG, AVIF and WEBP files remain in their original format. +Imported JPG, PNG, AVIF, WebP and GIF files remain in their original format. GIF, TGA, BMP and TIF image types will be converted to JPG or PNG on import. If the imported image has transparency, it will be converted to PNG. Otherwise, it will be converted to JPG. From e91a0a681637c662c1177628aa34df2a79684765 Mon Sep 17 00:00:00 2001 From: Mark Lundin Date: Mon, 16 Oct 2023 09:21:34 +0100 Subject: [PATCH 3/4] Update content/en/user-manual/assets/textures/index.md Co-authored-by: Will Eastcott --- content/en/user-manual/assets/textures/index.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/user-manual/assets/textures/index.md b/content/en/user-manual/assets/textures/index.md index 9958c0630c..1eda934c27 100644 --- a/content/en/user-manual/assets/textures/index.md +++ b/content/en/user-manual/assets/textures/index.md @@ -73,7 +73,7 @@ Whereas on a Samsung S7 mobile device, only 4096x4096 is supported. Samsung S7 WebGL report -If the engine attempts to utilize a texture that exceeds the max texture size reported by WebGL, it will resize it down to this maximum size at runtime. Note that this is only done for texture loaded from images (PNG, JPG, AVIF, WEBP, GIF). Compressed textures cannot be resized at runtime and will simply fail to render if they are too large for the device. +If the engine attempts to utilize a texture that exceeds the max texture size reported by WebGL, it will resize it down to this maximum size at runtime. Note that this is only done for texture loaded from images (PNG, JPG, AVIF, WebP, GIF). Compressed textures cannot be resized at runtime and will simply fail to render if they are too large for the device. If you would like to avoid downsizing at runtime, at the time of writing (Fri 23 Oct 2020), 4096x4096 is very widely supported with some developers even opting for 2048x2048 which is guaranteed to work everywhere. From 0126193004aed69a4a52d9dd6d29b01d0359e26d Mon Sep 17 00:00:00 2001 From: Mark Lundin Date: Mon, 16 Oct 2023 09:21:45 +0100 Subject: [PATCH 4/4] Update content/en/user-manual/optimization/load-time.md Co-authored-by: Will Eastcott --- content/en/user-manual/optimization/load-time.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/content/en/user-manual/optimization/load-time.md b/content/en/user-manual/optimization/load-time.md index 5155898447..01ee086326 100644 --- a/content/en/user-manual/optimization/load-time.md +++ b/content/en/user-manual/optimization/load-time.md @@ -8,7 +8,7 @@ Optimizing isn't just related to improving frame rate. Fast load times are also Here are some tips to achieve super-fast load times: -* In general, AVIF images produce smaller files than WEBP, JPG, or PNG for the same image quality. It also supports an alpha channels like WEBP and PNG. However [not all browsers currently support AVIF](https://caniuse.com/avif) so use it where it makes sense for your project. If you can't use AVIF, [WEBP has much wider support](https://caniuse.com/webp) and produces smaller files than JPEG or PNG with similar quality, but we encourage you to test with different formats. +* In general, AVIF images produce smaller files than WebP, JPG, or PNG for the same image quality. It also supports an alpha channel like WebP and PNG. However [not all browsers currently support AVIF](https://caniuse.com/avif) so use it where it makes sense for your project. If you can't use AVIF, [WebP has much wider support](https://caniuse.com/webp) and produces smaller files than JPEG or PNG with similar quality, but we encourage you to test with different formats. * Look for opportunities to downsample certain texture images. For example, a 2048x2048 texture that is used on a small graphical object may look almost exactly the same at 1024x1024 or even 512x512. * Don't preload assets which can be loaded asynchronously. For example, it may not be necessary for your game music to play immediately at game start, so consider unchecking the Preload option for that asset in the Inspector panel. * If you have a prefiltered cubemap and are not displaying the top-level mipmap for the skybox, you can uncheck preload for all the 6 face images.