docs.unity3d.com
Version: 

    Decimate To Target

    In 3D data preparation, it can be required to reach a specific polycount to properly display a 3D model on a particular device or platform (e.g. a maximum of 100 000 triangles is advised for HoloLens).

    There are many possibilities to achieve that with Pixyz Studio, but the most direct way is by decimating meshes, using the Decimate To Target function.

    Decimate To Target reduces meshes density until a targeted polycount is reached.

    The function is available from the Optimize Mesh menu.

    Image

    Parameters

    The function is mainly controlled by a Triangle Count criterion (or Triangle ratio), which is the number of triangles left after the decimation.

    More control over the reduction can be achieved using the parameters available in the Optional Parameters tab.

    They are meant to preserve the model's UVs and topology, and set the method used for decimating the model:

    Parameter Description
    UV Importance This parameters defines how UVs (texture coordinates) should be preserved during the decimation process:
    • Preserve Seams And Reduce Deformation: preserves UV seams (UV islands contours) from being displaced, and UV islands from being distorted, stretched (along with the textures using the UVs).
    • Preserve Seams: specifically preserves UV seams (UV islands contours) from being displaced, without trying to preserve other UV information.
    • Ignore UV: UVs are not preserved at all when decimating, resulting in potential UV and textures stretching/displacement/overlapping.
    NOTE: Choosing Ignore UV does not give the same result as decimating meshes with no UV at all: UVs are still attributes potentially preventing decimation from delivering the best result (see here).
    Protect Topology If disabled (default), important topological singularities of the mesh (like holes for example) can change and some edges can become non-manifold. But the visual quality will be better on models with complex topology, because you let the algorithm get to a better overall result rather than trying to preserve topological singularities at all costs. If keeping the topology of your model is important, enable the parameter.
    Iterative Threshold This parameter enables a different method for decimating large models, like industrial models with a very high polycount (several millions).
    Indeed, this type of model requires a large quantity of memory to be processed, requiring a different, iterative decimation method.
    The iterative method is triggered when the quantity of triangles to decimate is higher than the threshold. So, you should set the number of triangles according to your computer memory capacity. As a rule of thumb, count 5 GB of RAM for 1,000,000 triangles.

    WARNING: If the available memory is not sufficient to process the model, your CPU might swap and slow down your computer dramatically.
    Process Mesh Independently If enabled, each mesh will be processed indepently and the Triangle Count or Ratio will apply by mesh (disables the iterative method).
    See General Behavior below.
    Max Quadric Edge If >0, defines the maximum memory (number of collapse) of a vertex before a new evaluation of its quadric.

    General behavior

    By default, because the parameter Process Mesh Independently is disabled, the Decimate To Target function takes the whole selection into consideration: although this algorithm operates at part level (on the meshes), it is based on the whole set of parts (given as function input) to evaluate the target triangle count.

    For AEC use cases (buildings, factories), it is advised to call the function a single time with a list of all of the parts, so that meshes made of a very few triangles such as walls or windows are kept intact while the decimation focuses on denser meshes.

    If the parameter Process Mesh Independently is enabled, then each mesh of the selection is decimated independently to reach the given triangle count.

    About the algorithm

    The algorithm behind the Decimate to Target function is based on the Quadric error metric method, which reduces the density of a mesh by collapsing its edges:

    Image

    First, the algorithm calculates a new vertex placing, and then computes a misplacement error score for each edge. The score is calculated by adding different geometrical deviations (boundaries, normals and UVs).

    Then, it removes in priority the edges generating the least errors until it reaches the targeted polycount.

    The user can influence the computed score by modifying the UV Importance parameter. The global edge error for the edges displacing UVs will get higher error scores than the others, and thus will be deleted last.

    Examples

    Here are simple examples explaining how to setup the Decimate To Target function:

    Game model

    With the Game asset below, here is how parameters should be set in order to obtain a beautifully decimated model:

    1. Repair mesh: as explained here, it is better to repair a mesh before decimating in order to reconnect edges and avoid gaps

    2. Target Strategy: Here the model is already quite low poly for a character (~35k triangles), so the target should not be too low, but it mostly depends on how far from the camera the decimated model will be. Let's try the default 10 000 triangles value (~30%).

    3. Setting other parameters:

      Parameter Parameter value Explanation
      UV Importance Preserve Seams And Reduce Deformation UVs need to be preserved, because our model has textures applied. These textures play a great role at making it look good. We do not want them to be too distorted
      Protect Topology Enabled Enable it in order to preserve the panda's topological singularities (e.g. the eye sockets) as much as possible
      As you can see below, when the parameter is disabled, the holes like the eyes and the mouth are starting to stretch a little:
      Image
      Iterative Threshold Disabled No need to enable it as the model is very low poly and will not require a lot of memory to be processed by the decimation function

    Here is the result of the decimation, which reduced the model and preserved the required attributes:

    Image

    Note

    With this animated model, skins, bones and animation were also properly preserved during the decimation process!

    CAD model

    With the CAD / Hard surface model below, which is a car door, here is how parameters should be set in order to obtain a beautifully decimated model:

    1. Repair mesh: as explained here, it is better to repair a mesh before decimating in order to reconnect edges and avoid gaps

    2. Target Strategy: Here the model is quite dense (~18k triangles), so there is room for a good reduction. Let's try keeping 10%.

    3. Setting other parameters:

      Parameter Parameter value Explanation
      UV Importance Ignore UV This model, like most CAD models, has no UVs (they can of course be added afterwards if necessary) Anyway as explained here, it can be interesting to check first if the model has UVs that might prevent the decimation to reduce as strongly as required, and remove them.
      Protect Topology Enabled As the door panel has a rather simple topology, it is preferable to enable this parameter to try to keep its topological singularities like the small holes at the bottom
      Iterative Threshold 5 000 000 No need to enable it as the model is very low poly and will not require a lot of memory to be processed by the decimation function

    Here is the result of the decimation, which reduced the model and preserved the required attributes:

    Image

    API function parameters

    Check the API Reference page to learn how to use this function in Python code.

    Related topics

    • About Decimation
    • About Decimate To Quality
    • About 3D Models Types
    Pixyz Studio 2025.1.1.2 based on SDK 2025.1.2.3
    • Legal
    • Privacy Policy
    • Cookies
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)
    "Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
    Generated by DocFX.