@3driseai/3drise-viewer 0.1.29 → 0.1.31
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/ClipPlayer.d.ts.map +1 -1
- package/dist/animationsV2/ClipPlayer.js +14 -12
- package/dist/animationsV2/ClipsRuntime.d.ts +13 -0
- package/dist/animationsV2/ClipsRuntime.d.ts.map +1 -1
- package/dist/animationsV2/ClipsRuntime.js +115 -4
- package/dist/animationsV2/appliers.d.ts.map +1 -1
- package/dist/animationsV2/appliers.js +21 -2
- package/dist/animationsV2/clipUtils.d.ts.map +1 -1
- package/dist/animationsV2/clipUtils.js +5 -1
- package/dist/animationsV2/sequenceUtils.d.ts +5 -0
- package/dist/animationsV2/sequenceUtils.d.ts.map +1 -1
- package/dist/animationsV2/sequenceUtils.js +14 -5
- package/dist/animationsV2/sunSystemLive.d.ts +12 -0
- package/dist/animationsV2/sunSystemLive.d.ts.map +1 -0
- package/dist/animationsV2/sunSystemLive.js +8 -0
- package/dist/animationsV2/types.d.ts +6 -0
- package/dist/animationsV2/types.d.ts.map +1 -1
- package/dist/api/sceneHandle.d.ts +3 -1
- package/dist/api/sceneHandle.d.ts.map +1 -1
- package/dist/api/sceneHandle.js +2 -2
- package/dist/components/AdaptiveResolution.d.ts +9 -0
- package/dist/components/AdaptiveResolution.d.ts.map +1 -0
- package/dist/components/AdaptiveResolution.js +61 -0
- package/dist/components/CameraController.d.ts.map +1 -1
- package/dist/components/CameraController.js +24 -7
- package/dist/components/EffectsGenerator.d.ts.map +1 -1
- package/dist/components/EffectsGenerator.js +43 -38
- package/dist/components/GeometryShape.d.ts.map +1 -1
- package/dist/components/GeometryShape.js +22 -2
- package/dist/components/MoonDisc.d.ts.map +1 -1
- package/dist/components/MoonDisc.js +2 -1
- package/dist/components/ObjectNode.d.ts.map +1 -1
- package/dist/components/ObjectNode.js +6 -17
- package/dist/components/OceanBuilder.d.ts +4 -1
- package/dist/components/OceanBuilder.d.ts.map +1 -1
- package/dist/components/OceanBuilder.js +2 -1
- package/dist/components/ParticlesGenerator.d.ts.map +1 -1
- package/dist/components/ParticlesGenerator.js +46 -24
- package/dist/components/PickVolume.d.ts +17 -0
- package/dist/components/PickVolume.d.ts.map +1 -0
- package/dist/components/PickVolume.js +20 -0
- package/dist/components/SceneBuilder.d.ts.map +1 -1
- package/dist/components/SceneBuilder.js +5 -2
- package/dist/components/SkyStars.d.ts.map +1 -1
- package/dist/components/SkyStars.js +83 -2
- package/dist/components/Skybox.d.ts.map +1 -1
- package/dist/components/Skybox.js +2 -1
- package/dist/components/SunLight.d.ts.map +1 -1
- package/dist/components/SunLight.js +3 -2
- package/dist/components/TextGenerator.d.ts.map +1 -1
- package/dist/components/TextGenerator.js +3 -2
- package/dist/components/index.d.ts +2 -8
- package/dist/components/index.d.ts.map +1 -1
- package/dist/components/index.js +2 -4
- package/dist/components/lightBulb/LightBulb.d.ts.map +1 -1
- package/dist/components/lightBulb/LightBulb.js +7 -2
- package/dist/components/particles/BioluminescentWakeParticles.d.ts +5 -0
- package/dist/components/particles/BioluminescentWakeParticles.d.ts.map +1 -1
- package/dist/components/particles/BioluminescentWakeParticles.js +2 -1
- package/dist/components/particles/BrownianDustParticles.d.ts +5 -0
- package/dist/components/particles/BrownianDustParticles.d.ts.map +1 -1
- package/dist/components/particles/BrownianDustParticles.js +2 -0
- package/dist/components/particles/ChladniSandParticles.d.ts +5 -0
- package/dist/components/particles/ChladniSandParticles.d.ts.map +1 -1
- package/dist/components/particles/ChladniSandParticles.js +2 -1
- package/dist/components/particles/ElectronOrbitalsParticles.d.ts +5 -0
- package/dist/components/particles/ElectronOrbitalsParticles.d.ts.map +1 -1
- package/dist/components/particles/ElectronOrbitalsParticles.js +2 -1
- package/dist/components/particles/FaradayPowderParticles.d.ts +5 -0
- package/dist/components/particles/FaradayPowderParticles.d.ts.map +1 -1
- package/dist/components/particles/FaradayPowderParticles.js +2 -1
- package/dist/components/particles/FireworksParticles.d.ts +22 -0
- package/dist/components/particles/FireworksParticles.d.ts.map +1 -0
- package/dist/components/particles/FireworksParticles.js +1649 -0
- package/dist/components/particles/GrinderSparksParticles.d.ts +5 -0
- package/dist/components/particles/GrinderSparksParticles.d.ts.map +1 -1
- package/dist/components/particles/GrinderSparksParticles.js +2 -1
- package/dist/components/particles/MagneticBottleParticles.d.ts +5 -0
- package/dist/components/particles/MagneticBottleParticles.d.ts.map +1 -1
- package/dist/components/particles/MagneticBottleParticles.js +2 -1
- package/dist/components/particles/NeonRainParticles.d.ts +5 -0
- package/dist/components/particles/NeonRainParticles.d.ts.map +1 -1
- package/dist/components/particles/NeonRainParticles.js +2 -1
- package/dist/components/particles/ShapeBurstParticles.d.ts +5 -0
- package/dist/components/particles/ShapeBurstParticles.d.ts.map +1 -1
- package/dist/components/particles/ShapeBurstParticles.js +2 -1
- package/dist/components/particles/ShapeFlowParticles.d.ts +5 -0
- package/dist/components/particles/ShapeFlowParticles.d.ts.map +1 -1
- package/dist/components/particles/ShapeFlowParticles.js +2 -1
- package/dist/components/particles/TidalStreamParticles.d.ts +5 -0
- package/dist/components/particles/TidalStreamParticles.d.ts.map +1 -1
- package/dist/components/particles/TidalStreamParticles.js +2 -0
- package/dist/components/particles/index.d.ts +2 -0
- package/dist/components/particles/index.d.ts.map +1 -1
- package/dist/components/particles/index.js +1 -0
- package/dist/components/terrain/TerrainSurface.d.ts.map +1 -1
- package/dist/components/terrain/TerrainSurface.js +26 -4
- package/dist/components/text/PlainText.d.ts +15 -0
- package/dist/components/text/PlainText.d.ts.map +1 -0
- package/dist/components/text/PlainText.js +4 -0
- package/dist/components/text/TextObjectView.d.ts +3 -1
- package/dist/components/text/TextObjectView.d.ts.map +1 -1
- package/dist/components/text/TextObjectView.js +9 -3
- package/dist/components/text/engine/looks/index.d.ts.map +1 -1
- package/dist/components/text/engine/looks/index.js +2 -1
- package/dist/components/text/engine/looks/plain.d.ts +146 -0
- package/dist/components/text/engine/looks/plain.d.ts.map +1 -0
- package/dist/components/text/engine/looks/plain.js +104 -0
- package/dist/components/text/fonts/bebas-neue.outline.d.ts +3 -0
- package/dist/components/text/fonts/bebas-neue.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/bebas-neue.outline.js +4 -0
- package/dist/components/text/fonts/bebas-neue.strokes.d.ts +3 -0
- package/dist/components/text/fonts/bebas-neue.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/bebas-neue.strokes.js +4 -0
- package/dist/components/text/fonts/index.d.ts +1 -1
- package/dist/components/text/fonts/index.d.ts.map +1 -1
- package/dist/components/text/fonts/index.js +15 -1
- package/dist/components/text/fonts/inter.outline.d.ts +3 -0
- package/dist/components/text/fonts/inter.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/inter.outline.js +4 -0
- package/dist/components/text/fonts/inter.strokes.d.ts +3 -0
- package/dist/components/text/fonts/inter.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/inter.strokes.js +4 -0
- package/dist/components/text/fonts/lora.outline.d.ts +3 -0
- package/dist/components/text/fonts/lora.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/lora.outline.js +4 -0
- package/dist/components/text/fonts/lora.strokes.d.ts +3 -0
- package/dist/components/text/fonts/lora.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/lora.strokes.js +4 -0
- package/dist/components/text/fonts/montserrat.outline.d.ts +3 -0
- package/dist/components/text/fonts/montserrat.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/montserrat.outline.js +4 -0
- package/dist/components/text/fonts/montserrat.strokes.d.ts +3 -0
- package/dist/components/text/fonts/montserrat.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/montserrat.strokes.js +4 -0
- package/dist/components/text/fonts/oswald.outline.d.ts +3 -0
- package/dist/components/text/fonts/oswald.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/oswald.outline.js +4 -0
- package/dist/components/text/fonts/oswald.strokes.d.ts +3 -0
- package/dist/components/text/fonts/oswald.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/oswald.strokes.js +4 -0
- package/dist/components/text/fonts/playfair-display.outline.d.ts +3 -0
- package/dist/components/text/fonts/playfair-display.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/playfair-display.outline.js +4 -0
- package/dist/components/text/fonts/playfair-display.strokes.d.ts +3 -0
- package/dist/components/text/fonts/playfair-display.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/playfair-display.strokes.js +4 -0
- package/dist/components/text/fonts/roboto.outline.d.ts +3 -0
- package/dist/components/text/fonts/roboto.outline.d.ts.map +1 -0
- package/dist/components/text/fonts/roboto.outline.js +4 -0
- package/dist/components/text/fonts/roboto.strokes.d.ts +3 -0
- package/dist/components/text/fonts/roboto.strokes.d.ts.map +1 -0
- package/dist/components/text/fonts/roboto.strokes.js +4 -0
- package/dist/components/text/index.d.ts +2 -0
- package/dist/components/text/index.d.ts.map +1 -1
- package/dist/components/text/index.js +1 -0
- package/dist/components/text/useTextObject.d.ts +1 -0
- package/dist/components/text/useTextObject.d.ts.map +1 -1
- package/dist/components/text/useTextObject.js +23 -11
- package/dist/components/water/OceanSurface.d.ts.map +1 -1
- package/dist/components/water/OceanSurface.js +5 -1
- package/dist/components/water/types.d.ts +3 -1
- package/dist/components/water/types.d.ts.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -1
- package/dist/hooks/useOceanMaterial.d.ts +6 -2
- package/dist/hooks/useOceanMaterial.d.ts.map +1 -1
- package/dist/hooks/useOceanMaterial.js +22 -2
- package/dist/hooks/useOrbitTargetFollow.d.ts +10 -0
- package/dist/hooks/useOrbitTargetFollow.d.ts.map +1 -0
- package/dist/hooks/useOrbitTargetFollow.js +194 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -1
- package/dist/operations/catalogue/flock.d.ts.map +1 -1
- package/dist/operations/catalogue/flock.js +44 -9
- package/dist/operations/catalogue/inkBloom.d.ts.map +1 -1
- package/dist/operations/catalogue/inkBloom.js +46 -9
- package/dist/operations/catalogue/liquidMetal.d.ts.map +1 -1
- package/dist/operations/catalogue/liquidMetal.js +41 -12
- package/dist/operations/catalogue/particleSwarm.d.ts.map +1 -1
- package/dist/operations/catalogue/particleSwarm.js +29 -9
- package/dist/operations/catalogue/petalPeel.d.ts.map +1 -1
- package/dist/operations/catalogue/petalPeel.js +33 -9
- package/dist/operations/catalogue/portal.d.ts.map +1 -1
- package/dist/operations/catalogue/portal.js +33 -11
- package/dist/operations/catalogue/sandErosion.d.ts.map +1 -1
- package/dist/operations/catalogue/sandErosion.js +36 -14
- package/dist/operations/catalogue/teleport.d.ts.map +1 -1
- package/dist/operations/catalogue/teleport.js +43 -12
- package/dist/operations/catalogue/unweave.d.ts.map +1 -1
- package/dist/operations/catalogue/unweave.js +34 -15
- package/dist/operations/catalogue/voxelize.d.ts.map +1 -1
- package/dist/operations/catalogue/voxelize.js +37 -10
- package/dist/shaders/glsl/terrainCore.glsl.d.ts +18 -3
- package/dist/shaders/glsl/terrainCore.glsl.d.ts.map +1 -1
- package/dist/shaders/glsl/terrainCore.glsl.js +42 -21
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts +36 -11
- package/dist/shaders/ocean/OceanSurfaceMaterial.d.ts.map +1 -1
- package/dist/shaders/ocean/OceanSurfaceMaterial.js +96 -5
- package/dist/triggers/engine.d.ts +1 -1
- package/dist/triggers/engine.d.ts.map +1 -1
- package/dist/triggers/engine.js +3 -0
- package/dist/triggers/hosts/actions.d.ts.map +1 -1
- package/dist/triggers/hosts/actions.js +3 -1
- package/dist/triggers/hosts/interactions.d.ts.map +1 -1
- package/dist/triggers/hosts/interactions.js +1 -1
- package/dist/triggers/hosts/timelineCues.js +1 -1
- package/dist/triggers/kinds/change.d.ts +4 -0
- package/dist/triggers/kinds/change.d.ts.map +1 -0
- package/dist/triggers/kinds/change.js +50 -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/utils/CameraSingleton.d.ts +4 -0
- package/dist/utils/CameraSingleton.d.ts.map +1 -1
- package/dist/utils/CameraSingleton.js +4 -0
- package/dist/utils/deviceTier.d.ts +2 -0
- package/dist/utils/deviceTier.d.ts.map +1 -0
- package/dist/utils/deviceTier.js +16 -0
- package/dist/utils/environmentDrawOrder.d.ts +23 -0
- package/dist/utils/environmentDrawOrder.d.ts.map +1 -0
- package/dist/utils/environmentDrawOrder.js +22 -0
- package/dist/utils/pickProxy.d.ts +11 -0
- package/dist/utils/pickProxy.d.ts.map +1 -0
- package/dist/utils/pickProxy.js +36 -0
- package/dist/utils/shapes.d.ts +4 -0
- package/dist/utils/shapes.d.ts.map +1 -1
- package/dist/utils/shapes.js +4 -1
- package/dist/utils/terrainUniforms.d.ts +7 -0
- package/dist/utils/terrainUniforms.d.ts.map +1 -1
- package/dist/utils/terrainUniforms.js +15 -2
- package/dist/utils/textShape.d.ts +24 -0
- package/dist/utils/textShape.d.ts.map +1 -0
- package/dist/utils/textShape.js +102 -0
- package/package.json +2 -2
|
@@ -12,6 +12,11 @@ export interface GrinderSparksParticlesProps extends ObjectReadyProps {
|
|
|
12
12
|
/** Per-domain keyframes; the `particles` domain drives this object's config knobs. */
|
|
13
13
|
animations?: ObjectAnimations;
|
|
14
14
|
}
|
|
15
|
+
/** Selection / pick volume in sim units (× size): the off-screen culling sphere and the hover / click proxy. */
|
|
16
|
+
export declare const BOUNDS: {
|
|
17
|
+
center: number[];
|
|
18
|
+
radius: number;
|
|
19
|
+
};
|
|
15
20
|
declare const GrinderSparksParticles: React.FC<GrinderSparksParticlesProps>;
|
|
16
21
|
export default GrinderSparksParticles;
|
|
17
22
|
//# sourceMappingURL=GrinderSparksParticles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GrinderSparksParticles.d.ts","sourceRoot":"","sources":["../../../src/components/particles/GrinderSparksParticles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM7G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACjE,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,4BAA4B,CAAC;IACrC,sFAAsF;IACtF,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"GrinderSparksParticles.d.ts","sourceRoot":"","sources":["../../../src/components/particles/GrinderSparksParticles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,4BAA4B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM7G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,2BAA4B,SAAQ,gBAAgB;IACjE,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,4BAA4B,CAAC;IACrC,sFAAsF;IACtF,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;AA4ID,gHAAgH;AAChH,eAAO,MAAM,MAAM;;;CAA0C,CAAC;AAkhB9D,QAAA,MAAM,sBAAsB,EAAE,KAAK,CAAC,EAAE,CAAC,2BAA2B,CAqDjE,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -139,7 +139,8 @@ const TR_MODE = { streak: TR, comet: 0.03, echo: 0.04 }; // arcs and smoulder lo
|
|
|
139
139
|
// the editor's selection box and gizmo centre on the visible spray, not on the wheel.
|
|
140
140
|
const C0 = [-1.3, 0.95, 0]; // contact point at rest (m)
|
|
141
141
|
const SPRAY_MID = [-0.4, 0.6, 0];
|
|
142
|
-
|
|
142
|
+
/** Selection / pick volume in sim units (× size): the off-screen culling sphere and the hover / click proxy. */
|
|
143
|
+
export const BOUNDS = { center: [-0.2, 0.7, 0], radius: 2.3 };
|
|
143
144
|
const RHO_C = 7800 * 600; // steel density x heat capacity
|
|
144
145
|
const SIGMA = 5.67e-8, EPS = 0.8, T_AIR = 300;
|
|
145
146
|
const EL0 = -0.26; // rest elevation of the fan (rad)
|
|
@@ -12,6 +12,11 @@ export interface MagneticBottleParticlesProps extends ObjectReadyProps {
|
|
|
12
12
|
/** Per-domain keyframes; the `particles` domain drives this object's config knobs. */
|
|
13
13
|
animations?: ObjectAnimations;
|
|
14
14
|
}
|
|
15
|
+
/** Selection / pick volume in sim units (× size): the off-screen culling sphere and the hover / click proxy. */
|
|
16
|
+
export declare const BOUNDS: {
|
|
17
|
+
center: number[];
|
|
18
|
+
radius: number;
|
|
19
|
+
};
|
|
15
20
|
declare const MagneticBottleParticles: React.FC<MagneticBottleParticlesProps>;
|
|
16
21
|
export default MagneticBottleParticles;
|
|
17
22
|
//# sourceMappingURL=MagneticBottleParticles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MagneticBottleParticles.d.ts","sourceRoot":"","sources":["../../../src/components/particles/MagneticBottleParticles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAO9G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,4BAA6B,SAAQ,gBAAgB;IAClE,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,6BAA6B,CAAC;IACtC,sFAAsF;IACtF,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"MagneticBottleParticles.d.ts","sourceRoot":"","sources":["../../../src/components/particles/MagneticBottleParticles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,6BAA6B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAO9G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,4BAA6B,SAAQ,gBAAgB;IAClE,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,6BAA6B,CAAC;IACtC,sFAAsF;IACtF,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;AAmHD,gHAAgH;AAChH,eAAO,MAAM,MAAM;;;CAAsC,CAAC;AA0Z1D,QAAA,MAAM,uBAAuB,EAAE,KAAK,CAAC,EAAE,CAAC,4BAA4B,CAuDnE,CAAC;AAEF,eAAe,uBAAuB,CAAC"}
|
|
@@ -116,7 +116,8 @@ const H_STEP = 1 / 120;
|
|
|
116
116
|
const V0 = 0.9; // speed along the orbit (units / s) at speed 1
|
|
117
117
|
const TRAIL_LOOK = { streak: 0.25, comet: 1, echo: 1 };
|
|
118
118
|
const TRAIL_ALPHA = { streak: 1.6, comet: 2, echo: 3 };
|
|
119
|
-
|
|
119
|
+
/** Selection / pick volume in sim units (× size): the off-screen culling sphere and the hover / click proxy. */
|
|
120
|
+
export const BOUNDS = { center: [0, 0, 0], radius: 1.25 };
|
|
120
121
|
function createUniforms() {
|
|
121
122
|
return {
|
|
122
123
|
uTime: { value: 0 },
|
|
@@ -12,6 +12,11 @@ export interface NeonRainParticlesProps extends ObjectReadyProps {
|
|
|
12
12
|
/** Per-domain keyframes; the `particles` domain drives this object's config knobs. */
|
|
13
13
|
animations?: ObjectAnimations;
|
|
14
14
|
}
|
|
15
|
+
/** Selection / pick volume in sim units (× size): the off-screen culling sphere and the hover / click proxy. */
|
|
16
|
+
export declare const BOUNDS: {
|
|
17
|
+
center: number[];
|
|
18
|
+
radius: number;
|
|
19
|
+
};
|
|
15
20
|
declare const NeonRainParticles: React.FC<NeonRainParticlesProps>;
|
|
16
21
|
export default NeonRainParticles;
|
|
17
22
|
//# sourceMappingURL=NeonRainParticles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NeonRainParticles.d.ts","sourceRoot":"","sources":["../../../src/components/particles/NeonRainParticles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAMxG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC5D,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,uBAAuB,CAAC;IAChC,sFAAsF;IACtF,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"NeonRainParticles.d.ts","sourceRoot":"","sources":["../../../src/components/particles/NeonRainParticles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAMxG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,sBAAuB,SAAQ,gBAAgB;IAC5D,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,uBAAuB,CAAC;IAChC,sFAAsF;IACtF,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;AA4HD,gHAAgH;AAChH,eAAO,MAAM,MAAM;;;CAAsC,CAAC;AAqf1D,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAqDvD,CAAC;AAEF,eAAe,iBAAiB,CAAC"}
|
|
@@ -124,7 +124,8 @@ const H_STEP = 1 / 60;
|
|
|
124
124
|
const GRAV = 9.81;
|
|
125
125
|
const TR_MODE = { streak: 0.04, comet: 0.06, echo: 0.08 }; // physics seconds per trail unit
|
|
126
126
|
const TRAIL_GAIN = { streak: 3, comet: 3.5, echo: 4.5 };
|
|
127
|
-
|
|
127
|
+
/** Selection / pick volume in sim units (× size): the off-screen culling sphere and the hover / click proxy. */
|
|
128
|
+
export const BOUNDS = { center: [0, 0, 0], radius: 1.75 };
|
|
128
129
|
// neon light sources behind the rain (never drawn): segments [x0, y0, x1, y1, colour index], and a ring [cx, cy, r, colour]
|
|
129
130
|
const SEGS = [[-0.9, -0.35, -0.9, 0.65, 0]];
|
|
130
131
|
const RING = [0.78, 0.2, 0.3, 1];
|
|
@@ -12,6 +12,11 @@ export interface ShapeBurstParticlesProps extends ObjectReadyProps {
|
|
|
12
12
|
/** Per-domain keyframes; the `particles` domain drives this object's config knobs. */
|
|
13
13
|
animations?: ObjectAnimations;
|
|
14
14
|
}
|
|
15
|
+
/** Selection / pick volume in sim units (× size): the off-screen culling sphere and the hover / click proxy. */
|
|
16
|
+
export declare const BOUNDS: {
|
|
17
|
+
center: number[];
|
|
18
|
+
radius: number;
|
|
19
|
+
};
|
|
15
20
|
declare const ShapeBurstParticles: React.FC<ShapeBurstParticlesProps>;
|
|
16
21
|
export default ShapeBurstParticles;
|
|
17
22
|
//# sourceMappingURL=ShapeBurstParticles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShapeBurstParticles.d.ts","sourceRoot":"","sources":["../../../src/components/particles/ShapeBurstParticles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAO1G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAC9D,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,yBAAyB,CAAC;IAClC,sFAAsF;IACtF,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"ShapeBurstParticles.d.ts","sourceRoot":"","sources":["../../../src/components/particles/ShapeBurstParticles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,yBAAyB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAO1G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,wBAAyB,SAAQ,gBAAgB;IAC9D,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,yBAAyB,CAAC;IAClC,sFAAsF;IACtF,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;AA8HD,gHAAgH;AAChH,eAAO,MAAM,MAAM;;;CAAqC,CAAC;AA8WzD,QAAA,MAAM,mBAAmB,EAAE,KAAK,CAAC,EAAE,CAAC,wBAAwB,CAuD3D,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -126,7 +126,8 @@ const H_STEP = 1 / 120;
|
|
|
126
126
|
const W_PER_FIELD = 4.2; // cyclotron rate (rad / s) per unit field
|
|
127
127
|
const TRAIL_LOOK = { streak: 0.12, comet: 1, echo: 1 };
|
|
128
128
|
const TRAIL_ALPHA = { streak: 1.4, comet: 1.6, echo: 2.4 };
|
|
129
|
-
|
|
129
|
+
/** Selection / pick volume in sim units (× size): the off-screen culling sphere and the hover / click proxy. */
|
|
130
|
+
export const BOUNDS = { center: [0, 0, 0], radius: 1.3 };
|
|
130
131
|
const FADE = 1.2; // seconds of dissolve
|
|
131
132
|
const INK_EVERY = 1; // particles that draw lines (1 = all)
|
|
132
133
|
const INK_SPACING = 0.006;
|
|
@@ -12,6 +12,11 @@ export interface ShapeFlowParticlesProps extends ObjectReadyProps {
|
|
|
12
12
|
/** Per-domain keyframes; the `particles` domain drives this object's config knobs. */
|
|
13
13
|
animations?: ObjectAnimations;
|
|
14
14
|
}
|
|
15
|
+
/** Selection / pick volume in sim units (× size): the off-screen culling sphere and the hover / click proxy. */
|
|
16
|
+
export declare const BOUNDS: {
|
|
17
|
+
center: number[];
|
|
18
|
+
radius: number;
|
|
19
|
+
};
|
|
15
20
|
declare const ShapeFlowParticles: React.FC<ShapeFlowParticlesProps>;
|
|
16
21
|
export default ShapeFlowParticles;
|
|
17
22
|
//# sourceMappingURL=ShapeFlowParticles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ShapeFlowParticles.d.ts","sourceRoot":"","sources":["../../../src/components/particles/ShapeFlowParticles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOzG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB;IAC7D,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,wBAAwB,CAAC;IACjC,sFAAsF;IACtF,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"ShapeFlowParticles.d.ts","sourceRoot":"","sources":["../../../src/components/particles/ShapeFlowParticles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,wBAAwB,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAOzG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,uBAAwB,SAAQ,gBAAgB;IAC7D,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,wBAAwB,CAAC;IACjC,sFAAsF;IACtF,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;AAsID,gHAAgH;AAChH,eAAO,MAAM,MAAM;;;CAAqC,CAAC;AAiezD,QAAA,MAAM,kBAAkB,EAAE,KAAK,CAAC,EAAE,CAAC,uBAAuB,CAuDzD,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -134,7 +134,8 @@ const GX = 56, GY = 40, GZ = 40; // base-flow grid
|
|
|
134
134
|
const DELTA = 0.32; // boundary-layer thickness for the potential ramp
|
|
135
135
|
const TRAIL_LOOK = { streak: 0.35, comet: 1, echo: 1 };
|
|
136
136
|
const TRAIL_ALPHA = { streak: 1.8, comet: 2, echo: 2.6 };
|
|
137
|
-
|
|
137
|
+
/** Selection / pick volume in sim units (× size): the off-screen culling sphere and the hover / click proxy. */
|
|
138
|
+
export const BOUNDS = { center: [0, 0, 0], radius: 1.6 };
|
|
138
139
|
function createUniforms() {
|
|
139
140
|
return {
|
|
140
141
|
uTime: { value: 0 },
|
|
@@ -12,6 +12,11 @@ export interface TidalStreamParticlesProps extends ObjectReadyProps {
|
|
|
12
12
|
/** Per-domain keyframes; the `particles` domain drives this object's config knobs. */
|
|
13
13
|
animations?: ObjectAnimations;
|
|
14
14
|
}
|
|
15
|
+
/** Selection / pick volume in sim units (× size): the stream shells reach ~1.2 past the apocentre. */
|
|
16
|
+
export declare const BOUNDS: {
|
|
17
|
+
center: number[];
|
|
18
|
+
radius: number;
|
|
19
|
+
};
|
|
15
20
|
declare const TidalStreamParticles: React.FC<TidalStreamParticlesProps>;
|
|
16
21
|
export default TidalStreamParticles;
|
|
17
22
|
//# sourceMappingURL=TidalStreamParticles.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TidalStreamParticles.d.ts","sourceRoot":"","sources":["../../../src/components/particles/TidalStreamParticles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM3G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;IAC/D,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,0BAA0B,CAAC;IACnC,sFAAsF;IACtF,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"TidalStreamParticles.d.ts","sourceRoot":"","sources":["../../../src/components/particles/TidalStreamParticles.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAmE,MAAM,OAAO,CAAC;AAIxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,0BAA0B,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAM3G,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAEhE,MAAM,WAAW,yBAA0B,SAAQ,gBAAgB;IAC/D,6EAA6E;IAC7E,SAAS,CAAC,EAAE,eAAe,CAAC;IAC5B,wEAAwE;IACxE,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,0BAA0B,CAAC;IACnC,sFAAsF;IACtF,UAAU,CAAC,EAAE,gBAAgB,CAAC;CACjC;AAwGD,sGAAsG;AACtG,eAAO,MAAM,MAAM;;;CAAsC,CAAC;AA6mB1D,QAAA,MAAM,oBAAoB,EAAE,KAAK,CAAC,EAAE,CAAC,yBAAyB,CAqD7D,CAAC;AAEF,eAAe,oBAAoB,CAAC"}
|
|
@@ -100,6 +100,8 @@ const PERTURBER_MASS = 0.12;
|
|
|
100
100
|
const HOLE_MASS = 0.07;
|
|
101
101
|
const HOLE_SPIN = 0.018; // Lense–Thirring J (sim units) at strength 1
|
|
102
102
|
const DISC_TRAIL_SHARE = 0.35; // disc stars trail at this fraction of trailShare
|
|
103
|
+
/** Selection / pick volume in sim units (× size): the stream shells reach ~1.2 past the apocentre. */
|
|
104
|
+
export const BOUNDS = { center: [0, 0, 0], radius: 1.35 };
|
|
103
105
|
// orbit families: [apocentre radius, inclination, node angle, eccentricity offset, mass factor]
|
|
104
106
|
const ORBITS = [
|
|
105
107
|
[1.05, 0.28, 0.0, 0.0, 1.0], // main dwarf: long arcs
|
|
@@ -20,4 +20,6 @@ export { default as ShapeBurstParticles } from './ShapeBurstParticles';
|
|
|
20
20
|
export type { ShapeBurstParticlesProps } from './ShapeBurstParticles';
|
|
21
21
|
export { default as ShapeFlowParticles } from './ShapeFlowParticles';
|
|
22
22
|
export type { ShapeFlowParticlesProps } from './ShapeFlowParticles';
|
|
23
|
+
export { default as FireworksParticles } from './FireworksParticles';
|
|
24
|
+
export type { FireworksParticlesProps } from './FireworksParticles';
|
|
23
25
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/particles/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,YAAY,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACvF,YAAY,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,YAAY,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,YAAY,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/particles/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAC3E,YAAY,EAAE,0BAA0B,EAAE,MAAM,yBAAyB,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACvF,YAAY,EAAE,gCAAgC,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,OAAO,IAAI,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACnF,YAAY,EAAE,8BAA8B,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AACzE,YAAY,EAAE,yBAAyB,EAAE,MAAM,wBAAwB,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAC7E,YAAY,EAAE,2BAA2B,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACnE,YAAY,EAAE,sBAAsB,EAAE,MAAM,qBAAqB,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,uBAAuB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,YAAY,EAAE,4BAA4B,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,EAAE,OAAO,IAAI,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AACvE,YAAY,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AACrE,YAAY,EAAE,uBAAuB,EAAE,MAAM,sBAAsB,CAAC"}
|
|
@@ -10,3 +10,4 @@ export { default as NeonRainParticles } from './NeonRainParticles.js';
|
|
|
10
10
|
export { default as MagneticBottleParticles } from './MagneticBottleParticles.js';
|
|
11
11
|
export { default as ShapeBurstParticles } from './ShapeBurstParticles.js';
|
|
12
12
|
export { default as ShapeFlowParticles } from './ShapeFlowParticles.js';
|
|
13
|
+
export { default as FireworksParticles } from './FireworksParticles.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TerrainSurface.d.ts","sourceRoot":"","sources":["../../../src/components/terrain/TerrainSurface.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAkB1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"TerrainSurface.d.ts","sourceRoot":"","sources":["../../../src/components/terrain/TerrainSurface.tsx"],"names":[],"mappings":"AACA,OAAO,KAAqC,MAAM,OAAO,CAAC;AAkB1D,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAkBjD;;;;;;;;;;;;;;;;GAgBG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,iBAAiB,CA6I/C,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -11,6 +11,21 @@ import { applyTerrainAmbient, applyTerrainTextures, applyTerrainUniforms } from
|
|
|
11
11
|
import { useTerrainTextures } from '../../hooks/useTerrainTextures.js';
|
|
12
12
|
import { getAnimatableProperties } from '@3driseai/3drise-core';
|
|
13
13
|
import { applyConfigKeyframeAnimations, applyConfigMouseMove, } from '../../utils/configAnimations.js';
|
|
14
|
+
import { TERRAIN_DRAW_ORDER, ringDrawOrder } from '../../utils/environmentDrawOrder.js';
|
|
15
|
+
import { isMobileDevice } from '../../utils/deviceTier.js';
|
|
16
|
+
/**
|
|
17
|
+
* Phone / tablet tier, applied at render time only — the saved scene keeps its
|
|
18
|
+
* numbers, so the same project is full quality on a desktop. Measured on the
|
|
19
|
+
* desktop: textures within 100 m instead of 1500 saved ~2.8 ms, 5 octaves
|
|
20
|
+
* instead of 8 ~1.7 ms; the shadow march costs nothing measurable, so it stays.
|
|
21
|
+
* Fewer, coarser rings cut the vertex load by roughly half.
|
|
22
|
+
*/
|
|
23
|
+
const MOBILE = {
|
|
24
|
+
maxSegments: 96,
|
|
25
|
+
maxLevels: 8,
|
|
26
|
+
maxOctaves: 5,
|
|
27
|
+
maxTextureDistance: 400,
|
|
28
|
+
};
|
|
14
29
|
/**
|
|
15
30
|
* The terrain renderer. One clipmap, one material, four landforms — they differ
|
|
16
31
|
* by the shaping operator the height field applies, not by having separate
|
|
@@ -29,7 +44,8 @@ import { applyConfigKeyframeAnimations, applyConfigMouseMove, } from '../../util
|
|
|
29
44
|
* the camera. Nothing here re-renders React.
|
|
30
45
|
*/
|
|
31
46
|
const TerrainSurface = ({ id = '3drise-terrain', config, quality, skySettings, timeSettings, sunIntensity = 1, animations, mouseMove, onObjectReady, onObjectDispose, }) => {
|
|
32
|
-
const
|
|
47
|
+
const mobile = isMobileDevice();
|
|
48
|
+
const clipmap = useTerrainClipmap(mobile ? Math.min(quality.levels, MOBILE.maxLevels) : quality.levels, mobile ? Math.min(quality.segments, MOBILE.maxSegments) : quality.segments, quality.cellSize);
|
|
33
49
|
const { state: sun, update: updateSun } = useCloudSun({ skySettings, timeSettings });
|
|
34
50
|
const material = useMemo(() => new TerrainMaterial(), []);
|
|
35
51
|
// The four ground textures, packed into arrays. Repacks only when a map URL
|
|
@@ -46,9 +62,9 @@ const TerrainSurface = ({ id = '3drise-terrain', config, quality, skySettings, t
|
|
|
46
62
|
useEffect(() => { liveConfig.current = {}; }, [config]);
|
|
47
63
|
useEffect(() => { liveQuality.current = {}; }, [quality]);
|
|
48
64
|
// The `terrain` keyframe / pointer domains: config -> keyframes -> pointer ->
|
|
49
|
-
// live drag, the clouds' order.
|
|
50
|
-
//
|
|
51
|
-
//
|
|
65
|
+
// live drag, the clouds' order. Every numeric / colour knob is in the set — shape
|
|
66
|
+
// and surface alike are shader uniforms, so the ground can rise or shift per frame;
|
|
67
|
+
// only the integer counts (octaves, strata) are structural in the registry.
|
|
52
68
|
const animatable = useMemo(() => new Set(getAnimatableProperties({ type: 'terrain', config }, 'terrain').map(p => p.value)), [config.terrainType]);
|
|
53
69
|
const override = useRef({});
|
|
54
70
|
const startValues = useRef({});
|
|
@@ -91,6 +107,10 @@ const TerrainSurface = ({ id = '3drise-terrain', config, quality, skySettings, t
|
|
|
91
107
|
applyConfigMouseMove(mouseMove.terrain.properties, config, o, state.pointer, animatable);
|
|
92
108
|
}
|
|
93
109
|
const cfg = { ...config, ...o, ...liveConfig.current };
|
|
110
|
+
if (mobile) {
|
|
111
|
+
cfg.octaves = Math.min(cfg.octaves, MOBILE.maxOctaves);
|
|
112
|
+
cfg.textureDistance = Math.min(cfg.textureDistance ?? 4000, MOBILE.maxTextureDistance);
|
|
113
|
+
}
|
|
94
114
|
const qual = { ...quality, ...liveQuality.current };
|
|
95
115
|
applyTerrainUniforms(material, cfg, qual);
|
|
96
116
|
applyTerrainTextures(material, cfg, textures);
|
|
@@ -110,6 +130,8 @@ const TerrainSurface = ({ id = '3drise-terrain', config, quality, skySettings, t
|
|
|
110
130
|
}
|
|
111
131
|
});
|
|
112
132
|
return (_jsx("group", { ref: rootRef, children: clipmap.levels.map((ring, i) => (_jsx("mesh", { ref: (m) => { meshRefs.current[i] = m; }, geometry: ring.geometry, material: material, receiveShadow: quality.receiveShadows,
|
|
133
|
+
// After the water, inner ring first: see environmentDrawOrder.
|
|
134
|
+
renderOrder: ringDrawOrder(TERRAIN_DRAW_ORDER, ring.level),
|
|
113
135
|
// Displacement happens in the vertex shader, so the object-space
|
|
114
136
|
// bounds describe a flat plane. Culling against them hides the
|
|
115
137
|
// terrain the moment the camera tilts up.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { AnimationOptions, MouseMoveDomain, PlainTextConfig } from '@3driseai/3drise-core';
|
|
3
|
+
import type { ObjectReadyProps } from '../../types/objectReady';
|
|
4
|
+
export interface PlainTextProps extends ObjectReadyProps {
|
|
5
|
+
config: PlainTextConfig;
|
|
6
|
+
/** Scene object id: the live-edit handle is found by it. */
|
|
7
|
+
id?: string;
|
|
8
|
+
/** Keyframes on the config knobs (animations.text.animations). */
|
|
9
|
+
keyframes?: AnimationOptions[];
|
|
10
|
+
/** Pointer bindings on the config knobs (mouseMove.text). */
|
|
11
|
+
mouseMove?: MouseMoveDomain;
|
|
12
|
+
}
|
|
13
|
+
declare const PlainText: React.FC<PlainTextProps>;
|
|
14
|
+
export default PlainText;
|
|
15
|
+
//# sourceMappingURL=PlainText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PlainText.d.ts","sourceRoot":"","sources":["../../../src/components/text/PlainText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,KAAK,EAAE,gBAAgB,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAChG,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAYhE,MAAM,WAAW,cAAe,SAAQ,gBAAgB;IACpD,MAAM,EAAE,eAAe,CAAC;IACxB,4DAA4D;IAC5D,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,kEAAkE;IAClE,SAAS,CAAC,EAAE,gBAAgB,EAAE,CAAC;IAC/B,6DAA6D;IAC7D,SAAS,CAAC,EAAE,eAAe,CAAC;CAC/B;AAED,QAAA,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,cAAc,CAAyD,CAAC;AAElG,eAAe,SAAS,CAAC"}
|
|
@@ -3,7 +3,9 @@ import type { TextObjectType } from '@3driseai/3drise-core';
|
|
|
3
3
|
import { type TextObjectProps } from './useTextObject';
|
|
4
4
|
/**
|
|
5
5
|
* The shared body of every text look: an empty group that the look's mesh is built into once the font has
|
|
6
|
-
* loaded
|
|
6
|
+
* loaded, plus the pick proxy — an invisible plane over the text's box that is the only thing the pointer can
|
|
7
|
+
* hit (hover / click react to the text as a whole, not letter by letter). The inner group is the em scale, so
|
|
8
|
+
* the object's own transform stays the parent's.
|
|
7
9
|
*/
|
|
8
10
|
declare const TextObjectView: React.FC<TextObjectProps & {
|
|
9
11
|
look: TextObjectType;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextObjectView.d.ts","sourceRoot":"","sources":["../../../src/components/text/TextObjectView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TextObjectView.d.ts","sourceRoot":"","sources":["../../../src/components/text/TextObjectView.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAE5D,OAAO,EAA0B,KAAK,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAG/E;;;;;GAKG;AACH,QAAA,MAAM,cAAc,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,GAAG;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAWxE,CAAC;AAEF,eAAe,cAAc,CAAC"}
|
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useMemo } from 'react';
|
|
2
3
|
import { TEXT_EM, useTextObject } from './useTextObject.js';
|
|
4
|
+
import { pickPlane } from '../../utils/pickProxy.js';
|
|
3
5
|
/**
|
|
4
6
|
* The shared body of every text look: an empty group that the look's mesh is built into once the font has
|
|
5
|
-
* loaded
|
|
7
|
+
* loaded, plus the pick proxy — an invisible plane over the text's box that is the only thing the pointer can
|
|
8
|
+
* hit (hover / click react to the text as a whole, not letter by letter). The inner group is the em scale, so
|
|
9
|
+
* the object's own transform stays the parent's.
|
|
6
10
|
*/
|
|
7
11
|
const TextObjectView = ({ look, ...props }) => {
|
|
8
|
-
const { rootRef, innerRef } = useTextObject(look, props);
|
|
9
|
-
|
|
12
|
+
const { rootRef, innerRef, proxyRef } = useTextObject(look, props);
|
|
13
|
+
const proxy = useMemo(() => pickPlane(), []);
|
|
14
|
+
useEffect(() => () => { proxy.geometry.dispose(); proxy.material.dispose(); }, [proxy]);
|
|
15
|
+
return (_jsx("group", { ref: rootRef, children: _jsx("group", { ref: innerRef, scale: TEXT_EM, children: _jsx("primitive", { ref: proxyRef, object: proxy }) }) }));
|
|
10
16
|
};
|
|
11
17
|
export default TextObjectView;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/text/engine/looks/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/components/text/engine/looks/index.ts"],"names":[],"mappings":"AAsCA,eAAO,MAAM,KAAK,EAAuM,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC"}
|
|
@@ -8,6 +8,7 @@ import inkBleed from './inkBleed.js';
|
|
|
8
8
|
import lightPainting from './lightPainting.js';
|
|
9
9
|
import liquidMetal from './liquidMetal.js';
|
|
10
10
|
import plasmaDischarge from './plasmaDischarge.js';
|
|
11
|
+
import plain from './plain.js';
|
|
11
12
|
// Additive / max-blended glow passes write alpha 1 with black where they add nothing, which on a transparent canvas
|
|
12
13
|
// (alpha: true, no scene background) paints opaque black quads. Make their output a valid premultiplied pixel instead:
|
|
13
14
|
// alpha = brightest channel, blended One/One (same colour as before, no black rectangles).
|
|
@@ -45,4 +46,4 @@ const safe = (v) => ({
|
|
|
45
46
|
},
|
|
46
47
|
});
|
|
47
48
|
// Text looks whose rendering is look-native (own shaders, per-pixel fields, own draw / erase methods).
|
|
48
|
-
export const LOOKS = Object.fromEntries(Object.entries({ burnAway, chalkboard, constellation, embroidery, frostGrowth, inkBleed, lightPainting, liquidMetal, plasmaDischarge }).map(([k, v]) => [k, safe(v)]));
|
|
49
|
+
export const LOOKS = Object.fromEntries(Object.entries({ burnAway, chalkboard, constellation, embroidery, frostGrowth, inkBleed, lightPainting, liquidMetal, plasmaDischarge, plain }).map(([k, v]) => [k, safe(v)]));
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
declare const _default: {
|
|
2
|
+
key: string;
|
|
3
|
+
source: string;
|
|
4
|
+
drawMethods: string[];
|
|
5
|
+
eraseMethods: string[];
|
|
6
|
+
drawDefault: string;
|
|
7
|
+
eraseDefault: string;
|
|
8
|
+
catalog: {
|
|
9
|
+
name: string;
|
|
10
|
+
description: string;
|
|
11
|
+
tags: string[];
|
|
12
|
+
};
|
|
13
|
+
animDefaults: {
|
|
14
|
+
text: string;
|
|
15
|
+
font: string;
|
|
16
|
+
drawDuration: number;
|
|
17
|
+
eraseDuration: number;
|
|
18
|
+
};
|
|
19
|
+
defaults: {
|
|
20
|
+
color: string;
|
|
21
|
+
color2: string;
|
|
22
|
+
weight: number;
|
|
23
|
+
outline: number;
|
|
24
|
+
fill: number;
|
|
25
|
+
softness: number;
|
|
26
|
+
opacity: number;
|
|
27
|
+
};
|
|
28
|
+
ui: {
|
|
29
|
+
main: ({
|
|
30
|
+
name: string;
|
|
31
|
+
label: string;
|
|
32
|
+
description: string;
|
|
33
|
+
type: string;
|
|
34
|
+
min?: undefined;
|
|
35
|
+
max?: undefined;
|
|
36
|
+
step?: undefined;
|
|
37
|
+
unit?: undefined;
|
|
38
|
+
} | {
|
|
39
|
+
name: string;
|
|
40
|
+
label: string;
|
|
41
|
+
description: string;
|
|
42
|
+
type: string;
|
|
43
|
+
min: number;
|
|
44
|
+
max: number;
|
|
45
|
+
step: number;
|
|
46
|
+
unit: string;
|
|
47
|
+
} | {
|
|
48
|
+
name: string;
|
|
49
|
+
label: string;
|
|
50
|
+
description: string;
|
|
51
|
+
type: string;
|
|
52
|
+
min: number;
|
|
53
|
+
max: number;
|
|
54
|
+
step: number;
|
|
55
|
+
unit?: undefined;
|
|
56
|
+
})[];
|
|
57
|
+
more: ({
|
|
58
|
+
name: string;
|
|
59
|
+
label: string;
|
|
60
|
+
description: string;
|
|
61
|
+
type: string;
|
|
62
|
+
min?: undefined;
|
|
63
|
+
max?: undefined;
|
|
64
|
+
step?: undefined;
|
|
65
|
+
unit?: undefined;
|
|
66
|
+
} | {
|
|
67
|
+
name: string;
|
|
68
|
+
label: string;
|
|
69
|
+
description: string;
|
|
70
|
+
type: string;
|
|
71
|
+
min: number;
|
|
72
|
+
max: number;
|
|
73
|
+
step: number;
|
|
74
|
+
unit?: undefined;
|
|
75
|
+
} | {
|
|
76
|
+
name: string;
|
|
77
|
+
label: string;
|
|
78
|
+
description: string;
|
|
79
|
+
type: string;
|
|
80
|
+
min: number;
|
|
81
|
+
max: number;
|
|
82
|
+
step: number;
|
|
83
|
+
unit: string;
|
|
84
|
+
})[];
|
|
85
|
+
};
|
|
86
|
+
structural: any[];
|
|
87
|
+
presets: ({
|
|
88
|
+
name: string;
|
|
89
|
+
description: string;
|
|
90
|
+
patch: {
|
|
91
|
+
weight?: undefined;
|
|
92
|
+
fill?: undefined;
|
|
93
|
+
outline?: undefined;
|
|
94
|
+
color2?: undefined;
|
|
95
|
+
softness?: undefined;
|
|
96
|
+
color?: undefined;
|
|
97
|
+
};
|
|
98
|
+
} | {
|
|
99
|
+
name: string;
|
|
100
|
+
description: string;
|
|
101
|
+
patch: {
|
|
102
|
+
weight: number;
|
|
103
|
+
fill?: undefined;
|
|
104
|
+
outline?: undefined;
|
|
105
|
+
color2?: undefined;
|
|
106
|
+
softness?: undefined;
|
|
107
|
+
color?: undefined;
|
|
108
|
+
};
|
|
109
|
+
} | {
|
|
110
|
+
name: string;
|
|
111
|
+
description: string;
|
|
112
|
+
patch: {
|
|
113
|
+
fill: number;
|
|
114
|
+
outline: number;
|
|
115
|
+
color2: string;
|
|
116
|
+
weight?: undefined;
|
|
117
|
+
softness?: undefined;
|
|
118
|
+
color?: undefined;
|
|
119
|
+
};
|
|
120
|
+
} | {
|
|
121
|
+
name: string;
|
|
122
|
+
description: string;
|
|
123
|
+
patch: {
|
|
124
|
+
softness: number;
|
|
125
|
+
weight: number;
|
|
126
|
+
fill?: undefined;
|
|
127
|
+
outline?: undefined;
|
|
128
|
+
color2?: undefined;
|
|
129
|
+
color?: undefined;
|
|
130
|
+
};
|
|
131
|
+
} | {
|
|
132
|
+
name: string;
|
|
133
|
+
description: string;
|
|
134
|
+
patch: {
|
|
135
|
+
color: string;
|
|
136
|
+
weight: number;
|
|
137
|
+
fill?: undefined;
|
|
138
|
+
outline?: undefined;
|
|
139
|
+
color2?: undefined;
|
|
140
|
+
softness?: undefined;
|
|
141
|
+
};
|
|
142
|
+
})[];
|
|
143
|
+
build(layout: any, cfg: any, anim: any): any;
|
|
144
|
+
};
|
|
145
|
+
export default _default;
|
|
146
|
+
//# sourceMappingURL=plain.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plain.d.ts","sourceRoot":"","sources":["../../../../../src/components/text/engine/looks/plain.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4CA,wBAsDE"}
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
import { prepare, applyAnim, DRAW_METHODS, ERASE_METHODS } from '../methods.js';
|
|
3
|
+
import { buildField, fieldMaterial, fieldQuad } from '../fieldkit.js';
|
|
4
|
+
import { setReveal } from '../ribbon.js';
|
|
5
|
+
// =========================================================================================
|
|
6
|
+
// plain — flat, solid text from the font's outlines: the everyday label, caption and title.
|
|
7
|
+
//
|
|
8
|
+
// THE CONSTRUCTION
|
|
9
|
+
// 1. The glyph outlines are baked once into a signed distance field over the text's extent (fieldkit: exact
|
|
10
|
+
// nearest-contour distance by jump flooding, negative inside the even-odd filled glyph). Shading is per pixel
|
|
11
|
+
// from that field, so the edge is anti-aliased in screen space with fwidth(d) — crisp at any camera distance,
|
|
12
|
+
// like SDF text rendering, and never a hard step.
|
|
13
|
+
// 2. Weight offsets the zero contour (d - weight): a positive weight makes the face bolder, a negative one lighter,
|
|
14
|
+
// the way a variable font's wght axis thickens every stroke from its centreline outwards.
|
|
15
|
+
// 3. Outline is the band 0 < d < outline just outside the (weighted) face, in colour2; fill is the face itself,
|
|
16
|
+
// with its own opacity so an outline-only label is one slider away. Softness widens the edge transition
|
|
17
|
+
// symmetrically for a soft, printed-on-fabric look.
|
|
18
|
+
// 4. Draw / erase: every pixel carries the arrival of its nearest contour point (fieldkit gD / gO), so every
|
|
19
|
+
// shared method works unchanged — pen and trace ink the letters in from their contours, wipe / radial sweep
|
|
20
|
+
// across the face, scatter / dissolve break it up, fade is a plain cross-fade.
|
|
21
|
+
// There is no idle motion: a plain label stands still.
|
|
22
|
+
// =========================================================================================
|
|
23
|
+
const hex = (h) => new THREE.Color(h);
|
|
24
|
+
const PLAIN_FRAG = /* glsl */ `
|
|
25
|
+
uniform vec3 uColor; uniform vec3 uColor2; uniform float uOpacity; uniform float uFill; uniform float uWeight; uniform float uOutline; uniform float uSoft;
|
|
26
|
+
void main(){
|
|
27
|
+
vec4 A = fieldA(vPos);
|
|
28
|
+
float d = A.x - uWeight; // signed distance to the weighted face (em; < 0 inside)
|
|
29
|
+
float aa = max(fwidth(d), 1e-5)*0.7 + uSoft; // derivatives first: no discard before them
|
|
30
|
+
float face = 1.0 - smoothstep(-aa, aa, d);
|
|
31
|
+
float ring = smoothstep(-aa, aa, d)*(1.0 - smoothstep(uOutline - aa, uOutline + aa, d))*step(0.0005, uOutline);
|
|
32
|
+
float vis = revealInG(A.y)*revealOutG(A.z)*uOpacity;
|
|
33
|
+
float f = face*uFill;
|
|
34
|
+
float a = (f + ring*(1.0 - f))*vis;
|
|
35
|
+
if (a < 0.002) discard;
|
|
36
|
+
vec3 col = (uColor*f + uColor2*ring*(1.0 - f))*vis; // premultiplied
|
|
37
|
+
gl_FragColor = vec4(col, a);
|
|
38
|
+
#include <tonemapping_fragment>
|
|
39
|
+
#include <colorspace_fragment>
|
|
40
|
+
}`;
|
|
41
|
+
export default {
|
|
42
|
+
key: 'plain', source: 'outline', drawMethods: DRAW_METHODS, eraseMethods: ERASE_METHODS, drawDefault: 'fade', eraseDefault: 'fade',
|
|
43
|
+
catalog: {
|
|
44
|
+
name: 'Plain',
|
|
45
|
+
description: 'Flat solid text from the font outlines with a weight axis, an optional outline and soft edges, anti-aliased from a signed distance field. Use for labels, captions, prices, menus and titles.',
|
|
46
|
+
tags: ['plain', 'label', 'caption', 'solid', 'flat', 'sans', 'title', 'text'],
|
|
47
|
+
},
|
|
48
|
+
animDefaults: { text: 'Hello', font: 'inter', drawDuration: 1.2, eraseDuration: 0.8 },
|
|
49
|
+
defaults: { color: '#ffffff', color2: '#111111', weight: 0, outline: 0, fill: 1, softness: 0, opacity: 1 },
|
|
50
|
+
ui: {
|
|
51
|
+
main: [
|
|
52
|
+
{ name: 'color', label: 'Colour', description: 'Colour of the face', type: 'color' },
|
|
53
|
+
{ name: 'weight', label: 'Weight', description: 'Bolder (right) or lighter (left) face: offsets every edge of the letters', type: 'number', min: -0.04, max: 0.05, step: 0.001, unit: 'em' },
|
|
54
|
+
{ name: 'outline', label: 'Outline', description: 'Width of the outline drawn just outside the face (0 = none)', type: 'number', min: 0, max: 0.08, step: 0.001, unit: 'em' },
|
|
55
|
+
{ name: 'opacity', label: 'Opacity', description: 'Overall opacity', type: 'number', min: 0, max: 1, step: 0.01 },
|
|
56
|
+
],
|
|
57
|
+
more: [
|
|
58
|
+
{ name: 'color2', label: 'Outline colour', description: 'Colour of the outline', type: 'color' },
|
|
59
|
+
{ name: 'fill', label: 'Fill', description: 'Opacity of the face alone (0 with an outline = hollow letters)', type: 'number', min: 0, max: 1, step: 0.01 },
|
|
60
|
+
{ name: 'softness', label: 'Softness', description: 'Width of the edge transition: 0 is crisp, more is a soft printed edge', type: 'number', min: 0, max: 0.06, step: 0.001, unit: 'em' },
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
structural: [],
|
|
64
|
+
presets: [
|
|
65
|
+
{ name: 'Default', description: 'White, crisp', patch: {} },
|
|
66
|
+
{ name: 'Bold', description: 'A heavier face', patch: { weight: 0.025 } },
|
|
67
|
+
{ name: 'Hollow', description: 'Outline only', patch: { fill: 0, outline: 0.03, color2: '#ffffff' } },
|
|
68
|
+
{ name: 'Soft', description: 'Soft printed edge', patch: { softness: 0.03, weight: 0.012 } },
|
|
69
|
+
{ name: 'Caption', description: 'Light grey, a little lighter in weight', patch: { color: '#c9ced6', weight: -0.01 } },
|
|
70
|
+
],
|
|
71
|
+
build(layout, cfg, anim) {
|
|
72
|
+
const strokes = layout.strokes;
|
|
73
|
+
prepare(strokes, 'outline');
|
|
74
|
+
const G = layout.glyphs.length;
|
|
75
|
+
strokes.forEach((s) => { s.glyphN = s.glyph / Math.max(1, G - 1); });
|
|
76
|
+
const { infoD, infoE } = applyAnim(strokes, anim, G);
|
|
77
|
+
// The cheapest look, and the one read closest: a finer field than the others (1536 along the long side).
|
|
78
|
+
const field = buildField(strokes, { source: 'outline', texels: 1536, pad: 0.2, maxDist: 0.3 });
|
|
79
|
+
const mat = fieldMaterial(field, PLAIN_FRAG, {
|
|
80
|
+
uColor: { value: hex(cfg.color) }, uColor2: { value: hex(cfg.color2) }, uOpacity: { value: 1 }, uFill: { value: 1 }, uWeight: { value: 0 }, uOutline: { value: 0 }, uSoft: { value: 0 },
|
|
81
|
+
});
|
|
82
|
+
const mesh = fieldQuad(field, mat);
|
|
83
|
+
const group = new THREE.Group();
|
|
84
|
+
group.add(mesh);
|
|
85
|
+
const api = {
|
|
86
|
+
object: group,
|
|
87
|
+
apply(c) {
|
|
88
|
+
const u = mat.uniforms;
|
|
89
|
+
u.uColor.value.set(c.color);
|
|
90
|
+
u.uColor2.value.set(c.color2);
|
|
91
|
+
u.uOpacity.value = c.opacity;
|
|
92
|
+
u.uFill.value = c.fill;
|
|
93
|
+
u.uWeight.value = c.weight;
|
|
94
|
+
u.uOutline.value = c.outline;
|
|
95
|
+
u.uSoft.value = c.softness;
|
|
96
|
+
api.c = c;
|
|
97
|
+
},
|
|
98
|
+
update(S, time) { setReveal(mat.uniforms, S, infoD, infoE, anim.draw.duration, time); },
|
|
99
|
+
dispose() { mesh.geometry.dispose(); mat.dispose(); field.dispose(); },
|
|
100
|
+
};
|
|
101
|
+
api.apply(cfg);
|
|
102
|
+
return api;
|
|
103
|
+
},
|
|
104
|
+
};
|