@3driseai/3drise-viewer 0.1.22 → 0.1.23

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.
Files changed (87) hide show
  1. package/dist/components/CreatedObject.d.ts.map +1 -1
  2. package/dist/components/CreatedObject.js +6 -1
  3. package/dist/components/LightObject.d.ts.map +1 -1
  4. package/dist/components/LightObject.js +20 -13
  5. package/dist/components/ModelPrimitive.d.ts.map +1 -1
  6. package/dist/components/ModelPrimitive.js +4 -6
  7. package/dist/components/ObjectNode.js +1 -1
  8. package/dist/components/ParticlesGenerator.d.ts +3 -1
  9. package/dist/components/ParticlesGenerator.d.ts.map +1 -1
  10. package/dist/components/ParticlesGenerator.js +2 -2
  11. package/dist/components/ProjectLoader.js +1 -1
  12. package/dist/components/SceneBuilder.d.ts.map +1 -1
  13. package/dist/components/SceneBuilder.js +5 -1
  14. package/dist/components/fluorescentTube/FluorescentTube.d.ts +14 -0
  15. package/dist/components/fluorescentTube/FluorescentTube.d.ts.map +1 -0
  16. package/dist/components/fluorescentTube/FluorescentTube.js +262 -0
  17. package/dist/components/fluorescentTube/index.d.ts +5 -0
  18. package/dist/components/fluorescentTube/index.d.ts.map +1 -0
  19. package/dist/components/fluorescentTube/index.js +3 -0
  20. package/dist/components/fluorescentTube/tubeMaterials.d.ts +34 -0
  21. package/dist/components/fluorescentTube/tubeMaterials.d.ts.map +1 -0
  22. package/dist/components/fluorescentTube/tubeMaterials.js +185 -0
  23. package/dist/components/index.d.ts +3 -0
  24. package/dist/components/index.d.ts.map +1 -1
  25. package/dist/components/index.js +3 -0
  26. package/dist/components/ledArray/LedArray.d.ts +14 -0
  27. package/dist/components/ledArray/LedArray.d.ts.map +1 -0
  28. package/dist/components/ledArray/LedArray.js +243 -0
  29. package/dist/components/ledArray/index.d.ts +7 -0
  30. package/dist/components/ledArray/index.d.ts.map +1 -0
  31. package/dist/components/ledArray/index.js +4 -0
  32. package/dist/components/ledArray/ledLayout.d.ts +22 -0
  33. package/dist/components/ledArray/ledLayout.d.ts.map +1 -0
  34. package/dist/components/ledArray/ledLayout.js +59 -0
  35. package/dist/components/ledArray/ledMaterials.d.ts +14 -0
  36. package/dist/components/ledArray/ledMaterials.d.ts.map +1 -0
  37. package/dist/components/ledArray/ledMaterials.js +151 -0
  38. package/dist/components/lightBulb/LightBulb.d.ts.map +1 -1
  39. package/dist/components/lightBulb/LightBulb.js +10 -13
  40. package/dist/components/particles/BioluminescentWakeParticles.d.ts +3 -1
  41. package/dist/components/particles/BioluminescentWakeParticles.d.ts.map +1 -1
  42. package/dist/components/particles/BioluminescentWakeParticles.js +7 -3
  43. package/dist/components/particles/BrownianDustParticles.d.ts +3 -1
  44. package/dist/components/particles/BrownianDustParticles.d.ts.map +1 -1
  45. package/dist/components/particles/BrownianDustParticles.js +7 -3
  46. package/dist/components/particles/ChladniSandParticles.d.ts +3 -1
  47. package/dist/components/particles/ChladniSandParticles.d.ts.map +1 -1
  48. package/dist/components/particles/ChladniSandParticles.js +7 -3
  49. package/dist/components/particles/ElectronOrbitalsParticles.d.ts +3 -1
  50. package/dist/components/particles/ElectronOrbitalsParticles.d.ts.map +1 -1
  51. package/dist/components/particles/ElectronOrbitalsParticles.js +7 -3
  52. package/dist/components/particles/FaradayPowderParticles.d.ts +3 -1
  53. package/dist/components/particles/FaradayPowderParticles.d.ts.map +1 -1
  54. package/dist/components/particles/FaradayPowderParticles.js +7 -3
  55. package/dist/components/particles/GrinderSparksParticles.d.ts +3 -1
  56. package/dist/components/particles/GrinderSparksParticles.d.ts.map +1 -1
  57. package/dist/components/particles/GrinderSparksParticles.js +7 -3
  58. package/dist/components/particles/NeonRainParticles.d.ts +3 -1
  59. package/dist/components/particles/NeonRainParticles.d.ts.map +1 -1
  60. package/dist/components/particles/NeonRainParticles.js +7 -3
  61. package/dist/components/particles/TidalStreamParticles.d.ts +3 -1
  62. package/dist/components/particles/TidalStreamParticles.d.ts.map +1 -1
  63. package/dist/components/particles/TidalStreamParticles.js +7 -3
  64. package/dist/components/spotBeam/SpotBeam.d.ts +14 -0
  65. package/dist/components/spotBeam/SpotBeam.d.ts.map +1 -0
  66. package/dist/components/spotBeam/SpotBeam.js +244 -0
  67. package/dist/components/spotBeam/beamPatterns.d.ts +11 -0
  68. package/dist/components/spotBeam/beamPatterns.d.ts.map +1 -0
  69. package/dist/components/spotBeam/beamPatterns.js +106 -0
  70. package/dist/components/spotBeam/index.d.ts +7 -0
  71. package/dist/components/spotBeam/index.d.ts.map +1 -0
  72. package/dist/components/spotBeam/index.js +4 -0
  73. package/dist/components/spotBeam/spotBeamMaterials.d.ts +16 -0
  74. package/dist/components/spotBeam/spotBeamMaterials.d.ts.map +1 -0
  75. package/dist/components/spotBeam/spotBeamMaterials.js +307 -0
  76. package/dist/hooks/index.d.ts +2 -0
  77. package/dist/hooks/index.d.ts.map +1 -1
  78. package/dist/hooks/index.js +1 -0
  79. package/dist/hooks/useLightConfig.d.ts +25 -0
  80. package/dist/hooks/useLightConfig.d.ts.map +1 -0
  81. package/dist/hooks/useLightConfig.js +125 -0
  82. package/dist/hooks/useLightLive.d.ts.map +1 -1
  83. package/dist/hooks/useLightLive.js +9 -2
  84. package/dist/hooks/useShadowApplication.d.ts +4 -4
  85. package/dist/hooks/useShadowApplication.d.ts.map +1 -1
  86. package/dist/hooks/useShadowApplication.js +25 -10
  87. package/package.json +2 -2
@@ -0,0 +1,185 @@
1
+ // =============================================================================
2
+ // tubeMaterials — the phosphor, the air around it, and the end caps
3
+ // =============================================================================
4
+ //
5
+ // A fluorescent tube is a long, evenly bright surface, so the glow cannot be a
6
+ // blob at a point: the phosphor cylinder is the source, and a slightly larger
7
+ // additive sleeve around it carries the haze, brightest where you look through
8
+ // the most glass. Both are drawn by hand — the viewer has no bloom.
9
+ //
10
+ // `uAge` is the knob that does the most work here. A tired tube loses output,
11
+ // and its cathodes sputter tungsten onto the glass, so the ends blacken first.
12
+ //
13
+ import { AdditiveBlending, Color, DoubleSide, MeshStandardMaterial, ShaderMaterial } from 'three';
14
+ const OUTPUT = /* glsl */ `
15
+ #include <tonemapping_fragment>
16
+ #include <colorspace_fragment>
17
+ `;
18
+ /** Shared by both cylinder materials: how far along the tube, 0..1 at the ends. */
19
+ const END_FACTOR = /* glsl */ `
20
+ float endFactor(float v, float age) {
21
+ float m = min(v, 1.0 - v) * 2.0; // 0 at an end, 1 at the middle
22
+ float ends = smoothstep(0.0, 0.22 + age * 0.3, m);
23
+ // even a new tube is a little darker at the cathodes
24
+ return mix(mix(1.0, ends, 0.3), ends * ends, age);
25
+ }`;
26
+ function phosphorMaterial() {
27
+ return new ShaderMaterial({
28
+ uniforms: {
29
+ uColor: { value: new Color(1, 1, 1) },
30
+ uStrength: { value: 0 },
31
+ uAge: { value: 0.15 },
32
+ },
33
+ vertexShader: /* glsl */ `
34
+ varying vec2 vUv;
35
+ varying vec3 vNormalV;
36
+ void main() {
37
+ vUv = uv;
38
+ vNormalV = normalize(normalMatrix * normal);
39
+ gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);
40
+ }`,
41
+ fragmentShader: /* glsl */ `
42
+ uniform vec3 uColor;
43
+ uniform float uStrength;
44
+ uniform float uAge;
45
+ varying vec2 vUv;
46
+ varying vec3 vNormalV;
47
+ ${END_FACTOR}
48
+ void main() {
49
+ float lit = endFactor(vUv.y, uAge);
50
+ // the soot band right at the cathodes
51
+ float m = min(vUv.y, 1.0 - vUv.y) * 2.0;
52
+ float soot = uAge * (1.0 - smoothstep(0.0, 0.10 + uAge * 0.12, m));
53
+ // the curve of the glass: a touch brighter face-on, never black
54
+ float facing = 0.72 + 0.28 * abs(vNormalV.z);
55
+ vec3 c = uColor * uStrength * lit * facing * (1.0 - soot * 0.9);
56
+ gl_FragColor = vec4(c, 1.0);
57
+ ${OUTPUT}
58
+ }`,
59
+ side: DoubleSide,
60
+ toneMapped: false,
61
+ });
62
+ }
63
+ /**
64
+ * The haze around the glass. Not a bigger cylinder — a quad that pivots about
65
+ * the tube's own axis to face the camera, which is the only way a line source
66
+ * keeps an even glow from every angle. A fatter cylinder shows its own far wall
67
+ * as a second bright edge; this does not.
68
+ */
69
+ /**
70
+ * Both glows are quads that pivot about the tube's own axis to face the camera.
71
+ * A fatter cylinder would show its own far wall as a second bright edge, and a
72
+ * plain screen-space billboard would stretch along the screen instead of along
73
+ * the tube — which is wrong the moment the fixture is not horizontal.
74
+ */
75
+ /**
76
+ * Distance to the tube's *line* rather than to its centre, normalised: 0 along
77
+ * the core, 1 at the quad's rim. Both glows are capsules round the fixture, so
78
+ * they wrap the ends instead of being cut off at them.
79
+ */
80
+ /** Fraction of each quad that is the tube itself; the rest is the rounded end. */
81
+ export const SLEEVE_CORE = 0.86;
82
+ export const HALO_CORE = 0.75;
83
+ const CAPSULE = /* glsl */ `
84
+ float capsule(vec2 uv, float core) {
85
+ float along = max(abs(uv.x) - core, 0.0) / max(1.0 - core, 1e-3);
86
+ return length(vec2(along, uv.y));
87
+ }`;
88
+ const BILLBOARD_VERT = /* glsl */ `
89
+ uniform float uHalfLength;
90
+ uniform float uHalfWidth;
91
+ varying vec2 vUv;
92
+ void main() {
93
+ // The tube lies along local X. Both it and the quad's centre go to view
94
+ // space; the quad then opens perpendicular to the axis and to the eye.
95
+ vec3 axis = normalize((modelViewMatrix * vec4(1.0, 0.0, 0.0, 0.0)).xyz);
96
+ vec4 c = modelViewMatrix * vec4(0.0, 0.0, 0.0, 1.0);
97
+ // Open the quad across the axis *in the screen plane*: turning the
98
+ // projected axis 90 degrees. cross(axis, eye) is the textbook version and
99
+ // it collapses here, and a quad stretched along screen X ignores the
100
+ // fixture's angle entirely — this keeps the glow on the tube either way.
101
+ vec3 perp = length(axis.xy) > 1e-4
102
+ ? normalize(vec3(-axis.y, axis.x, 0.0))
103
+ : vec3(0.0, 1.0, 0.0);
104
+ float scale = length(modelMatrix[0].xyz);
105
+ vec3 p = c.xyz
106
+ + axis * (position.x * uHalfLength * scale)
107
+ + perp * (position.y * uHalfWidth * scale);
108
+ vUv = position.xy;
109
+ gl_Position = projectionMatrix * vec4(p, 1.0);
110
+ }`;
111
+ function sleeveMaterial() {
112
+ return new ShaderMaterial({
113
+ uniforms: {
114
+ uColor: { value: new Color(1, 1, 1) },
115
+ uStrength: { value: 0 },
116
+ uAge: { value: 0.15 },
117
+ /** Half the tube length and half the width of the glow, object space. */
118
+ uHalfLength: { value: 0.6 },
119
+ uHalfWidth: { value: 0.06 },
120
+ },
121
+ vertexShader: BILLBOARD_VERT,
122
+ fragmentShader: /* glsl */ `
123
+ uniform vec3 uColor;
124
+ uniform float uStrength;
125
+ uniform float uAge;
126
+ varying vec2 vUv;
127
+ ${END_FACTOR}
128
+ ${CAPSULE}
129
+ #define SLEEVE_CORE 0.86
130
+ void main() {
131
+ // vUv.x runs -1..1 end to end, vUv.y -1..1 across the glow
132
+ float lit = endFactor(clamp(vUv.x / SLEEVE_CORE, -1.0, 1.0) * 0.5 + 0.5, uAge);
133
+ float d = capsule(vUv, SLEEVE_CORE);
134
+ // Steep enough that it has reached zero before the quad's rim: in
135
+ // sRGB even 1% of linear light draws a visible edge.
136
+ float a = exp(-d * d * 10.0);
137
+ gl_FragColor = vec4(uColor * uStrength * lit * a, 1.0);
138
+ ${OUTPUT}
139
+ }`,
140
+ transparent: true,
141
+ depthWrite: false,
142
+ blending: AdditiveBlending,
143
+ });
144
+ }
145
+ function haloMaterial() {
146
+ return new ShaderMaterial({
147
+ uniforms: {
148
+ uColor: { value: new Color(1, 1, 1) },
149
+ uStrength: { value: 0 },
150
+ /** Half the length and half the width of the wash, object space. */
151
+ uHalfLength: { value: 0.8 },
152
+ uHalfWidth: { value: 0.3 },
153
+ },
154
+ vertexShader: BILLBOARD_VERT,
155
+ fragmentShader: /* glsl */ `
156
+ uniform vec3 uColor;
157
+ uniform float uStrength;
158
+ varying vec2 vUv;
159
+ ${CAPSULE}
160
+ #define HALO_CORE 0.75
161
+ void main() {
162
+ float d = capsule(vUv, HALO_CORE);
163
+ float a = exp(-d * d * 9.0);
164
+ gl_FragColor = vec4(uColor * uStrength * a, 1.0);
165
+ ${OUTPUT}
166
+ }`,
167
+ transparent: true,
168
+ depthWrite: false,
169
+ blending: AdditiveBlending,
170
+ });
171
+ }
172
+ export function createTubeMaterials() {
173
+ return {
174
+ phosphor: phosphorMaterial(),
175
+ sleeve: sleeveMaterial(),
176
+ cap: new MeshStandardMaterial({ color: 0x6f7478, metalness: 0.9, roughness: 0.42 }),
177
+ halo: haloMaterial(),
178
+ };
179
+ }
180
+ export function disposeTubeMaterials(m) {
181
+ m.phosphor.dispose();
182
+ m.sleeve.dispose();
183
+ m.cap.dispose();
184
+ m.halo.dispose();
185
+ }
@@ -159,6 +159,9 @@ export * from './water';
159
159
  export * from './effects';
160
160
  export * from './particles';
161
161
  export * from './lightBulb';
162
+ export * from './spotBeam';
163
+ export * from './ledArray';
164
+ export * from './fluorescentTube';
162
165
  export type { LandscapeBuilderProps } from './LandscapeBuilder';
163
166
  export { default as LandscapeBuilder } from './LandscapeBuilder';
164
167
  export type { LandscapeObjectProps } from './LandscapeObject';
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/components/index.ts"],"names":[],"mappings":"AAIA,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,YAAY,EAAE,YAAY,EAAE,MAAM,WAAW,CAAC;AAC9C,YAAY,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAC5C,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,YAAY,EAAE,uBAAuB,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AAC7F,YAAY,EAAE,mBAAmB,EAAE,MAAM,kBAAkB,CAAC;AAC5D,YAAY,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAC5D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AAC;AAC3B,cAAc,YAAY,CAAC;AAC3B,cAAc,mBAAmB,CAAC;AAIlC,YAAY,EAAE,qBAAqB,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACjE,YAAY,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAC9D,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAC/D,cAAc,aAAa,CAAC"}
@@ -103,6 +103,9 @@ export * from './water/index.js';
103
103
  export * from './effects/index.js';
104
104
  export * from './particles/index.js';
105
105
  export * from './lightBulb/index.js';
106
+ export * from './spotBeam/index.js';
107
+ export * from './ledArray/index.js';
108
+ export * from './fluorescentTube/index.js';
106
109
  export { default as LandscapeBuilder } from './LandscapeBuilder.js';
107
110
  export { default as LandscapeObject } from './LandscapeObject.js';
108
111
  export * from './landscape/index.js';
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ import type { AnimationOptions, CreatedObjectSettings, MouseMoveDomain } from '@3driseai/3drise-core';
3
+ import type { ObjectReadyProps } from '../../types/objectReady';
4
+ export type LedArrayProps = ObjectReadyProps & {
5
+ /** Scene object id: the light controller finds the live-edit handle by it. */
6
+ id?: string;
7
+ config: Record<string, any>;
8
+ animations?: AnimationOptions[];
9
+ mouseMove?: MouseMoveDomain;
10
+ settings: CreatedObjectSettings | Record<string, any>;
11
+ };
12
+ declare const LedArray: React.FC<LedArrayProps>;
13
+ export default LedArray;
14
+ //# sourceMappingURL=LedArray.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LedArray.d.ts","sourceRoot":"","sources":["../../../src/components/ledArray/LedArray.tsx"],"names":[],"mappings":"AAoBA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAK1D,OAAO,KAAK,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAItG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAMhE,MAAM,MAAM,aAAa,GAAG,gBAAgB,GAAG;IAC3C,8EAA8E;IAC9E,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC5B,UAAU,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAChC,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,QAAQ,EAAE,qBAAqB,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;CACzD,CAAC;AAgBF,QAAA,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CA4OrC,CAAC;AAEF,eAAe,QAAQ,CAAC"}
@@ -0,0 +1,243 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ // =============================================================================
3
+ // LedArray — a point light drawn as the dies that make it
4
+ // =============================================================================
5
+ //
6
+ // Rendered by LightObject for `config.type === 'ledArray'`. Like spotBeam, this
7
+ // is a light rather than a lamp: the geometry is the emitters themselves (and
8
+ // can be switched off), because the object is meant to be dropped into whatever
9
+ // housing the scene already has.
10
+ //
11
+ // What makes it read as LED rather than a small bulb:
12
+ // - it comes on instantly — no thermal lag, the opposite of a filament;
13
+ // - `pwm` puts back the high-frequency chop a dimmed LED runs on, which a
14
+ // camera (and a 60 Hz render) sees as a slow strobe rather than a flat dim;
15
+ // - `diffuser` both fades the dies into one sheet and widens the light's own
16
+ // shadow radius, because those are the same fact: a bigger apparent source
17
+ // casts a softer shadow;
18
+ // - 'rgb' colour mode runs a hue across the array and can chase along it,
19
+ // which is what an addressable strip actually is. The light itself takes the
20
+ // average of the dies, the way the room would.
21
+ //
22
+ import { useEffect, useMemo, useRef } from 'react';
23
+ import { useFrame } from '@react-three/fiber';
24
+ import { BoxGeometry, Color, InstancedBufferAttribute, Matrix4, PlaneGeometry } from 'three';
25
+ import { SELF_OWNED_MATERIAL_KEY } from '@3driseai/3drise-core';
26
+ import { useObjectReady } from '../../hooks/useObjectReady.js';
27
+ import { useLightShadow } from '../../hooks/useLightShadow.js';
28
+ import { useLightConfig } from '../../hooks/useLightConfig.js';
29
+ import { kelvinToColor } from '../lightBulb/kelvin.js';
30
+ import { createLedArrayMaterials, disposeLedArrayMaterials } from './ledMaterials.js';
31
+ import { placeDies } from './ledLayout.js';
32
+ const num = (v, fallback) => (typeof v === 'number' && Number.isFinite(v) ? v : fallback);
33
+ const clamp01 = (v) => Math.min(Math.max(v, 0), 1);
34
+ const hash = (n) => {
35
+ const s = Math.sin(n * 127.1) * 43758.5453;
36
+ return s - Math.floor(s);
37
+ };
38
+ const noise1 = (x) => {
39
+ const i = Math.floor(x), f = x - i, u = f * f * (3 - 2 * f);
40
+ return hash(i) * (1 - u) + hash(i + 1) * u;
41
+ };
42
+ const scratchMatrix = new Matrix4();
43
+ const LedArray = ({ id, config, animations, mouseMove, settings, onObjectReady, onObjectDispose }) => {
44
+ const groupRef = useRef(null);
45
+ const lightRef = useRef(null);
46
+ const diesRef = useRef(null);
47
+ const glowRef = useRef(null);
48
+ const diffuserRef = useRef(null);
49
+ useObjectReady(groupRef, settings, onObjectReady, onObjectDispose);
50
+ useLightShadow(lightRef, config.shadow);
51
+ const { merged } = useLightConfig(groupRef, lightRef, id, config, animations, mouseMove);
52
+ const layout = (config.layout ?? 'panel');
53
+ const spacing = Math.max(num(config.spacing, 0.06), 0.005);
54
+ const dieSize = Math.max(num(config.dieSize, 0.022), 0.002);
55
+ const emitter = (config.emitter ?? 'dies');
56
+ // --- where the dies sit; rebuilt only when the array's shape changes ---
57
+ const place = useMemo(() => placeDies(layout, config.count, config.rows, spacing), [layout, config.count, config.rows, spacing]);
58
+ const geometry = useMemo(() => ({
59
+ // a flat chip, so a die reads as a surface rather than a cube
60
+ die: new BoxGeometry(1, 0.35, 1),
61
+ glow: new PlaneGeometry(2, 2),
62
+ sheet: new PlaneGeometry(1, 1),
63
+ }), []);
64
+ useEffect(() => () => {
65
+ geometry.die.dispose();
66
+ geometry.glow.dispose();
67
+ geometry.sheet.dispose();
68
+ }, [geometry]);
69
+ const mats = useMemo(() => createLedArrayMaterials(), []);
70
+ useEffect(() => () => disposeLedArrayMaterials(mats), [mats]);
71
+ /** One colour per die, reused every frame instead of reallocated. */
72
+ const dieColors = useMemo(() => {
73
+ const list = [];
74
+ for (let i = 0; i < place.count; i++)
75
+ list.push(new Color());
76
+ return list;
77
+ }, [place]);
78
+ // Instance transforms + the per-die colour attribute the glow shader reads.
79
+ useEffect(() => {
80
+ const dies = diesRef.current;
81
+ const glow = glowRef.current;
82
+ const { positions, count } = place;
83
+ const colors = new Float32Array(count * 3).fill(1);
84
+ for (let i = 0; i < count; i++) {
85
+ const x = positions[i * 3], z = positions[i * 3 + 2];
86
+ scratchMatrix.makeScale(dieSize, dieSize, dieSize);
87
+ scratchMatrix.setPosition(x, 0, z);
88
+ dies?.setMatrixAt(i, scratchMatrix);
89
+ glow?.setMatrixAt(i, scratchMatrix);
90
+ }
91
+ if (dies) {
92
+ dies.count = count;
93
+ dies.instanceMatrix.needsUpdate = true;
94
+ }
95
+ if (glow) {
96
+ glow.count = count;
97
+ glow.instanceMatrix.needsUpdate = true;
98
+ glow.geometry.setAttribute('aColor', new InstancedBufferAttribute(colors, 3));
99
+ }
100
+ mats.diffuser.uniforms.uPitch.value = Math.max(place.pitchX, 1);
101
+ }, [place, dieSize, mats]);
102
+ // The light owns its materials and its shadow flags.
103
+ useEffect(() => {
104
+ const group = groupRef.current;
105
+ if (!group)
106
+ return;
107
+ group.userData[SELF_OWNED_MATERIAL_KEY] = true;
108
+ return () => { delete group.userData[SELF_OWNED_MATERIAL_KEY]; };
109
+ }, []);
110
+ // The dies sit millimetres from the light; the point shadow camera's default
111
+ // near of 0.5 would clip the whole array out of its own shadow map.
112
+ const shadowNear = config.shadow?.cameraNear;
113
+ useEffect(() => {
114
+ const light = lightRef.current;
115
+ if (!light || shadowNear !== undefined)
116
+ return;
117
+ light.shadow.camera.near = 0.02;
118
+ light.shadow.camera.updateProjectionMatrix();
119
+ }, [shadowNear]);
120
+ const colorMode = (config.colorMode ?? 'temperature');
121
+ const lightColor = useMemo(() => (colorMode === 'temperature'
122
+ ? kelvinToColor(config.temperature ?? 5000)
123
+ : new Color(config.color || '#ffffff')), [colorMode, config.color, config.temperature]);
124
+ const power = useRef({
125
+ level: (config.on ?? true) ? 1 : 0,
126
+ base: config.intensity ?? 1,
127
+ written: Number.NaN,
128
+ seed: Math.random() * 1000,
129
+ });
130
+ const scratch = useMemo(() => ({ mean: new Color(), glow: new Color(), tmp: new Color() }), []);
131
+ useFrame(({ clock }, delta) => {
132
+ const light = lightRef.current;
133
+ if (!light)
134
+ return;
135
+ const cfg = merged.current;
136
+ const p = power.current;
137
+ // Adopt any intensity we did not write ourselves as the new base, so the
138
+ // multiplier below never compounds and animations stay in charge.
139
+ if (light.intensity !== p.written)
140
+ p.base = light.intensity;
141
+ const on = cfg.on ?? true;
142
+ // An LED has no thermal lag: the default is a hard switch, and `warmup`
143
+ // is there only for someone who wants a fade.
144
+ const warmup = Math.max(num(cfg.warmup, 0), 0);
145
+ const target = on ? 1 : 0;
146
+ p.level = warmup <= 0
147
+ ? target
148
+ : p.level + (target - p.level) * (1 - Math.exp(-Math.min(delta, 0.1) * 3 / warmup));
149
+ if (Math.abs(target - p.level) < 1e-4)
150
+ p.level = target;
151
+ const t = clock.elapsedTime;
152
+ // PWM: a real dimmed LED is fully on for part of each cycle and fully off
153
+ // for the rest. At ~118 Hz against a 60 Hz frame that beats slowly, which
154
+ // is exactly the strobe a camera picks up.
155
+ const pwm = clamp01(num(cfg.pwm, 0));
156
+ const chop = pwm > 0 ? 1 - pwm * 0.5 * (0.5 + 0.5 * Math.sin(t * Math.PI * 2 * 118)) : 1;
157
+ const flicker = clamp01(num(cfg.flicker, 0));
158
+ let flick = 1;
159
+ if (flicker > 0) {
160
+ const ft = t + p.seed;
161
+ flick = 1 - flicker * (0.1 * noise1(ft * 13) + 0.6 * Math.pow(noise1(ft * 3.1), 4));
162
+ }
163
+ const output = p.level * chop * flick;
164
+ light.intensity = p.base * output;
165
+ p.written = light.intensity;
166
+ const baseIntensity = Math.max(num(config.intensity, 1), 1e-4);
167
+ const glowK = Math.min(output * (p.base / baseIntensity), 3);
168
+ // --- colour: one per die, and the light takes their mean ---
169
+ const rgbSpread = num(cfg.rgbSpread, 1);
170
+ const rgbSpeed = num(cfg.rgbSpeed, 0.2);
171
+ const mean = scratch.mean.setRGB(0, 0, 0);
172
+ const n = dieColors.length || 1;
173
+ for (let i = 0; i < dieColors.length; i++) {
174
+ const c = dieColors[i];
175
+ if (colorMode === 'rgb')
176
+ c.setHSL(((i / n) * rgbSpread + t * rgbSpeed) % 1, 1, 0.5);
177
+ else
178
+ c.copy(light.color);
179
+ mean.r += c.r / n;
180
+ mean.g += c.g / n;
181
+ mean.b += c.b / n;
182
+ }
183
+ // In RGB mode the light is the mix of the dies, not one of them. This runs
184
+ // after useLightConfig's own write, which is the point: the array owns its
185
+ // colour the way the bulb's filament owns its heat.
186
+ if (colorMode === 'rgb' && dieColors.length)
187
+ light.color.copy(mean);
188
+ const glowColor = scratch.glow.copy(colorMode === 'rgb' ? mean : light.color);
189
+ // --- diffuser: fades the dies out and softens the shadow with them ---
190
+ const diffuser = clamp01(num(cfg.diffuser, 0));
191
+ const dieVisible = emitter === 'dies' && glowK > 0.005;
192
+ const dieK = glowK * (1 - diffuser * 0.85);
193
+ const dies = diesRef.current;
194
+ const glow = glowRef.current;
195
+ if (dies) {
196
+ dies.visible = dieVisible;
197
+ if (dieVisible) {
198
+ for (let i = 0; i < dieColors.length; i++)
199
+ dies.setColorAt(i, scratch.tmp.copy(dieColors[i]).multiplyScalar(Math.min(0.06 + dieK * 1.8, 4)));
200
+ if (dies.instanceColor)
201
+ dies.instanceColor.needsUpdate = true;
202
+ }
203
+ }
204
+ if (glow) {
205
+ glow.visible = dieVisible;
206
+ const attr = glow.geometry.getAttribute('aColor');
207
+ if (dieVisible && attr) {
208
+ const arr = attr.array;
209
+ for (let i = 0; i < dieColors.length; i++) {
210
+ const c = dieColors[i];
211
+ arr[i * 3] = c.r;
212
+ arr[i * 3 + 1] = c.g;
213
+ arr[i * 3 + 2] = c.b;
214
+ }
215
+ attr.needsUpdate = true;
216
+ }
217
+ // Every die adds to the same pixels, so the per-die glow has to stay
218
+ // small and faint or a panel fuses into one white slab.
219
+ mats.dieGlow.uniforms.uStrength.value = dieK * 0.34;
220
+ mats.dieGlow.uniforms.uSize.value = Math.min(dieSize * 3.6, spacing * 0.85);
221
+ }
222
+ const sheet = diffuserRef.current;
223
+ if (sheet) {
224
+ sheet.visible = diffuser > 0.01 && glowK > 0.005;
225
+ mats.diffuser.uniforms.uColor.value.copy(glowColor);
226
+ mats.diffuser.uniforms.uStrength.value = diffuser * glowK * 0.85;
227
+ mats.diffuser.uniforms.uBlend.value = diffuser;
228
+ }
229
+ // A diffuser is a physically bigger source, so it blurs the shadow. Only
230
+ // when the config has not set a radius of its own.
231
+ if (config.shadow?.radius === undefined)
232
+ light.shadow.radius = 1 + diffuser * 11;
233
+ const halo = Math.max(num(cfg.halo, 1), 0);
234
+ mats.halo.uniforms.uColor.value.copy(glowColor);
235
+ mats.halo.uniforms.uStrength.value = halo * glowK * (0.12 + diffuser * 0.2);
236
+ // Sized to the array, not the world: a strip and a panel glow differently.
237
+ mats.halo.uniforms.uRadius.value = Math.max(place.width, place.depth) * 1.5;
238
+ });
239
+ // The diffuser sits just in front of the dies, facing down with them.
240
+ const sheetSize = [place.width * 1.12, place.depth * 1.12];
241
+ return (_jsxs("group", { ref: groupRef, children: [_jsx("pointLight", { ref: lightRef, color: lightColor, intensity: config.intensity ?? 1, decay: config.decay ?? 1, distance: config.distance ?? 0 }), _jsx("instancedMesh", { ref: diesRef, args: [geometry.die, mats.die, place.count], renderOrder: 2, frustumCulled: false }), _jsx("instancedMesh", { ref: glowRef, args: [geometry.glow, mats.dieGlow, place.count], renderOrder: 3, frustumCulled: false }), _jsx("mesh", { ref: diffuserRef, material: mats.diffuser, position: [0, -Math.max(dieSize * 1.4, 0.012), 0], rotation: [-Math.PI / 2, 0, 0], scale: [sheetSize[0], sheetSize[1], 1], geometry: geometry.sheet, renderOrder: 4, frustumCulled: false }), _jsx("mesh", { material: mats.halo, geometry: geometry.glow, renderOrder: 5, frustumCulled: false })] }));
242
+ };
243
+ export default LedArray;
@@ -0,0 +1,7 @@
1
+ export { default as LedArray } from './LedArray';
2
+ export type { LedArrayProps } from './LedArray';
3
+ export { createLedArrayMaterials, disposeLedArrayMaterials } from './ledMaterials';
4
+ export type { LedArrayMaterials } from './ledMaterials';
5
+ export { LED_LAYOUTS, MAX_DIES, placeDies } from './ledLayout';
6
+ export type { LedLayout, LedPlacement } from './ledLayout';
7
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/ledArray/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,YAAY,CAAC;AACjD,YAAY,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,EAAE,uBAAuB,EAAE,wBAAwB,EAAE,MAAM,gBAAgB,CAAC;AACnF,YAAY,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC/D,YAAY,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC"}
@@ -0,0 +1,4 @@
1
+ // An array of LED dies with a real point light (config.type 'ledArray').
2
+ export { default as LedArray } from './LedArray.js';
3
+ export { createLedArrayMaterials, disposeLedArrayMaterials } from './ledMaterials.js';
4
+ export { LED_LAYOUTS, MAX_DIES, placeDies } from './ledLayout.js';
@@ -0,0 +1,22 @@
1
+ export type LedLayout = 'single' | 'strip' | 'panel' | 'ring';
2
+ export declare const LED_LAYOUTS: LedLayout[];
3
+ /** Instances are cheap but not free, and a 64x12 panel is already 768 dies. */
4
+ export declare const MAX_DIES = 512;
5
+ export interface LedPlacement {
6
+ /** x, y, z per die, flat. */
7
+ positions: Float32Array;
8
+ /** How many dies were actually placed (after the cap). */
9
+ count: number;
10
+ /** Footprint in object space, for the diffuser and the halo. */
11
+ width: number;
12
+ depth: number;
13
+ /** Hot spots across the diffuser's width, for its ripple. */
14
+ pitchX: number;
15
+ pitchZ: number;
16
+ }
17
+ /**
18
+ * Lay the dies out for a layout. `count` is the number along the main axis;
19
+ * `rows` only means anything for a panel.
20
+ */
21
+ export declare function placeDies(layout: LedLayout, countRaw: unknown, rowsRaw: unknown, spacing: number): LedPlacement;
22
+ //# sourceMappingURL=ledLayout.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ledLayout.d.ts","sourceRoot":"","sources":["../../../src/components/ledArray/ledLayout.ts"],"names":[],"mappings":"AAQA,MAAM,MAAM,SAAS,GAAG,QAAQ,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAE9D,eAAO,MAAM,WAAW,EAAE,SAAS,EAAyC,CAAC;AAE7E,+EAA+E;AAC/E,eAAO,MAAM,QAAQ,MAAM,CAAC;AAE5B,MAAM,WAAW,YAAY;IACzB,6BAA6B;IAC7B,SAAS,EAAE,YAAY,CAAC;IACxB,0DAA0D;IAC1D,KAAK,EAAE,MAAM,CAAC;IACd,gEAAgE;IAChE,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,6DAA6D;IAC7D,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;CAClB;AAOD;;;GAGG;AACH,wBAAgB,SAAS,CAAC,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,GAAG,YAAY,CA8C/G"}
@@ -0,0 +1,59 @@
1
+ export const LED_LAYOUTS = ['single', 'strip', 'panel', 'ring'];
2
+ /** Instances are cheap but not free, and a 64x12 panel is already 768 dies. */
3
+ export const MAX_DIES = 512;
4
+ const clampInt = (v, lo, hi, fallback) => {
5
+ const n = typeof v === 'number' && Number.isFinite(v) ? Math.round(v) : fallback;
6
+ return Math.min(Math.max(n, lo), hi);
7
+ };
8
+ /**
9
+ * Lay the dies out for a layout. `count` is the number along the main axis;
10
+ * `rows` only means anything for a panel.
11
+ */
12
+ export function placeDies(layout, countRaw, rowsRaw, spacing) {
13
+ const pitch = Math.max(spacing, 0.005);
14
+ let count = clampInt(countRaw, 1, 64, 8);
15
+ let rows = clampInt(rowsRaw, 1, 12, 4);
16
+ if (layout === 'single') {
17
+ count = 1;
18
+ rows = 1;
19
+ }
20
+ else if (layout !== 'panel')
21
+ rows = 1;
22
+ // Keep the instance count sane whatever the knobs say.
23
+ while (count * rows > MAX_DIES) {
24
+ if (rows > 1)
25
+ rows -= 1;
26
+ else
27
+ count -= 1;
28
+ }
29
+ const total = count * rows;
30
+ const positions = new Float32Array(total * 3);
31
+ if (layout === 'ring') {
32
+ // A ring of `count`, sized so neighbours sit one pitch apart.
33
+ const radius = count > 1 ? (pitch * count) / (2 * Math.PI) : 0;
34
+ for (let i = 0; i < count; i++) {
35
+ const a = (i / count) * Math.PI * 2;
36
+ positions[i * 3] = Math.cos(a) * radius;
37
+ positions[i * 3 + 2] = Math.sin(a) * radius;
38
+ }
39
+ const span = radius * 2 + pitch;
40
+ return { positions, count, width: span, depth: span, pitchX: Math.max(count / 4, 1), pitchZ: Math.max(count / 4, 1) };
41
+ }
42
+ const spanX = (count - 1) * pitch;
43
+ const spanZ = (rows - 1) * pitch;
44
+ let i = 0;
45
+ for (let r = 0; r < rows; r++) {
46
+ for (let c = 0; c < count; c++, i++) {
47
+ positions[i * 3] = c * pitch - spanX / 2;
48
+ positions[i * 3 + 2] = r * pitch - spanZ / 2;
49
+ }
50
+ }
51
+ return {
52
+ positions,
53
+ count: total,
54
+ width: spanX + pitch,
55
+ depth: spanZ + pitch,
56
+ pitchX: Math.max(count / 2, 1),
57
+ pitchZ: Math.max(rows / 2, 1),
58
+ };
59
+ }
@@ -0,0 +1,14 @@
1
+ import { MeshBasicMaterial, ShaderMaterial } from 'three';
2
+ export interface LedArrayMaterials {
3
+ /** The dies themselves: emissive squares, per-instance colour. */
4
+ die: MeshBasicMaterial;
5
+ /** One additive billboard per die. */
6
+ dieGlow: ShaderMaterial;
7
+ /** The sheet in front of the dies, lit from behind. */
8
+ diffuser: ShaderMaterial;
9
+ /** One big camera-facing halo for the array as a whole. */
10
+ halo: ShaderMaterial;
11
+ }
12
+ export declare function createLedArrayMaterials(): LedArrayMaterials;
13
+ export declare function disposeLedArrayMaterials(m: LedArrayMaterials): void;
14
+ //# sourceMappingURL=ledMaterials.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ledMaterials.d.ts","sourceRoot":"","sources":["../../../src/components/ledArray/ledMaterials.ts"],"names":[],"mappings":"AAeA,OAAO,EAAuC,iBAAiB,EAAE,cAAc,EAAE,MAAM,OAAO,CAAC;AAE/F,MAAM,WAAW,iBAAiB;IAC9B,kEAAkE;IAClE,GAAG,EAAE,iBAAiB,CAAC;IACvB,sCAAsC;IACtC,OAAO,EAAE,cAAc,CAAC;IACxB,uDAAuD;IACvD,QAAQ,EAAE,cAAc,CAAC;IACzB,2DAA2D;IAC3D,IAAI,EAAE,cAAc,CAAC;CACxB;AA+HD,wBAAgB,uBAAuB,IAAI,iBAAiB,CAO3D;AAED,wBAAgB,wBAAwB,CAAC,CAAC,EAAE,iBAAiB,GAAG,IAAI,CAKnE"}