Optimizing Unity games with Simplygon 10.3

In this blog, we'll detail how our new Simplygon 10.3 release can be used to optimize Unity games. We'll showcase different examples on what kind of performance problems that can be solved with automated asset optimization.

Major update since Simplygon 10.2

The first thing existing users will notice upon installing the Simplygon 10.3 Unity plugin is that we no longer use USD as an intermediary file format. Simplygon now imports and exports directly from Unity. This allows us to have much better control over the data flow and removes some limitations and issues the plugin previously had.

Create LOD levels for Unity's LODGroup

The most common use case for Simplygon in Unity is to create LOD levels to be used in conjunction with a LODGroup with the triangle reducer.

Shaded
Shaded Wireframe

Here we create a 50% and 25% triangle reduction of our anime character using two cascaded Template → Basic → Reduction pipelines. The character uses custom toon shaders. As the triangle reducer reuses the original material, it does not matter what shaders your asset uses.

Image 1

The assets will be imported as new objects in the scene with their own skeletons. Consult Reuse skeletons for Unity LODGroup for how to reuse the same skeleton for all LODs.

Visibility culling

With Visibility culling, a scene can be optimized so parts not visible to the player get removed. This has several benefits: decreased triangle count in the scene, less overdraw, and better lightmap usage.

Image 1

In our game, we can only view the scene from a specific position. This is the case for many VR games.

Before
After

After optimization, we can see that many triangles not visible from the camera selection set, the green sphere, are removed. A SimplygonSelectionSet component was added to the sphere mesh representing where the player's camera can be located. This means that every vertex in that sphere model will be used as an omnidirectional camera for visibility culling.

Image 1

The scene was optimized with the Template → Advanced → Aggregation pipeline. The "Merge geometries" flag determines if the output geometry should be one mesh or individual ones as in the input scene. If you choose to merge the scene, keep in mind that this breaks camera frustum culling.

Removing overdraw from kit-bashed scenes

When building levels using kit-bashing, overdraw can be a big issue. Having hidden internal geometry also causes poor usage of lightmaps as well as internal runtime shadows.

Before
After

With aggregation and geometry culling enabled, we can remove all inside triangles. We can also use clipping geometry to remove triangles hidden behind other surfaces. In this case, we have removed all triangles located below ground. This pipeline leaves the surface untouched, so we will have no visual degradation of our asset.

Image 1

The scene was optimized with Template → Basic → Aggregation pipeline. A SimplygonSelectionSet component was added to the ground plane.

Merge materials to optimize draw calls

Draw calls can be an issue in Unity games. This is especially important for VR and mobile games. To address this, Simplygon can bake several different materials into one. This can either be done on LOD0 or at a step in the LOD chain. Let us do this as a step in a LOD chain.

Before
After

We'll do material baking and a 50% triangle reduction on our character asset. It is important to note that to perform material casting, we need to understand the shader. We support the Standard, URP, and HDRP render pipelines. Consult the documentation for supported shaders. The resulting asset is intended to be used as LOD1 in a character LOD chain.

Image 1

This standard shader character was optimized with Template → Basic → Reduction with material baking.

Impostors

Creating open-world games with large vistas can be a hard task in Unity. Thanks to Simplygon's impostor, those faraway objects can be replaced with cheap-to-render impostors. The impostor processor creates a model with new topology and bakes materials from the original asset onto it.

Impostors are often used as the last LOD level in a LOD chain. They can also be used to create HLODs proxies, representing a group of assets.

Remeshed impostors

For HLOD proxies for distance viewing the ideal model is a watertight connected model. Simplygon's remesher creates this kind of model.

Before
After

After optimization we get a nice low poly watertight asset without any inside. The asset can be rendered with only one material.

Image 1

This HDRP house asset was optimized with Template → Basic → Remeshing with material baking.

Impostors from single view

If the object should only be rendered from one angle at a distance impostor from single view can be a great alternative.

Before
After

It will optimize your entire asset into only a quad. The viewing angle can be specified using the view direction setting.

Image 1

This HDRP Unity asset was optimized with Template → Basic → Impostor from single view.

Automating with scripting

In this blog, we showcased Simplygon's different features using the user interface. We see this as the starting point for using Simplygon. The real power of automated asset optimization comes once you start to automate it. In Unity, everything we have talked about in this blog, and much more, can be automated with C# scripting. How this can be achieved can be read in the Simplygon Unity scripting example.

And more

We have just scatched the surface of what optimization Simplygon can do for Unity based games. Simplygon can also do bone optimization, create physic meshes and more. If you want to learn more about how to optimize Unity games with Simplygon contact us and we'll give you a tech demo.

⇐ Back to all posts

Request 30-days free evaluation license

*
*
*
*
Industry
*

Request 30-days free evaluation license

*
*
*
*
Industry
*