illutions 0.21.8 → 0.22.0

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/CHANGELOG.md CHANGED
@@ -1,7 +1,27 @@
1
- # Changelog
1
+ # Changelog
2
+
3
+ ## 0.22.0
4
+
5
+ ### Changed
6
+
7
+ - Updated the framework to Three.js r185.
8
+ - Changed the default renderer selection to `render.api = 'auto'`.
9
+ - Added `envCtrls.dataType` to configure environment texture data handling.
10
+ - Replaced `SsrWebGpuCfg.opacity` with `SsrWebGpuCfg.intensity`.
11
+
12
+ ### Fixed
13
+
14
+ - Clarified the WebGL/WebGPU renderer switch behavior.
15
+ - Enabled WebGPU renderer loading even when post-processing is disabled.
2
16
 
3
- ## Unreleased
4
-
5
- ### Changed
6
-
7
- - Add cfg.audio.enable in config
17
+ ## 0.21.9
18
+
19
+ ### Changed
20
+
21
+ - Removed the `CfgCtrl` class and the related `app.cfgCtrl` access point. Runtime parameters are now updated through the responsible feature APIs, such as `app.audio.set(...)`.
22
+
23
+ ## 0.21.8
24
+
25
+ ### Changed
26
+
27
+ - Added `cfg.audio.enable` to the configuration.
package/README.md CHANGED
@@ -3,6 +3,38 @@
3
3
  illutions is a proprietary Web 3D engine for building interactive browser-based
4
4
  3D applications with Three.js, XState, GSAP, Tweakpane and more.
5
5
 
6
+ ## Highlights
7
+
8
+ **Advanced post-processing**
9
+ Add SSAO, SSR, FXAA and SMAA through configurable pipelines for WebGL and WebGPU.
10
+
11
+ **Advanced animation control**
12
+ Coordinate GLTF animation clips, GSAP transitions, camera paths and custom dolly-rig camera workflows.
13
+
14
+ **XState-powered application logic**
15
+ Model complex application flows as predictable and inspectable state machines with integrated XState 5 usage.
16
+
17
+ **Resource-aware rendering**
18
+ An intelligent, configurable FPS limiter avoids unnecessary frames and helps reduce CPU and GPU load.
19
+
20
+ **WebGL and WebGPU rendering**
21
+ Support established and next-generation browser rendering with automatic WebGPU selection and WebGL fallback.
22
+
23
+ **Lean initial bundles**
24
+ Optional controls, loaders, inspectors and effects are dynamically imported only when needed.
25
+
26
+ **Optimized GLTF/GLB pipeline**
27
+ Load assets with Draco or Meshopt mesh compression and WebP or KTX2 textures.
28
+
29
+ **Built-in interaction and audio**
30
+ Use pointer-based raycasting and distance-aware spatial audio.
31
+
32
+ **Flexible environments**
33
+ Load HDR, EXR and texture environments with configurable rotation, intensity and background controls.
34
+
35
+ **Runtime insights and debugging**
36
+ Inspect runtime properties, FPS, CPU and renderer statistics with detailed state, event and console reporting.
37
+
6
38
  ## Installation
7
39
 
8
40
  The recommended starting point is an illutions project template. The template
@@ -38,9 +70,11 @@ await App.run(cfg);
38
70
  illutions is not open source software. It may be used only under the terms granted
39
71
  by illutions.
40
72
 
41
- A free license displays the illutions menu bar and attribution. Removing or hiding
42
- that menu bar requires an active paid illutions license subscription or another
43
- written agreement with illutions.
73
+ A valid `license.json` permits commercial and non-commercial use without
74
+ requiring the illutions menu bar or attribution to remain visible.
75
+
76
+ For the 2026 introductory period, the official GitHub project templates include
77
+ a free `license.json` valid through December 31, 2026.
44
78
 
45
79
  See the included `LICENSE` file for the legal rights and restrictions.
46
80
 
package/dist/main.d.ts CHANGED
@@ -1,10 +1,13 @@
1
1
  import { AnyEventObject } from 'xstate';
2
2
  import { AnyStateMachine } from 'xstate';
3
+ import { ao } from 'three/addons/tsl/display/GTAONode.js';
4
+ import { createBrowserInspector } from '@statelyai/inspect';
3
5
  import { default as default_2 } from 'three/addons/tsl/display/GTAONode.js';
4
6
  import { default as default_3 } from 'three/addons/tsl/display/SSRNode.js';
5
7
  import { DRACOLoader } from 'three/addons/loaders/DRACOLoader.js';
6
8
  import { EffectComposer } from 'three/addons/postprocessing/EffectComposer.js';
7
9
  import { EXRLoader } from 'three/addons/loaders/EXRLoader.js';
10
+ import { FXAAShader } from 'three/addons/shaders/FXAAShader.js';
8
11
  import { GLTFLoader } from 'three/addons/loaders/GLTFLoader.js';
9
12
  import { HDRLoader } from 'three/addons/loaders/HDRLoader.js';
10
13
  import { KTX2Loader } from 'three/addons/loaders/KTX2Loader.js';
@@ -12,16 +15,21 @@ import { MeshoptDecoder } from 'three/addons/libs/meshopt_decoder.module.js';
12
15
  import { OrbitControls } from 'three/addons/controls/OrbitControls.js';
13
16
  import { OrbitControls as OrbitControls_2 } from 'three/examples/jsm/controls/OrbitControls.js';
14
17
  import { OutputPass } from 'three/addons/postprocessing/OutputPass.js';
18
+ import { Pane } from 'tweakpane';
15
19
  import { PointerLockControls } from 'three/addons/controls/PointerLockControls.js';
16
20
  import { PointerLockControls as PointerLockControls_2 } from 'three/examples/jsm/controls/PointerLockControls.js';
17
21
  import { ReflectorForSSRPass } from 'three/addons/objects/ReflectorForSSRPass.js';
18
22
  import { RenderPass } from 'three/addons/postprocessing/RenderPass.js';
19
23
  import { ShaderPass } from 'three/addons/postprocessing/ShaderPass.js';
24
+ import { smaa } from 'three/addons/tsl/display/SMAANode.js';
25
+ import { SMAAPass } from 'three/addons/postprocessing/SMAAPass.js';
20
26
  import { SSAOPass } from 'three/addons/postprocessing/SSAOPass.js';
27
+ import { ssr } from 'three/addons/tsl/display/SSRNode.js';
21
28
  import { SSRPass } from 'three/addons/postprocessing/SSRPass.js';
22
29
  import type * as THREE_TYPE from 'three';
23
30
  import type * as THREE_WEBGPU_TYPE from 'three/webgpu';
24
31
  import type * as THREE_WEBTSL_TYPE from 'three/tsl';
32
+ import { TierResult } from 'detect-gpu';
25
33
 
26
34
  /**
27
35
  * Defines the shared anti-aliasing settings.
@@ -92,8 +100,7 @@ export declare interface AnimFadeEvent {
92
100
  * @category Core
93
101
  */
94
102
  export declare class App<TClasses extends Classes = {}> {
95
- readonly audio: Audio_2 | null;
96
- readonly cfgCtrl: CfgCtrl;
103
+ readonly audio: Audio_2;
97
104
  readonly engine: Engine;
98
105
  readonly envCtrls: EnvCtrls;
99
106
  readonly events: Events;
@@ -127,16 +134,19 @@ export declare class App<TClasses extends Classes = {}> {
127
134
  * @category Core
128
135
  */
129
136
  declare class Audio_2 {
130
- private readonly cfg;
131
137
  private readonly ctx;
132
138
  private readonly loader;
133
139
  private readonly engine;
134
140
  private readonly sounds;
135
- private audioCfgLast;
136
- private callback;
141
+ private readonly params;
137
142
  private listener;
138
143
  /* Excluded from this release type: __constructor */
139
144
  private attachSoundTo;
145
+ /**
146
+ * Returns the audio parameters currently used at runtime.
147
+ * @returns A snapshot of the mutable audio settings.
148
+ */
149
+ get(): Partial<AudioCfg>;
140
150
  /**
141
151
  * Checks whether an audio source with the given name is loaded.
142
152
  * @param params - Parameter object.
@@ -194,6 +204,11 @@ declare class Audio_2 {
194
204
  }): void;
195
205
  private setAllPositionalSoundsCfg;
196
206
  private setPositionalSoundCfg;
207
+ /**
208
+ * Updates one or more audio parameters at runtime.
209
+ * @param params - Audio parameters to update.
210
+ */
211
+ set(params: Partial<AudioCfg>): void;
197
212
  /**
198
213
  * Stops the playback of an audio with a smooth fade-out.
199
214
  * @param params - Parameter object.
@@ -208,7 +223,6 @@ declare class Audio_2 {
208
223
  * @remarks This method is intended for advanced custom integrations where developers need direct access to the engine instance. The extension is executed once immediately when `use()` is called.
209
224
  */
210
225
  use(extension: (audio: Audio_2) => void): void;
211
- /* Excluded from this release type: update */
212
226
  }
213
227
  export { Audio_2 as Audio }
214
228
 
@@ -453,39 +467,9 @@ export declare interface Cfg {
453
467
  stateMachine: StateMachineCfg;
454
468
  }
455
469
 
456
- /** Defines the static configuration that is applied at compile-time. For runtime updates use {@link CfgCtrl}. */
470
+ /** Defines the initial configuration that is applied when the application starts. */
457
471
  export declare const cfg: Cfg;
458
472
 
459
- /**
460
- * Controls configuration options at runtime.
461
- * @category Core
462
- */
463
- export declare class CfgCtrl {
464
- private cfg;
465
- /* Excluded from this release type: __constructor */
466
- /**
467
- * Applies runtime updates to `AudioCfg`.
468
- *
469
- * @param params - Partial audio settings to apply.
470
- * @param params.refDistance - {@link AudioCfg.refDistance}.
471
- * @param params.rolloffFactor - {@link AudioCfg.rolloffFactor}.
472
- * @param params.maxDistance - {@link AudioCfg.maxDistance}.
473
- * @param params.distanceModel - {@link AudioCfg.distanceModel}.
474
- * @param params.coneInnerAngle - {@link AudioCfg.coneInnerAngle}.
475
- * @param params.coneOuterAngle - {@link AudioCfg.coneOuterAngle}.
476
- * @param params.coneOuterGain - {@link AudioCfg.coneOuterGain}.
477
- */
478
- setAudio(params: Partial<Omit<AudioCfg, 'enable'>>): void;
479
- /**
480
- * Applies runtime updates to `RenderCfg`.
481
- *
482
- * @param params - Partial render settings to apply.
483
- * @param params.fpsLimiter - {@link RenderCfg.fpsLimiter}.
484
- * @param params.deltaTimesMax - {@link RenderCfg.deltaTimesMax}.
485
- */
486
- setRender(params: Partial<RenderCfg>): void;
487
- }
488
-
489
473
  /**
490
474
  * Groups optional class registries for `Obj3D` and `Comp`.
491
475
  *
@@ -524,6 +508,8 @@ export declare interface ClipFadeEvent {
524
508
  action?: THREE_TYPE.AnimationAction;
525
509
  }
526
510
 
511
+ declare type ColorNode = THREE_WEBGPU_TYPE.Node<'vec4'>;
512
+
527
513
  /**
528
514
  * Represents a reusable web-component logic unit bound to a custom element that participates in the scene lifecycle.
529
515
  * @category Components
@@ -532,7 +518,6 @@ export declare class Comp extends HTMLElement {
532
518
  /** The root HTML element that hosts the visual container for the engine. */
533
519
  canvas: Readonly<HTMLElement>;
534
520
  cfg: Cfg;
535
- cfgCtrl: Readonly<CfgCtrl>;
536
521
  comps: Map<string, Comp[]> | null;
537
522
  events: Readonly<Events>;
538
523
  objs3D: Map<string, Obj3D>;
@@ -1024,6 +1009,11 @@ export declare interface EnvCtrlsCfg {
1024
1009
  * @default 0
1025
1010
  */
1026
1011
  backgroundIntensity: number;
1012
+ /**
1013
+ * Specifies the texture data type used by EXR and HDR loaders.
1014
+ * @default 'halfFloat'
1015
+ */
1016
+ dataType: 'halfFloat' | 'float';
1027
1017
  /**
1028
1018
  * Enables or disables environment and background map handling.
1029
1019
  * @default false
@@ -1126,20 +1116,11 @@ export declare interface FogCfg {
1126
1116
  export declare class FpvCtrls {
1127
1117
  private readonly cam3D;
1128
1118
  private readonly canvas;
1129
- private readonly cfg;
1130
1119
  private readonly engine;
1131
1120
  private readonly events;
1132
1121
  private readonly modules;
1133
1122
  /* Excluded from this release type: pointerLockCtrls */
1134
- private minPolarAngle;
1135
- private maxPolarAngle;
1136
- private pointerSpeed;
1137
- private keyMoveForward;
1138
- private keyMoveLeft;
1139
- private keyMoveBackward;
1140
- private keyMoveRight;
1141
- private keyMoveUp;
1142
- private keyMoveDown;
1123
+ private readonly params;
1143
1124
  private isMoveForward;
1144
1125
  private isMoveLeft;
1145
1126
  private isMoveBackward;
@@ -1159,7 +1140,10 @@ export declare class FpvCtrls {
1159
1140
  enable(): void;
1160
1141
  /** Disposes three.js `PointerLockControls` and cleans up their runtime resources. */
1161
1142
  dispose(): void;
1162
- /** Returns the current three.js `PointerLockControls` configuration. */
1143
+ /**
1144
+ * Returns the parameters currently used by three.js `PointerLockControls`.
1145
+ * @returns A snapshot of the mutable first-person control settings.
1146
+ */
1163
1147
  get(): Partial<FpvCtrlsCfg>;
1164
1148
  /** Returns whether three.js `PointerLockControls` are enabled. */
1165
1149
  isEnabled(): boolean;
@@ -1280,6 +1264,8 @@ export declare interface FxaaCfg {
1280
1264
  sharpness: number;
1281
1265
  }
1282
1266
 
1267
+ declare type FXAAPostNode = (input: ColorNode) => ColorNode;
1268
+
1283
1269
  /**
1284
1270
  * Defines the GUI elements for runtime information, controls and inspection.
1285
1271
  * @category Cfg
@@ -1578,17 +1564,17 @@ export declare interface ModelLoadingEvent {
1578
1564
  }
1579
1565
 
1580
1566
  declare class Modules {
1581
- gpuTier: any;
1582
- fxaaNode: any;
1583
- fxaaShader: any;
1584
- smaaPassClass: any;
1585
- smaaNode: any;
1586
- ssaoPassClass: any;
1587
- gtaoNodeClass: any;
1588
- ssrNode: any;
1589
- ssrPassClass: any;
1590
- paneClass: any;
1591
- createBrowserInspector: any;
1567
+ gpuTier: TierResult | null;
1568
+ fxaaNode: FXAAPostNode | null;
1569
+ fxaaShader: typeof FXAAShader | null;
1570
+ smaaPassClass: typeof SMAAPass | null;
1571
+ smaaNode: typeof smaa | null;
1572
+ ssaoPassClass: typeof SSAOPass | null;
1573
+ gtaoNodeClass: typeof ao | null;
1574
+ ssrNode: typeof ssr | null;
1575
+ ssrPassClass: typeof SSRPass | null;
1576
+ paneClass: typeof Pane | null;
1577
+ createBrowserInspector: typeof createBrowserInspector | null;
1592
1578
  effectComposerClass: typeof EffectComposer | null;
1593
1579
  envLoader: EXRLoader | HDRLoader | null;
1594
1580
  dracoLoader: DRACOLoader | null;
@@ -1613,8 +1599,8 @@ declare class Modules {
1613
1599
  tslVec3: typeof THREE_WEBTSL_TYPE.vec3 | null;
1614
1600
  tslVec4: typeof THREE_WEBTSL_TYPE.vec4 | null;
1615
1601
  tslFloat: typeof THREE_WEBTSL_TYPE.float | null;
1616
- tslDirectionToColor: typeof THREE_WEBTSL_TYPE.directionToColor | null;
1617
- tslColorToDirection: typeof THREE_WEBTSL_TYPE.colorToDirection | null;
1602
+ packNormalToRGB: typeof THREE_WEBTSL_TYPE.packNormalToRGB | null;
1603
+ unpackRGBToNormal: typeof THREE_WEBTSL_TYPE.unpackRGBToNormal | null;
1618
1604
  private cfg;
1619
1605
  constructor(cfg: Cfg);
1620
1606
  private consoleLog;
@@ -1651,8 +1637,6 @@ export declare class Obj3D {
1651
1637
  /** @public */
1652
1638
  protected canvas: HTMLElement;
1653
1639
  protected cfg: Cfg;
1654
- /** @public */
1655
- protected readonly cfgCtrl: Readonly<CfgCtrl>;
1656
1640
  /* Excluded from this release type: events */
1657
1641
  protected name: string;
1658
1642
  /** The managed `THREE.Object3D` instance for this object. It is `null` until a scene object is assigned. */
@@ -1743,7 +1727,7 @@ export declare class Obj3D {
1743
1727
  }
1744
1728
 
1745
1729
  /** Constructor type for `Obj3D` classes. */
1746
- export declare type Obj3DClass = new (canvas: HTMLElement, cfg: Cfg, cfgCtrl: CfgCtrl, name: string) => Objs3D;
1730
+ export declare type Obj3DClass = new (canvas: HTMLElement, cfg: Cfg, name: string) => Objs3D;
1747
1731
 
1748
1732
  /** Defines all event types supported by `Obj3D.addEventListener`. */
1749
1733
  export declare type Obj3DEvent = Obj3DPosWorldEvent | Obj3DPosScreenEvent | Obj3DVisibleEvent | Obj3DPointerEvent;
@@ -1810,25 +1794,11 @@ export declare type Objs3D = Cam3D | Light3D | Mesh3D | Obj3D;
1810
1794
  export declare class OrbitCtrls {
1811
1795
  private readonly cam3D;
1812
1796
  private readonly canvas;
1813
- private readonly cfg;
1814
1797
  private readonly engine;
1815
1798
  private readonly events;
1816
1799
  private readonly modules;
1817
1800
  orbitControls: OrbitControls_2 | null;
1818
- private enableDamping;
1819
- private dampingFactor;
1820
- private minDistance;
1821
- private maxDistance;
1822
- private enableZoom;
1823
- private zoomSpeed;
1824
- private enableRotate;
1825
- private rotateSpeed;
1826
- private enablePan;
1827
- private panSpeed;
1828
- private autoRotate;
1829
- private autoRotateSpeed;
1830
- private minPolarAngle;
1831
- private maxPolarAngle;
1801
+ private readonly params;
1832
1802
  private orbitCtrlsFirstChange;
1833
1803
  private callback;
1834
1804
  private listenerPointersStart;
@@ -1843,6 +1813,11 @@ export declare class OrbitCtrls {
1843
1813
  enable(): void;
1844
1814
  /** Disposes three.js `OrbitControls` and removes them from the render loop. */
1845
1815
  dispose(): void;
1816
+ /**
1817
+ * Returns the parameters currently used by three.js `OrbitControls`.
1818
+ * @returns A snapshot of the mutable orbit control settings.
1819
+ */
1820
+ get(): Partial<OrbitCtrlsCfg>;
1846
1821
  /**
1847
1822
  * Returns whether three.js `OrbitControls` are currently enabled.
1848
1823
  * @returns `true` if `OrbitControls` are currently enabled; otherwise, `false`.
@@ -1853,8 +1828,6 @@ export declare class OrbitCtrls {
1853
1828
  * @param params - Object containing any subset of orbit control parameters.
1854
1829
  */
1855
1830
  set(params: Partial<OrbitCtrlsCfg>): void;
1856
- /** Returns the current three.js `OrbitControls` configuration. */
1857
- get(): Partial<OrbitCtrlsCfg>;
1858
1831
  /**
1859
1832
  * Registers and executes a low-level extension function with access to the public `OrbitCtrls` API.
1860
1833
  *
@@ -2120,7 +2093,7 @@ export declare interface RenderCfg {
2120
2093
  * - `webgpu`: use `THREE.WebGPURenderer`
2121
2094
  * - `auto`: use WebGPU if supported, otherwise fall back to WebGL
2122
2095
  *
2123
- * @default 'auto'
2096
+ * @default 'webgl'
2124
2097
  */
2125
2098
  api: Renderer;
2126
2099
  /**
@@ -2444,10 +2417,10 @@ export declare interface SsrWebGpuCfg {
2444
2417
  */
2445
2418
  maxDistance: number;
2446
2419
  /**
2447
- * Reflection opacity value.
2420
+ * Reflection intensity value.
2448
2421
  * @default 0.5
2449
2422
  */
2450
- opacity: number;
2423
+ intensity: number;
2451
2424
  /**
2452
2425
  * Ray thickness used for SSR intersection tests.
2453
2426
  * @default 0.018
@@ -2519,3 +2492,10 @@ export declare interface WindowResizeEvent {
2519
2492
  }
2520
2493
 
2521
2494
  export { }
2495
+
2496
+
2497
+ declare module 'three/addons/postprocessing/SSRPass.js' {
2498
+ interface SSRPassParams {
2499
+ bouncing?: boolean;
2500
+ }
2501
+ }