Skip to main content

File Size Reduction

glTF and GLB allow for significant optimizations of the file size for assets by using various techniques. The following sections describe the different options available in Gestaltor to reduce the file size of a glTF or GLB asset.

This is especially helpful when optimising for web delivery, where the file size is a critical factor for the user experience.

Draco Mesh Compression

Draco is a library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission size of 3D models.

The easiest way to compress meshes in Gestaltor is to select Meshes in the Resources panel and use right-click to select the Draco Compression option. A screenshot showing how to select draco mesh compression from the mesh context menu

You can use multiselection with the Command or Control key to compress multiple meshes at once.

warning

Changing the mesh compression settings can result in broken geometry. We therefore recommend to leave these settings at default.

Image Compression

Images can be compressed using the Basis Universal texture compression format. This format is supported by most modern GPUs and can significantly reduce the file size of textures.

For this open the Image in the Inspector panel and click on Convert and Resize.

A screen recording where first the image is selected in the resources panel and then the operation "Convert and Resize" is executed from the inspector panel

You may want to also reduce the resolution of the image to further reduce the file size.

tip

It's best to do both image conversion and resize in the same step to avoid quality loss due to compression.

Select JPEG or KTX - ETC1S BasisLZ for the smallest file sizes but be aware that these are using lossy compression which can lead to rendering artifacts when used with normal maps and other pbr textures. This may be acceptable to achieve the smallest possible file sizes.

Basis Universal Texture Compression (KTX)

danger

KTX is still not supported by all glTF viewers. Make sure to test your asset in the target viewer before deploying.

KTX is a container format for storing textures for OpenGL and Vulkan applications. In glTF it also is the primary way to support Basis Universal texture compression. With this format, textures can be stored in a transmission optimized form that optimizes file size, while still being easily transcodable to a wide range of GPU texture compression formats.

  • UASTC + ZStandard for normal maps and other computational textures
  • ETC1S for color maps

Increase the compression levels to reduce the file size further.

Reduce Mesh

Use the reduce mesh functionality in the Primitive Inspector to reduce the number of vertices in a mesh. This can be useful to reduce the file size of a mesh without changing the overall shape too much, especially when the vertex count is excessive.

alt text

  • Tolerance Low tolerance: more aggressive reduction, high tolerance: preference to keep the shape of the mesh
  • Target Percentage The approximate reduction factor. Note that this is only a goal for the reduction algorithm and also depends on the tolerance value.

Remove Unused Resources

By going through the hierarchy and viewport reduce all unused elements. Especially look out for Scenes and Animations that are not used and Nodes that should not be displayed in the delivery version.

This process of manual removal is a preparation for the next step, where the cleanup operation will remove all unused resources from the glTF file.

Cleanup All

The cleanup operation allows you to remove unused resources from the glTF file. This can be useful to reduce the file size of the glTF file. The cleanup operation can be accessed via the menu Automation -> Cleanup All.

tip

The cleanup operation can only remove resources that are not referenced in the glTFs scenes. Make sure to remove all unused Scenes, Nodes, and Animations before running the cleanup operation.