static void SelectSampler(FMAT material, UVViewport UVViewport, int index, bool onLoad)
        {
            var materialData = material.Material;

            var sampler   = materialData.Samplers[index].TexSampler;
            var texMapSel = materialData.TextureRefs[index];

            //Texture map info
            if (ImGui.CollapsingHeader("Texture Info", ImGuiTreeNodeFlags.DefaultOpen))
            {
                ImGuiHelper.InputFromText("Name", texMapSel, "Name", 200);
            }

            var width = ImGui.GetWindowWidth();

            //A UV preview window drawn using opengl
            if (ImGui.CollapsingHeader("Preview", ImGuiTreeNodeFlags.DefaultOpen))
            {
                if (ImGui.BeginChild("uv_viewport1", new Vector2(width, 150)))
                {
                    if (onLoad)
                    {
                        var meshes = material.GetMappedMeshes();

                        UVViewport.ActiveObjects.Clear();
                        foreach (FSHP mesh in meshes)
                        {
                            UVViewport.ActiveObjects.Add(mesh);
                        }
                    }

                    UVViewport.ActiveTextureMap = material.TextureMaps[index];
                    UVViewport.Render((int)width, 150);
                }
                ImGui.EndChild();
            }

            if (ImGui.BeginChild("sampler_properties"))
            {
                LoadProperties(sampler);
                material.ReloadTextureMap(index);
                ImGui.EndChild();
            }
        }