Exemple #1
0
        public static void Render(FMAT material)
        {
            var renderer = material.MaterialAsset as SharcFBRenderer;

            if (renderer.GLShaderInfo == null)
            {
                return;
            }

            if (ImGui.BeginCombo("Stage", selectedStage))
            {
                if (ImGui.Selectable("Vertex"))
                {
                    selectedStage = "Vertex";
                }
                if (ImGui.Selectable("Pixel"))
                {
                    selectedStage = "Pixel";
                }
                ImGui.EndCombo();
            }

            ImGui.BeginTabBar("menu_shader1");
            if (ImguiCustomWidgets.BeginTab("menu_shader1", $"Shader Code"))
            {
                LoadShaderStageCode(material);
                ImGui.EndTabItem();
            }
            if (ImguiCustomWidgets.BeginTab("menu_shader1", "Shader Info"))
            {
                if (ImGui.BeginChild("ShaderInfoC"))
                {
                    LoadShaderInfo(material);
                }
                ImGui.EndChild();
                ImGui.EndTabItem();
            }
            if (ImguiCustomWidgets.BeginTab("menu_shader1", "GX2 Shader Data"))
            {
                var shader  = material.MaterialAsset as SharcFBRenderer;
                var program = shader.ShaderModel;

                if (selectedStage == "Vertex")
                {
                    var gx2Shader = program.GetRawVertexShader(shader.BinaryIndex).ToArray();
                    MemoryEditor.Draw(gx2Shader, gx2Shader.Length);
                }
                if (selectedStage == "Pixel")
                {
                    var gx2Shader = program.GetRawPixelShader(shader.BinaryIndex).ToArray();
                    MemoryEditor.Draw(gx2Shader, gx2Shader.Length);
                }
                ImGui.EndTabItem();
            }
        }
 public void LoadEditor(BfresBone bone)
 {
     ImGui.BeginTabBar("bone_tab");
     if (ImguiCustomWidgets.BeginTab("bone_tab", "Bone Data"))
     {
         LoadBoneTab(bone);
         ImGui.EndTabItem();
     }
     if (ImguiCustomWidgets.BeginTab("bone_tab", "User Data"))
     {
         UserDataInfoEditor.Render(bone.BoneData.UserData);
         ImGui.EndTabItem();
     }
     ImGui.EndTabBar();
 }
Exemple #3
0
        public void Render(GLFrameworkEngine.GLContext context)
        {
            if (ImGui.Begin("Lighting Editor", ref opened))
            {
                ImGui.BeginTabBar("Menu1");

                if (ImguiCustomWidgets.BeginTab("Menu1", "Color Correction"))
                {
                    ImGui.EndTabItem();
                }

                if (ImguiCustomWidgets.BeginTab("Menu1", "Environment"))
                {
                    ImGui.EndTabItem();
                }

                if (ImguiCustomWidgets.BeginTab("Menu1", "Light Maps"))
                {
                    LightMapEditor.Render(context);
                    ImGui.EndTabItem();
                }

                if (ImguiCustomWidgets.BeginTab("Menu1", "Cube Maps"))
                {
                    CubemapUintWindow.Render(context);
                    ImGui.EndTabItem();
                }

                ImGui.EndTabBar();

/*
 *              ImGui.Columns(2);
 *              if (ImGui.Selectable("Color Correction", ColorCorrectionWindow.IsActive)) {
 *                  ColorCorrectionWindow.IsActive = true;
 *              }
 *              ImGui.NextColumn();
 *
 *              if (ColorCorrectionWindow.IsActive)
 *                  ColorCorrectionWindow.Render(context);
 *
 *              ImGui.NextColumn();*/
            }
            ImGui.End();
        }
        public void Render(GX2VertexShader vertexShader, GX2PixelShader pixelShader)
        {
            if (string.IsNullOrEmpty(VertexShaderSource))
            {
                OnLoad(vertexShader, pixelShader);
            }

            if (ImGui.BeginCombo("Stage", selectedStage))
            {
                if (ImGui.Selectable("Vertex"))
                {
                    selectedStage = "Vertex";
                }
                if (ImGui.Selectable("Pixel"))
                {
                    selectedStage = "Pixel";
                }
                ImGui.EndCombo();
            }

            ImGui.BeginTabBar("menu_shader1");
            if (ImguiCustomWidgets.BeginTab("menu_shader1", $"Shader Code"))
            {
                LoadShaderStageCode();
                ImGui.EndTabItem();
            }
            if (ImguiCustomWidgets.BeginTab("menu_shader1", "Shader Info"))
            {
                if (ImGui.BeginChild("ShaderInfoC"))
                {
                    LoadShaderInfo(vertexShader, pixelShader);
                }
                ImGui.EndChild();
                ImGui.EndTabItem();
            }
        }
Exemple #5
0
        public void LoadEditorMenus(FMAT material)
        {
            if (UVViewport == null)
            {
                Init();
            }

            if (activeMaterial != material)
            {
                onLoad = true;
                MaterialParameter.Reset();
                MaterialOptions.Reset();
                BfresTextureMapEditor.Reset();
                UVViewport.Reset();
            }

            activeMaterial = material;

            if (ImGui.CollapsingHeader("Material Info", ImGuiTreeNodeFlags.DefaultOpen))
            {
                ImGuiHelper.InputFromText("Name", material, "Name", 200);
                ImGuiHelper.InputFromText("ShaderArchive", material, "ShaderArchive", 200);
                ImGuiHelper.InputFromText("ShaderModel", material, "ShaderModel", 200);
                ImGuiHelper.InputFromBoolean("Visible", material.Material, "Visible");
            }

            if (ImGui.BeginChild("##MATERIAL_EDITOR"))
            {
                ImGui.BeginTabBar("Menu1");

                if (ImguiCustomWidgets.BeginTab("Menu1", "Texture Maps"))
                {
                    BfresTextureMapEditor.Render(material, UVViewport, onLoad);
                    ImGui.EndTabItem();
                }

                if (ImguiCustomWidgets.BeginTab("Menu1", "Parameters"))
                {
                    MaterialParameter.Render(material);
                    ImGui.EndTabItem();
                }
                if (ImguiCustomWidgets.BeginTab("Menu1", "Render Info"))
                {
                    RenderInfoEditor.Render(material);
                    ImGui.EndTabItem();
                }
                if (ImguiCustomWidgets.BeginTab("Menu1", "Options"))
                {
                    MaterialOptions.Render(material);
                    ImGui.EndTabItem();
                }

                if (!material.ParentFile.ResFile.IsPlatformSwitch)
                {
                    if (ImguiCustomWidgets.BeginTab("Menu1", "Render State"))
                    {
                        RenderStateEditor.Render(material);
                        ImGui.EndTabItem();
                    }
                }

                if (ImguiCustomWidgets.BeginTab("Menu1", "User Data"))
                {
                    UserDataInfoEditor.Render(material.Material.UserData);
                    ImGui.EndTabItem();
                }

                if (material.MaterialAsset is BfshaRenderer)
                {
                    if (ImguiCustomWidgets.BeginTab("Menu1", "Shader Data"))
                    {
                        BfshaShaderProgramViewer.Render(material);
                        ImGui.EndTabItem();
                    }
                }
                else if (material.MaterialAsset is SharcFBRenderer)
                {
                    if (ImguiCustomWidgets.BeginTab("Menu1", "Shader Data"))
                    {
                        SharcFBShaderProgramViewer.Render(material);
                        ImGui.EndTabItem();
                    }
                }


                if (material.MaterialAsset is KSANXRender)
                {
                    if (ImguiCustomWidgets.BeginTab("Menu1", "Lighting Data"))
                    {
                        ((KSANXRender)material.MaterialAsset).RenderUI();
                        ImGui.EndTabItem();
                    }
                }

                ImGui.EndTabBar();
            }
            ImGui.EndChild();

            onLoad = false;
        }
Exemple #6
0
        public static void Render(FMAT material)
        {
            var renderer = material.MaterialAsset as BfshaRenderer;

            if (ImGui.BeginCombo("Stage", selectedStage))
            {
                if (ImGui.Selectable("Vertex"))
                {
                    selectedStage = "Vertex";
                }
                if (ImGui.Selectable("Pixel"))
                {
                    selectedStage = "Pixel";
                }
                ImGui.EndCombo();
            }

            ImGui.BeginTabBar("menu_shader1");
            if (ImguiCustomWidgets.BeginTab("menu_shader1", $"Shader Code"))
            {
                if (renderer.GLShaderInfo != null)
                {
                    LoadShaderStageCode(material);
                }
                ImGui.EndTabItem();
            }
            if (ImguiCustomWidgets.BeginTab("menu_shader1", "Shader Info"))
            {
                if (ImGui.BeginChild("ShaderInfoC"))
                {
                    LoadShaderInfo(material);
                }
                ImGui.EndChild();
                ImGui.EndTabItem();
            }

            if (renderer.GLShaderInfo != null)
            {
                if (ImguiCustomWidgets.BeginTab("menu_shader1", "Shader Constants"))
                {
                    if (selectedStage == "Vertex")
                    {
                        var constants = renderer.GLShaderInfo.VertexConstants;
                        if (constants != null)
                        {
                            MemoryEditor.Draw(constants, constants.Length);
                        }
                    }
                    if (selectedStage == "Pixel")
                    {
                        var constants = renderer.GLShaderInfo.PixelConstants;
                        if (constants != null)
                        {
                            MemoryEditor.Draw(constants, constants.Length);
                        }
                    }
                    ImGui.EndTabItem();
                }
            }

            ImGui.EndTabBar();
        }