Merged
Conversation
…Ex.h includes Agent-Logs-Url: https://github.com/starbounded-dev/LuxEngine/sessions/6dd2cc57-3cd7-44f6-b72a-901b8e701a30 Co-authored-by: sheazywi <73042839+sheazywi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Execute Phase 1 of Hazel Editor plan for LuxEngine
Phase 1: Establish Hazel-style UI:: namespace helpers
Apr 11, 2026
… controls Agent-Logs-Url: https://github.com/starbounded-dev/LuxEngine/sessions/b51ce09c-9fb1-4afe-b601-b42cd02bbf2f Co-authored-by: sheazywi <73042839+sheazywi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/starbounded-dev/LuxEngine/sessions/d53382d2-2538-494a-889e-b6b51fec073e Co-authored-by: sheazywi <73042839+sheazywi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/starbounded-dev/LuxEngine/sessions/d53382d2-2538-494a-889e-b6b51fec073e Co-authored-by: sheazywi <73042839+sheazywi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/starbounded-dev/LuxEngine/sessions/f16b0821-312b-4a7d-958d-babb8c8cf8af Co-authored-by: sheazywi <73042839+sheazywi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/starbounded-dev/LuxEngine/sessions/f16b0821-312b-4a7d-958d-babb8c8cf8af Co-authored-by: sheazywi <73042839+sheazywi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/starbounded-dev/LuxEngine/sessions/410e4096-920e-42cb-a755-1c5bc98874b2 Co-authored-by: sheazywi <73042839+sheazywi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/starbounded-dev/LuxEngine/sessions/3cc95e1b-7917-48e3-b55b-e255bc294d2d Co-authored-by: sheazywi <73042839+sheazywi@users.noreply.github.com>
…up' into copilot/refactor-scene-system-entity-hierarchy
…nds rendering Agent-Logs-Url: https://github.com/starbounded-dev/LuxEngine/sessions/feafe25a-14ea-4dc9-b2ca-d49949ed3bd1 Co-authored-by: sheazywi <73042839+sheazywi@users.noreply.github.com>
Agent-Logs-Url: https://github.com/starbounded-dev/LuxEngine/sessions/feafe25a-14ea-4dc9-b2ca-d49949ed3bd1 Co-authored-by: sheazywi <73042839+sheazywi@users.noreply.github.com>
…pilot/phase-1-hazel-editor-setup
There was a problem hiding this comment.
Pull request overview
This PR is a broad editor + scene architecture refactor aimed at moving LuxEngine’s editor toward a Hazel-style workflow (custom titlebar/dockspace, viewport overlay toolbars, hierarchy parenting, picking, and updated rendering/logging plumbing).
Changes:
- Add entity hierarchy (RelationshipComponent), world-space transform support, and prefab instantiation/serialization.
- Refactor editor UI to use a custom titlebar + viewport overlay toolbars/settings and add mouse-picking + debug overlays (AABB/icons).
- Replace the old ConsolePanel with an EditorConsolePanel + spdlog sink integration and adjust renderer/shader/pipeline wiring.
Reviewed changes
Copilot reviewed 31 out of 32 changed files in this pull request and generated 9 comments.
Show a summary per file
| File | Description |
|---|---|
| Editor/Source/Panels/SceneHierarchyPanel.cpp | Adds hierarchy-aware tree rendering + drag/drop parenting and prefab dropping. |
| Editor/Source/Panels/ConsolePanel.h | Removes legacy console panel (replaced by EditorConsolePanel). |
| Editor/Source/Panels/ConsolePanel.cpp | Removes legacy console panel implementation. |
| Editor/Source/EditorLayer.h | Adds titlebar/viewport UI APIs, picking helpers, viewport settings state, and EditorConsolePanel reference. |
| Editor/Source/EditorLayer.cpp | Implements custom titlebar/menubar, viewport overlays, mouse picking, and selection/overlay rendering updates. |
| Editor/SandboxProject/Assets/Scenes/Physics2D.luxscene | Updates sample scene with RelationshipComponent data and transform tweaks. |
| Editor/Resources/Shaders/LuxPBR_Transparent.glsl | Introduces Lux transparent PBR shader variant for the scene renderer. |
| Editor/Resources/Shaders/LuxPBR_Static.glsl | Introduces Lux static PBR shader variant for the scene renderer. |
| Core/Source/Lux/UI/UI.h | Removes legacy UI scoped color helper header. |
| Core/Source/Lux/Scene/SceneSerializer.cpp | Serializes/deserializes RelationshipComponent + new mesh/prefab components; defers parent linking. |
| Core/Source/Lux/Scene/Scene.h | Adds prefab APIs, const GetEntityByUUID, world transform helper, and const entity views. |
| Core/Source/Lux/Scene/Scene.cpp | Adds RelationshipComponent on entity creation, prefab instantiation, world-space transforms, and hierarchy-aware usage in multiple systems. |
| Core/Source/Lux/Scene/Prefab.h | Adds Prefab asset type definition. |
| Core/Source/Lux/Scene/Prefab.cpp | Implements prefab creation by cloning an entity hierarchy. |
| Core/Source/Lux/Scene/Entity.h | Adds parenting API surface (GetParent/SetParent/Children/HasParent) and GetScene accessor. |
| Core/Source/Lux/Scene/Entity.cpp | Implements parenting logic, including cycle prevention and child list maintenance. |
| Core/Source/Lux/Scene/Components.h | Adds RelationshipComponent and new mesh/prefab-related components; updates AllComponents list. |
| Core/Source/Lux/Renderer/SceneRenderer.h | Adds storage buffers for visible light index lists. |
| Core/Source/Lux/Renderer/SceneRenderer.cpp | Wires new light buffers/uniforms into geometry passes and binds spot shadow texture placeholder. |
| Core/Source/Lux/Renderer/Renderer2D.h | Adds circle render pass handle for framebuffer retargeting. |
| Core/Source/Lux/Renderer/Renderer2D.cpp | Refactors circle rendering to use a RenderPass and supports retargeting circle pass to a framebuffer. |
| Core/Source/Lux/ImGui/ImGuiLayer.cpp | Tweaks cursor handling and style/theme parameters. |
| Core/Source/Lux/ImGui/ImGuiEx.h | Includes Prefab and removes remaining UI::-qualified calls in some helpers. |
| Core/Source/Lux/Editor/EditorConsolePanel.h | Adds Hazel-style editor log panel API. |
| Core/Source/Lux/Editor/EditorConsolePanel.cpp | Implements log panel UI, filtering, details popup, and message ingestion. |
| Core/Source/Lux/Editor/EditorConsole/EditorConsoleSink.h | Adds spdlog sink to push messages into the editor console panel. |
| Core/Source/Lux/Editor/EditorConsole/ConsoleMessage.h | Adds console message model + flags. |
| Core/Source/Lux/Core/Window.cpp | Simplifies undecorated window hinting for custom titlebar support. |
| Core/Source/Lux/Core/Log.h | Removes legacy callback-based console plumbing and adjusts log formatting usage. |
| Core/Source/Lux/Core/Log.cpp | Enables editor console logger construction and includes the editor sink header. |
| Core/Source/Lux/Core/Events/SceneEvents.h | Adds new scene lifecycle/selection event types (currently not wired). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| for (auto entityID : view) | ||
| { | ||
| auto& transform = view.template get<TransformComponent>(entityID); | ||
| m_Renderer2D->DrawQuadBillboard(transform.Translation, glm::vec2(0.35f), iconTexture, 1.0f, glm::vec4(1.0f)); |
Comment on lines
+1209
to
+1210
| const TransformComponent& transform = selectedEntity.GetComponent<TransformComponent>(); | ||
| const glm::mat4 worldTransform = transform.GetTransform(); |
Comment on lines
134
to
+136
| auto& tag = entity.GetComponent<TagComponent>().Tag; | ||
| const auto& relationship = entity.GetComponent<RelationshipComponent>(); | ||
| const bool hasChildren = !relationship.Children.empty(); |
| void ImGuiLayer::Begin() | ||
| { | ||
| ImGui::SetMouseCursor(Input::GetCursorMode() == CursorMode::Normal ? ImGui::GetMouseCursor() : ImGuiMouseCursor_None); | ||
| ImGui::SetMouseCursor(Input::GetCursorMode() == CursorMode::Normal ? ImGuiMouseCursor_Arrow : ImGuiMouseCursor_None); |
Comment on lines
+47
to
+48
| for (const auto& message : m_MessageBuffer) | ||
| EditorConsolePanel::PushMessage(message); |
Comment on lines
+243
to
+255
| void EditorConsolePanel::PushMessage(const ConsoleMessage& message) | ||
| { | ||
| if (s_Instance == nullptr) | ||
| return; | ||
|
|
||
| { | ||
| std::scoped_lock<std::mutex> lock(s_Instance->m_MessageBufferMutex); | ||
| s_Instance->m_MessageBuffer.push_back(message); | ||
| } | ||
|
|
||
| if (s_Instance->m_EnableScrollToLatest) | ||
| s_Instance->m_ScrollToLatest = true; | ||
| } |
Comment on lines
+185
to
+186
|
|
||
| color = vec4(m_Params.Albedo, u_MaterialUniforms.Transparency); |
Comment on lines
+1037
to
+1038
| const TransformComponent& transformComponent = entity.GetComponent<TransformComponent>(); | ||
| const glm::mat4 worldTransform = transformComponent.GetTransform(); |
Comment on lines
+1043
to
+1055
| const glm::mat4 inverseTransform = glm::inverse(worldTransform * localTransform); | ||
| const glm::vec3 localOrigin = glm::vec3(inverseTransform * glm::vec4(rayOrigin, 1.0f)); | ||
| const glm::vec3 localDirectionVector = glm::vec3(inverseTransform * glm::vec4(rayDirection, 0.0f)); | ||
| if (glm::dot(localDirectionVector, localDirectionVector) <= std::numeric_limits<float>::epsilon()) | ||
| return; | ||
| const glm::vec3 localDirection = glm::normalize(localDirectionVector); | ||
|
|
||
| Ray localRay(localOrigin, localDirection); | ||
| float t = 0.0f; | ||
| if (localRay.IntersectsAABB(localAABB, t) && t >= 0.0f && t < outDistance) | ||
| { | ||
| outDistance = t; | ||
| hit = true; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Original prompt
Execute Phase 1 of the Hazel Editor plan for LuxEngine. Establish the Hazel visual language, fonts, and ImGui configuration.
Please implement the following:
Look at the relevant ImGui setup files, editor layer, and UI utility files to implement these foundational features.
The following is the prior conversation context from the user's chat exploration (may be truncated):
User: Could you make a plan for the Copilot agent, to make my LuxEngine's Editor exactly looking like and feeling like the Hazel Editor's
Assistant: Here is a comprehensive, step-by-step plan for the GitHub Copilot coding agent to transform LuxEngine's editor into a Hazel-style Editor. This plan breaks down the massive
EditorLayer.cppandEditorLayer.himplementation into manageable, sequential phases that an AI agent can implement via separate Pull Requests (PRs).Phase 1: Foundational UI & Theming Setup
Goal: Establish the Hazel visual language, fonts, and ImGui configuration.
ImGuiConfigFlags_DockingEnableandImGuiConfigFlags_ViewportsEnableactive.Texture2Dresources (Play, Stop, Pause, Translate, Rotate, Scale, Gears, File/Folder icons).Colors::Themenamespace/struct mapping exactly to Hazel's dark theme (e.g.,titlebar,titlebarGreen,backgroundDark,text,muted,accent).UI::namespace helpers (e.g.,UI::ScopedStyle,UI::ScopedColour,UI::ShiftCursorY,UI::DrawButtonImage) used heavily throughout Hazel.Phase 2: Custom Titlebar & Frameless Window
Goal: Remove the OS window borders and implement the custom draggable Hazel titlebar.
OnImGuiRenderwith zero padding and no background.UI_DrawTitlebar(). Include the engine logo, project name, current scene name, and right-aligned custom Window control buttons (Minimize, Maximize, Close).UI_DrawMenubar()to embed the File, Edit, View, Tools, and Help menus directly into the custom titlebar.Phase 3: The Viewport & Render Targets
Goal: Set up the main central viewport where the game scene is rendered.
ImGui::Image.m_ViewportBounds) to allow for accurate mouse picking and raycasting.EditorCamerato handle Maya-style panning, zooming, and orbiting when the viewport is hovered/focused.EditorCamerawhen the ImGui Viewport panel size changes.Phase 4: Overlaid Toolbars (Floating UI)
Goal: Add the floating transparent toolbars inside the viewport.
UI_GizmosToolbar(). Render a small borderless window in the top-left of the viewport containing Select, Translate, Rotate, and Scale icons.UI_CentralToolbar(). Render a centered overlay at the top of the viewport containing Play, Simulate, and Stop buttons to toggle theSceneState.UI_ViewportSettings(). Add the gear icon overlay in the top-right that opens a popup for grid snapping, bounding box rendering, and display modes.Phase 5: ImGuizmo & Scene Interaction
Goal: Enable visual scene manipulation.
ImGuizmo::BeginFrame(),ImGuizmo::SetOrthographic(false), andImGuizmo::SetRect()tied to the Viewport bounds.UI_DrawGizmos(). Fetch the selected entity's transform, pass it toImGuizmo::Manipulate, and decompose the resulting matrix back into the entity's Local Translation, Rotation, and Scale.This pull request was created from Copilot chat.