@3driseai/3drise-core 1.0.15 → 1.0.16
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/dist/data/index.d.ts +2 -0
- package/dist/data/index.d.ts.map +1 -1
- package/dist/data/index.js +2 -0
- package/dist/data/lightsDefaults.d.ts +14 -0
- package/dist/data/lightsDefaults.d.ts.map +1 -0
- package/dist/data/lightsDefaults.js +120 -0
- package/dist/data/shadowDefaults.d.ts +11 -0
- package/dist/data/shadowDefaults.d.ts.map +1 -0
- package/dist/data/shadowDefaults.js +31 -0
- package/dist/types/lights.d.ts +137 -2
- package/dist/types/lights.d.ts.map +1 -1
- package/dist/utils/generativeAnimatable.d.ts +1 -1
- package/dist/utils/generativeAnimatable.d.ts.map +1 -1
- package/dist/utils/generativeAnimatable.js +4 -0
- package/dist/utils/getAnimatableProperties.d.ts.map +1 -1
- package/dist/utils/getAnimatableProperties.js +6 -35
- package/package.json +1 -1
package/dist/data/index.d.ts
CHANGED
|
@@ -5,6 +5,8 @@ export * from './particlesSettings';
|
|
|
5
5
|
export * from './paths';
|
|
6
6
|
export * from './effectsDefaults';
|
|
7
7
|
export * from './particlesDefaults';
|
|
8
|
+
export * from './lightsDefaults';
|
|
9
|
+
export * from './shadowDefaults';
|
|
8
10
|
export * from './defaults';
|
|
9
11
|
export * from './shaders';
|
|
10
12
|
export { shapeConfig } from './shapeConfig';
|
package/dist/data/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/data/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,UAAU,CAAC;AACzB,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,kBAAkB,CAAC;AACjC,cAAc,kBAAkB,CAAC;AACjC,cAAc,YAAY,CAAC;AAC3B,cAAc,WAAW,CAAC;AAC1B,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC"}
|
package/dist/data/index.js
CHANGED
|
@@ -5,6 +5,8 @@ export * from './particlesSettings.js';
|
|
|
5
5
|
export * from './paths.js';
|
|
6
6
|
export * from './effectsDefaults.js';
|
|
7
7
|
export * from './particlesDefaults.js';
|
|
8
|
+
export * from './lightsDefaults.js';
|
|
9
|
+
export * from './shadowDefaults.js';
|
|
8
10
|
export * from './defaults.js';
|
|
9
11
|
export * from './shaders.js';
|
|
10
12
|
export { shapeConfig } from './shapeConfig.js';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { LightType } from '../types/lights';
|
|
2
|
+
export declare const LIGHT_LABELS: Record<LightType, string>;
|
|
3
|
+
/** Config defaults per light type — what the renderer falls back to, and what Reset restores. */
|
|
4
|
+
export declare const DEFAULT_LIGHTS: Record<LightType, Record<string, unknown>>;
|
|
5
|
+
export interface AnimatableLightProperty {
|
|
6
|
+
value: string;
|
|
7
|
+
label: string;
|
|
8
|
+
}
|
|
9
|
+
export declare const LIGHTS_ANIMATABLE: Record<LightType, AnimatableLightProperty[]>;
|
|
10
|
+
/** True when this config is a light config the tables above cover. */
|
|
11
|
+
export declare function isLightConfigType(config: {
|
|
12
|
+
type?: string;
|
|
13
|
+
} | undefined | null): boolean;
|
|
14
|
+
//# sourceMappingURL=lightsDefaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lightsDefaults.d.ts","sourceRoot":"","sources":["../../src/data/lightsDefaults.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CASlD,CAAC;AAEF,iGAAiG;AACjG,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAoCrE,CAAC;AAEF,MAAM,WAAW,uBAAuB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAWD,eAAO,MAAM,iBAAiB,EAAE,MAAM,CAAC,SAAS,EAAE,uBAAuB,EAAE,CA2D1E,CAAC;AAEF,sEAAsE;AACtE,wBAAgB,iBAAiB,CAAC,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAAG,IAAI,GAAG,OAAO,CAEvF"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
export const LIGHT_LABELS = {
|
|
2
|
+
ambient: 'Ambient Light',
|
|
3
|
+
directional: 'Directional Light',
|
|
4
|
+
point: 'Point Light',
|
|
5
|
+
spot: 'Spot Light',
|
|
6
|
+
lightBulb: 'Light Bulb',
|
|
7
|
+
spotBeam: 'Spot Beam',
|
|
8
|
+
ledArray: 'LED Array',
|
|
9
|
+
fluorescentTube: 'Fluorescent Tube',
|
|
10
|
+
};
|
|
11
|
+
/** Config defaults per light type — what the renderer falls back to, and what Reset restores. */
|
|
12
|
+
export const DEFAULT_LIGHTS = {
|
|
13
|
+
ambient: { type: 'ambient', enabled: true, intensity: 1, color: '#ffffff' },
|
|
14
|
+
directional: { type: 'directional', enabled: true, intensity: 1, color: '#ffffff' },
|
|
15
|
+
point: { type: 'point', enabled: true, intensity: 1, color: '#ffffff', distance: 0, decay: 1 },
|
|
16
|
+
spot: {
|
|
17
|
+
type: 'spot', enabled: true, intensity: 1, color: '#ffffff', distance: 0, decay: 1,
|
|
18
|
+
angle: Math.PI / 4, penumbra: 0.1, targetPosition: [0, 0, 0],
|
|
19
|
+
},
|
|
20
|
+
lightBulb: {
|
|
21
|
+
type: 'lightBulb', enabled: true, intensity: 1, color: '#ffffff', distance: 0, decay: 1,
|
|
22
|
+
on: true, colorMode: 'temperature', temperature: 2700,
|
|
23
|
+
shape: 'classic', glass: 'clear', glassTint: '#ffb070',
|
|
24
|
+
warmup: 0.25, flicker: 0, halo: 1,
|
|
25
|
+
},
|
|
26
|
+
spotBeam: {
|
|
27
|
+
type: 'spotBeam', enabled: true, intensity: 1, color: '#ffffff', distance: 0, decay: 1,
|
|
28
|
+
angle: Math.PI / 6, penumbra: 0.3, targetPosition: [0, 0, 0],
|
|
29
|
+
on: true, colorMode: 'temperature', temperature: 3600,
|
|
30
|
+
pattern: 'round', patternSoftness: 0.25, patternRotation: 0,
|
|
31
|
+
beamMode: 'soft', beam: 1, beamLength: 1, beamNoise: 0.35, beamSteps: 28,
|
|
32
|
+
emitter: 'lens', warmup: 0.3, flicker: 0, halo: 1,
|
|
33
|
+
},
|
|
34
|
+
ledArray: {
|
|
35
|
+
type: 'ledArray', enabled: true, intensity: 1, color: '#ffffff', distance: 0, decay: 1,
|
|
36
|
+
on: true, colorMode: 'temperature', temperature: 5000,
|
|
37
|
+
layout: 'panel', count: 8, rows: 4, spacing: 0.06, dieSize: 0.022, emitter: 'dies',
|
|
38
|
+
diffuser: 0, pwm: 0, rgbSpread: 1, rgbSpeed: 0.2,
|
|
39
|
+
warmup: 0, flicker: 0, halo: 1,
|
|
40
|
+
},
|
|
41
|
+
fluorescentTube: {
|
|
42
|
+
type: 'fluorescentTube', enabled: true, intensity: 1, color: '#ffffff', distance: 0, decay: 1,
|
|
43
|
+
on: true, colorMode: 'temperature', temperature: 4000,
|
|
44
|
+
tubes: 1, tubeSpacing: 0.14, length: 1.2, diameter: 0.026, emitter: 'tubes',
|
|
45
|
+
greenShift: 0.35, startup: 'stutter', warmup: 1.2, hum: 0.3, age: 0.15,
|
|
46
|
+
shadowStrength: 0.4, flicker: 0, halo: 1,
|
|
47
|
+
},
|
|
48
|
+
};
|
|
49
|
+
const COMMON = [
|
|
50
|
+
{ value: 'intensity', label: 'Intensity' },
|
|
51
|
+
{ value: 'color', label: 'Color' },
|
|
52
|
+
];
|
|
53
|
+
const FALLOFF = [
|
|
54
|
+
{ value: 'distance', label: 'Distance' },
|
|
55
|
+
{ value: 'decay', label: 'Decay' },
|
|
56
|
+
];
|
|
57
|
+
export const LIGHTS_ANIMATABLE = {
|
|
58
|
+
ambient: [...COMMON],
|
|
59
|
+
directional: [...COMMON],
|
|
60
|
+
point: [...COMMON, ...FALLOFF],
|
|
61
|
+
spot: [
|
|
62
|
+
...COMMON, ...FALLOFF,
|
|
63
|
+
{ value: 'angle', label: 'Angle' },
|
|
64
|
+
{ value: 'penumbra', label: 'Penumbra' },
|
|
65
|
+
],
|
|
66
|
+
// `color` drives the light only in 'color' mode, `temperature` only in
|
|
67
|
+
// 'temperature' mode; both are offered and the renderer applies the one its
|
|
68
|
+
// colorMode selects. on / shape / glass / colorMode rebuild, so they are out.
|
|
69
|
+
lightBulb: [
|
|
70
|
+
...COMMON, ...FALLOFF,
|
|
71
|
+
{ value: 'temperature', label: 'Temperature' },
|
|
72
|
+
{ value: 'flicker', label: 'Flicker' },
|
|
73
|
+
{ value: 'halo', label: 'Halo' },
|
|
74
|
+
{ value: 'warmup', label: 'Warm-up' },
|
|
75
|
+
],
|
|
76
|
+
// pattern / patternSoftness / patternRotation redraw the gobo and beamMode /
|
|
77
|
+
// emitter rebuild geometry, so they stay out; beamSteps is a quality knob.
|
|
78
|
+
spotBeam: [
|
|
79
|
+
...COMMON, ...FALLOFF,
|
|
80
|
+
{ value: 'angle', label: 'Angle' },
|
|
81
|
+
{ value: 'penumbra', label: 'Penumbra' },
|
|
82
|
+
{ value: 'temperature', label: 'Temperature' },
|
|
83
|
+
{ value: 'beam', label: 'Beam' },
|
|
84
|
+
{ value: 'beamLength', label: 'Beam Length' },
|
|
85
|
+
{ value: 'beamNoise', label: 'Beam Noise' },
|
|
86
|
+
{ value: 'flicker', label: 'Flicker' },
|
|
87
|
+
{ value: 'halo', label: 'Halo' },
|
|
88
|
+
{ value: 'warmup', label: 'Warm-up' },
|
|
89
|
+
],
|
|
90
|
+
// layout / count / rows / spacing / dieSize rebuild the array and colorMode
|
|
91
|
+
// switches how the colour is read, so they stay out.
|
|
92
|
+
ledArray: [
|
|
93
|
+
...COMMON, ...FALLOFF,
|
|
94
|
+
{ value: 'temperature', label: 'Temperature' },
|
|
95
|
+
{ value: 'diffuser', label: 'Diffuser' },
|
|
96
|
+
{ value: 'pwm', label: 'PWM' },
|
|
97
|
+
{ value: 'rgbSpread', label: 'RGB Spread' },
|
|
98
|
+
{ value: 'rgbSpeed', label: 'RGB Speed' },
|
|
99
|
+
{ value: 'flicker', label: 'Flicker' },
|
|
100
|
+
{ value: 'halo', label: 'Halo' },
|
|
101
|
+
{ value: 'warmup', label: 'Warm-up' },
|
|
102
|
+
],
|
|
103
|
+
// The tube geometry (tubes / spacing / length / diameter) and the startup mode
|
|
104
|
+
// rebuild; everything the ballast does every frame is drivable.
|
|
105
|
+
fluorescentTube: [
|
|
106
|
+
...COMMON,
|
|
107
|
+
{ value: 'temperature', label: 'Temperature' },
|
|
108
|
+
{ value: 'greenShift', label: 'Green Spike' },
|
|
109
|
+
{ value: 'hum', label: 'Ballast Hum' },
|
|
110
|
+
{ value: 'age', label: 'Age' },
|
|
111
|
+
{ value: 'shadowStrength', label: 'Shadow Core' },
|
|
112
|
+
{ value: 'flicker', label: 'Flicker' },
|
|
113
|
+
{ value: 'halo', label: 'Halo' },
|
|
114
|
+
{ value: 'warmup', label: 'Warm-up' },
|
|
115
|
+
],
|
|
116
|
+
};
|
|
117
|
+
/** True when this config is a light config the tables above cover. */
|
|
118
|
+
export function isLightConfigType(config) {
|
|
119
|
+
return !!config?.type && Object.prototype.hasOwnProperty.call(LIGHTS_ANIMATABLE, config.type);
|
|
120
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface ShadowFlags {
|
|
2
|
+
castShadow: boolean;
|
|
3
|
+
receiveShadow: boolean;
|
|
4
|
+
}
|
|
5
|
+
export declare const DEFAULT_OBJECT_SHADOWS: Record<string, ShadowFlags>;
|
|
6
|
+
/** The flags to apply for this object: explicit values win, then the type's default. */
|
|
7
|
+
export declare function resolveShadowFlags(type: string | undefined, meshSettings: {
|
|
8
|
+
castShadow?: boolean;
|
|
9
|
+
receiveShadow?: boolean;
|
|
10
|
+
} | undefined | null): ShadowFlags;
|
|
11
|
+
//# sourceMappingURL=shadowDefaults.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shadowDefaults.d.ts","sourceRoot":"","sources":["../../src/data/shadowDefaults.ts"],"names":[],"mappings":"AAeA,MAAM,WAAW,WAAW;IACxB,UAAU,EAAE,OAAO,CAAC;IACpB,aAAa,EAAE,OAAO,CAAC;CAC1B;AAKD,eAAO,MAAM,sBAAsB,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAmB9D,CAAC;AAIF,wFAAwF;AACxF,wBAAgB,kBAAkB,CAC9B,IAAI,EAAE,MAAM,GAAG,SAAS,EACxB,YAAY,EAAE;IAAE,UAAU,CAAC,EAAE,OAAO,CAAC;IAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,SAAS,GAAG,IAAI,GACnF,WAAW,CAMb"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const ON = { castShadow: true, receiveShadow: true };
|
|
2
|
+
const OFF = { castShadow: false, receiveShadow: false };
|
|
3
|
+
export const DEFAULT_OBJECT_SHADOWS = {
|
|
4
|
+
// Solid objects: the scene's shadow casters and catchers.
|
|
5
|
+
mesh: ON,
|
|
6
|
+
model: ON,
|
|
7
|
+
text: ON,
|
|
8
|
+
gallery: ON,
|
|
9
|
+
// Shader planes, generative systems and volumes own their look; a shader
|
|
10
|
+
// plane in a shadow map is a large black slab and costs a full extra pass.
|
|
11
|
+
grid: OFF,
|
|
12
|
+
effect: OFF,
|
|
13
|
+
particles: OFF,
|
|
14
|
+
space: OFF,
|
|
15
|
+
path: OFF,
|
|
16
|
+
// The landscape has its own quality.castShadows switch; the light object's
|
|
17
|
+
// fixture decides for itself (LightBulb: only the screw base casts).
|
|
18
|
+
landscape: OFF,
|
|
19
|
+
light: OFF,
|
|
20
|
+
// Water catches shadows but casting from the surface reads as dirt.
|
|
21
|
+
ocean: { castShadow: false, receiveShadow: true },
|
|
22
|
+
};
|
|
23
|
+
const FALLBACK = ON;
|
|
24
|
+
/** The flags to apply for this object: explicit values win, then the type's default. */
|
|
25
|
+
export function resolveShadowFlags(type, meshSettings) {
|
|
26
|
+
const defaults = (type && DEFAULT_OBJECT_SHADOWS[type]) || FALLBACK;
|
|
27
|
+
return {
|
|
28
|
+
castShadow: meshSettings?.castShadow ?? defaults.castShadow,
|
|
29
|
+
receiveShadow: meshSettings?.receiveShadow ?? defaults.receiveShadow,
|
|
30
|
+
};
|
|
31
|
+
}
|
package/dist/types/lights.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Vector3Array } from "./common";
|
|
2
2
|
import { AnimationOptions, MouseMoveInteraction } from ".";
|
|
3
|
-
export type LightType = 'ambient' | 'directional' | 'point' | 'spot' | 'lightBulb';
|
|
3
|
+
export type LightType = 'ambient' | 'directional' | 'point' | 'spot' | 'lightBulb' | 'spotBeam' | 'ledArray' | 'fluorescentTube';
|
|
4
4
|
export type BaseLightConfig = {
|
|
5
5
|
enabled: boolean;
|
|
6
6
|
name: string;
|
|
@@ -55,7 +55,142 @@ export type LightBulbConfig = Omit<PointLightConfig, 'type'> & {
|
|
|
55
55
|
/** Strength of the camera-facing halo, 0–2. Default 1. */
|
|
56
56
|
halo?: number;
|
|
57
57
|
};
|
|
58
|
-
export type
|
|
58
|
+
export type BeamPattern = 'round' | 'slot' | 'bars' | 'blinds' | 'window' | 'leaves';
|
|
59
|
+
export type BeamMode = 'none' | 'soft' | 'layered' | 'volumetric';
|
|
60
|
+
export type SpotBeamEmitter = 'none' | 'dot' | 'lens';
|
|
61
|
+
export type SpotBeamColorMode = 'temperature' | 'color';
|
|
62
|
+
/**
|
|
63
|
+
* A spot light you can see: a procedural gobo shapes the pool on the floor and
|
|
64
|
+
* the haze in the air, so both carry the same pattern. The visible geometry is
|
|
65
|
+
* only a small emitter (and can be switched off) — the object is meant to be
|
|
66
|
+
* dropped inside whatever fixture the scene already has. The object origin is
|
|
67
|
+
* the light; it aims at `targetPosition` in world space.
|
|
68
|
+
*/
|
|
69
|
+
export type SpotBeamConfig = Omit<SpotLightConfig, 'type'> & {
|
|
70
|
+
type: 'spotBeam';
|
|
71
|
+
/** Gobo shaping the pool and the beam. Default 'round'. */
|
|
72
|
+
pattern?: BeamPattern;
|
|
73
|
+
/** Edge softness of the pattern, 0–1. Default 0.25. */
|
|
74
|
+
patternSoftness?: number;
|
|
75
|
+
/** Pattern rotation in radians. Default 0. */
|
|
76
|
+
patternRotation?: number;
|
|
77
|
+
/** How the beam in the air is drawn. 'volumetric' raymarches the gobo and costs the most. Default 'soft'. */
|
|
78
|
+
beamMode?: BeamMode;
|
|
79
|
+
/** Beam brightness, 0–3. 0 hides it. Default 1. */
|
|
80
|
+
beam?: number;
|
|
81
|
+
/** Beam length as a fraction of the throw to the target, 0–1. Default 1. */
|
|
82
|
+
beamLength?: number;
|
|
83
|
+
/** Haze breakup in the beam, 0–1. Default 0.35. */
|
|
84
|
+
beamNoise?: number;
|
|
85
|
+
/** Raymarch steps for the 'volumetric' mode, 8–48. Default 24. */
|
|
86
|
+
beamSteps?: number;
|
|
87
|
+
/** Visible source at the origin. Default 'lens'. */
|
|
88
|
+
emitter?: SpotBeamEmitter;
|
|
89
|
+
/** 'temperature' drives the light colour from `temperature`; 'color' uses `color`. Default 'temperature'. */
|
|
90
|
+
colorMode?: SpotBeamColorMode;
|
|
91
|
+
/** Colour temperature in Kelvin, 1000–10000. Default 3600. */
|
|
92
|
+
temperature?: number;
|
|
93
|
+
/** Power switch. Toggling runs the warm-up / cool-down. Default true. */
|
|
94
|
+
on?: boolean;
|
|
95
|
+
/** Seconds for the lamp to come up to full. 0 = instant. Default 0.25. */
|
|
96
|
+
warmup?: number;
|
|
97
|
+
/** Flicker amount 0–1. Default 0. */
|
|
98
|
+
flicker?: number;
|
|
99
|
+
/** Strength of the camera-facing halo at the source, 0–2. Default 1. */
|
|
100
|
+
halo?: number;
|
|
101
|
+
};
|
|
102
|
+
export type LedLayout = 'single' | 'strip' | 'panel' | 'ring';
|
|
103
|
+
export type LedColorMode = 'temperature' | 'color' | 'rgb';
|
|
104
|
+
/**
|
|
105
|
+
* A point light drawn as the array of dies that makes it. Instant on, with the
|
|
106
|
+
* PWM ripple of a dimmed LED, a diffuser that softens the shadow as it fades the
|
|
107
|
+
* dies into one sheet, and an RGB mode where the hue runs across the array.
|
|
108
|
+
* The object origin is the light, in the plane of the dies.
|
|
109
|
+
*/
|
|
110
|
+
export type LedArrayConfig = Omit<PointLightConfig, 'type'> & {
|
|
111
|
+
type: 'ledArray';
|
|
112
|
+
/** How the dies are arranged. Default 'panel'. */
|
|
113
|
+
layout?: LedLayout;
|
|
114
|
+
/** Dies along the main axis, 1–64. Default 8. */
|
|
115
|
+
count?: number;
|
|
116
|
+
/** Rows, 1–12; only a panel uses more than one. Default 4. */
|
|
117
|
+
rows?: number;
|
|
118
|
+
/** Distance between dies. Default 0.06. */
|
|
119
|
+
spacing?: number;
|
|
120
|
+
/** Size of one die. Default 0.022. */
|
|
121
|
+
dieSize?: number;
|
|
122
|
+
/** 'none' hides the dies and leaves only the light. Default 'dies'. */
|
|
123
|
+
emitter?: 'dies' | 'none';
|
|
124
|
+
/** 'rgb' runs a hue across the array; the light takes their mean. Default 'temperature'. */
|
|
125
|
+
colorMode?: LedColorMode;
|
|
126
|
+
/** Colour temperature in Kelvin, 2200–6500. Default 5000. */
|
|
127
|
+
temperature?: number;
|
|
128
|
+
/** Turns of hue across the array in 'rgb' mode, 0–2. Default 1. */
|
|
129
|
+
rgbSpread?: number;
|
|
130
|
+
/** How fast the hue chases along the array, -2–2. Default 0.2. */
|
|
131
|
+
rgbSpeed?: number;
|
|
132
|
+
/** Sheet over the dies, 0–1. Also widens the light's shadow radius. Default 0. */
|
|
133
|
+
diffuser?: number;
|
|
134
|
+
/** Depth of the PWM chop a dimmed LED runs on, 0–1. Default 0. */
|
|
135
|
+
pwm?: number;
|
|
136
|
+
/** Power switch. Default true. */
|
|
137
|
+
on?: boolean;
|
|
138
|
+
/** Seconds to fade up. An LED has no thermal lag, so the default is 0 — instant. */
|
|
139
|
+
warmup?: number;
|
|
140
|
+
/** Flicker amount 0–1. Default 0. */
|
|
141
|
+
flicker?: number;
|
|
142
|
+
/** Strength of the glow around the array, 0–2. Default 1. */
|
|
143
|
+
halo?: number;
|
|
144
|
+
};
|
|
145
|
+
export type FluorescentStartup = 'instant' | 'stutter';
|
|
146
|
+
/**
|
|
147
|
+
* A bank of fluorescent tubes lit by a THREE.RectAreaLight, so the light is as
|
|
148
|
+
* long and as soft as the tubes are. A rect-area light cannot cast a shadow, so
|
|
149
|
+
* `shadowStrength` of the output comes from a point light at the middle of the
|
|
150
|
+
* fixture, which is the part that casts; 0 gives a pure area light.
|
|
151
|
+
*
|
|
152
|
+
* A rect-area light only lights MeshStandardMaterial and MeshPhysicalMaterial.
|
|
153
|
+
*/
|
|
154
|
+
export type FluorescentTubeConfig = Omit<BaseLightConfig, 'type'> & {
|
|
155
|
+
type: 'fluorescentTube';
|
|
156
|
+
/** Tubes in the fixture, 1–4. Default 1. */
|
|
157
|
+
tubes?: number;
|
|
158
|
+
/** Distance between tubes. Default 0.14. */
|
|
159
|
+
tubeSpacing?: number;
|
|
160
|
+
/** Tube length. Default 1.2. */
|
|
161
|
+
length?: number;
|
|
162
|
+
/** Tube diameter. Default 0.026. */
|
|
163
|
+
diameter?: number;
|
|
164
|
+
/** 'none' hides the tubes and leaves only the light. Default 'tubes'. */
|
|
165
|
+
emitter?: 'tubes' | 'none';
|
|
166
|
+
/** 'temperature' drives the light colour from `temperature`; 'color' uses `color`. Default 'temperature'. */
|
|
167
|
+
colorMode?: 'temperature' | 'color';
|
|
168
|
+
/** Colour temperature in Kelvin, 2700–6500. Default 4000. */
|
|
169
|
+
temperature?: number;
|
|
170
|
+
/** The phosphor's green spike, 0–1. Default 0.35. */
|
|
171
|
+
greenShift?: number;
|
|
172
|
+
/** 'stutter' strikes the arc with false starts first. Default 'stutter'. */
|
|
173
|
+
startup?: FluorescentStartup;
|
|
174
|
+
/** Seconds for the mercury vapour to reach full output. Default 1.2. */
|
|
175
|
+
warmup?: number;
|
|
176
|
+
/** Depth of the ballast's 100 Hz ripple, 0–1. Default 0.3. */
|
|
177
|
+
hum?: number;
|
|
178
|
+
/** Wear, 0–1: dimmer, blackened ends, a longer strike and more flicker. Default 0.15. */
|
|
179
|
+
age?: number;
|
|
180
|
+
/** Share of the output carried by the shadow-casting point at the fixture's centre, 0–1. Default 0.4. */
|
|
181
|
+
shadowStrength?: number;
|
|
182
|
+
/** Power switch. Default true. */
|
|
183
|
+
on?: boolean;
|
|
184
|
+
/** Falloff of the shadow-casting point source. Default 1 / 0. */
|
|
185
|
+
decay?: number;
|
|
186
|
+
distance?: number;
|
|
187
|
+
/** Flicker amount 0–1, on top of whatever `age` adds. Default 0. */
|
|
188
|
+
flicker?: number;
|
|
189
|
+
/** Strength of the wash around the fixture, 0–2. Default 1. */
|
|
190
|
+
halo?: number;
|
|
191
|
+
shadow?: PointShadowSettings;
|
|
192
|
+
};
|
|
193
|
+
export type LightObjectConfig = BaseLightConfig | SpotLightConfig | PointLightConfig | LightBulbConfig | SpotBeamConfig | LedArrayConfig | FluorescentTubeConfig;
|
|
59
194
|
export type ShadowSettings = {
|
|
60
195
|
enabled?: boolean;
|
|
61
196
|
mapSize?: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lights.d.ts","sourceRoot":"","sources":["../../src/types/lights.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,GAAG,CAAC;AAC3D,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"lights.d.ts","sourceRoot":"","sources":["../../src/types/lights.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAC7C,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,GAAG,CAAC;AAC3D,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,aAAa,GAAG,OAAO,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,UAAU,GAAG,iBAAiB,CAAC;AAEjI,MAAM,MAAM,eAAe,GAAG;IAC1B,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,SAAS,CAAC;IAChB,QAAQ,CAAC,EAAE,YAAY,CAAC;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,EAAE,MAAM,CAAC;IAClB,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,oBAAoB,CAAC;CACpC,CAAC;AAEF,MAAM,MAAM,eAAe,GAAG,eAAe,GAAG;IAC5C,KAA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C;KACpC,CAAC;IACF,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAGD,OAAO,EAAE,CAAC"}
|
|
@@ -2,7 +2,7 @@ export interface AnimatableConfigProperty {
|
|
|
2
2
|
value: string;
|
|
3
3
|
label: string;
|
|
4
4
|
}
|
|
5
|
-
export type GenerativeFamily = 'particles';
|
|
5
|
+
export type GenerativeFamily = 'particles' | 'lights';
|
|
6
6
|
/** The animatable knobs of one generative object, by family and config.type. */
|
|
7
7
|
export declare function getGenerativeAnimatable(family: GenerativeFamily, config: {
|
|
8
8
|
type?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generativeAnimatable.d.ts","sourceRoot":"","sources":["../../src/utils/generativeAnimatable.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"generativeAnimatable.d.ts","sourceRoot":"","sources":["../../src/utils/generativeAnimatable.ts"],"names":[],"mappings":"AAmBA,MAAM,WAAW,wBAAwB;IACrC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,QAAQ,CAAC;AAStD,gFAAgF;AAChF,wBAAgB,uBAAuB,CACnC,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAAG,IAAI,GAC7C,wBAAwB,EAAE,CAK5B;AAED,sFAAsF;AACtF,wBAAgB,wBAAwB,CACpC,MAAM,EAAE,gBAAgB,EACxB,MAAM,EAAE;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,GAAG,IAAI,GAC7C,OAAO,CAGT"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { GENERATIVE_PARTICLES_ANIMATABLE } from "../data/particlesDefaults.js";
|
|
2
|
+
import { LIGHTS_ANIMATABLE } from "../data/lightsDefaults.js";
|
|
2
3
|
const FAMILIES = {
|
|
3
4
|
particles: GENERATIVE_PARTICLES_ANIMATABLE,
|
|
5
|
+
// Lights are not generative, but they store their knobs in `config` and drive
|
|
6
|
+
// them through one applyLightConfig per frame, so they use the same registry.
|
|
7
|
+
lights: LIGHTS_ANIMATABLE,
|
|
4
8
|
};
|
|
5
9
|
/** The animatable knobs of one generative object, by family and config.type. */
|
|
6
10
|
export function getGenerativeAnimatable(family, config) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getAnimatableProperties.d.ts","sourceRoot":"","sources":["../../src/utils/getAnimatableProperties.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAE7G,MAAM,MAAM,gBAAgB,GAAG,WAAW,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,CAAC;AAE9G,MAAM,WAAW,kBAAkB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC7B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACnC,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACvC,aAAa,CAAC,EAAE;QACZ,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QACvB,gBAAgB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;KAC1C,CAAC;IACF,MAAM,CAAC,EAAE,CAAC;QACN,IAAI,CAAC,EAAE,MAAM,CAAC;KACjB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,CAAC;IACzB,UAAU,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kB,EAAE,CAuBlH;AACD;;;;GAIG;AACH,wBAAgB,sBAAsB,CAAC,QAAQ,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAsBhH"}
|
|
@@ -15,7 +15,7 @@ import { getGenerativeAnimatable } from "./generativeAnimatable.js";
|
|
|
15
15
|
// - transform: hardcoded ['position', 'rotation', 'scale']
|
|
16
16
|
// - material : keys of settings.materialSettings minus an excluded list
|
|
17
17
|
// - edges : geometry props by edgesSettings.type + filtered material keys
|
|
18
|
-
// - light :
|
|
18
|
+
// - light : the generated LIGHTS_ANIMATABLE registry, by settings.config.type
|
|
19
19
|
// - clouds : ['speed'] when settings.config.type === 'clouds'
|
|
20
20
|
//
|
|
21
21
|
// =============================================================================
|
|
@@ -31,19 +31,6 @@ const EXCLUDED_MATERIAL_KEYS = new Set([
|
|
|
31
31
|
'u_time', 'u_mouse',
|
|
32
32
|
'apply', 'visible', 'map', 'uHasTexture',
|
|
33
33
|
]);
|
|
34
|
-
const LIGHT_COMMON = [
|
|
35
|
-
{ value: 'intensity', label: 'Intensity' },
|
|
36
|
-
{ value: 'color', label: 'Color' },
|
|
37
|
-
];
|
|
38
|
-
const LIGHT_POINT_EXTRA = [
|
|
39
|
-
{ value: 'distance', label: 'Distance' },
|
|
40
|
-
{ value: 'decay', label: 'Decay' },
|
|
41
|
-
];
|
|
42
|
-
const LIGHT_SPOT_EXTRA = [
|
|
43
|
-
...LIGHT_POINT_EXTRA,
|
|
44
|
-
{ value: 'angle', label: 'Angle' },
|
|
45
|
-
{ value: 'penumbra', label: 'Penumbra' },
|
|
46
|
-
];
|
|
47
34
|
// Volumetric cloud deck properties. Only scalars that can be interpolated per
|
|
48
35
|
// frame without rebuilding the density field: altitudes and feature sizes are
|
|
49
36
|
// deliberately absent, because the vertical profile is measured as a fraction of
|
|
@@ -111,28 +98,12 @@ function getEdgesProperties(edgesSettings) {
|
|
|
111
98
|
}
|
|
112
99
|
return props;
|
|
113
100
|
}
|
|
114
|
-
function getLightProperties(config) {
|
|
115
|
-
switch (config?.type) {
|
|
116
|
-
case 'point':
|
|
117
|
-
return [...LIGHT_COMMON, ...LIGHT_POINT_EXTRA];
|
|
118
|
-
case 'spot':
|
|
119
|
-
return [...LIGHT_COMMON, ...LIGHT_SPOT_EXTRA];
|
|
120
|
-
case 'ambient':
|
|
121
|
-
case 'directional':
|
|
122
|
-
default:
|
|
123
|
-
return [...LIGHT_COMMON];
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
101
|
function getCloudsProperties() {
|
|
127
102
|
return [...CLOUDS_PROPS];
|
|
128
103
|
}
|
|
129
104
|
function getRainProperties() {
|
|
130
105
|
return [...RAIN_PROPS];
|
|
131
106
|
}
|
|
132
|
-
function isLightConfig(config) {
|
|
133
|
-
const t = config?.type;
|
|
134
|
-
return t === 'ambient' || t === 'directional' || t === 'point' || t === 'spot';
|
|
135
|
-
}
|
|
136
107
|
function isCloudsConfig(config) {
|
|
137
108
|
return config?.type === 'clouds';
|
|
138
109
|
}
|
|
@@ -150,8 +121,10 @@ export function getAnimatableProperties(settings, domain) {
|
|
|
150
121
|
return getMaterialProperties(settings.materialSettings);
|
|
151
122
|
case 'edges':
|
|
152
123
|
return getEdgesProperties(settings.edgesSettings);
|
|
124
|
+
// Lights read the same generated registry as the generative families, so a
|
|
125
|
+
// new light type's knobs show up without touching this file.
|
|
153
126
|
case 'light':
|
|
154
|
-
return
|
|
127
|
+
return getGenerativeAnimatable('lights', settings.config);
|
|
155
128
|
case 'clouds':
|
|
156
129
|
return isCloudsConfig(settings.config) ? getCloudsProperties() : [];
|
|
157
130
|
case 'rain':
|
|
@@ -177,10 +150,8 @@ export function detectAnimatableDomain(settings, propertyName) {
|
|
|
177
150
|
const edges = getEdgesProperties(settings.edgesSettings).map(p => p.value);
|
|
178
151
|
if (edges.includes(propertyName))
|
|
179
152
|
return 'edges';
|
|
180
|
-
if (
|
|
181
|
-
|
|
182
|
-
return 'light';
|
|
183
|
-
}
|
|
153
|
+
if (getGenerativeAnimatable('lights', settings.config).some(p => p.value === propertyName))
|
|
154
|
+
return 'light';
|
|
184
155
|
if (isCloudsConfig(settings.config)) {
|
|
185
156
|
if (getCloudsProperties().some(p => p.value === propertyName))
|
|
186
157
|
return 'clouds';
|