MeshInstancing#
Estimates candidate instance groups from scene definitions without using the GPU. Use it to inspect potential asset sharing, not to predict draw counts. The renderer batches compatible Lit and Unlit uses independently by mesh, material, reflection-probe selection and blend weight, and culling state; depth passes omit material and probe keys. Transforms may differ. CPU-skinned meshes have separate geometry, and deforming Matter and space slices draw individually. This planner does not model those runtime rules.
public static class MeshInstancingKey#
public static InstanceKey? Key(MeshAsset mesh, Material? material, bool skinned);The candidate sharing key of one mesh object, or null when marked as skinned. Numeric and string material values are omitted; matching keys do not guarantee a shared draw.
Plan#
public static (IReadOnlyDictionary<InstanceKey, int> Groups, int Individual) Plan(IEnumerable<SceneEntityDefinition> entities);Counts candidate mesh groups and mesh objects with animation bindings, which are counted individually. Objects without meshes are skipped. Visibility, render passes and runtime batch splits are not evaluated.
Related types#
InstanceKey · Material · MeshAsset · SceneEntityDefinition
Source#
- MeshInstancing.cs