Skip to content

Conversation

@simplast
Copy link

Problem Summary:

Issue: Light intensity accumulation with multiple client connections

Description: When multiple web clients connect to the same gzbridge instance, the existing client's scene becomes progressively brighter with each new client connection.

Symptoms:

  • Client A connects normally with correct lighting
  • When Client B connects, Client A's scene becomes overbright
  • With Client C connection, lighting becomes even brighter
  • Each additional client connection adds to the light accumulation

Root Cause: The initScene() function in gzscene.js creates a new sun light on every client initialization without checking if lights already exist, causing duplicate light sources to accumulate in the shared THREE.js scene.

Impact: Visual degradation where scenes become unnaturally bright as more clients connect, making the simulation unusable for existing clients.

Reproduction:

  1. Open first web client → lighting appears normal
  2. Open second web client → first client's scene becomes brighter
  3. Open third web client → lighting becomes even more overbright
  4. Repeat → progressive light accumulation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants