static void ReloadMaterial(FMAT mat)
 {
     mat.UpdateRenderState();
     foreach (FSHP mesh in mat.GetMappedMeshes())
     {
         mesh.ReloadShader();
     }
 }
        static void ReloadMaterial(FMAT mat)
        {
            mat.Material.RenderState.PolygonControl.CullBack  = mat.CullBack;
            mat.Material.RenderState.PolygonControl.CullFront = mat.CullFront;

            mat.UpdateRenderState();
            foreach (FSHP mesh in mat.GetMappedMeshes())
            {
                mesh.ReloadShader();
            }
        }
        public static void Render(FMAT material)
        {
            RenderHeader();

            if (ImGui.BeginChild("RENDER_INFO_LIST"))
            {
                int index = 0;
                foreach (var renderInfo in material.Material.RenderInfos.Values)
                {
                    ImGui.Columns(2);
                    if (ImGui.Selectable(renderInfo.Name, SelectedIndices.Contains(index)))
                    {
                        SelectedIndices.Clear();
                        SelectedIndices.Add(index);
                    }
                    ImGui.NextColumn();
                    ImGui.Text(GetDataString(renderInfo, ","));
                    ImGui.NextColumn();

                    if (dialogOpen && SelectedIndices.Contains(index))
                    {
                        ActiveDialog.LoadDialog(renderInfo, dialogOpen, (o, e) =>
                        {
                            material.UpdateRenderState();
                            foreach (FSHP mesh in material.GetMappedMeshes())
                            {
                                mesh.ReloadShader();
                            }
                        });
                    }

                    if (SelectedIndices.Contains(index) && ImGui.IsMouseDoubleClicked(0))
                    {
                        dialogOpen = true;
                        ActiveDialog.OnLoad(material, renderInfo);
                        ImGui.OpenPopup("##render_info_dialog");
                    }

                    index++;

                    ImGui.Columns(1);
                }
            }
            ImGui.EndChild();
        }