three-ilda 0.1.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.
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Laser show for THREE.WebGLRenderer (the WebGL 2 version): ShaderMaterials with the same math as the TSL variant.
3
+ * Playback, buffers and the public API live in LaserShowBase.
4
+ */
5
+ export class LaserShow extends LaserShowBase {
6
+ _createMaterials(): {
7
+ line: ShaderMaterial;
8
+ beam: ShaderMaterial;
9
+ scale: {
10
+ value: Vector3;
11
+ };
12
+ origin: {
13
+ value: Vector3;
14
+ };
15
+ clock: {
16
+ value: number;
17
+ };
18
+ intensity: {
19
+ value: number;
20
+ };
21
+ beamIntensity: {
22
+ value: number;
23
+ };
24
+ };
25
+ }
26
+ import { LaserShowBase } from '../core/LaserShowBase.js';
27
+ import { ShaderMaterial } from 'three';
28
+ import { Vector3 } from 'three';
@@ -0,0 +1,99 @@
1
+ /** @typedef {import('../core/LaserShowBase.js').LaserShowBase} LaserShowBase */
2
+ /**
3
+ * @typedef {Object} LaserShowPipelineOptions
4
+ * @property {number} [beamLayer] Layer reserved for beam meshes, 1 to 31 (default 31).
5
+ * @property {number} [strength] Bloom strength (default 15).
6
+ * @property {number} [radius] Bloom radius (default 1).
7
+ * @property {number} [threshold] Bloom luminance threshold (default 0).
8
+ * @property {number} [samples] MSAA samples of the scene pass (default 4).
9
+ */
10
+ /**
11
+ * Post-processing for THREE.WebGLRenderer (the WebGL 2 version) with the same structure as the node pipeline:
12
+ * scene pass with a depth texture, bloom, a half-resolution beam pass faded by scene depth, blur and haze compositing.
13
+ * Uses the host's scene and camera; reserves beamLayer (default 31) for registered beam meshes.
14
+ */
15
+ export class LaserShowPipeline {
16
+ /**
17
+ * @param {import('three').WebGLRenderer} renderer
18
+ * @param {import('three').Scene} scene
19
+ * @param {import('three').Camera} camera
20
+ * @param {LaserShowPipelineOptions} [options]
21
+ */
22
+ constructor(renderer: import("three").WebGLRenderer, scene: import("three").Scene, camera: import("three").Camera, { beamLayer, strength, radius, threshold, samples }?: LaserShowPipelineOptions);
23
+ renderer: import("three").WebGLRenderer;
24
+ scene: import("three").Scene<import("three").Object3DEventMap>;
25
+ camera: import("three").Camera;
26
+ beamLayer: number;
27
+ /** @type {Map<LaserShowBase, { mask: number, uniforms: Record<string, { value: unknown }>, onDispose: () => void }>} */
28
+ shows: Map<LaserShowBase, {
29
+ mask: number;
30
+ uniforms: Record<string, {
31
+ value: unknown;
32
+ }>;
33
+ onDispose: () => void;
34
+ }>;
35
+ disposed: boolean;
36
+ _size: Vector2;
37
+ _clear: Color;
38
+ _beamLayers: Layers;
39
+ sceneTarget: WebGLRenderTarget<import("three").Texture<unknown, import("three").TextureEventMap>>;
40
+ beamTarget: WebGLRenderTarget<import("three").Texture<unknown, import("three").TextureEventMap>>;
41
+ blurTarget: WebGLRenderTarget<import("three").Texture<unknown, import("three").TextureEventMap>>;
42
+ glow: UnrealBloomPass;
43
+ _blur: FullScreenQuad;
44
+ _composite: FullScreenQuad;
45
+ _depth: {
46
+ tDepth: {
47
+ value: DepthTexture<import("three").DepthTextureImageData>;
48
+ };
49
+ resolution: {
50
+ value: Vector2;
51
+ };
52
+ cameraNear: {
53
+ value: any;
54
+ };
55
+ cameraFar: {
56
+ value: any;
57
+ };
58
+ orthographic: {
59
+ value: boolean;
60
+ };
61
+ };
62
+ /** @param {LaserShowBase} show @returns {this} */
63
+ add(show: LaserShowBase): this;
64
+ /** @param {LaserShowBase} show @returns {this} */
65
+ remove(show: LaserShowBase): this;
66
+ _resize(width: any, height: any): void;
67
+ render(): void;
68
+ dispose(): void;
69
+ }
70
+ export type LaserShowBase = import("../core/LaserShowBase.js").LaserShowBase;
71
+ export type LaserShowPipelineOptions = {
72
+ /**
73
+ * Layer reserved for beam meshes, 1 to 31 (default 31).
74
+ */
75
+ beamLayer?: number;
76
+ /**
77
+ * Bloom strength (default 15).
78
+ */
79
+ strength?: number;
80
+ /**
81
+ * Bloom radius (default 1).
82
+ */
83
+ radius?: number;
84
+ /**
85
+ * Bloom luminance threshold (default 0).
86
+ */
87
+ threshold?: number;
88
+ /**
89
+ * MSAA samples of the scene pass (default 4).
90
+ */
91
+ samples?: number;
92
+ };
93
+ import { Vector2 } from 'three';
94
+ import { Color } from 'three';
95
+ import { Layers } from 'three';
96
+ import { WebGLRenderTarget } from 'three';
97
+ import { UnrealBloomPass } from 'three/addons/postprocessing/UnrealBloomPass.js';
98
+ import { FullScreenQuad } from 'three/addons/postprocessing/Pass.js';
99
+ import { DepthTexture } from 'three';
@@ -0,0 +1,10 @@
1
+ export { LaserShow } from "./webgl/LaserShow.js";
2
+ export { LaserShowPipeline } from "./webgl/LaserShowPipeline.js";
3
+ export type ILDAAsset = import("./loaders/ILDALoader.js").ILDAAsset;
4
+ export type ILDAFrame = import("./loaders/ILDALoader.js").ILDAFrame;
5
+ export type ScannerParams = import("./core/LaserScanner.js").ScannerParams;
6
+ export type LaserShowOptions = import("./core/LaserShowBase.js").LaserShowOptions;
7
+ export type BeamMode = import("./core/LaserShowBase.js").BeamMode;
8
+ export type LaserShowPipelineOptions = import("./webgl/LaserShowPipeline.js").LaserShowPipelineOptions;
9
+ export { ILDALoader, ILDA_DEFAULT_PALETTE } from "./loaders/ILDALoader.js";
10
+ export { LaserScanner, SCANNER_DEFAULTS, TRAIL_POINTS } from "./core/LaserScanner.js";