Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Nov 29, 2025

Related issue: -

Description

Small cleanup to ensure the toJSON() implementations of light classes work in a consistent fashion. All lights behave now like LightProbe and RectAreaLight which means each class is responsible to serialize its own properties. This is a cleaner OO design than checking for properties of subclasses which was previously done in Light.toJSON().

Besides, SpotLight.map is now correctly serialized and copied.

@github-actions
Copy link

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 350.26
83.06
350.26
83.06
+0 B
+0 B
WebGPU 613.73
170.42
613.73
170.42
+0 B
+0 B
WebGPU Nodes 612.33
170.15
612.33
170.15
+0 B
+0 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Before After Diff
WebGL 482.25
117.84
482.25
117.84
+0 B
+0 B
WebGPU 684.87
186.19
685.12
186.21
+246 B
+10 B
WebGPU Nodes 634.71
173.38
634.96
173.39
+246 B
+7 B

@Mugen87 Mugen87 added this to the r182 milestone Nov 29, 2025
@Mugen87 Mugen87 merged commit 5fd137b into mrdoob:dev Nov 29, 2025
10 checks passed
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.

1 participant