Exemplo n.º 1
0
 public InstancedRenderItem(
     RenderInstanceData instanceData,
     Effect effect,
     EffectPipelineStateHandle pipelineStateHandle,
     RenderCallback renderCallback)
     : base(effect, pipelineStateHandle, renderCallback)
 {
     InstanceData = instanceData;
 }
Exemplo n.º 2
0
        public void AddInstancedRenderItem(ModelMesh mesh, RenderableComponent renderable, MeshEffect effect)
        {
            if (!InstanceData.TryGetValue(mesh, out var instanceData))
            {
                InstanceData.Add(mesh, instanceData = new RenderInstanceData(mesh));

                mesh.BuildRenderList(this, instanceData, effect);
            }

            instanceData.InstancedRenderables.Add(new InstancedRenderable(renderable));
        }