diff --git a/editor/Widgets/WorldViewer.cpp b/editor/Widgets/WorldViewer.cpp index ccf5ec190..70f930f66 100644 --- a/editor/Widgets/WorldViewer.cpp +++ b/editor/Widgets/WorldViewer.cpp @@ -93,37 +93,22 @@ void WorldViewer::TreeShow() bool is_in_game_mode = Spartan::Engine::IsFlagSet(Spartan::EngineMode::Playing); ImGui::BeginDisabled(is_in_game_mode); { - if (ImGui::TreeNodeEx("Root", ImGuiTreeNodeFlags_DefaultOpen | ImGuiTreeNodeFlags_SpanFullWidth)) + // iterate over root entities directly, omitting the root node + vector> root_entities = Spartan::World::GetRootEntities(); + for (const shared_ptr& entity : root_entities) { - // dropping on the scene node should unparent the entity - if (auto payload = ImGuiSp::receive_drag_drop_payload(ImGuiSp::DragPayloadType::Entity)) + if (entity->IsActive()) { - const uint64_t entity_id = get(payload->data); - if (const shared_ptr& dropped_entity = Spartan::World::GetEntityById(entity_id)) - { - shared_ptr null = nullptr; - dropped_entity->SetParent(null); - } - } - - vector> root_entities = Spartan::World::GetRootEntities(); - for (const shared_ptr& entity : root_entities) - { - if (entity->IsActive()) - { - TreeAddEntity(entity); - } - } - - // if we have been expanding to show an entity and no more expansions are taking place, we reached it - // so, we stop expanding and we bring it into view - if (m_expand_to_selection && !m_expanded_to_selection) - { - ImGui::ScrollToBringRectIntoView(m_window, m_selected_entity_rect); - m_expand_to_selection = false; + TreeAddEntity(entity); } + } - ImGui::TreePop(); + // if we have been expanding to show an entity and no more expansions are taking place, we reached it + // so, we stop expanding and we bring it into view + if (m_expand_to_selection && !m_expanded_to_selection) + { + ImGui::ScrollToBringRectIntoView(m_window, m_selected_entity_rect); + m_expand_to_selection = false; } } ImGui::EndDisabled(); diff --git a/runtime/Rendering/Renderer_Passes.cpp b/runtime/Rendering/Renderer_Passes.cpp index efa6b5e16..a27fad95e 100644 --- a/runtime/Rendering/Renderer_Passes.cpp +++ b/runtime/Rendering/Renderer_Passes.cpp @@ -403,28 +403,25 @@ namespace Spartan } } - // render resolution + // render at render resolution (only opaques) { - // opaque - { - bool is_transparent = false; - Pass_Visibility(cmd_list_graphics); - Pass_Depth_Prepass(cmd_list_graphics); - Pass_GBuffer(cmd_list_graphics, is_transparent); - Pass_Ssr(cmd_list_graphics); - Pass_Ssao(cmd_list_graphics); - Pass_Sss(cmd_list_graphics); - Pass_Light(cmd_list_graphics, is_transparent); // compute diffuse and specular buffers - Pass_Light_GlobalIllumination(cmd_list_graphics); // compute global illumination - Pass_Light_Composition(cmd_list_graphics, is_transparent); // compose all light (diffuse, specular, etc.) - Pass_Light_ImageBased(cmd_list_graphics, is_transparent); // apply IBL (skysphere, ssr, global illumination etc.) - } + bool is_transparent = false; + Pass_Visibility(cmd_list_graphics); + Pass_Depth_Prepass(cmd_list_graphics); + Pass_GBuffer(cmd_list_graphics, is_transparent); + Pass_Ssr(cmd_list_graphics); + Pass_Ssao(cmd_list_graphics); + Pass_Sss(cmd_list_graphics); + Pass_Light(cmd_list_graphics, is_transparent); // compute diffuse and specular buffers + Pass_Light_GlobalIllumination(cmd_list_graphics); // compute global illumination + Pass_Light_Composition(cmd_list_graphics, is_transparent); // compose all light (diffuse, specular, etc.) + Pass_Light_ImageBased(cmd_list_graphics, is_transparent); // apply IBL (skysphere, ssr, global illumination etc.) } - // render to output resolution + // upscale to output resolution Pass_Upscale(cmd_list_graphics); - // output resolution + // render at output resolution { // transparent if (mesh_index_transparent != -1)