Add light shape wireframe display in viewport

Draw a type-appropriate wireframe gizmo for every UsdLux light in the stage,
mirroring the existing camera-wireframe overlay (dedicated VAO/VBO reusing the
bbox shader, drawn on top with depth-test off).

Shapes, built in the light's local space and pushed through its local-to-world
transform:
  - SphereLight   3 orthogonal circles (radius); axis-cross when treatAsPoint
  - RectLight     width x height rectangle + emission direction line
  - DiskLight     circle + direction line
  - CylinderLight two end-cap circles + connectors (radius/length)
  - DistantLight  sun disc + parallel rays
  - DomeLight     3 large display-scaled circles

Selected lights draw accent orange, others warm yellow.

Verified by creating a SphereLight (3-circle sphere) and a RectLight
(rectangle) in-app: distinct shapes, correct selected/deselected colours,
gizmos visible over geometry.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-22 07:56:47 +08:00
parent a24eff04bd
commit 2649fe814c
3 changed files with 247 additions and 0 deletions
+3
View File
@@ -1104,6 +1104,9 @@ void ViewportTile::Render(int tileIndex, ImVec2 pos, ImVec2 size,
m_stage, m_selectedSdfPaths,
m_camera.GetUsdCameraPath(),
viewProj, m_camera.GetDist());
m_renderer.DrawLightWireframes(
m_stage, m_selectedSdfPaths,
viewProj, m_camera.GetDist());
}
// Display FBO texture (flip UV Y: OpenGL is bottom-up)