Optimising Meshes

Luna exports vertex data from meshes as float numbers to keep it as precise as possible to the original art. The data is stored in binary format, which allows for efficient uploading to GPU, reduction of startup time and the consumption of no additional memory which text formats are prone to.

However, mesh geometry might occupy considerable amount of wire size, especially when high-fidelity meshes are involved. In many cases, the only optimization tip available would be "ask artists to reduce the number of vertices", but this can be rather time-consuming and inefficient. Therefore, Luna provides an optional mesh precision reduction feature.

Let's start by navigating to the Assets section and the Meshes tab in Luna UI:


The highlighted part of the screenshot above is the section that describes parameters applied to exported sounds by default.

Store mesh in Half-precision floating-point format

This will instruct Luna to use half-precision floats for storing mesh data, reducing the size taken by 50%. It is almost impossible to predict whether it is going to be noticeable in the final product, but in many cases the difference will be negligable. These floats still have 3 precision digits, which is enough for many cases. The only parts of the mesh that get really affected are positions and blend weights; other parts like colors, normals, tangents, UVs and so on are usually represented well enough even with less precision.

Startup time penalty!
WebGL 1.0 doesn't support half-precision vertex format, thus Luna has to unpack the data into single-precision float numbers before sending the data onto video card. Depending on the overall mesh size and device power, the lag can be noticeable, so please test carefully before enabling it for production builds.

Per-mesh settings

All of the above settings are also available on a per-folder and per-mesh level. Developers can choose a folder of a file by ticking a checkbox in "Per-mesh settings" section of the window and use the same fields to tweak parameters of a specific mesh(s):