@volter/editor-threejs 0.5.75 → 0.5.76
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@volter/editor-threejs",
|
|
3
3
|
"author": "Volter AI, Inc.",
|
|
4
|
-
"version": "0.5.
|
|
4
|
+
"version": "0.5.76",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
7
7
|
},
|
|
@@ -135,12 +135,12 @@
|
|
|
135
135
|
"serving": "./dist-node/serving.mjs"
|
|
136
136
|
},
|
|
137
137
|
"dependencies": {
|
|
138
|
-
"@volter/editor-project": "0.5.
|
|
138
|
+
"@volter/editor-project": "0.5.76",
|
|
139
139
|
"@sparkjsdev/spark": "^2.1.0",
|
|
140
140
|
"three.quarks": "^0.16.0",
|
|
141
141
|
"zod": "^4.3.6",
|
|
142
142
|
"typescript": "5.9.3",
|
|
143
|
-
"@volter/editor-sdk": "0.5.
|
|
143
|
+
"@volter/editor-sdk": "0.5.76",
|
|
144
144
|
"postprocessing": "6.38.3",
|
|
145
145
|
"quarks.core": "0.16.0",
|
|
146
146
|
"@fortawesome/free-solid-svg-icons": "^7.2.0"
|
|
@@ -553,6 +553,8 @@ function fadingFloorMaterial(): THREE.MeshStandardMaterial {
|
|
|
553
553
|
}
|
|
554
554
|
|
|
555
555
|
export class StagePresentationRig {
|
|
556
|
+
/** What the scene held at the last `resolveSource`: which of its parts take over the view's. */
|
|
557
|
+
private takeover: Readonly<Partial<Record<SceneTakeover, boolean>>> = {};
|
|
556
558
|
private readonly group = new THREE.Group();
|
|
557
559
|
private readonly ambient = new THREE.AmbientLight(0xffffff, 0);
|
|
558
560
|
private lights: { readonly light: THREE.DirectionalLight; readonly spec: StudioLight }[] = [];
|
|
@@ -634,8 +636,9 @@ export class StagePresentationRig {
|
|
|
634
636
|
this.floor.material.color.set(presentation.overlays.floor.color);
|
|
635
637
|
const preset = studioPreset(lighting.studioPreset);
|
|
636
638
|
if (preset !== this.preset) this.build(preset);
|
|
637
|
-
|
|
638
|
-
|
|
639
|
+
// The source by the view's rule and what the scene last held (`resolveSource`): an `auto`
|
|
640
|
+
// view whose scene has its own lights stays dark.
|
|
641
|
+
this.resolveSource(this.takeover);
|
|
639
642
|
// A stage whose render pipeline owns the tone (the game world's) passes `tone: false`.
|
|
640
643
|
if (options.tone !== false) {
|
|
641
644
|
renderer.toneMapping = documentToneMapping ?? TONE_MAPPERS[lighting.tone.mapper];
|
|
@@ -953,6 +956,7 @@ export class StagePresentationRig {
|
|
|
953
956
|
* (the kit's rule, Godot's preview); without `auto` the view's source stands (Blender, Unity).
|
|
954
957
|
*/
|
|
955
958
|
resolveSource(scene: Readonly<Partial<Record<SceneTakeover, boolean>>>): 'studio' | 'preview' | 'scene' {
|
|
959
|
+
this.takeover = scene;
|
|
956
960
|
const lighting = this.presentation?.lighting;
|
|
957
961
|
let source: 'studio' | 'preview' | 'scene' = lighting?.source ?? 'studio';
|
|
958
962
|
if (lighting?.auto && source !== 'scene' && lighting.auto.takeover.some((part) => scene[part] === true)) {
|
|
@@ -3842,6 +3842,16 @@ export class EditorViewport {
|
|
|
3842
3842
|
// every draw. Nothing here should shadow that with a second source.
|
|
3843
3843
|
}
|
|
3844
3844
|
|
|
3845
|
+
/**
|
|
3846
|
+
* The presentation rig's lighting source for what the scene now holds: a view whose lighting is
|
|
3847
|
+
* `auto` gives way to an adopted scene's own lights. Every draw runs it; a stage whose document
|
|
3848
|
+
* is hidden (the game world during Play, drawn by the Game view) runs it too, so the editor's
|
|
3849
|
+
* studio lights never light the game.
|
|
3850
|
+
*/
|
|
3851
|
+
resolvePresentation(): void {
|
|
3852
|
+
this._presentation?.rig.resolveSource({ light: this._store.isAdoptedSceneActive });
|
|
3853
|
+
}
|
|
3854
|
+
|
|
3845
3855
|
update(dt = 0): void {
|
|
3846
3856
|
this._ensureSparkRenderer();
|
|
3847
3857
|
this._syncLookBackground();
|
|
@@ -3883,7 +3893,7 @@ export class EditorViewport {
|
|
|
3883
3893
|
}
|
|
3884
3894
|
|
|
3885
3895
|
if (this._presentation) {
|
|
3886
|
-
this.
|
|
3896
|
+
this.resolvePresentation();
|
|
3887
3897
|
this._presentation.rig.update(this.camera);
|
|
3888
3898
|
}
|
|
3889
3899
|
for (const helper of this._boxHelpers.values()) {
|