@3driseai/3drise-viewer 0.1.39 → 0.1.41
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animationsV2/ClipsRuntime.d.ts +30 -0
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
- package/dist/animationsV2/ClipsRuntime.js +185 -14
- package/dist/animationsV2/clipUtils.d.ts +15 -0
- package/dist/animationsV2/clipUtils.d.ts.map +1 -1
- package/dist/animationsV2/clipUtils.js +39 -2
- package/dist/animationsV2/normalize.d.ts.map +1 -1
- package/dist/animationsV2/normalize.js +4 -0
- package/dist/animationsV2/types.d.ts +12 -0
- package/dist/animationsV2/types.d.ts.map +1 -1
- package/dist/api/sceneHandle.d.ts +40 -3
- package/dist/api/sceneHandle.d.ts.map +1 -1
- package/dist/api/sceneHandle.js +40 -0
- package/dist/components/AnimatedObject.d.ts.map +1 -1
- package/dist/components/AnimatedObject.js +6 -2
- package/dist/components/EnabledContext.d.ts +12 -0
- package/dist/components/EnabledContext.d.ts.map +1 -0
- package/dist/components/EnabledContext.js +12 -0
- package/dist/components/GalleryObject.d.ts +13 -0
- package/dist/components/GalleryObject.d.ts.map +1 -0
- package/dist/components/GalleryObject.js +46 -0
- package/dist/components/ImageObject.d.ts +9 -0
- package/dist/components/ImageObject.d.ts.map +1 -0
- package/dist/components/ImageObject.js +26 -0
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +17 -6
- package/dist/components/ObjectsRenderer.d.ts.map +1 -1
- package/dist/components/ObjectsRenderer.js +9 -0
- package/dist/components/ProjectLoader.d.ts +2 -0
- package/dist/components/ProjectLoader.d.ts.map +1 -1
- package/dist/components/ProjectLoader.js +2 -2
- package/dist/components/SceneBuilder.d.ts +10 -0
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +3 -2
- package/dist/components/gallery/BasicCarouselGallery.d.ts +18 -0
- package/dist/components/gallery/BasicCarouselGallery.d.ts.map +1 -0
- package/dist/components/gallery/BasicCarouselGallery.js +9 -0
- package/dist/components/gallery/ContourLinesGallery.d.ts +18 -0
- package/dist/components/gallery/ContourLinesGallery.d.ts.map +1 -0
- package/dist/components/gallery/ContourLinesGallery.js +9 -0
- package/dist/components/gallery/DepthLayersGallery.d.ts +18 -0
- package/dist/components/gallery/DepthLayersGallery.d.ts.map +1 -0
- package/dist/components/gallery/DepthLayersGallery.js +9 -0
- package/dist/components/gallery/EngravingGallery.d.ts +18 -0
- package/dist/components/gallery/EngravingGallery.d.ts.map +1 -0
- package/dist/components/gallery/EngravingGallery.js +9 -0
- package/dist/components/gallery/FlowLinesGallery.d.ts +18 -0
- package/dist/components/gallery/FlowLinesGallery.d.ts.map +1 -0
- package/dist/components/gallery/FlowLinesGallery.js +9 -0
- package/dist/components/gallery/FoldGallery.d.ts +18 -0
- package/dist/components/gallery/FoldGallery.d.ts.map +1 -0
- package/dist/components/gallery/FoldGallery.js +9 -0
- package/dist/components/gallery/GlassPanesGallery.d.ts +18 -0
- package/dist/components/gallery/GlassPanesGallery.d.ts.map +1 -0
- package/dist/components/gallery/GlassPanesGallery.js +9 -0
- package/dist/components/gallery/HaloGallery.d.ts +18 -0
- package/dist/components/gallery/HaloGallery.d.ts.map +1 -0
- package/dist/components/gallery/HaloGallery.js +9 -0
- package/dist/components/gallery/LightThreadsGallery.d.ts +18 -0
- package/dist/components/gallery/LightThreadsGallery.d.ts.map +1 -0
- package/dist/components/gallery/LightThreadsGallery.js +9 -0
- package/dist/components/gallery/LoomGallery.d.ts +18 -0
- package/dist/components/gallery/LoomGallery.d.ts.map +1 -0
- package/dist/components/gallery/LoomGallery.js +9 -0
- package/dist/components/gallery/PaperLanternsGallery.d.ts +18 -0
- package/dist/components/gallery/PaperLanternsGallery.d.ts.map +1 -0
- package/dist/components/gallery/PaperLanternsGallery.js +9 -0
- package/dist/components/gallery/ParticleShiftGallery.d.ts +18 -0
- package/dist/components/gallery/ParticleShiftGallery.d.ts.map +1 -0
- package/dist/components/gallery/ParticleShiftGallery.js +9 -0
- package/dist/components/gallery/PinscreenGallery.d.ts +18 -0
- package/dist/components/gallery/PinscreenGallery.d.ts.map +1 -0
- package/dist/components/gallery/PinscreenGallery.js +9 -0
- package/dist/components/gallery/PopUpGallery.d.ts +18 -0
- package/dist/components/gallery/PopUpGallery.d.ts.map +1 -0
- package/dist/components/gallery/PopUpGallery.js +9 -0
- package/dist/components/gallery/PrismSplitGallery.d.ts +18 -0
- package/dist/components/gallery/PrismSplitGallery.d.ts.map +1 -0
- package/dist/components/gallery/PrismSplitGallery.js +9 -0
- package/dist/components/gallery/RidgelinesGallery.d.ts +18 -0
- package/dist/components/gallery/RidgelinesGallery.d.ts.map +1 -0
- package/dist/components/gallery/RidgelinesGallery.js +9 -0
- package/dist/components/gallery/ShadowBoxGallery.d.ts +18 -0
- package/dist/components/gallery/ShadowBoxGallery.d.ts.map +1 -0
- package/dist/components/gallery/ShadowBoxGallery.js +9 -0
- package/dist/components/gallery/SilkGallery.d.ts +18 -0
- package/dist/components/gallery/SilkGallery.d.ts.map +1 -0
- package/dist/components/gallery/SilkGallery.js +9 -0
- package/dist/components/gallery/SlatsGallery.d.ts +18 -0
- package/dist/components/gallery/SlatsGallery.d.ts.map +1 -0
- package/dist/components/gallery/SlatsGallery.js +9 -0
- package/dist/components/gallery/StrataGallery.d.ts +18 -0
- package/dist/components/gallery/StrataGallery.d.ts.map +1 -0
- package/dist/components/gallery/StrataGallery.js +9 -0
- package/dist/components/gallery/TerracesGallery.d.ts +18 -0
- package/dist/components/gallery/TerracesGallery.d.ts.map +1 -0
- package/dist/components/gallery/TerracesGallery.js +9 -0
- package/dist/components/gallery/WireReliefGallery.d.ts +18 -0
- package/dist/components/gallery/WireReliefGallery.d.ts.map +1 -0
- package/dist/components/gallery/WireReliefGallery.js +9 -0
- package/dist/components/gallery/index.d.ts +46 -0
- package/dist/components/gallery/index.d.ts.map +1 -0
- package/dist/components/gallery/index.js +22 -0
- package/dist/components/gallery/kit/GalleryVariant.d.ts +68 -0
- package/dist/components/gallery/kit/GalleryVariant.d.ts.map +1 -0
- package/dist/components/gallery/kit/GalleryVariant.js +231 -0
- package/dist/components/gallery/kit/feeds.d.ts +7 -0
- package/dist/components/gallery/kit/feeds.d.ts.map +1 -0
- package/dist/components/gallery/kit/feeds.js +83 -0
- package/dist/components/gallery/kit/galleryKit.d.ts +118 -0
- package/dist/components/gallery/kit/galleryKit.d.ts.map +1 -0
- package/dist/components/gallery/kit/galleryKit.js +298 -0
- package/dist/components/gallery/kit/lookBase.d.ts +157 -0
- package/dist/components/gallery/kit/lookBase.d.ts.map +1 -0
- package/dist/components/gallery/kit/lookBase.js +211 -0
- package/dist/components/gallery/kit/pictures.d.ts +14 -0
- package/dist/components/gallery/kit/pictures.d.ts.map +1 -0
- package/dist/components/gallery/kit/pictures.js +81 -0
- package/dist/components/gallery/looks/basicCarousel.d.ts +177 -0
- package/dist/components/gallery/looks/basicCarousel.d.ts.map +1 -0
- package/dist/components/gallery/looks/basicCarousel.js +315 -0
- package/dist/components/gallery/looks/contourLines.d.ts +153 -0
- package/dist/components/gallery/looks/contourLines.d.ts.map +1 -0
- package/dist/components/gallery/looks/contourLines.js +91 -0
- package/dist/components/gallery/looks/depthLayers.d.ts +155 -0
- package/dist/components/gallery/looks/depthLayers.d.ts.map +1 -0
- package/dist/components/gallery/looks/depthLayers.js +87 -0
- package/dist/components/gallery/looks/engraving.d.ts +162 -0
- package/dist/components/gallery/looks/engraving.d.ts.map +1 -0
- package/dist/components/gallery/looks/engraving.js +96 -0
- package/dist/components/gallery/looks/flowLines.d.ts +180 -0
- package/dist/components/gallery/looks/flowLines.d.ts.map +1 -0
- package/dist/components/gallery/looks/flowLines.js +113 -0
- package/dist/components/gallery/looks/fold.d.ts +209 -0
- package/dist/components/gallery/looks/fold.d.ts.map +1 -0
- package/dist/components/gallery/looks/fold.js +155 -0
- package/dist/components/gallery/looks/glassPanes.d.ts +133 -0
- package/dist/components/gallery/looks/glassPanes.d.ts.map +1 -0
- package/dist/components/gallery/looks/glassPanes.js +208 -0
- package/dist/components/gallery/looks/halo.d.ts +100 -0
- package/dist/components/gallery/looks/halo.d.ts.map +1 -0
- package/dist/components/gallery/looks/halo.js +119 -0
- package/dist/components/gallery/looks/lightThreads.d.ts +199 -0
- package/dist/components/gallery/looks/lightThreads.d.ts.map +1 -0
- package/dist/components/gallery/looks/lightThreads.js +246 -0
- package/dist/components/gallery/looks/loom.d.ts +238 -0
- package/dist/components/gallery/looks/loom.d.ts.map +1 -0
- package/dist/components/gallery/looks/loom.js +256 -0
- package/dist/components/gallery/looks/paperLanterns.d.ts +181 -0
- package/dist/components/gallery/looks/paperLanterns.d.ts.map +1 -0
- package/dist/components/gallery/looks/paperLanterns.js +399 -0
- package/dist/components/gallery/looks/particleShift.d.ts +193 -0
- package/dist/components/gallery/looks/particleShift.d.ts.map +1 -0
- package/dist/components/gallery/looks/particleShift.js +282 -0
- package/dist/components/gallery/looks/pinscreen.d.ts +175 -0
- package/dist/components/gallery/looks/pinscreen.d.ts.map +1 -0
- package/dist/components/gallery/looks/pinscreen.js +96 -0
- package/dist/components/gallery/looks/popUp.d.ts +206 -0
- package/dist/components/gallery/looks/popUp.d.ts.map +1 -0
- package/dist/components/gallery/looks/popUp.js +132 -0
- package/dist/components/gallery/looks/prismSplit.d.ts +151 -0
- package/dist/components/gallery/looks/prismSplit.d.ts.map +1 -0
- package/dist/components/gallery/looks/prismSplit.js +84 -0
- package/dist/components/gallery/looks/ridgelines.d.ts +179 -0
- package/dist/components/gallery/looks/ridgelines.d.ts.map +1 -0
- package/dist/components/gallery/looks/ridgelines.js +111 -0
- package/dist/components/gallery/looks/shadowBox.d.ts +152 -0
- package/dist/components/gallery/looks/shadowBox.d.ts.map +1 -0
- package/dist/components/gallery/looks/shadowBox.js +82 -0
- package/dist/components/gallery/looks/silk.d.ts +140 -0
- package/dist/components/gallery/looks/silk.d.ts.map +1 -0
- package/dist/components/gallery/looks/silk.js +346 -0
- package/dist/components/gallery/looks/slats.d.ts +176 -0
- package/dist/components/gallery/looks/slats.d.ts.map +1 -0
- package/dist/components/gallery/looks/slats.js +93 -0
- package/dist/components/gallery/looks/strata.d.ts +172 -0
- package/dist/components/gallery/looks/strata.d.ts.map +1 -0
- package/dist/components/gallery/looks/strata.js +88 -0
- package/dist/components/gallery/looks/terraces.d.ts +168 -0
- package/dist/components/gallery/looks/terraces.d.ts.map +1 -0
- package/dist/components/gallery/looks/terraces.js +91 -0
- package/dist/components/gallery/looks/wireRelief.d.ts +153 -0
- package/dist/components/gallery/looks/wireRelief.d.ts.map +1 -0
- package/dist/components/gallery/looks/wireRelief.js +128 -0
- package/dist/components/image/ContourImage.d.ts +7 -0
- package/dist/components/image/ContourImage.d.ts.map +1 -0
- package/dist/components/image/ContourImage.js +6 -0
- package/dist/components/image/EngravingImage.d.ts +7 -0
- package/dist/components/image/EngravingImage.d.ts.map +1 -0
- package/dist/components/image/EngravingImage.js +6 -0
- package/dist/components/image/FrostImage.d.ts +7 -0
- package/dist/components/image/FrostImage.d.ts.map +1 -0
- package/dist/components/image/FrostImage.js +6 -0
- package/dist/components/image/LenticularImage.d.ts +7 -0
- package/dist/components/image/LenticularImage.d.ts.map +1 -0
- package/dist/components/image/LenticularImage.js +6 -0
- package/dist/components/image/PinscreenImage.d.ts +7 -0
- package/dist/components/image/PinscreenImage.d.ts.map +1 -0
- package/dist/components/image/PinscreenImage.js +6 -0
- package/dist/components/image/PrismImage.d.ts +7 -0
- package/dist/components/image/PrismImage.d.ts.map +1 -0
- package/dist/components/image/PrismImage.js +6 -0
- package/dist/components/image/ProjectorImage.d.ts +7 -0
- package/dist/components/image/ProjectorImage.d.ts.map +1 -0
- package/dist/components/image/ProjectorImage.js +6 -0
- package/dist/components/image/ReliefImage.d.ts +7 -0
- package/dist/components/image/ReliefImage.d.ts.map +1 -0
- package/dist/components/image/ReliefImage.js +6 -0
- package/dist/components/image/RollImage.d.ts +7 -0
- package/dist/components/image/RollImage.d.ts.map +1 -0
- package/dist/components/image/RollImage.js +6 -0
- package/dist/components/image/ShardsImage.d.ts +126 -0
- package/dist/components/image/ShardsImage.d.ts.map +1 -0
- package/dist/components/image/ShardsImage.js +470 -0
- package/dist/components/image/core/contour.d.ts +126 -0
- package/dist/components/image/core/contour.d.ts.map +1 -0
- package/dist/components/image/core/contour.js +123 -0
- package/dist/components/image/core/engraving.d.ts +135 -0
- package/dist/components/image/core/engraving.d.ts.map +1 -0
- package/dist/components/image/core/engraving.js +163 -0
- package/dist/components/image/core/frost.d.ts +126 -0
- package/dist/components/image/core/frost.d.ts.map +1 -0
- package/dist/components/image/core/frost.js +156 -0
- package/dist/components/image/core/imageCore.d.ts +110 -0
- package/dist/components/image/core/imageCore.d.ts.map +1 -0
- package/dist/components/image/core/imageCore.js +269 -0
- package/dist/components/image/core/lenticular.d.ts +129 -0
- package/dist/components/image/core/lenticular.d.ts.map +1 -0
- package/dist/components/image/core/lenticular.js +132 -0
- package/dist/components/image/core/pinscreen.d.ts +126 -0
- package/dist/components/image/core/pinscreen.d.ts.map +1 -0
- package/dist/components/image/core/pinscreen.js +147 -0
- package/dist/components/image/core/prism.d.ts +120 -0
- package/dist/components/image/core/prism.d.ts.map +1 -0
- package/dist/components/image/core/prism.js +164 -0
- package/dist/components/image/core/projector.d.ts +135 -0
- package/dist/components/image/core/projector.d.ts.map +1 -0
- package/dist/components/image/core/projector.js +225 -0
- package/dist/components/image/core/relief.d.ts +111 -0
- package/dist/components/image/core/relief.d.ts.map +1 -0
- package/dist/components/image/core/relief.js +94 -0
- package/dist/components/image/core/roll.d.ts +114 -0
- package/dist/components/image/core/roll.d.ts.map +1 -0
- package/dist/components/image/core/roll.js +116 -0
- package/dist/components/image/imageVariant.d.ts +46 -0
- package/dist/components/image/imageVariant.d.ts.map +1 -0
- package/dist/components/image/imageVariant.js +128 -0
- package/dist/components/image/index.d.ts +22 -0
- package/dist/components/image/index.d.ts.map +1 -0
- package/dist/components/image/index.js +10 -0
- package/dist/components/image/pictureCycle.d.ts +15 -0
- package/dist/components/image/pictureCycle.d.ts.map +1 -0
- package/dist/components/image/pictureCycle.js +82 -0
- package/dist/components/index.d.ts +4 -0
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +4 -0
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +9 -7
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.js +39 -27
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +18 -5
- package/dist/galleryRuntime.d.ts +57 -0
- package/dist/galleryRuntime.d.ts.map +1 -0
- package/dist/galleryRuntime.js +105 -0
- package/dist/hooks/useConfigLive.d.ts +1 -1
- package/dist/hooks/useConfigLive.d.ts.map +1 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -0
- package/dist/keyPad/KeyPadControls.d.ts +16 -0
- package/dist/keyPad/KeyPadControls.d.ts.map +1 -0
- package/dist/keyPad/KeyPadControls.js +176 -0
- package/dist/keyPad/index.d.ts +16 -0
- package/dist/keyPad/index.d.ts.map +1 -0
- package/dist/keyPad/index.js +8 -0
- package/dist/keyPad/keyBindings.d.ts +43 -0
- package/dist/keyPad/keyBindings.d.ts.map +1 -0
- package/dist/keyPad/keyBindings.js +92 -0
- package/dist/keyPad/keyPadAnimation.d.ts +28 -0
- package/dist/keyPad/keyPadAnimation.d.ts.map +1 -0
- package/dist/keyPad/keyPadAnimation.js +131 -0
- package/dist/keyPad/keyPadMotion.d.ts +68 -0
- package/dist/keyPad/keyPadMotion.d.ts.map +1 -0
- package/dist/keyPad/keyPadMotion.js +283 -0
- package/dist/keyPad/keyPadStore.d.ts +25 -0
- package/dist/keyPad/keyPadStore.d.ts.map +1 -0
- package/dist/keyPad/keyPadStore.js +63 -0
- package/dist/keyPad/types.d.ts +23 -0
- package/dist/keyPad/types.d.ts.map +1 -0
- package/dist/keyPad/types.js +9 -0
- package/dist/operations/catalogue/motionTrail.d.ts.map +1 -1
- package/dist/operations/catalogue/motionTrail.js +8 -1
- package/dist/operations/catalogue/visibility.d.ts.map +1 -1
- package/dist/operations/catalogue/visibility.js +23 -1
- package/dist/shaders/clouds/CloudResolveMaterial.d.ts +2 -1
- package/dist/shaders/clouds/CloudResolveMaterial.d.ts.map +1 -1
- package/dist/shaders/clouds/CloudResolveMaterial.js +37 -12
- package/dist/shaders/clouds/CloudVolumeMaterial.d.ts +4 -0
- package/dist/shaders/clouds/CloudVolumeMaterial.d.ts.map +1 -1
- package/dist/shaders/clouds/CloudVolumeMaterial.js +15 -3
- package/dist/triggers/kinds/gallery.d.ts +2 -0
- package/dist/triggers/kinds/gallery.d.ts.map +1 -0
- package/dist/triggers/kinds/gallery.js +39 -0
- package/dist/triggers/kinds/index.d.ts +1 -0
- package/dist/triggers/kinds/index.d.ts.map +1 -1
- package/dist/triggers/kinds/index.js +1 -0
- package/dist/ui/UiAnchorUpdater.d.ts.map +1 -1
- package/dist/ui/UiAnchorUpdater.js +2 -1
- package/dist/utils/cursorPicking.d.ts.map +1 -1
- package/dist/utils/cursorPicking.js +2 -1
- package/dist/utils/shownInScene.d.ts +13 -0
- package/dist/utils/shownInScene.d.ts.map +1 -0
- package/dist/utils/shownInScene.js +16 -0
- package/package.json +2 -2
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export declare const catalog: {
|
|
3
|
+
key: string;
|
|
4
|
+
name: string;
|
|
5
|
+
camera: {
|
|
6
|
+
position: number[];
|
|
7
|
+
target: number[];
|
|
8
|
+
};
|
|
9
|
+
description: string;
|
|
10
|
+
tags: string[];
|
|
11
|
+
};
|
|
12
|
+
export declare const DEFAULTS: {
|
|
13
|
+
type: string;
|
|
14
|
+
aspect: number;
|
|
15
|
+
width: number;
|
|
16
|
+
sheets: number;
|
|
17
|
+
direction: string;
|
|
18
|
+
separation: number;
|
|
19
|
+
closed: number;
|
|
20
|
+
stagger: number;
|
|
21
|
+
smoothing: number;
|
|
22
|
+
roughness: number;
|
|
23
|
+
shadows: boolean;
|
|
24
|
+
page: boolean;
|
|
25
|
+
pageColor: string;
|
|
26
|
+
changeTime: number;
|
|
27
|
+
dim: number;
|
|
28
|
+
pointerMode: string;
|
|
29
|
+
pointerRadius: number;
|
|
30
|
+
tilt: number;
|
|
31
|
+
enabled: boolean;
|
|
32
|
+
lean: number;
|
|
33
|
+
imageUrls: any[];
|
|
34
|
+
autoplay: number;
|
|
35
|
+
intensity: number;
|
|
36
|
+
opacity: number;
|
|
37
|
+
layout: string;
|
|
38
|
+
spacing: number;
|
|
39
|
+
depth: number;
|
|
40
|
+
visible: number;
|
|
41
|
+
shape: number;
|
|
42
|
+
stiffness: number;
|
|
43
|
+
damping: number;
|
|
44
|
+
throwing: number;
|
|
45
|
+
wave: number;
|
|
46
|
+
slant: number;
|
|
47
|
+
pointerStrength: number;
|
|
48
|
+
};
|
|
49
|
+
export declare const STRUCTURAL: string[];
|
|
50
|
+
export declare const POINTER_MODES: string[];
|
|
51
|
+
export declare const GUI: ({
|
|
52
|
+
key: string;
|
|
53
|
+
options: string[];
|
|
54
|
+
tip: string;
|
|
55
|
+
min?: undefined;
|
|
56
|
+
max?: undefined;
|
|
57
|
+
step?: undefined;
|
|
58
|
+
} | {
|
|
59
|
+
key: string;
|
|
60
|
+
min: number;
|
|
61
|
+
max: number;
|
|
62
|
+
step: number;
|
|
63
|
+
} | {
|
|
64
|
+
key: string;
|
|
65
|
+
options: string[];
|
|
66
|
+
tip?: undefined;
|
|
67
|
+
color?: undefined;
|
|
68
|
+
} | {
|
|
69
|
+
key: string;
|
|
70
|
+
tip: string;
|
|
71
|
+
options?: undefined;
|
|
72
|
+
color?: undefined;
|
|
73
|
+
} | {
|
|
74
|
+
key: string;
|
|
75
|
+
color: boolean;
|
|
76
|
+
options?: undefined;
|
|
77
|
+
tip?: undefined;
|
|
78
|
+
})[];
|
|
79
|
+
export declare const PRESETS: ({
|
|
80
|
+
name: string;
|
|
81
|
+
description: string;
|
|
82
|
+
patch: {
|
|
83
|
+
sheets?: undefined;
|
|
84
|
+
separation?: undefined;
|
|
85
|
+
changeTime?: undefined;
|
|
86
|
+
direction?: undefined;
|
|
87
|
+
closed?: undefined;
|
|
88
|
+
stagger?: undefined;
|
|
89
|
+
};
|
|
90
|
+
} | {
|
|
91
|
+
name: string;
|
|
92
|
+
description: string;
|
|
93
|
+
patch: {
|
|
94
|
+
sheets: number;
|
|
95
|
+
separation: number;
|
|
96
|
+
changeTime: number;
|
|
97
|
+
direction?: undefined;
|
|
98
|
+
closed?: undefined;
|
|
99
|
+
stagger?: undefined;
|
|
100
|
+
};
|
|
101
|
+
} | {
|
|
102
|
+
name: string;
|
|
103
|
+
description: string;
|
|
104
|
+
patch: {
|
|
105
|
+
direction: string;
|
|
106
|
+
closed: number;
|
|
107
|
+
sheets?: undefined;
|
|
108
|
+
separation?: undefined;
|
|
109
|
+
changeTime?: undefined;
|
|
110
|
+
stagger?: undefined;
|
|
111
|
+
};
|
|
112
|
+
} | {
|
|
113
|
+
name: string;
|
|
114
|
+
description: string;
|
|
115
|
+
patch: {
|
|
116
|
+
closed: number;
|
|
117
|
+
stagger: number;
|
|
118
|
+
sheets?: undefined;
|
|
119
|
+
separation?: undefined;
|
|
120
|
+
changeTime?: undefined;
|
|
121
|
+
direction?: undefined;
|
|
122
|
+
};
|
|
123
|
+
})[];
|
|
124
|
+
export declare function createUniforms(): {
|
|
125
|
+
uSheets: {
|
|
126
|
+
value: number;
|
|
127
|
+
};
|
|
128
|
+
uSep: {
|
|
129
|
+
value: number;
|
|
130
|
+
};
|
|
131
|
+
uClosed: {
|
|
132
|
+
value: number;
|
|
133
|
+
};
|
|
134
|
+
uStagger: {
|
|
135
|
+
value: number;
|
|
136
|
+
};
|
|
137
|
+
uSmooth: {
|
|
138
|
+
value: number;
|
|
139
|
+
};
|
|
140
|
+
uLiftA: {
|
|
141
|
+
value: number;
|
|
142
|
+
};
|
|
143
|
+
uCard: {
|
|
144
|
+
value: THREE.Color;
|
|
145
|
+
};
|
|
146
|
+
uDir: {
|
|
147
|
+
value: number;
|
|
148
|
+
};
|
|
149
|
+
uTex: {
|
|
150
|
+
value: any;
|
|
151
|
+
};
|
|
152
|
+
uS: {
|
|
153
|
+
value: number;
|
|
154
|
+
};
|
|
155
|
+
uCount: {
|
|
156
|
+
value: number;
|
|
157
|
+
};
|
|
158
|
+
uTime: {
|
|
159
|
+
value: number;
|
|
160
|
+
};
|
|
161
|
+
uAct: {
|
|
162
|
+
value: Float32Array<ArrayBuffer>;
|
|
163
|
+
};
|
|
164
|
+
uW: {
|
|
165
|
+
value: number;
|
|
166
|
+
};
|
|
167
|
+
uH: {
|
|
168
|
+
value: number;
|
|
169
|
+
};
|
|
170
|
+
uWave: {
|
|
171
|
+
value: number;
|
|
172
|
+
};
|
|
173
|
+
uSlant: {
|
|
174
|
+
value: number;
|
|
175
|
+
};
|
|
176
|
+
uDim: {
|
|
177
|
+
value: number;
|
|
178
|
+
};
|
|
179
|
+
uIntensity: {
|
|
180
|
+
value: number;
|
|
181
|
+
};
|
|
182
|
+
uOpacity: {
|
|
183
|
+
value: number;
|
|
184
|
+
};
|
|
185
|
+
uPointer: {
|
|
186
|
+
value: THREE.Vector3;
|
|
187
|
+
};
|
|
188
|
+
uPointerActive: {
|
|
189
|
+
value: number;
|
|
190
|
+
};
|
|
191
|
+
uPointerMode: {
|
|
192
|
+
value: number;
|
|
193
|
+
};
|
|
194
|
+
uPointerStrength: {
|
|
195
|
+
value: number;
|
|
196
|
+
};
|
|
197
|
+
uPointerRadius: {
|
|
198
|
+
value: number;
|
|
199
|
+
};
|
|
200
|
+
uPlace: {
|
|
201
|
+
value: THREE.Matrix4[];
|
|
202
|
+
};
|
|
203
|
+
};
|
|
204
|
+
export declare function applyConfig(u: any, c: any): void;
|
|
205
|
+
export declare function build(u: any, c: any): any;
|
|
206
|
+
//# sourceMappingURL=popUp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"popUp.d.ts","sourceRoot":"","sources":["../../../../src/components/gallery/looks/popUp.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,eAAO,MAAM,OAAO;;;;;;;;;CAE0D,CAAC;AAE/E,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIpB,CAAC;AACF,eAAO,MAAM,UAAU,UAA6C,CAAC;AACrE,eAAO,MAAM,aAAa,UAAW,CAAC;AACtC,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;IAUf,CAAC;AACF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAKnB,CAAC;AACF,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAE7B;AACD,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,QAK/B;AAiDD,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,OAA6C"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
// The approved lab module, verbatim but for its import paths and the lab's picture loader (Claude outputs/gallery-lab/
|
|
2
|
+
// popup.mjs). Plain JS-shaped code (the viewer compiles non-strict); typed at its one door, kit/GalleryVariant.tsx. Its own DEFAULTS only fill knobs the
|
|
3
|
+
// core defaults (DEFAULT_GALLERY_OBJECTS.popUp) do not carry; its own autoplay is never used.
|
|
4
|
+
// popup — "Pop-up". Every picture is a pop-up book spread lit by the scene: the picture is cut by its own brightness
|
|
5
|
+
// into a few sheets (the back one whole, each one in front holding what is brighter than its level), each hinged
|
|
6
|
+
// along its bottom edge at its own depth (and, optionally, to a paper page lying at the foot of the picture).
|
|
7
|
+
// An inactive picture's sheets lie down — `direction` back (away from the viewer: a grey printed page seen from
|
|
8
|
+
// above) or forward (folded down toward the viewer, showing their plain card backs); the hinges at different depths
|
|
9
|
+
// keep the lying sheets apart (no z-fighting). When it becomes the active one
|
|
10
|
+
// the sheets stand up one after another, back to front, like a pop-up page opening, and take their colour; leaving
|
|
11
|
+
// lays them back front to back. The sheets cast their own cut-out shadows on each other. The cursor tilts the
|
|
12
|
+
// sheets near it back a little, like a fingertip on the paper. Scene-lit (standard material + shadows); no light.
|
|
13
|
+
import * as THREE from 'three';
|
|
14
|
+
import { BASE_DEFAULTS, BASE_GUI_MOTION, BASE_GUI_TAIL, LAYOUT_GUI, baseUniforms, applyBase, instanced, litMaterial, litDepthMaterial, makeGallery, withLean } from '../kit/lookBase.js';
|
|
15
|
+
export const catalog = { key: 'popUp', name: 'Pop-up', camera: { position: [1.3, 0.75, 4.4], target: [0, -0.1, 0.2] },
|
|
16
|
+
description: 'Pictures as pop-up book spreads lit by the scene: cut-paper sheets hinged to a page lie folded down and grey when inactive, and stand up one after another into the picture in full colour when it becomes active. Use for storytelling, kids, editorial and craft showcases.',
|
|
17
|
+
tags: ['gallery', 'pop-up', 'paper', 'book', 'scene-lit', 'interactive'] };
|
|
18
|
+
export const DEFAULTS = {
|
|
19
|
+
...BASE_DEFAULTS, type: 'popUp', aspect: 1.4, width: 2.2, sheets: 4, // structural
|
|
20
|
+
direction: 'back', separation: 0.16, closed: 76, stagger: 0.6, smoothing: 3.2, roughness: 0.85, shadows: true, page: false, pageColor: '#d8d2c6', changeTime: 2.2, dim: 0.5,
|
|
21
|
+
pointerMode: 'tilt', pointerRadius: 0.6, tilt: 12,
|
|
22
|
+
};
|
|
23
|
+
export const STRUCTURAL = ['imageUrls', 'aspect', 'width', 'sheets'];
|
|
24
|
+
export const POINTER_MODES = ['tilt'];
|
|
25
|
+
export const GUI = [
|
|
26
|
+
{ key: 'lean', min: 0, max: 3, step: 0.01, tip: 'The gallery turns toward the cursor' },
|
|
27
|
+
{ key: 'aspect', min: 0.6, max: 2.5, step: 0.01 }, { key: 'width', min: 1, max: 4, step: 0.01 }, { key: 'sheets', min: 2, max: 7, step: 1, tip: 'Pop-up sheets per picture' },
|
|
28
|
+
...LAYOUT_GUI, ...BASE_GUI_MOTION,
|
|
29
|
+
{ key: 'direction', options: ['back', 'forward'], tip: 'Which way an inactive picture’s sheets lie: back, away from the viewer, or forward, folded down toward the viewer' },
|
|
30
|
+
{ key: 'separation', min: 0.02, max: 0.5, step: 0.005, tip: 'Depth between the sheets’ hinges' }, { key: 'closed', min: 20, max: 88, step: 1, tip: 'How far an inactive picture’s sheets lie down (degrees from upright)' },
|
|
31
|
+
{ key: 'stagger', min: 0, max: 1, step: 0.01, tip: 'How much the sheets stand up one after another' },
|
|
32
|
+
{ key: 'smoothing', min: 0, max: 5, step: 0.1, tip: 'How much the brightness is smoothed before the sheets are cut' }, { key: 'roughness', min: 0, max: 1, step: 0.01 },
|
|
33
|
+
{ key: 'pointerMode', options: ['none', ...POINTER_MODES] }, ...BASE_GUI_TAIL, { key: 'tilt', min: 0, max: 40, step: 1, tip: 'How far the cursor tilts the sheets (degrees, the way they lie)' },
|
|
34
|
+
{ key: 'shadows', tip: 'The sheets cast shadows (on each other and on the scene)' }, { key: 'page', tip: 'Show the paper page the sheets are hinged to' }, { key: 'pageColor', color: true },
|
|
35
|
+
];
|
|
36
|
+
export const PRESETS = [
|
|
37
|
+
{ name: 'Pop-up', description: 'The default.', patch: {} },
|
|
38
|
+
{ name: 'Deep spread', description: 'Few sheets, far apart, slow.', patch: { sheets: 3, separation: 0.3, changeTime: 2.8 } },
|
|
39
|
+
{ name: 'Folded forward', description: 'The sheets fold down toward the viewer.', patch: { direction: 'forward', closed: 62 } },
|
|
40
|
+
{ name: 'Flat closed', description: 'Sheets lie fully flat when inactive.', patch: { closed: 86, stagger: 0.8 } },
|
|
41
|
+
];
|
|
42
|
+
export function createUniforms() {
|
|
43
|
+
return { ...baseUniforms(), uSheets: { value: 4 }, uSep: { value: 0.16 }, uClosed: { value: 1.26 }, uStagger: { value: 0.6 }, uSmooth: { value: 2.6 }, uLiftA: { value: 0.21 }, uCard: { value: new THREE.Color('#d8d2c6') }, uDir: { value: -1 } };
|
|
44
|
+
}
|
|
45
|
+
export function applyConfig(u, c) {
|
|
46
|
+
const set = applyBase(u, c, POINTER_MODES);
|
|
47
|
+
set('uCard', c.pageColor);
|
|
48
|
+
set('uSep', c.separation);
|
|
49
|
+
set('uStagger', c.stagger);
|
|
50
|
+
set('uSmooth', c.smoothing);
|
|
51
|
+
if (c.closed !== undefined)
|
|
52
|
+
u.uClosed.value = c.closed * Math.PI / 180;
|
|
53
|
+
if (c.tilt !== undefined)
|
|
54
|
+
u.uLiftA.value = c.tilt * Math.PI / 180;
|
|
55
|
+
if (c.direction !== undefined)
|
|
56
|
+
u.uDir.value = c.direction === 'forward' ? 1 : -1;
|
|
57
|
+
}
|
|
58
|
+
const vertex = {
|
|
59
|
+
head: /* glsl */ `uniform float uSheets, uSep, uClosed, uStagger, uLiftA, uDir; varying vec2 vUv; varying float vImg; varying float vK; varying float vE; varying float vAlpha;`,
|
|
60
|
+
body: /* glsl */ `
|
|
61
|
+
float img = aI.x, k = aI.y; float act = actOf(img);
|
|
62
|
+
// the sheets stand up back to front (and fold down front to back): sheet k's own share of the change
|
|
63
|
+
float t0 = (k / uSheets) * uStagger;
|
|
64
|
+
float ek = clamp((act - t0) / max(1.0 - uStagger * (uSheets - 1.0) / uSheets, 0.05), 0.0, 1.0);
|
|
65
|
+
ek = ek * ek * (3.0 - 2.0 * ek);
|
|
66
|
+
vec2 p = vec2(position.x * uW, position.y * uH);
|
|
67
|
+
// angle from upright: uDir -1 = lying back, away from the viewer; +1 = folded down toward the viewer
|
|
68
|
+
float th = uDir * (uClosed * (1.0 - ek) + uLiftA * maskAt(p) * ek);
|
|
69
|
+
float py = p.y + uH * 0.5; // height above the hinge
|
|
70
|
+
float zk = k * uSep;
|
|
71
|
+
gPos = vec3(p.x, -uH * 0.5 + py * cos(th), zk + py * sin(th));
|
|
72
|
+
// shading normal: lying back, the sheet's own normal (its print faces up, toward the light). Folded forward the
|
|
73
|
+
// print faces down, away from any overhead light, and reads as black — so forward sheets are shaded as if
|
|
74
|
+
// tilted slightly up instead: the print stays readable while it folds (a shading choice, not a light)
|
|
75
|
+
gNrm = (uDir < 0.0 ? vec3(0.0, -sin(th), cos(th)) : normalize(vec3(0.0, 0.3 * sin(th), cos(th)))) * sign(normal.z + 1e-4);
|
|
76
|
+
vUv = position.xy + 0.5; vImg = img; vK = k; vE = ek; vAlpha = fadeAt(img);
|
|
77
|
+
`,
|
|
78
|
+
};
|
|
79
|
+
const cut = /* glsl */ `
|
|
80
|
+
float L = lumOf(textureLod(uTex, vec3(vUv, vImg), uSmooth).rgb);
|
|
81
|
+
if (vK > 0.5 && L < vK / uSheets) discard;
|
|
82
|
+
`;
|
|
83
|
+
const fragment = {
|
|
84
|
+
head: /* glsl */ `uniform float uSheets, uSmooth; uniform vec3 uCard; varying vec2 vUv; varying float vImg; varying float vK; varying float vE; varying float vAlpha;`,
|
|
85
|
+
body: /* glsl */ `
|
|
86
|
+
${cut}
|
|
87
|
+
vec3 pic = texture(uTex, vec3(vUv, vImg)).rgb;
|
|
88
|
+
// the picture is printed on the front of each sheet; its back is plain card (what a folded-down sheet shows)
|
|
89
|
+
vec3 front = mix(fadedOf(pic) * 1.8, pic, vE);
|
|
90
|
+
diffuseColor.rgb = (gl_FrontFacing ? front : uCard * mix(0.55, 0.9, uDim)) * uIntensity;
|
|
91
|
+
diffuseColor.a *= vAlpha * uOpacity; if (diffuseColor.a < 0.01) discard;
|
|
92
|
+
`,
|
|
93
|
+
};
|
|
94
|
+
const depthCut = { head: fragment.head, body: cut + 'if (vAlpha < 0.5) discard;' };
|
|
95
|
+
// the page the sheets are hinged to (optional, `page`): flat at the foot of the picture, reaching toward the viewer
|
|
96
|
+
const pageVertex = {
|
|
97
|
+
head: /* glsl */ `uniform float uSheets, uSep; varying float vAlpha;`,
|
|
98
|
+
body: /* glsl */ `
|
|
99
|
+
float depth = uSheets * uSep + uH * 0.85;
|
|
100
|
+
gPos = vec3(position.x * uW * 1.04, -uH * 0.5 - 0.004, -0.06 + (0.5 - position.y) * depth); // (0.5 - y): the page faces up
|
|
101
|
+
gNrm = vec3(0.0, 1.0, 0.0); vAlpha = fadeAt(aI.x);
|
|
102
|
+
`,
|
|
103
|
+
};
|
|
104
|
+
const pageFragment = { head: /* glsl */ `varying float vAlpha;`, body: /* glsl */ `diffuseColor.a *= vAlpha * uOpacity; if (diffuseColor.a < 0.01) discard;` };
|
|
105
|
+
export function build(u, c) { return withLean(buildGallery(u, c), c); }
|
|
106
|
+
function buildGallery(u, c) {
|
|
107
|
+
const W = c.width, H = W / c.aspect, N = Math.max(2, c.sheets | 0);
|
|
108
|
+
u.uSheets.value = N;
|
|
109
|
+
const geo = instanced(new THREE.PlaneGeometry(1, 1, 8, 6), N, () => [0, 0]);
|
|
110
|
+
const mat = litMaterial(u, 'popup', vertex, fragment, { roughness: c.roughness });
|
|
111
|
+
const mesh = new THREE.Mesh(geo, mat);
|
|
112
|
+
mesh.frustumCulled = false;
|
|
113
|
+
mesh.raycast = () => { };
|
|
114
|
+
mesh.castShadow = c.shadows !== false;
|
|
115
|
+
mesh.receiveShadow = true;
|
|
116
|
+
mesh.customDepthMaterial = litDepthMaterial(u, 'popup', vertex, depthCut);
|
|
117
|
+
const pgeo = instanced(new THREE.PlaneGeometry(1, 1), 1, () => [0, 0]);
|
|
118
|
+
const pmat = litMaterial(u, 'popup-page', pageVertex, pageFragment, { color: c.pageColor, roughness: 0.9 });
|
|
119
|
+
const page = new THREE.Mesh(pgeo, pmat);
|
|
120
|
+
page.frustumCulled = false;
|
|
121
|
+
page.raycast = () => { };
|
|
122
|
+
page.receiveShadow = true;
|
|
123
|
+
page.visible = !!c.page;
|
|
124
|
+
const g = makeGallery(u, c, { W, H, meshes: [mesh, page], setCount: (n) => { geo.instanceCount = n * N; pgeo.instanceCount = n; }, dispose: () => mesh.customDepthMaterial.dispose() });
|
|
125
|
+
const apply = g.apply;
|
|
126
|
+
g.apply = (k) => { apply(k); applyConfig(u, k); if (k.roughness !== undefined)
|
|
127
|
+
mat.roughness = k.roughness; if (k.pageColor)
|
|
128
|
+
pmat.color.set(k.pageColor); if (k.page !== undefined)
|
|
129
|
+
page.visible = !!k.page; if (k.shadows !== undefined)
|
|
130
|
+
mesh.castShadow = !!k.shadows; };
|
|
131
|
+
return g;
|
|
132
|
+
}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
export declare const catalog: {
|
|
3
|
+
key: string;
|
|
4
|
+
name: string;
|
|
5
|
+
camera: {
|
|
6
|
+
position: number[];
|
|
7
|
+
target: number[];
|
|
8
|
+
};
|
|
9
|
+
description: string;
|
|
10
|
+
tags: string[];
|
|
11
|
+
};
|
|
12
|
+
export declare const DEFAULTS: {
|
|
13
|
+
type: string;
|
|
14
|
+
aspect: number;
|
|
15
|
+
width: number;
|
|
16
|
+
split: number;
|
|
17
|
+
dispersion: number;
|
|
18
|
+
saturation: number;
|
|
19
|
+
changeTime: number;
|
|
20
|
+
dim: number;
|
|
21
|
+
pointerMode: string;
|
|
22
|
+
pointerRadius: number;
|
|
23
|
+
enabled: boolean;
|
|
24
|
+
lean: number;
|
|
25
|
+
imageUrls: any[];
|
|
26
|
+
autoplay: number;
|
|
27
|
+
intensity: number;
|
|
28
|
+
opacity: number;
|
|
29
|
+
layout: string;
|
|
30
|
+
spacing: number;
|
|
31
|
+
depth: number;
|
|
32
|
+
visible: number;
|
|
33
|
+
shape: number;
|
|
34
|
+
stiffness: number;
|
|
35
|
+
damping: number;
|
|
36
|
+
throwing: number;
|
|
37
|
+
wave: number;
|
|
38
|
+
slant: number;
|
|
39
|
+
pointerStrength: number;
|
|
40
|
+
};
|
|
41
|
+
export declare const STRUCTURAL: string[];
|
|
42
|
+
export declare const POINTER_MODES: string[];
|
|
43
|
+
export declare const GUI: ({
|
|
44
|
+
key: string;
|
|
45
|
+
options: string[];
|
|
46
|
+
tip: string;
|
|
47
|
+
min?: undefined;
|
|
48
|
+
max?: undefined;
|
|
49
|
+
step?: undefined;
|
|
50
|
+
} | {
|
|
51
|
+
key: string;
|
|
52
|
+
min: number;
|
|
53
|
+
max: number;
|
|
54
|
+
step: number;
|
|
55
|
+
} | {
|
|
56
|
+
key: string;
|
|
57
|
+
options: string[];
|
|
58
|
+
})[];
|
|
59
|
+
export declare const PRESETS: ({
|
|
60
|
+
name: string;
|
|
61
|
+
description: string;
|
|
62
|
+
patch: {
|
|
63
|
+
split?: undefined;
|
|
64
|
+
dispersion?: undefined;
|
|
65
|
+
saturation?: undefined;
|
|
66
|
+
};
|
|
67
|
+
} | {
|
|
68
|
+
name: string;
|
|
69
|
+
description: string;
|
|
70
|
+
patch: {
|
|
71
|
+
split: number;
|
|
72
|
+
dispersion: number;
|
|
73
|
+
saturation: number;
|
|
74
|
+
};
|
|
75
|
+
} | {
|
|
76
|
+
name: string;
|
|
77
|
+
description: string;
|
|
78
|
+
patch: {
|
|
79
|
+
split: number;
|
|
80
|
+
dispersion: number;
|
|
81
|
+
saturation?: undefined;
|
|
82
|
+
};
|
|
83
|
+
})[];
|
|
84
|
+
export declare function createUniforms(): {
|
|
85
|
+
uSplit: {
|
|
86
|
+
value: number;
|
|
87
|
+
};
|
|
88
|
+
uDisp: {
|
|
89
|
+
value: number;
|
|
90
|
+
};
|
|
91
|
+
uSat: {
|
|
92
|
+
value: number;
|
|
93
|
+
};
|
|
94
|
+
uTex: {
|
|
95
|
+
value: any;
|
|
96
|
+
};
|
|
97
|
+
uS: {
|
|
98
|
+
value: number;
|
|
99
|
+
};
|
|
100
|
+
uCount: {
|
|
101
|
+
value: number;
|
|
102
|
+
};
|
|
103
|
+
uTime: {
|
|
104
|
+
value: number;
|
|
105
|
+
};
|
|
106
|
+
uAct: {
|
|
107
|
+
value: Float32Array<ArrayBuffer>;
|
|
108
|
+
};
|
|
109
|
+
uW: {
|
|
110
|
+
value: number;
|
|
111
|
+
};
|
|
112
|
+
uH: {
|
|
113
|
+
value: number;
|
|
114
|
+
};
|
|
115
|
+
uWave: {
|
|
116
|
+
value: number;
|
|
117
|
+
};
|
|
118
|
+
uSlant: {
|
|
119
|
+
value: number;
|
|
120
|
+
};
|
|
121
|
+
uDim: {
|
|
122
|
+
value: number;
|
|
123
|
+
};
|
|
124
|
+
uIntensity: {
|
|
125
|
+
value: number;
|
|
126
|
+
};
|
|
127
|
+
uOpacity: {
|
|
128
|
+
value: number;
|
|
129
|
+
};
|
|
130
|
+
uPointer: {
|
|
131
|
+
value: THREE.Vector3;
|
|
132
|
+
};
|
|
133
|
+
uPointerActive: {
|
|
134
|
+
value: number;
|
|
135
|
+
};
|
|
136
|
+
uPointerMode: {
|
|
137
|
+
value: number;
|
|
138
|
+
};
|
|
139
|
+
uPointerStrength: {
|
|
140
|
+
value: number;
|
|
141
|
+
};
|
|
142
|
+
uPointerRadius: {
|
|
143
|
+
value: number;
|
|
144
|
+
};
|
|
145
|
+
uPlace: {
|
|
146
|
+
value: THREE.Matrix4[];
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
export declare function applyConfig(u: any, c: any): void;
|
|
150
|
+
export declare function build(u: any, c: any): any;
|
|
151
|
+
//# sourceMappingURL=prismSplit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prismSplit.d.ts","sourceRoot":"","sources":["../../../../src/components/gallery/looks/prismSplit.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,eAAO,MAAM,OAAO;;;;;;;;;CAEwD,CAAC;AAE7E,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIpB,CAAC;AACF,eAAO,MAAM,UAAU,UAAmC,CAAC;AAC3D,eAAO,MAAM,aAAa,UAAY,CAAC;AACvC,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;IAQf,CAAC;AACF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;IAInB,CAAC;AACF,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA2G;AACzI,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,QAAgI;AAoChK,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,OAA6C"}
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
// The approved lab module, verbatim but for its import paths and the lab's picture loader (Claude outputs/gallery-lab/
|
|
2
|
+
// prism.mjs). Plain JS-shaped code (the viewer compiles non-strict); typed at its one door, kit/GalleryVariant.tsx. Its own DEFAULTS only fill knobs the
|
|
3
|
+
// core defaults (DEFAULT_GALLERY_OBJECTS.prismSplit) do not carry; its own autoplay is never used.
|
|
4
|
+
// prism — "Prism Split". Every picture is its three colour channels on three planes, added together: red, green
|
|
5
|
+
// and blue each a sheet of light, so where they line up they sum to the true picture. An inactive picture's planes
|
|
6
|
+
// stand apart in depth (and a little sideways, like light through a prism), dim and nearly grey, so it reads as a
|
|
7
|
+
// faint picture with soft colour fringes. When it becomes the active one a soft wave crosses it and the planes slide
|
|
8
|
+
// together behind it (the sheets bend along the front), the fringes thin out and the colour comes in full. The
|
|
9
|
+
// cursor splits the planes apart again a little where it passes. Self-coloured (additive light).
|
|
10
|
+
import * as THREE from 'three';
|
|
11
|
+
import { BASE_DEFAULTS, BASE_GUI_MOTION, BASE_GUI_TAIL, LAYOUT_GUI, baseUniforms, applyBase, baseGlsl, instanced, shaderMaterial, makeGallery, withLean, fragHead } from '../kit/lookBase.js';
|
|
12
|
+
export const catalog = { key: 'prismSplit', name: 'Prism Split', camera: { position: [1.0, 0.2, 4.6], target: [0, 0, 0] },
|
|
13
|
+
description: 'Pictures as their red, green and blue channels on three planes of light: inactive ones stand apart in depth, dim with soft colour fringes, the active one slides together into the true picture behind a soft wave; the cursor splits it again. Use for tech, music and optics-inspired showcases.',
|
|
14
|
+
tags: ['gallery', 'prism', 'rgb', 'chromatic', 'light', 'interactive'] };
|
|
15
|
+
export const DEFAULTS = {
|
|
16
|
+
...BASE_DEFAULTS, type: 'prismSplit', aspect: 1.4, width: 2.2,
|
|
17
|
+
split: 0.12, dispersion: 0.25, saturation: 0.3, changeTime: 1.8, dim: 0.28,
|
|
18
|
+
pointerMode: 'split', pointerRadius: 0.55,
|
|
19
|
+
};
|
|
20
|
+
export const STRUCTURAL = ['imageUrls', 'aspect', 'width'];
|
|
21
|
+
export const POINTER_MODES = ['split'];
|
|
22
|
+
export const GUI = [
|
|
23
|
+
{ key: 'lean', min: 0, max: 3, step: 0.01, tip: 'The gallery turns toward the cursor' },
|
|
24
|
+
{ key: 'aspect', min: 0.6, max: 2.5, step: 0.01 }, { key: 'width', min: 1, max: 4, step: 0.01 },
|
|
25
|
+
...LAYOUT_GUI, ...BASE_GUI_MOTION,
|
|
26
|
+
{ key: 'split', min: 0, max: 0.5, step: 0.005, tip: 'Depth between the colour planes of an inactive picture' },
|
|
27
|
+
{ key: 'dispersion', min: 0, max: 1, step: 0.01, tip: 'Sideways offset of the planes, as a share of the split' },
|
|
28
|
+
{ key: 'saturation', min: 0, max: 1, step: 0.01, tip: 'Colour of an inactive picture' },
|
|
29
|
+
{ key: 'pointerMode', options: ['none', ...POINTER_MODES] }, ...BASE_GUI_TAIL,
|
|
30
|
+
];
|
|
31
|
+
export const PRESETS = [
|
|
32
|
+
{ name: 'Prism', description: 'The default.', patch: {} },
|
|
33
|
+
{ name: 'Wide', description: 'Planes far apart, strong fringes.', patch: { split: 0.26, dispersion: 0.5, saturation: 0.5 } },
|
|
34
|
+
{ name: 'Hairline', description: 'Barely apart: a thin fringe.', patch: { split: 0.05, dispersion: 0.15 } },
|
|
35
|
+
];
|
|
36
|
+
export function createUniforms() { return { ...baseUniforms(), uSplit: { value: 0.12 }, uDisp: { value: 0.25 }, uSat: { value: 0.3 } }; }
|
|
37
|
+
export function applyConfig(u, c) { const set = applyBase(u, c, POINTER_MODES); set('uSplit', c.split); set('uDisp', c.dispersion); set('uSat', c.saturation); }
|
|
38
|
+
const vert = /* glsl */ `
|
|
39
|
+
attribute vec4 aI; // picture, channel 0 / 1 / 2
|
|
40
|
+
${baseGlsl}
|
|
41
|
+
uniform float uSplit, uDisp;
|
|
42
|
+
varying vec2 vUv; varying float vImg; varying float vK; varying float vS; varying float vAlpha;
|
|
43
|
+
void main(){
|
|
44
|
+
float img = aI.x, k = aI.y; vec2 g = position.xy + 0.5;
|
|
45
|
+
vec2 p = vec2(position.x * uW, position.y * uH);
|
|
46
|
+
float s = waveAt(actOf(img), g);
|
|
47
|
+
float apart = (1.0 - s) + 0.8 * maskAt(p) * s;
|
|
48
|
+
float o = (k - 1.0) * uSplit * apart;
|
|
49
|
+
vec3 local = vec3(p.x + o * uDisp, p.y, o);
|
|
50
|
+
vUv = g; vImg = img; vK = k; vS = s; vAlpha = fadeAt(img);
|
|
51
|
+
gl_Position = projectionMatrix * modelViewMatrix * vec4(placeAt(img, local), 1.0);
|
|
52
|
+
}
|
|
53
|
+
`;
|
|
54
|
+
const frag = /* glsl */ `
|
|
55
|
+
${fragHead}
|
|
56
|
+
precision highp sampler2DArray;
|
|
57
|
+
uniform sampler2DArray uTex;
|
|
58
|
+
${baseGlsl}
|
|
59
|
+
uniform float uSat;
|
|
60
|
+
varying vec2 vUv; varying float vImg; varying float vK; varying float vS; varying float vAlpha;
|
|
61
|
+
void main(){
|
|
62
|
+
vec3 pic = texture(uTex, vec3(vUv, vImg)).rgb;
|
|
63
|
+
float lum = lumOf(pic);
|
|
64
|
+
vec3 chan = vK < 0.5 ? vec3(1.0, 0.0, 0.0) : (vK < 1.5 ? vec3(0.0, 1.0, 0.0) : vec3(0.0, 0.0, 1.0));
|
|
65
|
+
float v = dot(mix(vec3(lum), pic, mix(uSat, 1.0, vS)), chan);
|
|
66
|
+
float b = mix(uDim, 1.0, vS) * vAlpha * uOpacity * uIntensity;
|
|
67
|
+
gl_FragColor = vec4(chan * v * b, 0.0);
|
|
68
|
+
#include <tonemapping_fragment>
|
|
69
|
+
#include <colorspace_fragment>
|
|
70
|
+
}
|
|
71
|
+
`;
|
|
72
|
+
export function build(u, c) { return withLean(buildGallery(u, c), c); }
|
|
73
|
+
function buildGallery(u, c) {
|
|
74
|
+
const W = c.width, H = W / c.aspect;
|
|
75
|
+
const geo = instanced(new THREE.PlaneGeometry(1, 1, 32, 22), 3, () => [0, 0]);
|
|
76
|
+
const mat = shaderMaterial(u, vert, frag, { depthWrite: false, blending: THREE.AdditiveBlending });
|
|
77
|
+
const mesh = new THREE.Mesh(geo, mat);
|
|
78
|
+
mesh.frustumCulled = false;
|
|
79
|
+
mesh.raycast = () => { };
|
|
80
|
+
const g = makeGallery(u, c, { W, H, meshes: [mesh], setCount: (n) => { geo.instanceCount = n * 3; } });
|
|
81
|
+
const apply = g.apply;
|
|
82
|
+
g.apply = (k) => { apply(k); applyConfig(u, k); };
|
|
83
|
+
return g;
|
|
84
|
+
}
|