From 95d6d083eda75b447ac09b17cebe272e8a93589e Mon Sep 17 00:00:00 2001 From: t-rvw <429601557@qq.com> Date: Tue, 19 Sep 2023 01:33:08 +0800 Subject: [PATCH] update README.md --- Engine/Source/Editor/UILayers/Inspector.cpp | 29 +++++++++++++++------ README.md | 17 +++++++++--- 2 files changed, 34 insertions(+), 12 deletions(-) diff --git a/Engine/Source/Editor/UILayers/Inspector.cpp b/Engine/Source/Editor/UILayers/Inspector.cpp index 8867ca01..bcbd696a 100644 --- a/Engine/Source/Editor/UILayers/Inspector.cpp +++ b/Engine/Source/Editor/UILayers/Inspector.cpp @@ -173,7 +173,14 @@ void UpdateComponentWidget(engine::SceneWorld* pScene for (int textureTypeValue = 0; textureTypeValue < static_cast(cd::MaterialTextureType::Count); ++textureTypeValue) { auto textureType = static_cast(textureTypeValue); - if (engine::MaterialComponent::TextureInfo* pTextureInfo = pMaterialComponent->GetTextureInfo(textureType)) + bool allowNoTextures = textureType == cd::MaterialTextureType::BaseColor || + textureType == cd::MaterialTextureType::Emissive || + textureType == cd::MaterialTextureType::Metallic || + textureType == cd::MaterialTextureType::Roughness; + + engine::MaterialComponent::TextureInfo* pTextureInfo = pMaterialComponent->GetTextureInfo(textureType); + bool canCreateTextureParameters = pTextureInfo || allowNoTextures; + if (canCreateTextureParameters) { const char* pTextureType = nameof::nameof_enum(static_cast(textureTypeValue)).data(); bool isOpen = ImGui::CollapsingHeader(pTextureType, ImGuiTreeNodeFlags_AllowItemOverlap | ImGuiTreeNodeFlags_DefaultOpen); @@ -205,13 +212,16 @@ void UpdateComponentWidget(engine::SceneWorld* pScene } } - if (pTextureInfo->textureHandle != bgfx::kInvalidHandle) + if (pTextureInfo) { - ImGui::Image(reinterpret_cast(pTextureInfo->textureHandle), ImVec2(64, 64)); + if (pTextureInfo->textureHandle != bgfx::kInvalidHandle) + { + ImGui::Image(reinterpret_cast(pTextureInfo->textureHandle), ImVec2(64, 64)); + } + + ImGuiUtils::ImGuiVectorProperty("UV Offset", pTextureInfo->GetUVOffset(), cd::Unit::None, cd::Vec2f(0.0f), cd::Vec2f(1.0f), false, 0.01f); + ImGuiUtils::ImGuiVectorProperty("UV Scale", pTextureInfo->GetUVScale()); } - - ImGuiUtils::ImGuiVectorProperty("UV Offset", pTextureInfo->GetUVOffset(), cd::Unit::None, cd::Vec2f(0.0f), cd::Vec2f(1.0f), false, 0.01f); - ImGuiUtils::ImGuiVectorProperty("UV Scale", pTextureInfo->GetUVScale()); ImGui::PopID(); } @@ -624,13 +634,15 @@ void Inspector::Update() m_lastSelectedEntity = selectedEntity; } + constexpr auto flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse; + ImGui::Begin(GetName(), &m_isEnable, flags); if (m_lastSelectedEntity == engine::INVALID_ENTITY) { + // Call ImGui::Begin to show the panel though we will do nothing. + ImGui::End(); return; } - constexpr auto flags = ImGuiWindowFlags_NoCollapse | ImGuiWindowFlags_NoScrollbar | ImGuiWindowFlags_NoScrollWithMouse; - ImGui::Begin(GetName(), &m_isEnable, flags); ImGui::BeginChild("Inspector"); details::UpdateComponentWidget(pSceneWorld, m_lastSelectedEntity); @@ -650,6 +662,7 @@ void Inspector::Update() #endif ImGui::EndChild(); + ImGui::End(); } diff --git a/README.md b/README.md index db41c6a0..9ae91288 100644 --- a/README.md +++ b/README.md @@ -5,24 +5,34 @@ [![win64_vs2022_clang](https://github.com/CatDogEngine/CatDogEngine/actions/workflows/win64_vs2022_clang.yml/badge.svg?branch=main)](https://github.com/CatDogEngine/CatDogEngine/actions/workflows/win64_vs2022_clang.yml) ## Snapshots - -![image](https://github.com/CatDogEngine/CatDogEngine/assets/75730859/4f1f0006-76e4-40cf-bd3a-ae70ecf4b6b5) +![image](https://github.com/CatDogEngine/CatDogEngine/assets/75730859/6a383b35-a1cd-45fd-98bb-a1d14709cc3e) +![image](https://github.com/CatDogEngine/CatDogEngine/assets/75730859/52ffa26b-6cc7-441a-8441-513ca11b9813) +![image](https://github.com/CatDogEngine/CatDogEngine/assets/75730859/bdeb4f25-fe78-4aca-92ca-8cd39022e194) +![image](https://github.com/CatDogEngine/CatDogEngine/assets/75730859/22da0826-baaa-47e2-b1b2-e49954345fbe) ## Features * Basic Cross Platform Editor based on ImGui * Basic Entity/Component Framework * Basic Physically Based Rendering +* Basic PostEffects + * Bloom + * Exposure + * Gamma Correction + * Tone Mapping * Basic Scene Graph SDK * Standard Atmospheric Scattering ## Developing Features +* Animation + * BlendShape + * Skeletion * JobSystem * Modern RHI except bgfx +* Particle System * Procedural Generated Terrain * RenderGraph -* Skeleton Animation ## TODO List @@ -32,7 +42,6 @@ * Foliage Rendering * Memory Management based on multiple allocators * Optimized STL specific for GameEngine -* Particle System * Physical Engine ## ThirdParty