Skip to content

Add Spark splat dynamic lighting and line-based point helper#39

Open
querielo wants to merge 1 commit into
Stem-Studio:mainfrom
querielo:kirill/light-splats
Open

Add Spark splat dynamic lighting and line-based point helper#39
querielo wants to merge 1 commit into
Stem-Studio:mainfrom
querielo:kirill/light-splats

Conversation

@querielo
Copy link
Copy Markdown
Contributor

@querielo querielo commented Jun 4, 2026

Summary

Add dynamic Spark lighting support for Gaussian splats and switch point light helper rendering to line geometry (no wireframe mesh).

Screen.Recording.2026-06-05.at.00.28.08.mp4

Why

  • Splats needed to react to scene lights.
  • Point/spot behavior needed better parity with standard materials.
  • Point light helper should avoid wireframe rendering.

Lighting Behavior

  • PointLight + SpotLight supported for splats.
  • SpotLight uses cone + range clipping.
  • PointLight tuned dimmer for splats with softer falloff.
  • Ambient/Directional mapping stays opt-in.
  • Runtime-only lights skipped unless explicitly enabled.

Performance

  • Scan-based light/splat discovery (scanIntervalMs).
  • Reduced per-frame allocations in bridge.
  • Fast path: no per-frame sync when no visible splats.

Validation

  • Typecheck passed.
  • Focused eslint passed.
  • Runtime probes passed for:
    • spot cone orientation
    • point vs spot SDF composition
    • hidden-parent visibility handling
    • no-splat fast path

Risk / Notes

  • Scan interval can add small propagation delay for new/removed lights/splats.
  • Set scene.userData.rendering.splat.lighting.scanIntervalMs = 0 for immediate updates.

Copilot AI review requested due to automatic review settings June 4, 2026 23:20
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Introduces a Spark dynamic lighting bridge that converts Three.js scene lights into Spark SDF-based lighting edits, wires it into the main renderer lifecycle, and updates helpers/loader behavior to support the new lighting workflow.

Changes:

  • Added SparkSceneLightingBridge to scan scene lights and drive Spark SplatEdit/SplatEditSdf instances.
  • Integrated lighting bridge creation/update/disposal into EffectRenderer.
  • Updated VolumePointLightHelper implementation and made loaded splats editable.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 4 comments.

File Description
client/packages/editor-oss/src/render/SparkLightingBridge.ts New bridge that maps Three lights to Spark lighting SDF edits and manages lifecycle.
client/packages/editor-oss/src/render/EffectRenderer.js Creates/updates/disposes the lighting bridge during renderer init/render/cleanup.
client/packages/editor-oss/src/helper/light/VolumePointLightHelper.js Replaces PointLightHelper inheritance with a custom LineSegments-based helper.
client/packages/editor-oss/src/assets/js/loaders/SparkGaussianSplatLoader.ts Loads splats as editable to support downstream edits/lighting workflows.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread client/packages/editor-oss/src/render/SparkLightingBridge.ts
Comment thread client/packages/editor-oss/src/render/EffectRenderer.js
Comment thread client/packages/editor-oss/src/render/EffectRenderer.js
Comment thread client/packages/editor-oss/src/render/SparkLightingBridge.ts
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants