@3driseai/3drise-viewer 0.1.16 → 0.1.17

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 (116) hide show
  1. package/README.md +4 -3
  2. package/dist/components/ChladniGrid.d.ts +15 -0
  3. package/dist/components/ChladniGrid.d.ts.map +1 -0
  4. package/dist/components/ChladniGrid.js +62 -0
  5. package/dist/components/CustomPrimitive.d.ts +2 -0
  6. package/dist/components/CustomPrimitive.d.ts.map +1 -1
  7. package/dist/components/CustomPrimitive.js +2 -2
  8. package/dist/components/EffectsGenerator.d.ts.map +1 -1
  9. package/dist/components/EffectsGenerator.js +26 -2
  10. package/dist/components/FlowNetGrid.d.ts +15 -0
  11. package/dist/components/FlowNetGrid.d.ts.map +1 -0
  12. package/dist/components/FlowNetGrid.js +61 -0
  13. package/dist/components/GirihGrid.d.ts +15 -0
  14. package/dist/components/GirihGrid.d.ts.map +1 -0
  15. package/dist/components/GirihGrid.js +62 -0
  16. package/dist/components/GravWaveGrid.d.ts +15 -0
  17. package/dist/components/GravWaveGrid.d.ts.map +1 -0
  18. package/dist/components/GravWaveGrid.js +62 -0
  19. package/dist/components/GridsGenerator.d.ts +2 -2
  20. package/dist/components/GridsGenerator.d.ts.map +1 -1
  21. package/dist/components/GridsGenerator.js +21 -0
  22. package/dist/components/HyperbolicGrid.d.ts +15 -0
  23. package/dist/components/HyperbolicGrid.d.ts.map +1 -0
  24. package/dist/components/HyperbolicGrid.js +61 -0
  25. package/dist/components/LayoutInstances.d.ts +13 -0
  26. package/dist/components/LayoutInstances.d.ts.map +1 -0
  27. package/dist/components/LayoutInstances.js +39 -0
  28. package/dist/components/ModelPrimitive.d.ts +2 -0
  29. package/dist/components/ModelPrimitive.d.ts.map +1 -1
  30. package/dist/components/ModelPrimitive.js +3 -3
  31. package/dist/components/ObjectNode.d.ts.map +1 -1
  32. package/dist/components/ObjectNode.js +36 -8
  33. package/dist/components/ReactionDiffusionGrid.d.ts +15 -0
  34. package/dist/components/ReactionDiffusionGrid.d.ts.map +1 -0
  35. package/dist/components/ReactionDiffusionGrid.js +376 -0
  36. package/dist/components/WallpaperGrid.d.ts +15 -0
  37. package/dist/components/WallpaperGrid.d.ts.map +1 -0
  38. package/dist/components/WallpaperGrid.js +555 -0
  39. package/dist/components/cursor/CursorController.d.ts.map +1 -1
  40. package/dist/components/effects/BlackHoleEffect.d.ts +3 -3
  41. package/dist/components/effects/BlackHoleEffect.d.ts.map +1 -1
  42. package/dist/components/effects/BlackHoleEffect.js +293 -163
  43. package/dist/components/effects/DandelionSeedsEffect.d.ts +13 -0
  44. package/dist/components/effects/DandelionSeedsEffect.d.ts.map +1 -0
  45. package/dist/components/effects/DandelionSeedsEffect.js +510 -0
  46. package/dist/components/effects/FallingLeavesEffect.d.ts +13 -0
  47. package/dist/components/effects/FallingLeavesEffect.d.ts.map +1 -0
  48. package/dist/components/effects/FallingLeavesEffect.js +446 -0
  49. package/dist/components/effects/FieldLinesEffect.d.ts +11 -0
  50. package/dist/components/effects/FieldLinesEffect.d.ts.map +1 -0
  51. package/dist/components/effects/FieldLinesEffect.js +260 -0
  52. package/dist/components/effects/FireflySwarmEffect.d.ts +13 -0
  53. package/dist/components/effects/FireflySwarmEffect.d.ts.map +1 -0
  54. package/dist/components/effects/FireflySwarmEffect.js +408 -0
  55. package/dist/components/effects/GalaxyEffect.d.ts +13 -0
  56. package/dist/components/effects/GalaxyEffect.d.ts.map +1 -0
  57. package/dist/components/effects/GalaxyEffect.js +374 -0
  58. package/dist/components/effects/HarmonicShellEffect.d.ts +11 -0
  59. package/dist/components/effects/HarmonicShellEffect.d.ts.map +1 -0
  60. package/dist/components/effects/HarmonicShellEffect.js +209 -0
  61. package/dist/components/effects/IceCrystalsEffect.d.ts +3 -3
  62. package/dist/components/effects/IceCrystalsEffect.d.ts.map +1 -1
  63. package/dist/components/effects/IceCrystalsEffect.js +286 -166
  64. package/dist/components/effects/IceHaloEffect.d.ts +13 -0
  65. package/dist/components/effects/IceHaloEffect.d.ts.map +1 -0
  66. package/dist/components/effects/IceHaloEffect.js +306 -0
  67. package/dist/components/effects/LichtenbergEffect.d.ts +13 -0
  68. package/dist/components/effects/LichtenbergEffect.d.ts.map +1 -0
  69. package/dist/components/effects/LichtenbergEffect.js +517 -0
  70. package/dist/components/effects/MoleculesEffect.d.ts +3 -3
  71. package/dist/components/effects/MoleculesEffect.d.ts.map +1 -1
  72. package/dist/components/effects/MoleculesEffect.js +322 -164
  73. package/dist/components/effects/MurmurationEffect.d.ts +13 -0
  74. package/dist/components/effects/MurmurationEffect.d.ts.map +1 -0
  75. package/dist/components/effects/MurmurationEffect.js +539 -0
  76. package/dist/components/effects/PlanetaryRingsEffect.d.ts +13 -0
  77. package/dist/components/effects/PlanetaryRingsEffect.d.ts.map +1 -0
  78. package/dist/components/effects/PlanetaryRingsEffect.js +458 -0
  79. package/dist/components/effects/PortalEffect.d.ts +3 -3
  80. package/dist/components/effects/PortalEffect.d.ts.map +1 -1
  81. package/dist/components/effects/PortalEffect.js +240 -163
  82. package/dist/components/effects/ShockwaveEffect.d.ts +5 -3
  83. package/dist/components/effects/ShockwaveEffect.d.ts.map +1 -1
  84. package/dist/components/effects/ShockwaveEffect.js +538 -142
  85. package/dist/components/effects/SmokePlumeEffect.d.ts +3 -3
  86. package/dist/components/effects/SmokePlumeEffect.d.ts.map +1 -1
  87. package/dist/components/effects/SmokePlumeEffect.js +180 -116
  88. package/dist/components/effects/SmokeRingEffect.d.ts +3 -3
  89. package/dist/components/effects/SmokeRingEffect.d.ts.map +1 -1
  90. package/dist/components/effects/SmokeRingEffect.js +260 -135
  91. package/dist/components/effects/StrangeAttractorEffect.d.ts +11 -0
  92. package/dist/components/effects/StrangeAttractorEffect.d.ts.map +1 -0
  93. package/dist/components/effects/StrangeAttractorEffect.js +229 -0
  94. package/dist/components/effects/VolumetricFogEffect.d.ts +5 -3
  95. package/dist/components/effects/VolumetricFogEffect.d.ts.map +1 -1
  96. package/dist/components/effects/VolumetricFogEffect.js +211 -93
  97. package/dist/components/effects/WaterCausticsEffect.d.ts +13 -0
  98. package/dist/components/effects/WaterCausticsEffect.d.ts.map +1 -0
  99. package/dist/components/effects/WaterCausticsEffect.js +308 -0
  100. package/dist/components/effects/index.d.ts +9 -0
  101. package/dist/components/effects/index.d.ts.map +1 -1
  102. package/dist/components/effects/index.js +9 -0
  103. package/dist/components/index.d.ts +16 -0
  104. package/dist/components/index.d.ts.map +1 -1
  105. package/dist/components/index.js +8 -0
  106. package/dist/constants.d.ts +1 -1
  107. package/dist/constants.d.ts.map +1 -1
  108. package/dist/constants.js +1 -1
  109. package/dist/hooks/useModelObject.d.ts +6 -1
  110. package/dist/hooks/useModelObject.d.ts.map +1 -1
  111. package/dist/hooks/useModelObject.js +19 -6
  112. package/dist/types/gridConfigs.d.ts +98 -0
  113. package/dist/types/gridConfigs.d.ts.map +1 -1
  114. package/dist/types/index.d.ts +1 -1
  115. package/dist/types/index.d.ts.map +1 -1
  116. package/package.json +2 -2
@@ -0,0 +1,13 @@
1
+ import type { ReactNode } from 'react';
2
+ import type { Object3D } from 'three';
3
+ import type { ThreeEvent } from '@react-three/fiber';
4
+ import type { CreatedObjectSettings, ObjectLayoutSettings } from '@3driseai/3drise-core';
5
+ export interface LayoutInstancesProps {
6
+ createdObject: CreatedObjectSettings;
7
+ layout: ObjectLayoutSettings;
8
+ render: (slot: number) => ReactNode;
9
+ handleObjectClick?: (createdObject: CreatedObjectSettings, ref: Object3D, event: ThreeEvent<MouseEvent>) => void;
10
+ }
11
+ declare const LayoutInstances: import("react").MemoExoticComponent<({ createdObject, layout, render, handleObjectClick }: LayoutInstancesProps) => import("react").JSX.Element>;
12
+ export default LayoutInstances;
13
+ //# sourceMappingURL=LayoutInstances.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"LayoutInstances.d.ts","sourceRoot":"","sources":["../../src/components/LayoutInstances.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AACvC,OAAO,KAAK,EAAS,QAAQ,EAAE,MAAM,OAAO,CAAC;AAC7C,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,OAAO,KAAK,EAAE,qBAAqB,EAAc,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAErG,MAAM,WAAW,oBAAoB;IACjC,aAAa,EAAE,qBAAqB,CAAC;IACrC,MAAM,EAAE,oBAAoB,CAAC;IAC7B,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,SAAS,CAAC;IACpC,iBAAiB,CAAC,EAAE,CAAC,aAAa,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CACpH;AAmCD,QAAA,MAAM,eAAe,6FAA+D,oBAAoB,iCAmBtG,CAAC;AAGH,eAAe,eAAe,CAAC"}
@@ -0,0 +1,39 @@
1
+ import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
2
+ // =============================================================================
3
+ // LayoutInstances — repeat one scene object across a gallery layout
4
+ // =============================================================================
5
+ //
6
+ // ObjectNode hands this the object's own renderer; each slot is a plain group at the
7
+ // transform LayoutCreator computed for it, and the renderer output goes inside.
8
+ //
9
+ // Rules (see the project doc claude/object-layout-plan.md):
10
+ // - Only slot 0 reports readiness. The render callback receives the slot index and
11
+ // ObjectNode passes no ready callbacks for the others, so one object still reports
12
+ // once and ObjectsRenderer's aggregate count stays right.
13
+ // - Slot groups never set userData.id, so findById(id) keeps returning the
14
+ // CreatedObject group that owns the transform.
15
+ // - Clicks are per slot: zoom / glow / vanish target the copy that was clicked, the
16
+ // same way gallery frames behave.
17
+ // - Motion stays on the CreatedObject group, so the whole layout animates as one.
18
+ import { memo, useMemo, useRef } from 'react';
19
+ import { generateLayoutSlots } from '@3driseai/3drise-core';
20
+ const LayoutSlotGroup = ({ slot, index, createdObject, handleObjectClick, children }) => {
21
+ const ref = useRef(null);
22
+ const onClick = handleObjectClick
23
+ ? (e) => {
24
+ if (!ref.current)
25
+ return;
26
+ e.stopPropagation();
27
+ handleObjectClick(createdObject, ref.current, e);
28
+ }
29
+ : undefined;
30
+ return (_jsx("group", { ref: ref, name: `layout-slot-${index}`, position: slot.position, rotation: slot.rotation ?? [0, 0, 0], scale: slot.scale ?? [1, 1, 1], userData: { layoutSlot: index }, onClick: onClick, children: children }));
31
+ };
32
+ const LayoutInstances = memo(({ createdObject, layout, render, handleObjectClick }) => {
33
+ // ObjectNode normalises the block on every render, so key on its contents.
34
+ const layoutKey = JSON.stringify(layout);
35
+ const slots = useMemo(() => generateLayoutSlots(layout.count, layout), [layoutKey]);
36
+ return (_jsx(_Fragment, { children: slots.map((slot, index) => (_jsx(LayoutSlotGroup, { slot: slot, index: index, createdObject: createdObject, handleObjectClick: handleObjectClick, children: render(index) }, index))) }));
37
+ });
38
+ LayoutInstances.displayName = 'LayoutInstances';
39
+ export default LayoutInstances;
@@ -4,6 +4,8 @@ import type { CreatedObjectSettings } from '@3driseai/3drise-core';
4
4
  import type { ObjectReadyProps } from '../types/objectReady';
5
5
  interface ModelPrimitiveProps extends ObjectReadyProps {
6
6
  createdObject: CreatedObjectSettings;
7
+ /** Layout slot. Slot 0 is the object itself; the rest are unregistered clones. */
8
+ slot?: number;
7
9
  children?: ReactNode;
8
10
  }
9
11
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"ModelPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/ModelPrimitive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,UAAU,mBAAoB,SAAQ,gBAAgB;IAClD,aAAa,EAAE,qBAAqB,CAAC;IACrC,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA8BhD,CAAC;AAIH,eAAe,cAAc,CAAC"}
1
+ {"version":3,"file":"ModelPrimitive.d.ts","sourceRoot":"","sources":["../../src/components/ModelPrimitive.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAEvC,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAGnE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAE7D,UAAU,mBAAoB,SAAQ,gBAAgB;IAClD,aAAa,EAAE,qBAAqB,CAAC;IACrC,kFAAkF;IAClF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,SAAS,CAAC;CACxB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,mBAAmB,CA8BhD,CAAC;AAIH,eAAe,cAAc,CAAC"}
@@ -29,9 +29,9 @@ import { useObjectReadyReporter } from '../hooks/useObjectReady.js';
29
29
  * master and every other instance of the same URL; letting R3F free them on unmount breaks
30
30
  * all of them.
31
31
  */
32
- const ModelPrimitive = memo(({ createdObject, onObjectReady, onObjectDispose, children }) => {
32
+ const ModelPrimitive = memo(({ createdObject, slot = 0, onObjectReady, onObjectDispose, children }) => {
33
33
  const attachedRef = useRef(null);
34
- const object = useModelObject(createdObject);
34
+ const object = useModelObject(createdObject, slot);
35
35
  const { report, reportDisposed } = useObjectReadyReporter(createdObject, onObjectReady, onObjectDispose);
36
36
  const setObjectRef = useCallback((instance) => {
37
37
  if (instance) {
@@ -46,7 +46,7 @@ const ModelPrimitive = memo(({ createdObject, onObjectReady, onObjectDispose, ch
46
46
  }, [report, reportDisposed]);
47
47
  if (!object)
48
48
  return null;
49
- return (_jsx("primitive", { ref: setObjectRef, name: createdObject.name, object: object, dispose: null, children: children }, createdObject.id));
49
+ return (_jsx("primitive", { ref: setObjectRef, name: createdObject.name, object: object, dispose: null, children: children }, `${createdObject.id}:${slot}`));
50
50
  });
51
51
  ModelPrimitive.displayName = 'ModelPrimitive';
52
52
  export default ModelPrimitive;
@@ -1 +1 @@
1
- {"version":3,"file":"ObjectNode.d.ts","sourceRoot":"","sources":["../../src/components/ObjectNode.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAe,qBAAqB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAErD,KAAK,eAAe,GAAG,gBAAgB,GAAG;IACtC,IAAI,EAAE,cAAc,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC7G,CAAC;AAgBF,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAqHzC,CAAC;AACF,eAAe,UAAU,CAAC"}
1
+ {"version":3,"file":"ObjectNode.d.ts","sourceRoot":"","sources":["../../src/components/ObjectNode.tsx"],"names":[],"mappings":"AAiBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,KAAK,EAAe,qBAAqB,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAiBrD,KAAK,eAAe,GAAG,gBAAgB,GAAG;IACtC,IAAI,EAAE,cAAc,CAAC;IACrB,iBAAiB,CAAC,EAAE,CAAC,MAAM,EAAE,qBAAqB,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,UAAU,CAAC,UAAU,CAAC,KAAK,IAAI,CAAC;CAC7G,CAAC;AAgBF,QAAA,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAiIzC,CAAC;AACF,eAAe,UAAU,CAAC"}
@@ -15,7 +15,23 @@ import Galaxy from "./Galaxy.js";
15
15
  import GridGenerator from "./GridsGenerator.js";
16
16
  import OceanBuilder from "./OceanBuilder.js";
17
17
  import LandscapeObject from "./LandscapeObject.js";
18
+ import LayoutInstances from "./LayoutInstances.js";
18
19
  import { SELF_MANAGED_MATERIAL } from "../constants.js";
20
+ import { LAYOUT_CAPABLE_TYPES, getObjectLayoutSupport, normalizeObjectLayout } from "@3driseai/3drise-core";
21
+ // Slots after the first render with no ready callbacks: one object reports once.
22
+ const NO_READY = {};
23
+ // A point light's shadow is six extra renders; only slot 0 keeps it. Cached per settings
24
+ // object so the copies do not re-run their shadow effect on every render.
25
+ const noShadowCache = new WeakMap();
26
+ const withoutShadow = (obj) => {
27
+ let copy = noShadowCache.get(obj);
28
+ if (!copy) {
29
+ const config = (obj.config ?? {});
30
+ copy = { ...obj, config: { ...config, shadow: { ...config.shadow, enabled: false } } };
31
+ noShadowCache.set(obj, copy);
32
+ }
33
+ return copy;
34
+ };
19
35
  // const EffectsLayer: React.FC<{ effects: CreatedObjectSettings['effects'] }> = ({ effects }) =>
20
36
  // effects?.length ? (
21
37
  // <>
@@ -40,7 +56,9 @@ const ObjectNode = ({ node, onObjectReady, onObjectDispose, handleObjectClick })
40
56
  // Specialized renderers for each object type
41
57
  const renderers = useMemo(() => ({
42
58
  group: () => null,
43
- mesh: (obj, onObjectReady) => (_jsx(CustomPrimitive, { createdObject: obj, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose, handleObjectClick: handleObjectClick }, obj.id)),
59
+ // mesh / model / effect / light take a layout slot as the third argument
60
+ // (see LayoutInstances); slot 0 is also the no-layout case.
61
+ mesh: (obj, _onObjectReady, slot = 0) => (_jsx(CustomPrimitive, { createdObject: obj, ...(slot === 0 ? { onObjectReady, onObjectDispose } : NO_READY), handleObjectClick: handleObjectClick }, obj.id)),
44
62
  // water: (obj: CreatedObjectSettings, cameraSettings: CameraState, onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void) => (
45
63
  // <Ocean
46
64
  // settings={obj}
@@ -56,7 +74,7 @@ const ObjectNode = ({ node, onObjectReady, onObjectDispose, handleObjectClick })
56
74
  // settings={obj}
57
75
  // />
58
76
  // ),
59
- model: (obj, onObjectReady) => (_jsx(CustomPrimitive, { createdObject: obj, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose, handleObjectClick: handleObjectClick }, obj.id)),
77
+ model: (obj, _onObjectReady, slot = 0) => (_jsx(CustomPrimitive, { createdObject: obj, slot: slot, ...(slot === 0 ? { onObjectReady, onObjectDispose } : NO_READY), handleObjectClick: handleObjectClick }, obj.id)),
60
78
  // custom_primitive: (obj: CreatedObjectSettings, cameraSettings: CameraState, onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void) => (
61
79
  // <CustomPrimitive
62
80
  // key={obj.id}
@@ -87,11 +105,11 @@ const ObjectNode = ({ node, onObjectReady, onObjectDispose, handleObjectClick })
87
105
  // LandscapeConnector instead; this one is a diorama, a floating island or
88
106
  // a game tile, and gets its transform from the CreatedObject wrapper.
89
107
  landscape: (obj, onObjectReady) => (_jsx(LandscapeObject, { settings: obj, ...relabel(obj) }, obj.id)),
90
- effect: (obj) => (_jsx(EffectsGenerator, { settings: {
108
+ effect: (obj, _onObjectReady, slot = 0) => (_jsx(EffectsGenerator, { settings: {
91
109
  config: obj.config,
92
- }, ...relabel(obj) }, obj.id)),
110
+ }, ...(slot === 0 ? relabel(obj) : NO_READY) }, obj.id)),
93
111
  gallery: (obj, onObjectReady) => (_jsx(GalleryLayout, { createdObject: obj, handleObjectClick: handleObjectClick, ...relabel(obj) })),
94
- light: (obj, onObjectReady) => (_jsx(LightObject, { createdObject: obj, ...relabel(obj) })),
112
+ light: (obj, _onObjectReady, slot = 0) => (_jsx(LightObject, { createdObject: slot === 0 ? obj : withoutShadow(obj), ...(slot === 0 ? relabel(obj) : NO_READY) })),
95
113
  environment: (obj, onObjectReady) => (_jsx(EnvironmentObject, { createdObject: obj, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })),
96
114
  space: (obj, onObjectReady) => (_jsx(Galaxy, { createdObject: obj, onObjectReady: onObjectReady, onObjectDispose: onObjectDispose })),
97
115
  // rain: (obj: CreatedObjectSettings, cameraSettings: CameraState, onObjectReady?: (object: CreatedObjectSettings, ref: Object3D) => void) => (
@@ -115,10 +133,20 @@ const ObjectNode = ({ node, onObjectReady, onObjectDispose, handleObjectClick })
115
133
  // />
116
134
  // ),
117
135
  }), [handleObjectClick, onObjectReady, onObjectDispose, relabel]);
118
- const renderObject = useCallback((obj, handleObjectClick) => {
136
+ const renderObject = useCallback((obj, _handleObjectClick) => {
119
137
  const renderer = renderers[obj.type];
120
- return renderer?.(obj, onObjectReady) ?? null;
121
- }, [onObjectReady, renderers]);
138
+ if (!renderer)
139
+ return null;
140
+ // meshSettings.layout: repeat the renderer output across a gallery layout.
141
+ // Absent on every object saved before layouts existed, which renders as before.
142
+ const layout = LAYOUT_CAPABLE_TYPES.has(obj.type) ? normalizeObjectLayout(obj.meshSettings?.layout) : null;
143
+ const support = layout?.enabled ? getObjectLayoutSupport(obj) : null;
144
+ if (layout && support?.allowed) {
145
+ const capped = layout.count > support.maxCount ? { ...layout, count: support.maxCount } : layout;
146
+ return (_jsx(LayoutInstances, { createdObject: obj, layout: capped, handleObjectClick: handleObjectClick, render: (slot) => renderer(obj, onObjectReady, slot) }));
147
+ }
148
+ return renderer(obj, onObjectReady) ?? null;
149
+ }, [onObjectReady, renderers, handleObjectClick]);
122
150
  if (!createdObject) {
123
151
  return null;
124
152
  }
@@ -0,0 +1,15 @@
1
+ import type { ThreeElements } from '@react-three/fiber';
2
+ import type { ObjectReadyProps } from '../types/objectReady';
3
+ import type { ReactionDiffusionGridConfig } from '../types/gridConfigs';
4
+ export interface ReactionDiffusionGridProps extends ObjectReadyProps {
5
+ config?: ReactionDiffusionGridConfig;
6
+ groupProps?: ThreeElements['group'];
7
+ }
8
+ /** ReactionDiffusionGridConfig defaults. Must match the catalog entry in grid-defaults.json exactly. */
9
+ export declare const defaultReactionDiffusionGridConfig: ReactionDiffusionGridConfig;
10
+ /**
11
+ * A Gray-Scott reaction-diffusion field simulated on the GPU and sampled by the plane: coral, labyrinths and dividing spots grow, merge and keep evolving, wrapped seamlessly as a torus.
12
+ */
13
+ export declare function ReactionDiffusionGrid({ config, groupProps, onObjectReady, onObjectDispose }: ReactionDiffusionGridProps): import("react").JSX.Element;
14
+ export default ReactionDiffusionGrid;
15
+ //# sourceMappingURL=ReactionDiffusionGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ReactionDiffusionGrid.d.ts","sourceRoot":"","sources":["../../src/components/ReactionDiffusionGrid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,sBAAsB,CAAC;AAGxE,MAAM,WAAW,0BAA2B,SAAQ,gBAAgB;IAChE,MAAM,CAAC,EAAE,2BAA2B,CAAC;IACrC,UAAU,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACvC;AAKD,wGAAwG;AACxG,eAAO,MAAM,kCAAkC,EAAE,2BA6BhD,CAAC;AAuTF;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,EAAE,MAA2C,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,0BAA0B,+BAgF5J;AAED,eAAe,qBAAqB,CAAC"}
@@ -0,0 +1,376 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect, useMemo, useRef } from 'react';
3
+ import * as THREE from 'three';
4
+ import { useFrame } from '@react-three/fiber';
5
+ import { useObjectReady } from '../hooks/useObjectReady.js';
6
+ import { useGridSurface } from '../hooks/useGridSurface.js';
7
+ import { ReactionDiffusionGridMaterial } from '@3driseai/3drise-core';
8
+ // Side-effect import registers <reactionDiffusionGridMaterial> via extend().
9
+ void ReactionDiffusionGridMaterial;
10
+ /** ReactionDiffusionGridConfig defaults. Must match the catalog entry in grid-defaults.json exactly. */
11
+ export const defaultReactionDiffusionGridConfig = {
12
+ cellSize: 3,
13
+ size: 50,
14
+ flat: true,
15
+ segments: undefined,
16
+ lineMode: 0,
17
+ cellMode: 0,
18
+ lineWidth: 1.1,
19
+ sectionSize: 5,
20
+ sectionWidth: 1.2,
21
+ animSpeed: 1,
22
+ animScale: 0.5,
23
+ animIntensity: 0.6,
24
+ fadeDistance: undefined,
25
+ fadeStrength: 0.7,
26
+ displace: 0,
27
+ feed: 0.037,
28
+ kill: 0.06,
29
+ variation: 0.55,
30
+ tileCells: 7,
31
+ lineColor: '#7ff0d4',
32
+ sectionColor: '#f0a26a',
33
+ cellColor: '#0d4b52',
34
+ glowColor: '#2fd9c8',
35
+ bgColor: '#03080a',
36
+ bgOpacity: 0,
37
+ followMouse: false,
38
+ reveal: 1,
39
+ revealDuration: 0,
40
+ };
41
+ const gridFragHeader = /* glsl */ `
42
+ precision highp float;
43
+
44
+ uniform float u_time;
45
+ uniform float u_cellSize;
46
+ uniform float u_lineWidth;
47
+ uniform float u_sectionSize;
48
+ uniform float u_sectionWidth;
49
+ uniform vec3 u_lineColor;
50
+ uniform vec3 u_sectionColor;
51
+ uniform vec3 u_cellColor;
52
+ uniform vec3 u_glowColor;
53
+ uniform vec3 u_bgColor;
54
+ uniform float u_bgOpacity;
55
+ uniform float u_lineMode;
56
+ uniform float u_cellMode;
57
+ uniform float u_animSpeed;
58
+ uniform float u_animScale;
59
+ uniform float u_animIntensity;
60
+ uniform float u_fadeDistance;
61
+ uniform float u_fadeStrength;
62
+ uniform vec2 u_focus;
63
+ uniform float u_reveal;
64
+
65
+ varying vec2 vGridPos;
66
+
67
+ float lineAt(float c, float width, float fp){
68
+ float d = abs(fract(c - 0.5) - 0.5);
69
+ return 1.0 - clamp(d / max(fp * max(width, 0.05), 1e-6), 0.0, 1.0);
70
+ }
71
+ `;
72
+ const gridCommon = /* glsl */ `
73
+ const float PI = 3.14159265359;
74
+ const float TAU = 6.28318530718;
75
+
76
+ float hash21(vec2 p){
77
+ p = fract(p * vec2(123.34, 456.21));
78
+ p += dot(p, p + 45.32);
79
+ return fract(p.x * p.y);
80
+ }
81
+ `;
82
+ const gridTail = /* glsl */ `
83
+ // ---- line animation --------------------------------------------------
84
+ float lineAnim = 1.0;
85
+ if (u_lineMode > 0.5){
86
+ if (u_lineMode < 1.5){
87
+ lineAnim = 0.5 + 0.5 * sin(cellDist * u_animScale - t);
88
+ } else if (u_lineMode < 2.5){
89
+ lineAnim = 0.5 + 0.5 * sin(flowCoord * u_animScale - t);
90
+ } else if (u_lineMode < 3.5){
91
+ float s = fract(scanCoord * 0.05 * u_animScale - t * 0.15);
92
+ lineAnim = 0.25 + smoothstep(0.0, 0.15, s) * (1.0 - smoothstep(0.15, 0.35, s));
93
+ } else {
94
+ lineAnim = 0.5 + 0.5 * sin(t);
95
+ }
96
+ }
97
+ lineAnim = mix(1.0, lineAnim, u_animIntensity);
98
+
99
+ // ---- cell fill -------------------------------------------------------
100
+ float cell = 0.0;
101
+ if (u_cellMode > 0.5){
102
+ if (u_cellMode < 1.5){
103
+ cell = 0.5 + 0.5 * sin(flowCoord * 0.5 * u_animScale - t);
104
+ } else if (u_cellMode < 2.5){
105
+ cell = 0.5 + 0.5 * sin(t * (0.6 + cellH) + cellH * TAU);
106
+ } else if (u_cellMode < 3.5){
107
+ cell = smoothstep(0.6, 1.0, sin(cellDist * u_animScale - t));
108
+ } else {
109
+ cell = step(0.5, cellH) * (0.5 + 0.5 * sin(t));
110
+ }
111
+ }
112
+ cell *= u_animIntensity * edgeKeep;
113
+
114
+ float tone = step(0.55, cellH);
115
+
116
+ vec3 col = u_bgColor * u_bgOpacity;
117
+ float a = u_bgOpacity;
118
+
119
+ col += mix(u_cellColor, u_cellColor * 2.2, tone) * cell;
120
+ a = max(a, cell * 0.9);
121
+ float linesI = lines * lineAnim;
122
+ col += u_lineColor * linesI; a = max(a, linesI);
123
+ float accentI = accent * lineAnim;
124
+ col += u_sectionColor * accentI; a = max(a, accentI);
125
+ col += u_glowColor * (linesI * 0.2 + cell * 0.35) * u_animIntensity;
126
+
127
+ col = col * regionMask + extraCol;
128
+ a = max(a * regionMask, extraA);
129
+
130
+ float fade = 1.0 - smoothstep(1.0 - u_fadeStrength, 1.0, fadeR);
131
+ col *= fade;
132
+ a *= fade;
133
+
134
+ // ---- reveal ----------------------------------------------------------
135
+ // The build boundary sweeps outward from the focus point with a bright
136
+ // leading edge, so the grid reads as assembling itself.
137
+ if (u_reveal < 0.999){
138
+ float rd = length(vGridPos - u_focus) / max(u_fadeDistance, 1e-4);
139
+ float edge = u_reveal * 1.1;
140
+ float mask = 1.0 - smoothstep(edge - 0.05, edge, rd);
141
+ float front = mask * smoothstep(edge - 0.22, edge - 0.05, rd);
142
+ col = col * mask + u_glowColor * front * (a * 1.8 + 0.08);
143
+ a = max(a * mask, front * 0.10);
144
+ }
145
+
146
+ if (a < 0.002) discard;
147
+ gl_FragColor = vec4(col, a);
148
+ }
149
+ `;
150
+ const gridVertexHead = /* glsl */ `
151
+ uniform float u_time;
152
+ uniform float u_cellSize;
153
+ uniform float u_displace;
154
+ uniform float u_animSpeed;
155
+ uniform float u_animScale;
156
+
157
+ varying vec2 vGridPos;
158
+ `;
159
+ // ---------------------------------------------------------------------------
160
+ // Gray-Scott reaction-diffusion. Two chemicals diffuse at different rates and
161
+ // react as u + 2v -> 3v: the autocatalyst v eats u, u is fed in at rate F and
162
+ // v is removed at rate F + k. Because v diffuses at half the rate of u, an even
163
+ // mixture is unstable (Turing instability) and the field breaks into fronts
164
+ // that grow, split and heal. F and k pick the morphology: coral and labyrinths
165
+ // near (0.037, 0.060), dividing spots near (0.030, 0.057), stable dots higher.
166
+ // The simulation runs on a 256^2 float texture with periodic boundaries, so it
167
+ // tiles seamlessly, and the plane just samples it.
168
+ // ---------------------------------------------------------------------------
169
+ const SIM_SIZE = 256;
170
+ const fsVert = /* glsl */ `
171
+ varying vec2 vUv;
172
+ void main(){
173
+ vUv = uv;
174
+ gl_Position = vec4(position.xy, 0.0, 1.0);
175
+ }
176
+ `;
177
+ const simFrag = /* glsl */ `
178
+ precision highp float;
179
+ uniform sampler2D u_state;
180
+ uniform vec2 u_texel;
181
+ uniform float u_feed;
182
+ uniform float u_kill;
183
+ uniform float u_variation;
184
+ uniform float u_age;
185
+ varying vec2 vUv;
186
+
187
+ void main(){
188
+ vec2 e = u_texel;
189
+ vec4 c = texture2D(u_state, vUv);
190
+ // 9-point laplacian (0.2 orthogonal, 0.05 diagonal), wrapped by the texture
191
+ vec2 lap =
192
+ (texture2D(u_state, vUv + vec2( e.x, 0.0)).rg
193
+ + texture2D(u_state, vUv + vec2(-e.x, 0.0)).rg
194
+ + texture2D(u_state, vUv + vec2( 0.0, e.y)).rg
195
+ + texture2D(u_state, vUv + vec2( 0.0,-e.y)).rg) * 0.2
196
+ + (texture2D(u_state, vUv + vec2( e.x, e.y)).rg
197
+ + texture2D(u_state, vUv + vec2(-e.x, e.y)).rg
198
+ + texture2D(u_state, vUv + vec2( e.x,-e.y)).rg
199
+ + texture2D(u_state, vUv + vec2(-e.x,-e.y)).rg) * 0.05
200
+ - c.rg;
201
+
202
+ // F and k drift smoothly across the tile; both modulations are periodic in
203
+ // uv, so the torus still matches itself at the seam.
204
+ float sx = sin(6.2831853 * vUv.x);
205
+ float sy = sin(6.2831853 * vUv.y);
206
+ float cx = cos(6.2831853 * vUv.x);
207
+ float cy = cos(6.2831853 * vUv.y);
208
+ float F = u_feed + u_variation * 0.009 * (sx * cy) + 0.0006 * sin(u_age * 0.031);
209
+ float K = u_kill + u_variation * 0.004 * (cx * sy) + 0.0003 * cos(u_age * 0.023);
210
+
211
+ float uv2 = c.r * c.g * c.g;
212
+ float nu = c.r + (1.0 * lap.x - uv2 + F * (1.0 - c.r));
213
+ float nv = c.g + (0.5 * lap.y + uv2 - (F + K) * c.g);
214
+ gl_FragColor = vec4(clamp(nu, 0.0, 1.0), clamp(nv, 0.0, 1.0), 0.0, 1.0);
215
+ }
216
+ `;
217
+ const seedFrag = /* glsl */ `
218
+ precision highp float;
219
+ uniform float u_spots;
220
+ varying vec2 vUv;
221
+
222
+ float hash21s(vec2 p){
223
+ p = fract(p * vec2(123.34, 456.21));
224
+ p += dot(p, p + 45.32);
225
+ return fract(p.x * p.y);
226
+ }
227
+
228
+ void main(){
229
+ // a scatter of seeded blobs; everything else is pure substrate
230
+ vec2 g = vUv * 9.0;
231
+ vec2 id = floor(g);
232
+ vec2 f = fract(g) - 0.5;
233
+ float h = hash21s(id + 3.7);
234
+ vec2 off = (vec2(hash21s(id + 1.3), hash21s(id + 7.1)) - 0.5) * 0.5;
235
+ float d = length(f - off);
236
+ float blob = step(h, u_spots) * (1.0 - smoothstep(0.10, 0.22, d));
237
+ gl_FragColor = vec4(1.0 - 0.5 * blob, 0.25 * blob, 0.0, 1.0);
238
+ }
239
+ `;
240
+ function createExtraUniforms() {
241
+ return {
242
+ u_field: { value: null },
243
+ u_tileCells: { value: 7 },
244
+ };
245
+ }
246
+ /** The simulation: two half-float targets ping-ponged through the Gray-Scott step. */
247
+ function createRuntime(u, renderer, c) {
248
+ const targetOptions = {
249
+ type: THREE.HalfFloatType,
250
+ format: THREE.RGBAFormat,
251
+ minFilter: THREE.LinearFilter,
252
+ magFilter: THREE.LinearFilter,
253
+ wrapS: THREE.RepeatWrapping,
254
+ wrapT: THREE.RepeatWrapping,
255
+ depthBuffer: false,
256
+ stencilBuffer: false,
257
+ generateMipmaps: false,
258
+ };
259
+ const simMaterial = new THREE.ShaderMaterial({
260
+ vertexShader: fsVert,
261
+ fragmentShader: simFrag,
262
+ uniforms: {
263
+ u_state: { value: null },
264
+ u_texel: { value: new THREE.Vector2(1 / SIM_SIZE, 1 / SIM_SIZE) },
265
+ u_feed: { value: 0.037 },
266
+ u_kill: { value: 0.06 },
267
+ u_variation: { value: 0.55 },
268
+ u_age: { value: 0 },
269
+ },
270
+ depthTest: false,
271
+ depthWrite: false,
272
+ });
273
+ const seedMaterial = new THREE.ShaderMaterial({
274
+ vertexShader: fsVert,
275
+ fragmentShader: seedFrag,
276
+ uniforms: { u_spots: { value: 0.3 } },
277
+ depthTest: false,
278
+ depthWrite: false,
279
+ });
280
+ const quadGeometry = new THREE.PlaneGeometry(2, 2);
281
+ const quad = new THREE.Mesh(quadGeometry, simMaterial);
282
+ quad.frustumCulled = false;
283
+ const scene = new THREE.Scene();
284
+ scene.add(quad);
285
+ return {
286
+ read: new THREE.WebGLRenderTarget(SIM_SIZE, SIM_SIZE, targetOptions),
287
+ write: new THREE.WebGLRenderTarget(SIM_SIZE, SIM_SIZE, targetOptions),
288
+ scene: scene,
289
+ camera: new THREE.OrthographicCamera(-1, 1, 1, -1, 0, 1),
290
+ quad: quad,
291
+ quadGeometry: quadGeometry,
292
+ simMaterial: simMaterial,
293
+ seedMaterial: seedMaterial,
294
+ seeded: false,
295
+ age: 0,
296
+ carry: 0,
297
+ };
298
+ }
299
+ function updateRuntime(rt, u, c, dt, renderer) {
300
+ const previousTarget = renderer.getRenderTarget();
301
+ if (!rt.seeded) {
302
+ rt.quad.material = rt.seedMaterial;
303
+ renderer.setRenderTarget(rt.read);
304
+ renderer.render(rt.scene, rt.camera);
305
+ rt.quad.material = rt.simMaterial;
306
+ rt.seeded = true;
307
+ }
308
+ const sim = rt.simMaterial.uniforms;
309
+ sim.u_feed.value = u.u_feed.value;
310
+ sim.u_kill.value = u.u_kill.value;
311
+ sim.u_variation.value = u.u_variation.value;
312
+ // fixed step count per second so the pattern grows at the same rate on any machine
313
+ rt.carry += Math.min(dt, 0.1) * 240 * Math.max(u.u_animSpeed.value, 0);
314
+ let steps = Math.floor(rt.carry);
315
+ rt.carry -= steps;
316
+ if (steps > 16)
317
+ steps = 16;
318
+ for (let i = 0; i < steps; i++) {
319
+ rt.age += 1;
320
+ sim.u_age.value = rt.age;
321
+ sim.u_state.value = rt.read.texture;
322
+ renderer.setRenderTarget(rt.write);
323
+ renderer.render(rt.scene, rt.camera);
324
+ const swap = rt.read;
325
+ rt.read = rt.write;
326
+ rt.write = swap;
327
+ }
328
+ renderer.setRenderTarget(previousTarget);
329
+ u.u_field.value = rt.read.texture;
330
+ }
331
+ function disposeRuntime(rt) {
332
+ rt.read.dispose();
333
+ rt.write.dispose();
334
+ rt.quadGeometry.dispose();
335
+ rt.simMaterial.dispose();
336
+ rt.seedMaterial.dispose();
337
+ }
338
+ /**
339
+ * A Gray-Scott reaction-diffusion field simulated on the GPU and sampled by the plane: coral, labyrinths and dividing spots grow, merge and keep evolving, wrapped seamlessly as a torus.
340
+ */
341
+ export function ReactionDiffusionGrid({ config = defaultReactionDiffusionGridConfig, groupProps, onObjectReady, onObjectDispose }) {
342
+ const matRef = useRef(null);
343
+ const rootRef = useRef(null);
344
+ const meshRef = useRef(null);
345
+ useObjectReady(rootRef, config, onObjectReady, onObjectDispose);
346
+ const { cellSize, size, segments, flat, lineMode, cellMode, lineWidth, sectionSize, sectionWidth, animSpeed, animScale, animIntensity, fadeDistance, fadeStrength, displace, feed, kill, variation, tileCells, lineColor, sectionColor, cellColor, glowColor, bgColor, bgOpacity, followMouse, reveal, revealDuration, } = config;
347
+ // the relief follows the pattern itself, which is a few texels wide
348
+ const segs = segments ?? (displace > 0 ? Math.min(512, Math.max(128, Math.ceil(size / Math.max(cellSize, 1e-4)) * 12)) : 1);
349
+ const fade = fadeDistance ?? size * 0.5;
350
+ const colors = useMemo(() => ({
351
+ line: new THREE.Color(lineColor),
352
+ section: new THREE.Color(sectionColor),
353
+ cell: new THREE.Color(cellColor),
354
+ glow: new THREE.Color(glowColor),
355
+ bg: new THREE.Color(bgColor),
356
+ }), [lineColor, sectionColor, cellColor, glowColor, bgColor]);
357
+ useGridSurface(matRef, meshRef, { followMouse, reveal, revealDuration });
358
+ // the simulation behind this grid: created on mount, stepped every frame
359
+ const runtimeRef = useRef(null);
360
+ useFrame((state, delta) => {
361
+ const mat = matRef.current;
362
+ if (!mat)
363
+ return;
364
+ if (!runtimeRef.current)
365
+ runtimeRef.current = createRuntime(mat.uniforms, state.gl, config);
366
+ updateRuntime(runtimeRef.current, mat.uniforms, config, Math.min(delta, 0.1), state.gl);
367
+ });
368
+ useEffect(() => () => {
369
+ if (runtimeRef.current) {
370
+ disposeRuntime(runtimeRef.current);
371
+ runtimeRef.current = null;
372
+ }
373
+ }, []);
374
+ return (_jsx("group", { ref: rootRef, ...groupProps, children: _jsxs("mesh", { ref: meshRef, rotation: flat ? [-Math.PI / 2, 0, 0] : [0, 0, 0], children: [_jsx("planeGeometry", { args: [size, size, segs, segs] }), _jsx("reactionDiffusionGridMaterial", { ref: matRef, transparent: true, depthWrite: false, blending: THREE.AdditiveBlending, side: THREE.DoubleSide, u_cellSize: cellSize, u_lineWidth: lineWidth, u_sectionSize: sectionSize, u_sectionWidth: sectionWidth, u_lineMode: lineMode, u_cellMode: cellMode, u_animSpeed: animSpeed, u_animScale: animScale, u_animIntensity: animIntensity, u_fadeDistance: fade, u_fadeStrength: fadeStrength, u_displace: displace, u_feed: feed, u_kill: kill, u_variation: variation, u_tileCells: tileCells, u_lineColor: colors.line, u_sectionColor: colors.section, u_cellColor: colors.cell, u_glowColor: colors.glow, u_bgColor: colors.bg, u_bgOpacity: bgOpacity }, ReactionDiffusionGridMaterial.key)] }) }));
375
+ }
376
+ export default ReactionDiffusionGrid;
@@ -0,0 +1,15 @@
1
+ import type { ThreeElements } from '@react-three/fiber';
2
+ import type { ObjectReadyProps } from '../types/objectReady';
3
+ import type { WallpaperGridConfig } from '../types/gridConfigs';
4
+ export interface WallpaperGridProps extends ObjectReadyProps {
5
+ config?: WallpaperGridConfig;
6
+ groupProps?: ThreeElements['group'];
7
+ }
8
+ /** WallpaperGridConfig defaults. Must match the catalog entry in grid-defaults.json exactly. */
9
+ export declare const defaultWallpaperGridConfig: WallpaperGridConfig;
10
+ /**
11
+ * Wallpaper-group kaleidoscope: a drifting lattice-periodic Fourier motif summed over the coset representatives of one of the 17 plane crystallographic groups. The runtime builds the group tables and crossfades from group to group.
12
+ */
13
+ export declare function WallpaperGrid({ config, groupProps, onObjectReady, onObjectDispose }: WallpaperGridProps): import("react").JSX.Element;
14
+ export default WallpaperGrid;
15
+ //# sourceMappingURL=WallpaperGrid.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WallpaperGrid.d.ts","sourceRoot":"","sources":["../../src/components/WallpaperGrid.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAKxD,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAGhE,MAAM,WAAW,kBAAmB,SAAQ,gBAAgB;IACxD,MAAM,CAAC,EAAE,mBAAmB,CAAC;IAC7B,UAAU,CAAC,EAAE,aAAa,CAAC,OAAO,CAAC,CAAC;CACvC;AAKD,gGAAgG;AAChG,eAAO,MAAM,0BAA0B,EAAE,mBA6BxC,CAAC;AAocF;;GAEG;AACH,wBAAgB,aAAa,CAAC,EAAE,MAAmC,EAAE,UAAU,EAAE,aAAa,EAAE,eAAe,EAAE,EAAE,kBAAkB,+BAgFpI;AAED,eAAe,aAAa,CAAC"}