@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,172 @@
|
|
|
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
|
+
plates: number;
|
|
17
|
+
relief: number;
|
|
18
|
+
base: number;
|
|
19
|
+
gap: number;
|
|
20
|
+
smoothing: number;
|
|
21
|
+
roughness: number;
|
|
22
|
+
plateColor: string;
|
|
23
|
+
changeTime: number;
|
|
24
|
+
wave: number;
|
|
25
|
+
slant: number;
|
|
26
|
+
dim: number;
|
|
27
|
+
pointerMode: string;
|
|
28
|
+
pointerRadius: number;
|
|
29
|
+
enabled: boolean;
|
|
30
|
+
lean: number;
|
|
31
|
+
imageUrls: any[];
|
|
32
|
+
autoplay: number;
|
|
33
|
+
intensity: number;
|
|
34
|
+
opacity: number;
|
|
35
|
+
layout: string;
|
|
36
|
+
spacing: number;
|
|
37
|
+
depth: number;
|
|
38
|
+
visible: number;
|
|
39
|
+
shape: number;
|
|
40
|
+
stiffness: number;
|
|
41
|
+
damping: number;
|
|
42
|
+
throwing: number;
|
|
43
|
+
pointerStrength: number;
|
|
44
|
+
};
|
|
45
|
+
export declare const STRUCTURAL: string[];
|
|
46
|
+
export declare const POINTER_MODES: string[];
|
|
47
|
+
export declare const GUI: ({
|
|
48
|
+
key: string;
|
|
49
|
+
options: string[];
|
|
50
|
+
tip: string;
|
|
51
|
+
min?: undefined;
|
|
52
|
+
max?: undefined;
|
|
53
|
+
step?: undefined;
|
|
54
|
+
} | {
|
|
55
|
+
key: string;
|
|
56
|
+
min: number;
|
|
57
|
+
max: number;
|
|
58
|
+
step: number;
|
|
59
|
+
} | {
|
|
60
|
+
key: string;
|
|
61
|
+
options: string[];
|
|
62
|
+
color?: undefined;
|
|
63
|
+
} | {
|
|
64
|
+
key: string;
|
|
65
|
+
color: boolean;
|
|
66
|
+
options?: undefined;
|
|
67
|
+
})[];
|
|
68
|
+
export declare const PRESETS: ({
|
|
69
|
+
name: string;
|
|
70
|
+
description: string;
|
|
71
|
+
patch: {
|
|
72
|
+
plates?: undefined;
|
|
73
|
+
gap?: undefined;
|
|
74
|
+
relief?: undefined;
|
|
75
|
+
smoothing?: undefined;
|
|
76
|
+
};
|
|
77
|
+
} | {
|
|
78
|
+
name: string;
|
|
79
|
+
description: string;
|
|
80
|
+
patch: {
|
|
81
|
+
plates: number;
|
|
82
|
+
gap: number;
|
|
83
|
+
relief: number;
|
|
84
|
+
smoothing?: undefined;
|
|
85
|
+
};
|
|
86
|
+
} | {
|
|
87
|
+
name: string;
|
|
88
|
+
description: string;
|
|
89
|
+
patch: {
|
|
90
|
+
plates: number;
|
|
91
|
+
gap: number;
|
|
92
|
+
relief: number;
|
|
93
|
+
smoothing: number;
|
|
94
|
+
};
|
|
95
|
+
})[];
|
|
96
|
+
export declare function createUniforms(): {
|
|
97
|
+
uPlates: {
|
|
98
|
+
value: number;
|
|
99
|
+
};
|
|
100
|
+
uRelief: {
|
|
101
|
+
value: number;
|
|
102
|
+
};
|
|
103
|
+
uBase: {
|
|
104
|
+
value: number;
|
|
105
|
+
};
|
|
106
|
+
uGap: {
|
|
107
|
+
value: number;
|
|
108
|
+
};
|
|
109
|
+
uSmooth: {
|
|
110
|
+
value: number;
|
|
111
|
+
};
|
|
112
|
+
uPlate: {
|
|
113
|
+
value: THREE.Color;
|
|
114
|
+
};
|
|
115
|
+
uTex: {
|
|
116
|
+
value: any;
|
|
117
|
+
};
|
|
118
|
+
uS: {
|
|
119
|
+
value: number;
|
|
120
|
+
};
|
|
121
|
+
uCount: {
|
|
122
|
+
value: number;
|
|
123
|
+
};
|
|
124
|
+
uTime: {
|
|
125
|
+
value: number;
|
|
126
|
+
};
|
|
127
|
+
uAct: {
|
|
128
|
+
value: Float32Array<ArrayBuffer>;
|
|
129
|
+
};
|
|
130
|
+
uW: {
|
|
131
|
+
value: number;
|
|
132
|
+
};
|
|
133
|
+
uH: {
|
|
134
|
+
value: number;
|
|
135
|
+
};
|
|
136
|
+
uWave: {
|
|
137
|
+
value: number;
|
|
138
|
+
};
|
|
139
|
+
uSlant: {
|
|
140
|
+
value: number;
|
|
141
|
+
};
|
|
142
|
+
uDim: {
|
|
143
|
+
value: number;
|
|
144
|
+
};
|
|
145
|
+
uIntensity: {
|
|
146
|
+
value: number;
|
|
147
|
+
};
|
|
148
|
+
uOpacity: {
|
|
149
|
+
value: number;
|
|
150
|
+
};
|
|
151
|
+
uPointer: {
|
|
152
|
+
value: THREE.Vector3;
|
|
153
|
+
};
|
|
154
|
+
uPointerActive: {
|
|
155
|
+
value: number;
|
|
156
|
+
};
|
|
157
|
+
uPointerMode: {
|
|
158
|
+
value: number;
|
|
159
|
+
};
|
|
160
|
+
uPointerStrength: {
|
|
161
|
+
value: number;
|
|
162
|
+
};
|
|
163
|
+
uPointerRadius: {
|
|
164
|
+
value: number;
|
|
165
|
+
};
|
|
166
|
+
uPlace: {
|
|
167
|
+
value: THREE.Matrix4[];
|
|
168
|
+
};
|
|
169
|
+
};
|
|
170
|
+
export declare function applyConfig(u: any, c: any): void;
|
|
171
|
+
export declare function build(u: any, c: any): any;
|
|
172
|
+
//# sourceMappingURL=strata.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"strata.d.ts","sourceRoot":"","sources":["../../../../src/components/gallery/looks/strata.ts"],"names":[],"mappings":"AAUA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,eAAO,MAAM,OAAO;;;;;;;;;CAE6D,CAAC;AAElF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIpB,CAAC;AACF,eAAO,MAAM,UAAU,UAA6C,CAAC;AACrE,eAAO,MAAM,aAAa,UAAW,CAAC;AACtC,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;IASf,CAAC;AACF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;IAInB,CAAC;AACF,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAA0M;AACxO,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,QAA+K;AAmC/M,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,OAA6C"}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// The approved lab module, verbatim but for its import paths and the lab's picture loader (Claude outputs/gallery-lab/
|
|
2
|
+
// strata.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.strata) do not carry; its own autoplay is never used.
|
|
4
|
+
// strata — every picture is a stack of thin horizontal plates, like a laser-cut relief: each plate's front edge
|
|
5
|
+
// follows the picture's brightness along its own row (bright stands forward), its front face carries its strip of
|
|
6
|
+
// the picture, its top, bottom and back are plain card. Lit by the scene, so from an angle the stack reads as
|
|
7
|
+
// layered relief, and the gaps between the plates draw fine dark lines. An inactive picture is a flat grey stack of
|
|
8
|
+
// thin plates. When it becomes the active one a soft wave crosses it and the plates slide forward into the relief,
|
|
9
|
+
// in full colour; leaving slides them back. The cursor pushes the plates near it back in. Scene-lit (standard
|
|
10
|
+
// material); the gallery adds no light.
|
|
11
|
+
import * as THREE from 'three';
|
|
12
|
+
import { BASE_DEFAULTS, BASE_GUI_MOTION, BASE_GUI_TAIL, LAYOUT_GUI, baseUniforms, applyBase, instanced, litMaterial, makeGallery, withLean } from '../kit/lookBase.js';
|
|
13
|
+
export const catalog = { key: 'strata', name: 'Strata', camera: { position: [1.5, 0.7, 4.2], target: [0, 0, 0] },
|
|
14
|
+
description: 'Pictures as stacks of thin horizontal plates lit by the scene, each plate’s front following the picture’s brightness like a laser-cut relief: inactive ones are a flat grey stack, the active one slides forward into relief in full colour; the cursor pushes plates back. Use for architecture, product, interiors and craft showcases.',
|
|
15
|
+
tags: ['gallery', 'strata', 'plates', 'relief', 'scene-lit', 'interactive'] };
|
|
16
|
+
export const DEFAULTS = {
|
|
17
|
+
...BASE_DEFAULTS, type: 'strata', aspect: 1.4, width: 2.2, plates: 30, // structural
|
|
18
|
+
relief: 0.3, base: 0.1, gap: 0.12, smoothing: 2.0, roughness: 0.7, plateColor: '#bdb7ad', changeTime: 2.0, wave: 0.45, slant: 0.15, dim: 0.5,
|
|
19
|
+
pointerMode: 'push', pointerRadius: 0.5,
|
|
20
|
+
};
|
|
21
|
+
export const STRUCTURAL = ['imageUrls', 'aspect', 'width', 'plates'];
|
|
22
|
+
export const POINTER_MODES = ['push'];
|
|
23
|
+
export const GUI = [
|
|
24
|
+
{ key: 'lean', min: 0, max: 3, step: 0.01, tip: 'The gallery turns toward the cursor' },
|
|
25
|
+
{ key: 'aspect', min: 0.6, max: 2.5, step: 0.01 }, { key: 'width', min: 1, max: 4, step: 0.01 }, { key: 'plates', min: 6, max: 120, step: 1, tip: 'Plates down a picture' },
|
|
26
|
+
...LAYOUT_GUI, ...BASE_GUI_MOTION,
|
|
27
|
+
{ key: 'relief', min: 0, max: 0.6, step: 0.005, tip: 'How far the brightest part of a plate stands forward' }, { key: 'base', min: 0, max: 1, step: 0.01, tip: 'Depth of the darkest part, as a share of the brightest' },
|
|
28
|
+
{ key: 'gap', min: 0, max: 0.6, step: 0.01, tip: 'Gap between plates, as a share of a plate' },
|
|
29
|
+
{ key: 'smoothing', min: 0, max: 5, step: 0.1, tip: 'How much the brightness is smoothed before it shapes the plates' }, { key: 'roughness', min: 0, max: 1, step: 0.01 },
|
|
30
|
+
{ key: 'pointerMode', options: ['none', ...POINTER_MODES] }, ...BASE_GUI_TAIL,
|
|
31
|
+
{ key: 'plateColor', color: true },
|
|
32
|
+
];
|
|
33
|
+
export const PRESETS = [
|
|
34
|
+
{ name: 'Strata', description: 'The default.', patch: {} },
|
|
35
|
+
{ name: 'Fine cut', description: 'Many thin plates.', patch: { plates: 80, gap: 0.08, relief: 0.18 } },
|
|
36
|
+
{ name: 'Slabs', description: 'A few thick plates, deep.', patch: { plates: 12, gap: 0.18, relief: 0.32, smoothing: 3 } },
|
|
37
|
+
];
|
|
38
|
+
export function createUniforms() { return { ...baseUniforms(), uPlates: { value: 30 }, uRelief: { value: 0.22 }, uBase: { value: 0.1 }, uGap: { value: 0.12 }, uSmooth: { value: 2 }, uPlate: { value: new THREE.Color('#bdb7ad') } }; }
|
|
39
|
+
export function applyConfig(u, c) { const set = applyBase(u, c, POINTER_MODES); set('uRelief', c.relief); set('uBase', c.base); set('uGap', c.gap); set('uSmooth', c.smoothing); set('uPlate', c.plateColor); }
|
|
40
|
+
const vertex = {
|
|
41
|
+
head: /* glsl */ `
|
|
42
|
+
uniform float uPlates, uRelief, uBase, uGap, uSmooth;
|
|
43
|
+
varying vec2 vUv; varying float vImg; varying float vW; varying float vFront; varying float vAlpha;
|
|
44
|
+
float depthAt(float img, vec2 g, float act){
|
|
45
|
+
float L = lumOf(textureLod(uTex, vec3(g, img), uSmooth).rgb);
|
|
46
|
+
vec2 p = vec2((g.x - 0.5) * uW, (g.y - 0.5) * uH);
|
|
47
|
+
return 0.012 + uRelief * (uBase + (1.0 - uBase) * L) * waveAt(act, g) * (1.0 - 0.9 * maskAt(p));
|
|
48
|
+
}
|
|
49
|
+
`,
|
|
50
|
+
body: /* glsl */ `
|
|
51
|
+
float img = aI.x, j = aI.y; float act = actOf(img);
|
|
52
|
+
float yj = (j + 0.5) / uPlates, ph = uH / uPlates * (1.0 - uGap);
|
|
53
|
+
vec2 g = vec2(position.x + 0.5, yj);
|
|
54
|
+
float front = step(0.0, position.z);
|
|
55
|
+
float dz = depthAt(img, g, act);
|
|
56
|
+
float d = 1.0 / 160.0;
|
|
57
|
+
float dzx = (depthAt(img, g + vec2(d, 0.0), act) - dz) / (d * uW);
|
|
58
|
+
gPos = vec3(position.x * uW, (yj - 0.5) * uH + position.y * ph, front * dz);
|
|
59
|
+
// the front edge bends with the relief; the plate's top / bottom / sides keep their own normals
|
|
60
|
+
if (normal.z > 0.5) gNrm = normalize(vec3(-dzx, 0.0, 1.0));
|
|
61
|
+
vUv = vec2(g.x, yj + position.y * ph / uH); vImg = img; vW = waveAt(act, g); vFront = step(0.5, normal.z); vAlpha = fadeAt(img);
|
|
62
|
+
`,
|
|
63
|
+
};
|
|
64
|
+
const fragment = {
|
|
65
|
+
head: /* glsl */ `uniform vec3 uPlate; varying vec2 vUv; varying float vImg; varying float vW; varying float vFront; varying float vAlpha;`,
|
|
66
|
+
body: /* glsl */ `
|
|
67
|
+
vec3 pic = texture(uTex, vec3(vUv, vImg)).rgb;
|
|
68
|
+
vec3 face = mix(fadedOf(pic) * 1.7, pic, vW);
|
|
69
|
+
diffuseColor.rgb = mix(uPlate * mix(0.45, 0.8, vW), face, vFront) * uIntensity;
|
|
70
|
+
diffuseColor.a *= vAlpha * uOpacity; if (diffuseColor.a < 0.01) discard;
|
|
71
|
+
`,
|
|
72
|
+
};
|
|
73
|
+
export function build(u, c) { return withLean(buildGallery(u, c), c); }
|
|
74
|
+
function buildGallery(u, c) {
|
|
75
|
+
const W = c.width, H = W / c.aspect, R = Math.max(2, c.plates | 0);
|
|
76
|
+
u.uPlates.value = R;
|
|
77
|
+
const geo = instanced(new THREE.BoxGeometry(1, 1, 1, 96, 1, 1), R, () => [0, 0]);
|
|
78
|
+
const mat = litMaterial(u, 'strata', vertex, fragment, { roughness: c.roughness });
|
|
79
|
+
const mesh = new THREE.Mesh(geo, mat);
|
|
80
|
+
mesh.frustumCulled = false;
|
|
81
|
+
mesh.raycast = () => { };
|
|
82
|
+
mesh.receiveShadow = true;
|
|
83
|
+
const g = makeGallery(u, c, { W, H, meshes: [mesh], setCount: (n) => { geo.instanceCount = n * R; } });
|
|
84
|
+
const apply = g.apply;
|
|
85
|
+
g.apply = (k) => { apply(k); applyConfig(u, k); if (k.roughness !== undefined)
|
|
86
|
+
mat.roughness = k.roughness; };
|
|
87
|
+
return g;
|
|
88
|
+
}
|
|
@@ -0,0 +1,168 @@
|
|
|
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
|
+
resolution: number;
|
|
17
|
+
levels: number;
|
|
18
|
+
relief: number;
|
|
19
|
+
sharpness: number;
|
|
20
|
+
smoothing: number;
|
|
21
|
+
edges: number;
|
|
22
|
+
roughness: number;
|
|
23
|
+
changeTime: number;
|
|
24
|
+
dim: number;
|
|
25
|
+
pointerMode: string;
|
|
26
|
+
pointerRadius: number;
|
|
27
|
+
lift: number;
|
|
28
|
+
enabled: boolean;
|
|
29
|
+
lean: number;
|
|
30
|
+
imageUrls: any[];
|
|
31
|
+
autoplay: number;
|
|
32
|
+
intensity: number;
|
|
33
|
+
opacity: number;
|
|
34
|
+
layout: string;
|
|
35
|
+
spacing: number;
|
|
36
|
+
depth: number;
|
|
37
|
+
visible: number;
|
|
38
|
+
shape: number;
|
|
39
|
+
stiffness: number;
|
|
40
|
+
damping: number;
|
|
41
|
+
throwing: number;
|
|
42
|
+
wave: number;
|
|
43
|
+
slant: number;
|
|
44
|
+
pointerStrength: number;
|
|
45
|
+
};
|
|
46
|
+
export declare const STRUCTURAL: string[];
|
|
47
|
+
export declare const POINTER_MODES: string[];
|
|
48
|
+
export declare const GUI: ({
|
|
49
|
+
key: string;
|
|
50
|
+
options: string[];
|
|
51
|
+
tip: string;
|
|
52
|
+
min?: undefined;
|
|
53
|
+
max?: undefined;
|
|
54
|
+
step?: undefined;
|
|
55
|
+
} | {
|
|
56
|
+
key: string;
|
|
57
|
+
min: number;
|
|
58
|
+
max: number;
|
|
59
|
+
step: number;
|
|
60
|
+
} | {
|
|
61
|
+
key: string;
|
|
62
|
+
options: string[];
|
|
63
|
+
})[];
|
|
64
|
+
export declare const PRESETS: ({
|
|
65
|
+
name: string;
|
|
66
|
+
description: string;
|
|
67
|
+
patch: {
|
|
68
|
+
levels?: undefined;
|
|
69
|
+
relief?: undefined;
|
|
70
|
+
edges?: undefined;
|
|
71
|
+
smoothing?: undefined;
|
|
72
|
+
};
|
|
73
|
+
} | {
|
|
74
|
+
name: string;
|
|
75
|
+
description: string;
|
|
76
|
+
patch: {
|
|
77
|
+
levels: number;
|
|
78
|
+
relief: number;
|
|
79
|
+
edges: number;
|
|
80
|
+
smoothing?: undefined;
|
|
81
|
+
};
|
|
82
|
+
} | {
|
|
83
|
+
name: string;
|
|
84
|
+
description: string;
|
|
85
|
+
patch: {
|
|
86
|
+
levels: number;
|
|
87
|
+
relief: number;
|
|
88
|
+
smoothing: number;
|
|
89
|
+
edges?: undefined;
|
|
90
|
+
};
|
|
91
|
+
})[];
|
|
92
|
+
export declare function createUniforms(): {
|
|
93
|
+
uLevels: {
|
|
94
|
+
value: number;
|
|
95
|
+
};
|
|
96
|
+
uRelief: {
|
|
97
|
+
value: number;
|
|
98
|
+
};
|
|
99
|
+
uSharp: {
|
|
100
|
+
value: number;
|
|
101
|
+
};
|
|
102
|
+
uSmooth: {
|
|
103
|
+
value: number;
|
|
104
|
+
};
|
|
105
|
+
uEdges: {
|
|
106
|
+
value: number;
|
|
107
|
+
};
|
|
108
|
+
uLift: {
|
|
109
|
+
value: number;
|
|
110
|
+
};
|
|
111
|
+
uTex: {
|
|
112
|
+
value: any;
|
|
113
|
+
};
|
|
114
|
+
uS: {
|
|
115
|
+
value: number;
|
|
116
|
+
};
|
|
117
|
+
uCount: {
|
|
118
|
+
value: number;
|
|
119
|
+
};
|
|
120
|
+
uTime: {
|
|
121
|
+
value: number;
|
|
122
|
+
};
|
|
123
|
+
uAct: {
|
|
124
|
+
value: Float32Array<ArrayBuffer>;
|
|
125
|
+
};
|
|
126
|
+
uW: {
|
|
127
|
+
value: number;
|
|
128
|
+
};
|
|
129
|
+
uH: {
|
|
130
|
+
value: number;
|
|
131
|
+
};
|
|
132
|
+
uWave: {
|
|
133
|
+
value: number;
|
|
134
|
+
};
|
|
135
|
+
uSlant: {
|
|
136
|
+
value: number;
|
|
137
|
+
};
|
|
138
|
+
uDim: {
|
|
139
|
+
value: number;
|
|
140
|
+
};
|
|
141
|
+
uIntensity: {
|
|
142
|
+
value: number;
|
|
143
|
+
};
|
|
144
|
+
uOpacity: {
|
|
145
|
+
value: number;
|
|
146
|
+
};
|
|
147
|
+
uPointer: {
|
|
148
|
+
value: THREE.Vector3;
|
|
149
|
+
};
|
|
150
|
+
uPointerActive: {
|
|
151
|
+
value: number;
|
|
152
|
+
};
|
|
153
|
+
uPointerMode: {
|
|
154
|
+
value: number;
|
|
155
|
+
};
|
|
156
|
+
uPointerStrength: {
|
|
157
|
+
value: number;
|
|
158
|
+
};
|
|
159
|
+
uPointerRadius: {
|
|
160
|
+
value: number;
|
|
161
|
+
};
|
|
162
|
+
uPlace: {
|
|
163
|
+
value: THREE.Matrix4[];
|
|
164
|
+
};
|
|
165
|
+
};
|
|
166
|
+
export declare function applyConfig(u: any, c: any): void;
|
|
167
|
+
export declare function build(u: any, c: any): any;
|
|
168
|
+
//# sourceMappingURL=terraces.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"terraces.d.ts","sourceRoot":"","sources":["../../../../src/components/gallery/looks/terraces.ts"],"names":[],"mappings":"AASA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,eAAO,MAAM,OAAO;;;;;;;;;CAEkE,CAAC;AAEvF,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIpB,CAAC;AACF,eAAO,MAAM,UAAU,UAAiD,CAAC;AACzE,eAAO,MAAM,aAAa,UAAW,CAAC;AACtC,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;IAQf,CAAC;AACF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;IAInB,CAAC;AACF,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAsL;AACpN,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,QAA4M;AAyC5O,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,OAA6C"}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
// The approved lab module, verbatim but for its import paths and the lab's picture loader (Claude outputs/gallery-lab/
|
|
2
|
+
// terraces.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.terraces) do not carry; its own autoplay is never used.
|
|
4
|
+
// terraces — every picture is a topographic model made of stacked card: its brightness, softened, is cut into
|
|
5
|
+
// `levels` flat plateaus (a stepped quantisation with crisp walls), and each plateau stands that many card
|
|
6
|
+
// thicknesses high. Lit by the scene, so the walls catch the light and the plateaus read as card. An inactive picture
|
|
7
|
+
// is flat: a grey contour map of its own levels. When it becomes the active one a soft wave crosses it and the
|
|
8
|
+
// terraces rise behind it in full colour; leaving lays them down again. The cursor lifts the terraces near it
|
|
9
|
+
// further. Scene-lit (standard material): the studio's lights draw the steps; the gallery adds none.
|
|
10
|
+
import * as THREE from 'three';
|
|
11
|
+
import { BASE_DEFAULTS, BASE_GUI_MOTION, BASE_GUI_TAIL, LAYOUT_GUI, baseUniforms, applyBase, instanced, litMaterial, makeGallery, withLean } from '../kit/lookBase.js';
|
|
12
|
+
export const catalog = { key: 'terraces', name: 'Terraces', camera: { position: [1.4, 0.9, 4.2], target: [0, -0.05, 0] },
|
|
13
|
+
description: 'Pictures as topographic models of stacked card lit by the scene: inactive ones are a flat grey contour map, the active one rises into terraces of its own brightness in full colour behind a soft wave; the cursor lifts the terraces higher. Use for architecture, maps, data and craft showcases.',
|
|
14
|
+
tags: ['gallery', 'terraces', 'topographic', 'card', 'scene-lit', 'interactive'] };
|
|
15
|
+
export const DEFAULTS = {
|
|
16
|
+
...BASE_DEFAULTS, type: 'terraces', aspect: 1.4, width: 2.2, resolution: 150, // structural
|
|
17
|
+
levels: 9, relief: 0.2, sharpness: 0.85, smoothing: 2.4, edges: 0.5, roughness: 0.8, changeTime: 2.2, dim: 0.5,
|
|
18
|
+
pointerMode: 'lift', pointerRadius: 0.5, lift: 0.12,
|
|
19
|
+
};
|
|
20
|
+
export const STRUCTURAL = ['imageUrls', 'aspect', 'width', 'resolution'];
|
|
21
|
+
export const POINTER_MODES = ['lift'];
|
|
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 }, { key: 'resolution', min: 40, max: 260, step: 2, tip: 'Grid resolution across a picture' },
|
|
25
|
+
...LAYOUT_GUI, ...BASE_GUI_MOTION,
|
|
26
|
+
{ key: 'levels', min: 2, max: 24, step: 1, tip: 'Number of terraces' }, { key: 'relief', min: 0, max: 0.6, step: 0.005, tip: 'Height of the top terrace' },
|
|
27
|
+
{ key: 'sharpness', min: 0, max: 1, step: 0.01, tip: 'How crisp the terrace walls are' }, { key: 'smoothing', min: 0, max: 5, step: 0.1, tip: 'How much the brightness is smoothed before it is cut into terraces' },
|
|
28
|
+
{ key: 'edges', min: 0, max: 1.5, step: 0.01, tip: 'Brightness of the thin card edge along each terrace' }, { key: 'roughness', min: 0, max: 1, step: 0.01 },
|
|
29
|
+
{ key: 'pointerMode', options: ['none', ...POINTER_MODES] }, ...BASE_GUI_TAIL, { key: 'lift', min: 0, max: 0.4, step: 0.005, tip: 'How far the cursor lifts the terraces' },
|
|
30
|
+
];
|
|
31
|
+
export const PRESETS = [
|
|
32
|
+
{ name: 'Terraces', description: 'The default.', patch: {} },
|
|
33
|
+
{ name: 'Survey model', description: 'Many thin card layers.', patch: { levels: 18, relief: 0.24, edges: 0.7 } },
|
|
34
|
+
{ name: 'Plateaus', description: 'A few broad, high steps.', patch: { levels: 4, relief: 0.3, smoothing: 3.4 } },
|
|
35
|
+
];
|
|
36
|
+
export function createUniforms() { return { ...baseUniforms(), uLevels: { value: 9 }, uRelief: { value: 0.2 }, uSharp: { value: 0.85 }, uSmooth: { value: 2.4 }, uEdges: { value: 0.5 }, uLift: { value: 0.12 } }; }
|
|
37
|
+
export function applyConfig(u, c) { const set = applyBase(u, c, POINTER_MODES); set('uLevels', c.levels); set('uRelief', c.relief); set('uSharp', c.sharpness); set('uSmooth', c.smoothing); set('uEdges', c.edges); set('uLift', c.lift); }
|
|
38
|
+
const vertex = {
|
|
39
|
+
head: /* glsl */ `
|
|
40
|
+
uniform float uLevels, uRelief, uSharp, uSmooth, uLift;
|
|
41
|
+
varying vec2 vUv; varying float vImg; varying float vW; varying float vAlpha;
|
|
42
|
+
float stepAt(float L){ // the level, with walls of width (1 - sharpness)
|
|
43
|
+
float x = L * uLevels, k = 0.5 * (1.0 - uSharp) + 0.02;
|
|
44
|
+
return (floor(x) + smoothstep(0.5 - k, 0.5 + k, fract(x))) / uLevels;
|
|
45
|
+
}
|
|
46
|
+
float heightAt(float img, vec2 g, float act){
|
|
47
|
+
float L = lumOf(textureLod(uTex, vec3(g, img), uSmooth).rgb);
|
|
48
|
+
vec2 p = vec2((g.x - 0.5) * uW, (g.y - 0.5) * uH);
|
|
49
|
+
float w = waveAt(act, g);
|
|
50
|
+
return stepAt(L) * w * (uRelief + uLift * maskAt(p));
|
|
51
|
+
}
|
|
52
|
+
`,
|
|
53
|
+
body: /* glsl */ `
|
|
54
|
+
float img = aI.x; float act = actOf(img);
|
|
55
|
+
vec2 g = position.xy + 0.5;
|
|
56
|
+
float h = heightAt(img, g, act);
|
|
57
|
+
float d = 1.0 / 220.0;
|
|
58
|
+
float hx = heightAt(img, g + vec2(d, 0.0), act), hy = heightAt(img, g + vec2(0.0, d), act);
|
|
59
|
+
gPos = vec3(position.x * uW, position.y * uH, h);
|
|
60
|
+
gNrm = normalize(vec3(-(hx - h) / (d * uW), -(hy - h) / (d * uH), 1.0));
|
|
61
|
+
vUv = g; vImg = img; vW = waveAt(act, g); vAlpha = fadeAt(img);
|
|
62
|
+
`,
|
|
63
|
+
};
|
|
64
|
+
const fragment = {
|
|
65
|
+
head: /* glsl */ `uniform float uLevels, uSmooth, uEdges; varying vec2 vUv; varying float vImg; varying float vW; varying float vAlpha;`,
|
|
66
|
+
body: /* glsl */ `
|
|
67
|
+
vec3 pic = texture(uTex, vec3(vUv, vImg)).rgb;
|
|
68
|
+
float L = lumOf(textureLod(uTex, vec3(vUv, vImg), uSmooth).rgb);
|
|
69
|
+
float f = L * uLevels, dist = abs(f - floor(f + 0.5)), px = max(fwidth(f), 1e-4);
|
|
70
|
+
float edge = 1.0 - smoothstep(0.0, px * 1.6, dist); // the thin card edge on every level line
|
|
71
|
+
vec3 c = mix(fadedOf(pic), pic, vW);
|
|
72
|
+
c += vec3(1.0) * edge * mix(0.35, uEdges * 0.4, vW);
|
|
73
|
+
diffuseColor.rgb = c * uIntensity;
|
|
74
|
+
diffuseColor.a *= vAlpha * uOpacity; if (diffuseColor.a < 0.01) discard;
|
|
75
|
+
`,
|
|
76
|
+
};
|
|
77
|
+
export function build(u, c) { return withLean(buildGallery(u, c), c); }
|
|
78
|
+
function buildGallery(u, c) {
|
|
79
|
+
const W = c.width, H = W / c.aspect, sx = Math.max(16, c.resolution | 0), sy = Math.max(12, Math.round(sx / c.aspect));
|
|
80
|
+
const geo = instanced(new THREE.PlaneGeometry(1, 1, sx, sy), 1, () => [0, 0]);
|
|
81
|
+
const mat = litMaterial(u, 'terraces', vertex, fragment, { roughness: c.roughness });
|
|
82
|
+
const mesh = new THREE.Mesh(geo, mat);
|
|
83
|
+
mesh.frustumCulled = false;
|
|
84
|
+
mesh.raycast = () => { };
|
|
85
|
+
mesh.receiveShadow = true;
|
|
86
|
+
const g = makeGallery(u, c, { W, H, meshes: [mesh], setCount: (n) => { geo.instanceCount = n; } });
|
|
87
|
+
const apply = g.apply;
|
|
88
|
+
g.apply = (k) => { apply(k); applyConfig(u, k); if (k.roughness !== undefined)
|
|
89
|
+
mat.roughness = k.roughness; };
|
|
90
|
+
return g;
|
|
91
|
+
}
|
|
@@ -0,0 +1,153 @@
|
|
|
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
|
+
cells: number;
|
|
17
|
+
relief: number;
|
|
18
|
+
wire: number;
|
|
19
|
+
wireColor: string;
|
|
20
|
+
changeTime: number;
|
|
21
|
+
dim: number;
|
|
22
|
+
pointerMode: string;
|
|
23
|
+
pointerRadius: number;
|
|
24
|
+
lift: number;
|
|
25
|
+
enabled: boolean;
|
|
26
|
+
lean: number;
|
|
27
|
+
imageUrls: any[];
|
|
28
|
+
autoplay: number;
|
|
29
|
+
intensity: number;
|
|
30
|
+
opacity: number;
|
|
31
|
+
layout: string;
|
|
32
|
+
spacing: number;
|
|
33
|
+
depth: number;
|
|
34
|
+
visible: number;
|
|
35
|
+
shape: number;
|
|
36
|
+
stiffness: number;
|
|
37
|
+
damping: number;
|
|
38
|
+
throwing: number;
|
|
39
|
+
wave: number;
|
|
40
|
+
slant: number;
|
|
41
|
+
pointerStrength: number;
|
|
42
|
+
};
|
|
43
|
+
export declare const STRUCTURAL: string[];
|
|
44
|
+
export declare const POINTER_MODES: string[];
|
|
45
|
+
export declare const GUI: ({
|
|
46
|
+
key: string;
|
|
47
|
+
options: string[];
|
|
48
|
+
tip: string;
|
|
49
|
+
min?: undefined;
|
|
50
|
+
max?: undefined;
|
|
51
|
+
step?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
key: string;
|
|
54
|
+
min: number;
|
|
55
|
+
max: number;
|
|
56
|
+
step: number;
|
|
57
|
+
} | {
|
|
58
|
+
key: string;
|
|
59
|
+
options: string[];
|
|
60
|
+
color?: undefined;
|
|
61
|
+
} | {
|
|
62
|
+
key: string;
|
|
63
|
+
color: boolean;
|
|
64
|
+
options?: undefined;
|
|
65
|
+
})[];
|
|
66
|
+
export declare const PRESETS: ({
|
|
67
|
+
name: string;
|
|
68
|
+
description: string;
|
|
69
|
+
patch: {
|
|
70
|
+
cells?: undefined;
|
|
71
|
+
relief?: undefined;
|
|
72
|
+
wire?: undefined;
|
|
73
|
+
};
|
|
74
|
+
} | {
|
|
75
|
+
name: string;
|
|
76
|
+
description: string;
|
|
77
|
+
patch: {
|
|
78
|
+
cells: number;
|
|
79
|
+
relief: number;
|
|
80
|
+
wire: number;
|
|
81
|
+
};
|
|
82
|
+
})[];
|
|
83
|
+
export declare function createUniforms(): {
|
|
84
|
+
uRelief: {
|
|
85
|
+
value: number;
|
|
86
|
+
};
|
|
87
|
+
uWire: {
|
|
88
|
+
value: number;
|
|
89
|
+
};
|
|
90
|
+
uLift: {
|
|
91
|
+
value: number;
|
|
92
|
+
};
|
|
93
|
+
uWireColor: {
|
|
94
|
+
value: THREE.Color;
|
|
95
|
+
};
|
|
96
|
+
uTex: {
|
|
97
|
+
value: any;
|
|
98
|
+
};
|
|
99
|
+
uS: {
|
|
100
|
+
value: number;
|
|
101
|
+
};
|
|
102
|
+
uCount: {
|
|
103
|
+
value: number;
|
|
104
|
+
};
|
|
105
|
+
uTime: {
|
|
106
|
+
value: number;
|
|
107
|
+
};
|
|
108
|
+
uAct: {
|
|
109
|
+
value: Float32Array<ArrayBuffer>;
|
|
110
|
+
};
|
|
111
|
+
uW: {
|
|
112
|
+
value: number;
|
|
113
|
+
};
|
|
114
|
+
uH: {
|
|
115
|
+
value: number;
|
|
116
|
+
};
|
|
117
|
+
uWave: {
|
|
118
|
+
value: number;
|
|
119
|
+
};
|
|
120
|
+
uSlant: {
|
|
121
|
+
value: number;
|
|
122
|
+
};
|
|
123
|
+
uDim: {
|
|
124
|
+
value: number;
|
|
125
|
+
};
|
|
126
|
+
uIntensity: {
|
|
127
|
+
value: number;
|
|
128
|
+
};
|
|
129
|
+
uOpacity: {
|
|
130
|
+
value: number;
|
|
131
|
+
};
|
|
132
|
+
uPointer: {
|
|
133
|
+
value: THREE.Vector3;
|
|
134
|
+
};
|
|
135
|
+
uPointerActive: {
|
|
136
|
+
value: number;
|
|
137
|
+
};
|
|
138
|
+
uPointerMode: {
|
|
139
|
+
value: number;
|
|
140
|
+
};
|
|
141
|
+
uPointerStrength: {
|
|
142
|
+
value: number;
|
|
143
|
+
};
|
|
144
|
+
uPointerRadius: {
|
|
145
|
+
value: number;
|
|
146
|
+
};
|
|
147
|
+
uPlace: {
|
|
148
|
+
value: THREE.Matrix4[];
|
|
149
|
+
};
|
|
150
|
+
};
|
|
151
|
+
export declare function applyConfig(u: any, c: any): void;
|
|
152
|
+
export declare function build(u: any, c: any): any;
|
|
153
|
+
//# sourceMappingURL=wireRelief.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wireRelief.d.ts","sourceRoot":"","sources":["../../../../src/components/gallery/looks/wireRelief.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,eAAO,MAAM,OAAO;;;;;;;;;CAEyD,CAAC;AAE9E,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAIpB,CAAC;AACF,eAAO,MAAM,UAAU,UAA4C,CAAC;AACpE,eAAO,MAAM,aAAa,UAAa,CAAC;AACxC,eAAO,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;IAOf,CAAC;AACF,eAAO,MAAM,OAAO;;;;;;;;;;;;;;;;IAInB,CAAC;AACF,wBAAgB,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAAiK;AAC/L,wBAAgB,WAAW,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,QAAuJ;AAkEvL,wBAAgB,KAAK,CAAC,CAAC,KAAA,EAAE,CAAC,KAAA,OAA6C"}
|