Procedurally scatter your existing prefabs—like tree or grass clusters—or select scene objects, then fuse them into single static meshes. Reduces draw calls by intelligently merging LODs.The Mesh Constructor is a free, multithreaded editor and runtime utility designed to procedurally scatter your existing prefabs and physically fuse their geometry into unified static meshes.Populating large-scale environments requires massive amounts of geometry. While Unity’s native GPU instancing is highly effective for rendering repeated meshes, relying on thousands of individual GameObjects to build a dense forest canopy or a sprawling field of grass creates a severe CPU bottleneck. The engine must still calculate the transform data, culling state, and memory footprint of every single active object before passing it to the GPU.This tool addresses that specific overhead. Rather than relying solely on instancing, the Mesh Constructor acts as a static geometry baking engine. It algorithmically packs your prefabs and physically welds their vertices together, completely eliminating the individual GameObject overhead. By compressing thousands of objects into a single mesh, it reduces massive amounts of active draw calls down to a single batch, freeing up your CPU threads for actual game logic.Core Workflows & CapabilitiesInstead of forcing you into a single level-design paradigm, the Constructor provides two distinct methods for building and optimizing your environments.Procedural ScatteringRather than manually placing thousands of objects, you can feed a pool of your existing prefabs into the engine and select a mathematical placement strategy tailored to your specific environment. The included algorithms include:Poisson Disc: Utilizes iterative rejection sampling for perfectly even, non-clumping distributions—ideal for dense forests and ground cover.Spirals: Applies a phyllotactic mathematical distribution to mimic natural botanical layouts.Crop Rows: Structures objects in parallel lines or staggered hex grids with procedural pathing for agricultural fields.Fractals: Uses recursive L-system branching for organic, sprawling structures like massive tree roots or coral reefs.Shapes & Perimeters: Blindly packs instances strictly within geometric primitives (circles, hexagons), or generates modular walls and hedges with corner clustering.The engine automatically applies randomized uniform scale and independent Y-axis scalar multipliers to every placed instance. This ensures that your natural formations maintain an organic, non-repeating appearance without requiring manual adjustment.Scene Geometry FusionIf you prefer placing objects by hand, you can bypass procedural generation and use the tool as a traditional mesh combiner to optimize your existing scene hierarchy.Manual Placement: Build your environments normally by hand-placing, rotating, and arranging prefabs directly in your active scene exactly how you want them.In-Scene Merging: Once your layout is finished, simply select those objects, and the Constructor will weld them together into a single, optimized static mesh asset. This is perfect for hand-crafted ruins, modular buildings, or specific hero-asset clusters that you want to design yourself rather than generate.Rendering Architecture & LOD ControlThe engine provides three distinct rendering pipelines to handle how your final assets are optimized at a distance.Full LOD Group Generation: The standard workflow. The Constructor systematically extracts and fuses every level of detail from your source prefabs, building a complete, multi-tiered LOD hierarchy for the final merged asset.Grass Mode (Lowest-Poly Extraction): For massive, low-poly coverage where rendering high-detail meshes is unnecessary, this aggressive optimization strips away high-poly layers. The tool exclusively extracts and merges the lowest-poly meshes for background scatter, saving critical memory budgets.Hierarchical LOD (HLOD): This architecture preserves your original, interactive prefabs at close range (LOD0) to maintain physics scripts and player collision. As the camera moves further away, it seamlessly transitions to your fused static mesh to cut background draw calls.The Sandbox Safety NetBecause geometry fusion permanently alters data structures and generates new asset files, testing these workflows directly on your production-ready layouts carries inherent risk. To solve this, the asset includes a dedicated Demo Control Panel.This window contains an asset factory that procedurally builds simple, multi-LOD test assets (such as trees, rocks, and bushes) from raw code. It also features a sandbox scene function that automatically spawns a ground plane, scatters the test assets across it, and highlights them in your scene hierarchy. This allows you to safely test the procedural generation and scene fusion pipelines, ensuring you understand the mechanics before touching your actual project files.Technical Realities & LimitationsBefore integrating this tool into your workflow, it is important to clearly define its technical limits. This is fundamentally a static geometry baker.Destroys Skinned Meshes: The Constructor is built strictly for static architecture. If you feed a skinned mesh into the tool, it will bake the object's current active pose into a static mesh, permanently stripping out all skeletal rigs, bone weights, and animations.Material Fragmentation: Fusing fifty prefabs that use fifty unique materials will not improve your performance. Unity still requires a separate render pass for every unique material on a mesh. Your draw call count will remain completely identical unless your source prefabs share a common material or texture atlas.Ecosystem Solutions & SupportThe Mesh Constructor belongs to an ecosystem of developer utilities designed to target specific open-world constraints. To maximize your performance, consider pairing it with other tools in your pipeline:BurstLOD: Quickly generate optimized, lightweight LODs for your custom models before feeding them into the fusion list.Terrain Slicer (FREE): If you are building landscapes large enough to require these dense mesh clusters, the Slicer divides massive, monolithic maps into streamable, optimized chunks.Material & Texture Combiner (Coming Soon): I am currently developing an asset that will directly address the limitation of material fragmentation. It will automatically bake your differing textures into clean, unified atlases during the fusion process.As a solo developer, creating and maintaining free tools requires a significant time investment. If this asset speeds up your workflow or saves you from manual layout headaches, please consider leaving a rating or review on the Asset Store. It is the single best way to help the tool gain visibility in the algorithm and supports continued updates.Requirements & CompatibilityMinimum Unity Version: Unity 6 or newer.Render Pipelines: Fully compatible with the Universal Render Pipeline (URP), High Definition Render Pipeline (HDRP), and the Built-in Render Pipeline.Native Dependencies: Relies entirely on standard Unity packages (Unity.Burst, Unity.Collections, Unity.Mathematics) which are included natively in modern engine versions. No external setup or third-party libraries are required.Asset Architecture & FootprintStrict Assembly Organization: The codebase is partitioned into dedicated Editor and Runtime assemblies. The Editor UI and layout scripts rely on the Runtime core in a one-way dependence, guaranteeing that Editor scripts are safely stripped from your final build.Zero MonoBehaviour Contamination: The tool outputs standard, vanilla Unity Meshes. There are no proprietary scripts, managers, or custom MonoBehaviours permanently attached to the generated clusters.Core Systems & ProcessingBurst-Compiled Asynchronous Welding: Fully utilizes the C# Job System to run heavy vertex math, array combining, and spatial calculations concurrently across CPU threads, moving the workload off the main thread to prevent Editor lockups.Dynamic Index Buffers: Automatically calculates vertex counts during the fusion process. If a generated cluster exceeds the standard 65,535 vertex limit, the engine automatically upgrades the mesh index format from 16-bit to 32-bit to prevent geometry corruption.Chunked Processing: Extracts and processes heavy mesh arrays in localized blocks rather than loading monolithic arrays into active Job memory, mitigating RAM spikes during massive layout fusions.Generated OutputsInherited Configurations: Re-instantiates clean GameObjects that seamlessly inherit the rendering settings of your source prefabs, including shadow casting modes, light probe settings, and motion vector configurations.Sub-Mesh Preservation: Automatically identifies and preserves sub-mesh data, ensuring complex models with multiple materials are assigned correctly across the fused asset.Pivot-to-Vertex Baking (Wind Support): Features an advanced toggle to bake the original, pre-fused local pivot positions of your prefabs into a designated vertex color channel. This ensures that custom foliage wind shaders continue to displace geometry correctly even after the objects are merged into a single pivot.Runtime API & FeaturesThread-Safe Runtime API: The core math engine is exposed via a fully asynchronous, cancellation-token-supported API (MeshFusionProcessor). This allows you to execute non-standard spatial grouping and mesh welding dynamically from your native game loops.Memory-Only Generation: Includes the RuntimeFusionAssetHandler, which bypasses hard-disk serialization entirely. This allows procedural world generators or UGC sandboxes to spawn, fuse, and render massive dynamic clusters strictly in RAM without causing disk-write stutter.A Quick Note on Licensing & OwnershipBecause the Mesh Constructor is a tool that fuses existing assets together, it is important to keep standard intellectual property guidelines in mind:Fusing Does Not Grant Ownership: Merging third-party 3D models or textures into a single static mesh does not alter their original copyright. For example, if you combine several assets purchased or downloaded from the Asset Store, the resulting merged mesh is a derivative work. Standard marketplace licenses typically do not permit you to resell or redistribute these combined files as standalone assets.Limitation of Liability: This tool is strictly a geometry pipeline utility. How you choose to use it, and the source assets you choose to input into it, are entirely your responsibility. By using this software, you agree that the developer is not liable for any licensing violations, copyright issues, or EULA breaches resulting from the assets you choose to modify, merge, or distribute.

