@laplace.live/persona-sdk 1.10.0 → 1.11.1

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.
@@ -33,6 +33,10 @@ export declare function sceneLightIntensityMax(type: SceneLightType): number;
33
33
  export declare function sceneLightIsAimed(type: SceneLightType): boolean;
34
34
  /** Whether a light of `type` can cast shadows; ambient and area lights never do. */
35
35
  export declare function sceneLightCastsShadows(type: SceneLightType): boolean;
36
+ /** Whether a light of `type` can light volumetric haze; directional and ambient lights never do. */
37
+ export declare function sceneLightCanHaze(type: SceneLightType): boolean;
38
+ /** Whether `light` lights volumetric haze now: switched on, opted in, and of a type that can. */
39
+ export declare function sceneLightHazes(light: Pick<SceneLight, 'type' | 'enabled' | 'volumetric'>): boolean;
36
40
  export declare const LIVE2D_SCALE_MIN = 0.1;
37
41
  export declare const LIVE2D_SCALE_MAX = 24;
38
42
  export declare const VRM_SCALE_MIN = 0.05;
@@ -55,6 +55,14 @@ export function sceneLightIsAimed(type) {
55
55
  export function sceneLightCastsShadows(type) {
56
56
  return type !== 'ambient' && type !== 'area';
57
57
  }
58
+ /** Whether a light of `type` can light volumetric haze; directional and ambient lights never do. */
59
+ export function sceneLightCanHaze(type) {
60
+ return type === 'point' || type === 'spot' || type === 'area';
61
+ }
62
+ /** Whether `light` lights volumetric haze now: switched on, opted in, and of a type that can. */
63
+ export function sceneLightHazes(light) {
64
+ return light.enabled !== false && light.volumetric === true && sceneLightCanHaze(light.type);
65
+ }
58
66
  // Live2D bounds are the zoom clamp (zoom.ts re-exports these); VRM scales a world-space root.
59
67
  export const LIVE2D_SCALE_MIN = 0.1;
60
68
  export const LIVE2D_SCALE_MAX = 24;
@@ -164,6 +172,8 @@ export function defaultSceneLightOf(type) {
164
172
  width: DEFAULT_AREA_LIGHT_SIZE,
165
173
  height: DEFAULT_AREA_LIGHT_SIZE,
166
174
  roll: 0,
175
+ // Haze is a render pass of its own; a new light joins it only when asked.
176
+ volumetric: false,
167
177
  // A point light shadow is six cube faces, so it stays opt-in where a
168
178
  // directional light's single depth pass can be on by default.
169
179
  shadowQuality: type === 'directional' ? 'high' : 'off',
@@ -30,7 +30,7 @@ export declare const SCENE_VOLUMETRIC_LIGHTING_SPECS: {
30
30
  readonly digits: 2;
31
31
  };
32
32
  };
33
- /** Existing scenes retain clear air until volumetric lighting is enabled. */
33
+ /** How the haze looks once a light opts in; scenes with no volumetric light keep clear air. */
34
34
  export declare function defaultSceneVolumetricLighting(): SceneVolumetricLighting;
35
35
  /** Restore saved haze settings and clamp them to the shared editor bounds. */
36
36
  export declare function healSceneVolumetricLighting(raw: unknown): SceneVolumetricLighting;
@@ -8,11 +8,10 @@ export const SCENE_VOLUMETRIC_LIGHTING_SPECS = {
8
8
  range: { default: 20, min: 1, max: 100, step: 1, digits: 0 },
9
9
  speed: { default: 0.2, min: 0, max: 5, step: 0.05, digits: 2 },
10
10
  };
11
- /** Existing scenes retain clear air until volumetric lighting is enabled. */
11
+ /** How the haze looks once a light opts in; scenes with no volumetric light keep clear air. */
12
12
  export function defaultSceneVolumetricLighting() {
13
13
  const specs = SCENE_VOLUMETRIC_LIGHTING_SPECS;
14
14
  return {
15
- enabled: false,
16
15
  density: specs.density.default,
17
16
  intensity: specs.intensity.default,
18
17
  range: specs.range.default,
@@ -27,7 +26,6 @@ export function healSceneVolumetricLighting(raw) {
27
26
  return d;
28
27
  const specs = SCENE_VOLUMETRIC_LIGHTING_SPECS;
29
28
  return {
30
- enabled: typeof raw.enabled === 'boolean' ? raw.enabled : d.enabled,
31
29
  density: clamp(finiteOr(raw.density, d.density), specs.density.min, specs.density.max),
32
30
  intensity: clamp(finiteOr(raw.intensity, d.intensity), specs.intensity.min, specs.intensity.max),
33
31
  range: clamp(finiteOr(raw.range, d.range), specs.range.min, specs.range.max),
@@ -396,6 +396,11 @@ export interface SceneLight {
396
396
  height?: number;
397
397
  /** Area light rotation in its rectangle's plane, in degrees; defaults to 0. */
398
398
  roll?: number;
399
+ /**
400
+ * Light illuminated haze around this light; point, spot and area lights only.
401
+ * Defaults to false; omitted by hosts without per-light volumetric lighting.
402
+ */
403
+ volumetric?: boolean;
399
404
  /** Ambient and area lights never cast shadows. */
400
405
  shadowQuality: ShadowQuality;
401
406
  /** PCF disk radius in shadow-map texels; retained while PCSS is selected. */
@@ -412,9 +417,11 @@ export interface SceneFog {
412
417
  /** Exponential-squared falloff; the useful band is well under 1 at avatar scale. */
413
418
  density: number;
414
419
  }
415
- /** Illuminated haze in the 3D stage; rendered only by perspective cameras. */
420
+ /**
421
+ * How the illuminated haze looks in the 3D stage; rendered only by perspective
422
+ * cameras, and only while some scene light opts in through `SceneLight.volumetric`.
423
+ */
416
424
  export interface SceneVolumetricLighting {
417
- enabled: boolean;
418
425
  density: number;
419
426
  intensity: number;
420
427
  /** Distance from the camera in scene units. */
@@ -910,6 +917,11 @@ export interface SceneEnvironment {
910
917
  volumetricLighting?: SceneVolumetricLighting;
911
918
  /** Optimize unshadowed point lights on supported renderers; omitted by older hosts. */
912
919
  clusteredLighting?: boolean;
920
+ /**
921
+ * Simulate 3D objects as rigid bodies falling onto the stage floor; omitted by older hosts.
922
+ * The simulated pose is never saved — switching it off restores each object's placement.
923
+ */
924
+ physics?: boolean;
913
925
  effects: SceneEffects;
914
926
  /**
915
927
  * Built-in effects added as layers, in registry order — one keeps its row and tuning while
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@laplace.live/persona-sdk",
3
- "version": "1.10.0",
3
+ "version": "1.11.1",
4
4
  "description": "TypeScript SDK and wire schema for the LAPLACE Persona plugin API",
5
5
  "license": "MIT",
6
6
  "type": "module",