MC Mesh Combiner
The mesh combiner is a core component that should be used on the parent element whose child meshes you want to combine.
Configuration
On Updated
Callback that will be called after each baking.
Keys
This is a set of keywords used to determine which meshes are accepted by the MC Combinable component. The component will accept a mesh if the keyword set is empty or if the mesh contains the combinable key.
Note: If you have a parent object with multiple combiners, only the first matching combiner (from top to bottom) will be used. This means that if first combiner doesn't have any keys specified, then only that component will be used.
Max Build Time
The baking process aims to limit the amount of time taken per frame. You can adjust this value to reduce lag during baking or increase it to speed up the baking process.
Please note that currently, this setting only affects the preparation steps and does not apply to the mesh combining itself. As a result, when dealing with large meshes, you may still experience some temporary freezes. To mitigate this, it is advisable to use multiple combiners: one for dynamically added objects and another for static ones, or you can use MC Chunk Combiner.
Render Types
The "Render Types" setting defines which renderers can utilize the combiner, specifically the Skinned Mesh Renderer or the Mesh Renderer.
By default, the combiner will automatically select the best renderer based on certain criteria.
If
Is Static
property is set to true, the combiner will prioritizeSkinned Mesh Renderer
.If
Is Static
property is set to false, the combiner will prioritizeMesh Renderer
.
If preferred renderer is disabled, the combiner will fall back to the second available renderer. This allows you to force the rendering of animated combinables as a static mesh or static meshes as an animated mesh (in some cases it can reduce draw calls a little, but note that each static mesh will have it's own bone).
It is important to note that if you enable both options, you may end up with at least two different renderers, which will increase the number of draw calls compared to using the Skinned Mesh Renderer only mode.
Bake Materials
The "Bake Materials" feature is an experimental option in the baker that allows the combination of materials into a single material. Currently, this feature only works with materials that do not have textures and use URP lit
or simple lit
shaders. Please see Bake Materials for more details.
As an experimental feature, you have the option to utilize TextureBaker, which enables texture atlas baking functionality within the TextureBaker. This feature allows you to consolidate multiple textures into a single texture atlas, further optimizing rendering performance and resource utilization in your Unity projects.
Bake Mesh
You have the option to bake a mesh directly from the editor. This allows you to prebake large static objects, resulting in smoother runtime performance without any startup lags. By baking the mesh, you can optimize its rendering and avoid the need for real-time calculations during runtime.
You can also prebake prefabs and configure the baked mesh as MC Combinable. This is recommended if you have prefabs that contain numerous smaller meshes. By prebaking the prefabs and setting the baked mesh as MC Combinable, you can optimize performance and reduce overhead, particularly when dealing with a large number of individual meshes. This approach allows for more efficient rendering and improved runtime performance.
Separate Blend Shapes
When the "Separate Blend Shapes" option is enabled during mesh combining, meshes with blend shapes are baked into separate meshes. This feature is crucial not only when dealing with numerous meshes with blend shapes but also when there is an expectation of a high polygon count in the output mesh. This is because each blend shape frame needs to contain data for every vertex.
Enabling "Separate Blend Shapes" is a valuable strategy for managing performance and memory considerations when working with meshes that incorporate blend shapes, especially in scenarios involving high expected polygon counts in the output mesh. Use it judiciously based on the specific needs of your project.
Last updated