Skip to content

Lights: Slice C — Light property panel #485

Description

@fernandotonon

Parent epic: #482
Depends on: Slice B

Goal

A dedicated "Light" section in the QML inspector that appears when a light is selected, exposing every editable property with sensible ranges and live preview.

Scope

  • New collapsible section in qml/PropertiesPanel.qml: "Light". Visible only when the selection contains lights.
  • Bridge through a new LightPropertiesController (src/LightPropertiesController.{h,cpp}, QML_SINGLETON) similar in shape to PropertiesPanelController. Reads/writes through LightManager.
  • Properties:
    • Type: directional / point / spot (changing type preserves position/rotation).
    • Enabled toggle.
    • Colour: diffuse + specular as separate pickers (most users will lock them together; provide a "link" toggle, default linked).
    • Intensity: scalar 0–10 with slider + numeric input. Maps to a power scaler on Ogre::Light colour or to setPowerScale where available.
    • Range (point/spot): scalar in scene units.
    • Attenuation: range, constant, linear, quadratic. Provide presets ("Realistic" inverse-square, "Old-school" linear) so users don't need to fiddle with the four numbers directly. Advanced expander shows the raw values.
    • Spot cone (spot only): inner angle, outer angle (in degrees), falloff exponent.
    • Directional softness (directional only, advanced): placeholder for a future PCSS-style param; UI-only no-op for now.
  • All slider edits push a single mergeable EditLightPropertyCommand per drag interaction (mirror TranslateCommand::mergeWith).
  • Numeric inputs honour Enter to commit; Escape to revert.
  • Multi-selected lights show "Mixed" for differing values; editing applies the new value to all.

Acceptance Criteria

  • All listed properties are editable and immediately visible in the viewport.
  • Spot inner/outer angle clamps correctly (inner ≤ outer ≤ 180°).
  • Attenuation presets produce believable point-light falloff curves.
  • Slider drags push exactly one undo command, not one per frame.
  • Multi-edit applies cleanly and the "Mixed" indicator behaves correctly.
  • Sentry breadcrumb scene.light.edit per property class (colour / intensity / range / cone).
  • Unit test on LightPropertiesController round-trips every property.

Effort

~5 days.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or requestlightingScene lighting: add/edit/manage lights, shadows, IESui

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions