public void Insert(Model9 model, Entity entity, MetaModel metaModel, string metaName, Settings settings)
        {
            //if (!IsVisible(metaModel, settings)) return;

            string techniqueNameEnding = Renderer.GetTechniqueNameExtension(metaModel, settings, techniqueNames);

            if (metaModel.HasAlpha)
            {
                //Renderer.totalAddedItems++;
                AlphaObjects.Add(new Common.Tuple <Model9, Entity, string, string>(model, entity, metaName, techniqueNameEnding));
            }
            else if (metaModel.SplatMapped)
            {
                //Renderer.totalAddedItems++;

                string techniqueName = "";
                techniqueName  = "Standard" + Renderer.GetTechniqueNameExtension(metaModel, settings, techniqueNames);
                techniqueName += GetSplatTechniqueExtention(model, settings);

                RenderSplatMesh r;
                if (!SplatTechniques.TryGetValue(techniqueName, out r))
                {
                    SplatTechniques[techniqueName] = r = new RenderSplatMesh();
                }
                r.Insert(model, entity, metaModel, metaName);
                if (entity.Scene.DesignMode)
                {
                    SplatObjects.Add(new Common.Tuple <Model9, Entity, string>(model, entity, metaName));
                }
            }
            else if (metaModel.SkinnedMesh != null)
            {
                foreach (var SM in model.SkinnedMesh.MeshContainers)
                {
                    if (SM.Second.SkinInfo != null)
                    {
                        //Renderer.totalAddedItems++;
                        string techniqueName = "SkinnedMesh" + techniqueNameEnding;

                        RenderTechnique r;
                        if (!Techniques.TryGetValue(techniqueName, out r))
                        {
                            Techniques[techniqueName] = r = new RenderTechnique();
                        }
                        r.Insert(model, entity, metaModel, metaName, model.SkinnedMesh, null, false);
                    }
                    else
                    {
                        //Renderer.totalAddedItems++;

                        RenderTechnique r;
                        if (!Techniques.TryGetValue("ShadowedSceneInstanced" + techniqueNameEnding, out r))
                        {
                            Techniques["ShadowedSceneInstanced" + techniqueNameEnding] = r = new RenderTechnique();
                        }
                        r.Insert(model, entity, metaModel, metaName, null, SM.Second.MeshData.Mesh, true);
                    }
                }
            }
            else if (metaModel.XMesh != null)
            {
                //Renderer.totalAddedItems++;

                RenderTechnique r;
                if (!Techniques.TryGetValue("ShadowedSceneInstanced" + techniqueNameEnding, out r))
                {
                    Techniques["ShadowedSceneInstanced" + techniqueNameEnding] = r = new RenderTechnique();
                }
                r.Insert(model, entity, metaModel, metaName, null, model.XMesh, false);
            }
        }
        public void Insert(Model9 model, Entity entity, MetaModel metaModel, string metaName, Settings settings)
        {
            //if (!IsVisible(metaModel, settings)) return;

            string techniqueNameEnding = Renderer.GetTechniqueNameExtension(metaModel, settings, techniqueNames);

            if (metaModel.HasAlpha)
            {
                //Renderer.totalAddedItems++;
                AlphaObjects.Add(new Common.Tuple<Model9, Entity, string, string>(model, entity, metaName, techniqueNameEnding));
            }
            else if (metaModel.SplatMapped)
            {
                //Renderer.totalAddedItems++;

                string techniqueName = "";
                techniqueName = "Standard" + Renderer.GetTechniqueNameExtension(metaModel, settings, techniqueNames);
                techniqueName += GetSplatTechniqueExtention(model, settings);

                RenderSplatMesh r;
                if (!SplatTechniques.TryGetValue(techniqueName, out r))
                    SplatTechniques[techniqueName] = r = new RenderSplatMesh();
                r.Insert(model, entity, metaModel, metaName);
                if(entity.Scene.DesignMode)
                    SplatObjects.Add(new Common.Tuple<Model9, Entity, string>(model, entity, metaName));
            }
            else if (metaModel.SkinnedMesh != null)
            {
                foreach (var SM in model.SkinnedMesh.MeshContainers)
                {
                    if (SM.Second.SkinInfo != null)
                    {
                        //Renderer.totalAddedItems++;
                        string techniqueName = "SkinnedMesh" + techniqueNameEnding;

                        RenderTechnique r;
                        if (!Techniques.TryGetValue(techniqueName, out r))
                            Techniques[techniqueName] = r = new RenderTechnique();
                        r.Insert(model, entity, metaModel, metaName, model.SkinnedMesh, null, false);
                    }
                    else
                    {
                        //Renderer.totalAddedItems++;

                        RenderTechnique r;
                        if (!Techniques.TryGetValue("ShadowedSceneInstanced" + techniqueNameEnding, out r))
                            Techniques["ShadowedSceneInstanced" + techniqueNameEnding] = r = new RenderTechnique();
                        r.Insert(model, entity, metaModel, metaName, null, SM.Second.MeshData.Mesh, true);
                    }
                }
            }
            else if (metaModel.XMesh != null)
            {
                //Renderer.totalAddedItems++;

                RenderTechnique r;
                if (!Techniques.TryGetValue("ShadowedSceneInstanced" + techniqueNameEnding, out r))
                    Techniques["ShadowedSceneInstanced" + techniqueNameEnding] = r = new RenderTechnique();
                r.Insert(model, entity, metaModel, metaName, null, model.XMesh, false);
            }
        }