Skip to content

Commit

Permalink
Updated documentation with information about AVIF/WEBP textures
Browse files Browse the repository at this point in the history
  • Loading branch information
marklundin committed Oct 12, 2023
1 parent 256fab0 commit d4205dd
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions content/en/user-manual/assets/textures/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,16 @@ Supported image formats are:

* JPG
* PNG
* AVIF
* WEBP
* GIF
* TGA
* BMP
* TIF
* 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.

Expand Down Expand Up @@ -71,7 +73,7 @@ Whereas on a Samsung S7 mobile device, only 4096x4096 is supported.

<img loading="lazy" src="/images/user-manual/assets/textures/samsung-s7-webgl-report.jpg" alt="Samsung S7 WebGL report" style="width: 600px;">

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.

Expand Down
2 changes: 1 addition & 1 deletion content/en/user-manual/optimization/load-time.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit d4205dd

Please sign in to comment.