kmcom-nuxt-layers 2.2.0 → 2.2.1
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/layers/animations/app/components/Motion/CountUp.vue +30 -30
- package/layers/animations/app/components/Motion/Magnetic.vue +14 -14
- package/layers/animations/app/components/Motion/Marquee.vue +59 -62
- package/layers/animations/app/components/Motion/MarqueeText.vue +2 -2
- package/layers/animations/app/components/Motion/Staggered.vue +45 -49
- package/layers/animations/app/components/Motion/TextReveal.vue +21 -19
- package/layers/animations/app/components/Motion/Tilt.vue +13 -13
- package/layers/animations/app/components/Motion/VelocityEffect.vue +80 -80
- package/layers/animations/app/composables/useCountUp.ts +1 -1
- package/layers/animations/app/composables/useMarqueeVelocity.ts +2 -2
- package/layers/canvas/app/components/ShaderCanvas.vue +42 -49
- package/layers/canvas/app/composables/useRendererCapabilities.ts +29 -21
- package/layers/canvas/app/composables/useShaderTime.ts +4 -5
- package/layers/canvas/app/types/renderer.ts +5 -0
- package/layers/content/app/components/Blog/Article.vue +10 -7
- package/layers/content/app/components/Blog/Card.vue +0 -1
- package/layers/content/app/components/Blog/List.vue +2 -4
- package/layers/content/app/components/Gallery/AmbientImage.vue +0 -1
- package/layers/content/app/components/Gallery/Card.vue +0 -1
- package/layers/content/app/components/Gallery/Detail.vue +0 -2
- package/layers/content/app/components/Gallery/Grid.vue +0 -2
- package/layers/content/app/components/Gallery/ImageDetail.vue +0 -2
- package/layers/content/app/components/Gallery/Lightbox.vue +1 -6
- package/layers/content/app/components/NuxtContent/Detail.vue +3 -4
- package/layers/content/app/components/NuxtContent/List.vue +0 -1
- package/layers/content/app/components/NuxtContent/Surround.vue +0 -1
- package/layers/content/app/components/NuxtContent/Toc.vue +0 -1
- package/layers/content/app/components/Portfolio/Card.vue +0 -1
- package/layers/content/app/components/Portfolio/ColorPalette.vue +0 -1
- package/layers/content/app/components/Portfolio/Detail.vue +2 -4
- package/layers/content/app/components/Portfolio/ItemPage.vue +3 -1
- package/layers/content/app/components/Portfolio/List.vue +20 -5
- package/layers/content/app/components/Portfolio/Typography.vue +0 -1
- package/layers/content/app/components/content/Figure.vue +0 -1
- package/layers/content/app/composables/createPortfolioComposables.ts +21 -7
- package/layers/content/app/composables/useCollectionItem.ts +2 -3
- package/layers/content/app/composables/useCollectionSurround.ts +2 -3
- package/layers/content/app/composables/useContentPage.ts +0 -2
- package/layers/content/app/composables/useGalleryItems.ts +0 -2
- package/layers/content/app/composables/usePortfolioItems.ts +0 -2
- package/layers/content/app/types/app-config.d.ts +3 -1
- package/layers/content/app/types/collections.d.ts +46 -0
- package/layers/content/nuxt.config.ts +0 -1
- package/layers/core/app/components/ErrorBoundary.vue +0 -3
- package/layers/core/app/composables/useBrowser.ts +0 -1
- package/layers/core/app/composables/useCache.ts +0 -3
- package/layers/core/app/composables/useErrorLog.ts +0 -2
- package/layers/core/app/composables/useFeatures.ts +0 -3
- package/layers/core/app/composables/useLoading.ts +16 -15
- package/layers/core/app/composables/useNetworkInfo.ts +0 -2
- package/layers/core/app/composables/usePWAInfo.ts +0 -1
- package/layers/core/app/composables/useRendering.ts +0 -2
- package/layers/core/app/composables/useScreen.ts +0 -2
- package/layers/core/app/composables/useScrollGuard.ts +44 -44
- package/layers/core/app/layouts/default.vue +0 -1
- package/layers/core/app/plugins/error-handler.ts +4 -2
- package/layers/core/app/plugins/feature-detection.client.ts +4 -4
- package/layers/core/app/plugins/init.ts +4 -6
- package/layers/core/app/plugins/loading.client.ts +4 -3
- package/layers/core/app/plugins/scroll-guard.client.ts +4 -4
- package/layers/core/app/types/app-config.d.ts +1 -1
- package/layers/core/app/types/runtime-config.ts +13 -1
- package/layers/core/app/utils/helpers.ts +0 -4
- package/layers/feeds/app/app.config.ts +1 -1
- package/layers/feeds/app/plugins/feed-head.ts +4 -3
- package/layers/feeds/package.json +1 -1
- package/layers/forms/app/components/Form/Contact.vue +0 -2
- package/layers/forms/app/components/Form/Field.vue +0 -1
- package/layers/forms/app/composables/useFormSchema.ts +0 -1
- package/layers/forms/app/types/app-config.d.ts +1 -1
- package/layers/layout/app/components/Layout/Grid/Item.vue +0 -3
- package/layers/layout/app/components/Layout/Page/Container.vue +0 -4
- package/layers/layout/app/components/Layout/Page/Header.vue +0 -1
- package/layers/layout/app/components/Layout/Page/index.vue +0 -1
- package/layers/layout/app/components/Layout/Section/Gallery.vue +0 -1
- package/layers/layout/app/components/Layout/Section/Hero.vue +0 -3
- package/layers/layout/app/components/Layout/Section/Stack.vue +0 -3
- package/layers/layout/app/components/Layout/Section/Title.vue +0 -1
- package/layers/layout/app/composables/useGridConfig.ts +0 -1
- package/layers/layout/app/types/app-config.d.ts +6 -3
- package/layers/navigation/app/app.config.ts +1 -2
- package/layers/navigation/app/components/Links/Group.vue +0 -4
- package/layers/navigation/app/components/Links/Named.vue +0 -4
- package/layers/navigation/app/composables/mastNav.ts +0 -1
- package/layers/navigation/app/composables/toast.ts +0 -1
- package/layers/navigation/app/composables/useSite.ts +0 -1
- package/layers/navigation/app/utils/createModal.ts +0 -1
- package/layers/page-transitions/app/app.config.ts +1 -1
- package/layers/page-transitions/app/plugins/page-transitions.client.ts +4 -2
- package/layers/routing/app/composables/useRoutingConfig.ts +0 -1
- package/layers/routing/app/plugins/feature-flags.client.ts +4 -2
- package/layers/routing/app/plugins/scroll-routing.client.ts +4 -2
- package/layers/routing/app/types/app-config.d.ts +1 -2
- package/layers/routing/nuxt.config.ts +0 -1
- package/layers/scripts/app/app.config.ts +1 -2
- package/layers/scripts/app/composables/useAnalytics.ts +6 -6
- package/layers/scripts/app/composables/useGtm.ts +4 -4
- package/layers/scripts/app/composables/useScriptLoader.ts +12 -1
- package/layers/scroll/app/components/Motion/HorizontalScroll.vue +4 -1
- package/layers/scroll/app/components/Motion/Parallax.vue +38 -42
- package/layers/scroll/app/components/Motion/PinnedSection.vue +4 -1
- package/layers/scroll/app/components/Motion/ScrollLink.vue +26 -29
- package/layers/scroll/app/components/Motion/ScrollProgress.vue +38 -44
- package/layers/scroll/app/components/Motion/ScrollScene.vue +0 -1
- package/layers/scroll/app/components/Motion/ScrollStats.vue +19 -23
- package/layers/scroll/app/composables/useSmoothScroll.ts +21 -24
- package/layers/scroll/app/plugins/locomotive-scroll.client.ts +5 -2
- package/layers/seo/app/app.config.ts +0 -1
- package/layers/seo/app/composables/useSeoConfig.ts +0 -1
- package/layers/shader/app/components/Effect/PostProcessing.vue +3 -13
- package/layers/shader/app/components/Material/AmbientAurora.client.vue +41 -47
- package/layers/shader/app/components/Material/AmbientFlow.client.vue +47 -56
- package/layers/shader/app/components/Material/AmbientGradientMesh.client.vue +45 -51
- package/layers/shader/app/components/Material/AmbientNebula.client.vue +47 -53
- package/layers/shader/app/components/Material/AmbientOcean.client.vue +40 -46
- package/layers/shader/app/components/Material/Fresnel.client.vue +24 -29
- package/layers/shader/app/components/Material/Gradient.client.vue +61 -67
- package/layers/shader/app/components/Material/Image.client.vue +65 -71
- package/layers/shader/app/components/Material/Node.client.vue +46 -46
- package/layers/shader/app/components/Material/Noise.client.vue +48 -54
- package/layers/shader/app/components/Mesh/Plane.vue +15 -20
- package/layers/shader/app/components/Node/Color.client.vue +3 -4
- package/layers/shader/app/components/Node/Fresnel.client.vue +17 -26
- package/layers/shader/app/components/Node/Gradient.client.vue +36 -42
- package/layers/shader/app/components/Node/Mix.client.vue +13 -19
- package/layers/shader/app/components/Node/Noise.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/ACESTonemap.client.vue +0 -2
- package/layers/shader/app/components/Pipeline/AddBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/AgedFilm.client.vue +27 -28
- package/layers/shader/app/components/Pipeline/Aurora.client.vue +37 -44
- package/layers/shader/app/components/Pipeline/BilinearGradient.client.vue +26 -33
- package/layers/shader/app/components/Pipeline/BillowNoise.client.vue +22 -23
- package/layers/shader/app/components/Pipeline/BrightnessContrast.client.vue +16 -20
- package/layers/shader/app/components/Pipeline/CellularNoise.client.vue +22 -23
- package/layers/shader/app/components/Pipeline/ChannelMixer.client.vue +28 -35
- package/layers/shader/app/components/Pipeline/ChebyshevNoiseField.client.vue +31 -31
- package/layers/shader/app/components/Pipeline/Checkerboard.client.vue +21 -23
- package/layers/shader/app/components/Pipeline/ChromaticAberration.client.vue +21 -23
- package/layers/shader/app/components/Pipeline/ChromaticScreenWaves.client.vue +31 -30
- package/layers/shader/app/components/Pipeline/Circle.client.vue +22 -23
- package/layers/shader/app/components/Pipeline/Clouds.client.vue +36 -43
- package/layers/shader/app/components/Pipeline/ColorBurnBlend.client.vue +15 -17
- package/layers/shader/app/components/Pipeline/ColorDodgeBlend.client.vue +15 -17
- package/layers/shader/app/components/Pipeline/ColourRamp.client.vue +28 -35
- package/layers/shader/app/components/Pipeline/ComplexPlaneField.client.vue +31 -38
- package/layers/shader/app/components/Pipeline/ConicGradient.client.vue +19 -21
- package/layers/shader/app/components/Pipeline/CosinePalette.client.vue +42 -49
- package/layers/shader/app/components/Pipeline/CoverageAlpha.client.vue +0 -4
- package/layers/shader/app/components/Pipeline/Cross.client.vue +28 -28
- package/layers/shader/app/components/Pipeline/CurlNoise.client.vue +26 -27
- package/layers/shader/app/components/Pipeline/DarkenBlend.client.vue +15 -17
- package/layers/shader/app/components/Pipeline/DayNightCycle.client.vue +26 -27
- package/layers/shader/app/components/Pipeline/Desaturate.client.vue +8 -15
- package/layers/shader/app/components/Pipeline/DiagonalGradient.client.vue +19 -21
- package/layers/shader/app/components/Pipeline/DiamondGradient.client.vue +19 -21
- package/layers/shader/app/components/Pipeline/DifferenceBlend.client.vue +15 -17
- package/layers/shader/app/components/Pipeline/DivideBlend.client.vue +14 -17
- package/layers/shader/app/components/Pipeline/DomainWarpedNoise.client.vue +30 -37
- package/layers/shader/app/components/Pipeline/Dots.client.vue +26 -33
- package/layers/shader/app/components/Pipeline/DuoTone.client.vue +16 -19
- package/layers/shader/app/components/Pipeline/ExclusionBlend.client.vue +14 -17
- package/layers/shader/app/components/Pipeline/ExponentialFog.client.vue +21 -23
- package/layers/shader/app/components/Pipeline/Exposure.client.vue +8 -15
- package/layers/shader/app/components/Pipeline/FBMNoise.client.vue +28 -36
- package/layers/shader/app/components/Pipeline/FilmBurn.client.vue +27 -28
- package/layers/shader/app/components/Pipeline/FilmGrain.client.vue +29 -29
- package/layers/shader/app/components/Pipeline/FisheyeRay.client.vue +11 -18
- package/layers/shader/app/components/Pipeline/Flame.client.vue +26 -27
- package/layers/shader/app/components/Pipeline/FocalGradient.client.vue +24 -25
- package/layers/shader/app/components/Pipeline/Gamma.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/GodRays.client.vue +32 -39
- package/layers/shader/app/components/Pipeline/GradientNoise.client.vue +22 -22
- package/layers/shader/app/components/Pipeline/Grain.client.vue +34 -41
- package/layers/shader/app/components/Pipeline/Grid.client.vue +24 -24
- package/layers/shader/app/components/Pipeline/Halation.client.vue +22 -24
- package/layers/shader/app/components/Pipeline/Halftone.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/HardLightBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/Haze.client.vue +22 -24
- package/layers/shader/app/components/Pipeline/Hexagon.client.vue +22 -22
- package/layers/shader/app/components/Pipeline/Hue.client.vue +8 -12
- package/layers/shader/app/components/Pipeline/Invert.client.vue +0 -1
- package/layers/shader/app/components/Pipeline/LensFlare.client.vue +27 -25
- package/layers/shader/app/components/Pipeline/LightenBlend.client.vue +15 -14
- package/layers/shader/app/components/Pipeline/LinearGradient.client.vue +17 -21
- package/layers/shader/app/components/Pipeline/LinearGradient4.client.vue +29 -33
- package/layers/shader/app/components/Pipeline/LinearToSRGB.client.vue +8 -12
- package/layers/shader/app/components/Pipeline/Marble.client.vue +41 -47
- package/layers/shader/app/components/Pipeline/MixBlend.client.vue +21 -27
- package/layers/shader/app/components/Pipeline/MonochromeTint.client.vue +16 -21
- package/layers/shader/app/components/Pipeline/MultiplyBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/NoisyGradient.client.vue +34 -40
- package/layers/shader/app/components/Pipeline/NoisyGradientBlend.client.vue +54 -60
- package/layers/shader/app/components/Pipeline/OverlayBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/PaperTexture.client.vue +22 -24
- package/layers/shader/app/components/Pipeline/Polygon.client.vue +32 -39
- package/layers/shader/app/components/Pipeline/Posterise.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/RadialGradient.client.vue +18 -24
- package/layers/shader/app/components/Pipeline/RayAutoOrbit.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/RayMouseOrbit.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/RayRotateX.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/RayRotateY.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/RayRotateZ.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/RayTiltBasis.client.vue +21 -22
- package/layers/shader/app/components/Pipeline/RaymarchTunnel.client.vue +34 -40
- package/layers/shader/app/components/Pipeline/Rectangle.client.vue +30 -36
- package/layers/shader/app/components/Pipeline/ReinhardTonemap.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/RidgedNoise.client.vue +22 -22
- package/layers/shader/app/components/Pipeline/Ring.client.vue +26 -32
- package/layers/shader/app/components/Pipeline/RingField.client.vue +36 -33
- package/layers/shader/app/components/Pipeline/RisographGrain.client.vue +29 -35
- package/layers/shader/app/components/Pipeline/RotatedGradientBlend.client.vue +29 -35
- package/layers/shader/app/components/Pipeline/SDFColourMask.client.vue +15 -18
- package/layers/shader/app/components/Pipeline/SDFRadialMask.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/SRGBToLinear.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/Saturation.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/Scanlines.client.vue +21 -22
- package/layers/shader/app/components/Pipeline/ScreenBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/ShaderDebugger.client.vue +28 -29
- package/layers/shader/app/components/Pipeline/SimplexNoise.client.vue +25 -32
- package/layers/shader/app/components/Pipeline/SkyAtmosphere.client.vue +37 -44
- package/layers/shader/app/components/Pipeline/SoftLightBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/SolidColour.client.vue +7 -16
- package/layers/shader/app/components/Pipeline/SplitTone.client.vue +27 -28
- package/layers/shader/app/components/Pipeline/Star.client.vue +31 -37
- package/layers/shader/app/components/Pipeline/Starfield.client.vue +29 -27
- package/layers/shader/app/components/Pipeline/Stripes.client.vue +28 -27
- package/layers/shader/app/components/Pipeline/SubtractBlend.client.vue +15 -16
- package/layers/shader/app/components/Pipeline/TanhTonemap.client.vue +8 -17
- package/layers/shader/app/components/Pipeline/Threshold.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/Tint.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/Triangle.client.vue +22 -22
- package/layers/shader/app/components/Pipeline/UVAspectCorrect.client.vue +0 -2
- package/layers/shader/app/components/Pipeline/UVBreath.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVBulge.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVClamp.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/UVColumnOffset.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVFlipX.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/UVFlipXY.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/UVFlipY.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/UVFractBand.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVMousePull.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/UVNoiseRotate.client.vue +21 -27
- package/layers/shader/app/components/Pipeline/UVNoiseWarp.client.vue +21 -22
- package/layers/shader/app/components/Pipeline/UVOrbit.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/UVParallax.client.vue +8 -18
- package/layers/shader/app/components/Pipeline/UVPixelate.client.vue +7 -14
- package/layers/shader/app/components/Pipeline/UVPulse.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVRipple.client.vue +26 -26
- package/layers/shader/app/components/Pipeline/UVRotate.client.vue +16 -22
- package/layers/shader/app/components/Pipeline/UVScale.client.vue +16 -22
- package/layers/shader/app/components/Pipeline/UVScroll.client.vue +12 -18
- package/layers/shader/app/components/Pipeline/UVScrollX.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/UVScrollY.client.vue +8 -14
- package/layers/shader/app/components/Pipeline/UVShear.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVSineWarpXY.client.vue +18 -24
- package/layers/shader/app/components/Pipeline/UVSwapAxes.client.vue +0 -3
- package/layers/shader/app/components/Pipeline/UVTile.client.vue +12 -18
- package/layers/shader/app/components/Pipeline/UVTwirl.client.vue +16 -18
- package/layers/shader/app/components/Pipeline/UVWarp.client.vue +21 -22
- package/layers/shader/app/components/Pipeline/VHSBleed.client.vue +27 -28
- package/layers/shader/app/components/Pipeline/ValueNoise.client.vue +22 -22
- package/layers/shader/app/components/Pipeline/Vibrance.client.vue +11 -17
- package/layers/shader/app/components/Pipeline/Vignette.client.vue +14 -20
- package/layers/shader/app/components/Pipeline/VoronoiEdges.client.vue +29 -28
- package/layers/shader/app/components/Pipeline/Water.client.vue +31 -37
- package/layers/shader/app/components/Pipeline/WaveBendLayer.client.vue +26 -32
- package/layers/shader/app/components/Pipeline/WaveColourLayer.client.vue +37 -36
- package/layers/shader/app/components/Pipeline/WhiteBalance.client.vue +23 -26
- package/layers/shader/app/components/Pipeline/Wood.client.vue +34 -40
- package/layers/shader/app/components/Preset/Aurora.client.vue +0 -7
- package/layers/shader/app/components/Preset/Flow.client.vue +15 -23
- package/layers/shader/app/components/Preset/GradientMesh.client.vue +15 -23
- package/layers/shader/app/components/Preset/Nebula.client.vue +15 -25
- package/layers/shader/app/components/Preset/Ocean.client.vue +15 -24
- package/layers/shader/app/components/Preset/ThemeAurora.client.vue +38 -47
- package/layers/shader/app/components/Preset/ThemeBubble.client.vue +38 -47
- package/layers/shader/app/components/Preset/ThemeFlow.client.vue +38 -47
- package/layers/shader/app/components/Preset/ThemeGradient.client.vue +38 -47
- package/layers/shader/app/components/Preset/ThemeLavaLamp.client.vue +38 -47
- package/layers/shader/app/components/Preset/ThemePlasma.client.vue +38 -47
- package/layers/shader/app/components/Preset/ThemeWave.client.vue +38 -47
- package/layers/shader/app/components/Shader/Background.client.vue +109 -75
- package/layers/shader/app/components/Shader/Debug.vue +4 -14
- package/layers/shader/app/components/Shader/Host.client.vue +7 -9
- package/layers/shader/app/components/Shader/Material.client.vue +8 -20
- package/layers/shader/app/components/Shader/Pipeline.client.vue +0 -6
- package/layers/shader/app/components/Shader/Runtime.client.vue +0 -5
- package/layers/shader/app/composables/useAmbientMaterials.ts +4 -9
- package/layers/shader/app/composables/useCSSColourUniform.ts +0 -4
- package/layers/shader/app/composables/useCSSFloatUniform.ts +0 -3
- package/layers/shader/app/composables/useShader.ts +1 -4
- package/layers/shader/app/composables/useShaderColor.ts +4 -6
- package/layers/shader/app/composables/useShaderFloat.ts +1 -3
- package/layers/shader/app/composables/useShaderGraph.ts +4 -5
- package/layers/shader/app/composables/useShaderRuntime.ts +0 -5
- package/layers/shader/app/composables/useShaderVec2.ts +4 -8
- package/layers/shader/app/composables/useSunDirectionUniform.ts +0 -6
- package/layers/shader/app/composables/useThemeColors.ts +0 -1
- package/layers/shader/app/composables/useUniforms.ts +25 -9
- package/layers/shader/app/plugins/shader.client.ts +4 -3
- package/layers/shader/app/shaders/common/blend.ts +2 -4
- package/layers/shader/app/shaders/common/complex.ts +0 -2
- package/layers/shader/app/shaders/common/effects.ts +5 -13
- package/layers/shader/app/shaders/common/grain.ts +2 -7
- package/layers/shader/app/shaders/common/lighting.ts +0 -3
- package/layers/shader/app/shaders/common/math.ts +12 -8
- package/layers/shader/app/shaders/common/noise.ts +48 -48
- package/layers/shader/app/shaders/common/noiseHelpers.ts +6 -6
- package/layers/shader/app/shaders/common/palette.ts +10 -11
- package/layers/shader/app/shaders/common/patterns.ts +1 -4
- package/layers/shader/app/shaders/common/sdf.ts +11 -7
- package/layers/shader/app/shaders/common/shapes.ts +25 -15
- package/layers/shader/app/shaders/common/tonemapping.ts +0 -2
- package/layers/shader/app/shaders/common/uv.ts +20 -29
- package/layers/shader/app/shaders/createMaterial.ts +2 -5
- package/layers/shader/app/shaders/layers/aurora.ts +14 -17
- package/layers/shader/app/shaders/layers/meshGradient.ts +13 -16
- package/layers/shader/app/shaders/layers/paperShading.ts +15 -19
- package/layers/shader/app/shaders/layers/shaderGradient.ts +18 -23
- package/layers/shader/app/shaders/layers/stripe.ts +14 -17
- package/layers/shader/app/shaders/types.ts +9 -1
- package/layers/shader/app/types/app-config.d.ts +1 -1
- package/layers/shader/app/types/tsl.ts +0 -1
- package/layers/shader/app/types/uniforms.ts +0 -1
- package/layers/shader/app/utils/tsl/animation.ts +50 -52
- package/layers/shader/app/utils/tsl/color.ts +20 -19
- package/layers/shader/app/utils/tsl/noise.ts +10 -12
- package/layers/shader/app/utils/tsl/oklch.ts +6 -7
- package/layers/shader/app/utils/tsl/patterns.ts +4 -6
- package/layers/shader/app/utils/tsl/tween.ts +2 -4
- package/layers/shader/app/utils/tsl/uv.ts +6 -6
- package/layers/theme/app/components/ThemePicker/AccentButton.vue +1 -3
- package/layers/theme/app/components/ThemePicker/Colors.vue +0 -1
- package/layers/theme/app/composables/useAccentColor.ts +0 -1
- package/layers/theme/app/plugins/theme.client.ts +4 -3
- package/layers/theme/app/types/app-config.d.ts +1 -2
- package/layers/transitions/app/components/Motion/Transition.vue +15 -22
- package/layers/typography/app/components/Typography/CodeBlock.vue +16 -19
- package/layers/typography/app/components/Typography/Headline.vue +46 -49
- package/layers/typography/app/components/Typography/HeadlineScreen.vue +36 -40
- package/layers/typography/app/components/Typography/QuoteBlock.vue +3 -4
- package/layers/typography/app/components/Typography/TextStroke.vue +15 -20
- package/layers/typography/app/components/Typography/index.vue +0 -4
- package/layers/typography/app/composables/typography.ts +9 -11
- package/layers/visual/app/app.config.ts +1 -2
- package/layers/visual/app/components/Accent/Blob.vue +0 -3
- package/layers/visual/app/components/Accent/Scene.vue +12 -17
- package/layers/visual/app/components/Base/Modal.vue +0 -1
- package/layers/visual/app/components/Gradient/Background.vue +10 -13
- package/layers/visual/app/components/Gradient/Text.vue +10 -13
- package/layers/visual/app/components/Media/Picture.vue +0 -1
- package/layers/visual/app/components/Progress/Bar.vue +0 -1
- package/layers/visual/app/components/Progress/Circular.vue +0 -1
- package/layers/visual/app/components/Tint/Overlay.vue +0 -2
- package/layers/visual/app/composables/gradient.ts +6 -11
- package/layers/visual/app/composables/picture.ts +0 -1
- package/layers/visual/app/composables/tint.ts +0 -1
- package/layers/visual/app/types/media.ts +0 -1
- package/package.json +2 -1
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-explicit-any */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
4
|
-
// @ts-nocheck - TSL types are complex
|
|
5
1
|
import { DoubleSide } from 'three'
|
|
6
2
|
import {
|
|
7
|
-
abs,
|
|
8
3
|
add,
|
|
9
4
|
exp,
|
|
10
5
|
float,
|
|
@@ -13,7 +8,6 @@ import {
|
|
|
13
8
|
mix,
|
|
14
9
|
mul,
|
|
15
10
|
pow,
|
|
16
|
-
sign,
|
|
17
11
|
sin,
|
|
18
12
|
smoothstep,
|
|
19
13
|
sub,
|
|
@@ -34,6 +28,7 @@ import {
|
|
|
34
28
|
voronoi2D,
|
|
35
29
|
} from '../shaders/common/noise'
|
|
36
30
|
import { cosinePalette } from '../shaders/common/palette'
|
|
31
|
+
import type { TSLNode } from '../shaders/types'
|
|
37
32
|
|
|
38
33
|
// ============================================
|
|
39
34
|
// Types
|
|
@@ -600,13 +595,13 @@ export function createThemeWaveColorNode(
|
|
|
600
595
|
|
|
601
596
|
// Wave warp (order matters: warped x feeds into y)
|
|
602
597
|
const waveSpeed = mul(time, uSpeed, 2.0)
|
|
603
|
-
const wx = rx.add(sin(ry.mul(5.0).add(waveSpeed)).div(30.0))
|
|
604
|
-
const wy = ry.add(sin(wx.mul(7.5).add(waveSpeed)).div(15.0))
|
|
598
|
+
const wx: TSLNode = rx.add(sin(ry.mul(5.0).add(waveSpeed)).div(30.0))
|
|
599
|
+
const wy: TSLNode = ry.add(sin(wx.mul(7.5).add(waveSpeed)).div(15.0))
|
|
605
600
|
|
|
606
601
|
// -5° rotation for layer blend
|
|
607
602
|
const COS5 = Math.cos((-5 * Math.PI) / 180)
|
|
608
603
|
const SIN5 = Math.sin((-5 * Math.PI) / 180)
|
|
609
|
-
const rotated5x = wx.mul(COS5).sub(wy.mul(SIN5))
|
|
604
|
+
const rotated5x: TSLNode = wx.mul(COS5).sub(wy.mul(SIN5))
|
|
610
605
|
|
|
611
606
|
const layer1 = mix(colors.color1, colors.color2, smoothstep(-0.3, 0.2, rotated5x))
|
|
612
607
|
const layer2 = mix(colors.color3, colors.color4, smoothstep(-0.3, 0.2, rotated5x))
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable no-restricted-syntax */
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
1
|
import { Color, Vector3 } from 'three'
|
|
4
2
|
import { uniform } from 'three/tsl'
|
|
5
3
|
|
|
@@ -12,7 +10,6 @@ import { uniform } from 'three/tsl'
|
|
|
12
10
|
* // Use primaryNode directly inside useShaderStage closures.
|
|
13
11
|
*/
|
|
14
12
|
export function useCSSColourUniform(varName: string) {
|
|
15
|
-
// @ts-expect-error — TSL uniform types
|
|
16
13
|
const node = uniform(new Vector3(0, 0, 0))
|
|
17
14
|
const c = new Color()
|
|
18
15
|
|
|
@@ -21,7 +18,6 @@ export function useCSSColourUniform(varName: string) {
|
|
|
21
18
|
if (!raw) return
|
|
22
19
|
try {
|
|
23
20
|
c.set(raw)
|
|
24
|
-
// @ts-expect-error
|
|
25
21
|
node.value.set(c.r, c.g, c.b)
|
|
26
22
|
} catch {
|
|
27
23
|
/* unsupported format — leave previous value */
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
1
|
import { uniform } from 'three/tsl'
|
|
3
2
|
|
|
4
3
|
/**
|
|
@@ -9,13 +8,11 @@ import { uniform } from 'three/tsl'
|
|
|
9
8
|
* const spacingNode = useCSSFloatUniform('--spacing-scale')
|
|
10
9
|
*/
|
|
11
10
|
export function useCSSFloatUniform(varName: string) {
|
|
12
|
-
// @ts-expect-error — TSL uniform types
|
|
13
11
|
const node = uniform(0)
|
|
14
12
|
|
|
15
13
|
function sync() {
|
|
16
14
|
const raw = getComputedStyle(document.documentElement).getPropertyValue(varName).trim()
|
|
17
15
|
const val = parseFloat(raw)
|
|
18
|
-
// @ts-expect-error
|
|
19
16
|
if (!isNaN(val)) node.value = val
|
|
20
17
|
}
|
|
21
18
|
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
/* eslint-disable complexity */
|
|
2
|
-
/* eslint-disable no-restricted-syntax */
|
|
3
1
|
import { onUnmounted, shallowRef } from 'vue'
|
|
4
2
|
import { MeshBasicNodeMaterial, MeshStandardNodeMaterial } from 'three/webgpu'
|
|
5
3
|
|
|
@@ -25,10 +23,9 @@ export function useShader(options: UseShaderOptions = {}) {
|
|
|
25
23
|
|
|
26
24
|
function createMaterial() {
|
|
27
25
|
try {
|
|
26
|
+
material.value = new MeshBasicNodeMaterial()
|
|
28
27
|
if (type === 'standard') {
|
|
29
28
|
material.value = new MeshStandardNodeMaterial()
|
|
30
|
-
} else {
|
|
31
|
-
material.value = new MeshBasicNodeMaterial()
|
|
32
29
|
}
|
|
33
30
|
|
|
34
31
|
applyConfig(config)
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/* eslint-disable no-restricted-syntax */
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
|
-
// @ts-nocheck - TSL types are complex
|
|
4
1
|
import { Color } from 'three'
|
|
5
2
|
import { uniform } from 'three/tsl'
|
|
6
3
|
|
|
4
|
+
import { oklchToColor } from '../utils/tsl/oklch'
|
|
7
5
|
import type { TweenHandle } from '../utils/tsl/tween'
|
|
8
6
|
|
|
9
7
|
/**
|
|
@@ -74,10 +72,10 @@ export function useShaderColor(initialHex: string) {
|
|
|
74
72
|
|
|
75
73
|
if (rawT < 1) {
|
|
76
74
|
requestAnimationFrame(tick)
|
|
77
|
-
|
|
78
|
-
hex.value = targetHex
|
|
79
|
-
resolvePromise()
|
|
75
|
+
return
|
|
80
76
|
}
|
|
77
|
+
hex.value = targetHex
|
|
78
|
+
resolvePromise()
|
|
81
79
|
}
|
|
82
80
|
|
|
83
81
|
requestAnimationFrame(tick)
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
|
-
// @ts-nocheck - TSL types are complex
|
|
3
1
|
import { uniform } from 'three/tsl'
|
|
4
2
|
|
|
5
|
-
import type
|
|
3
|
+
import { tweenUniform, type TweenHandle } from '../utils/tsl/tween'
|
|
6
4
|
|
|
7
5
|
export type ShaderFloatOptions = {
|
|
8
6
|
min?: number
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-params */
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
|
-
// @ts-nocheck - TSL types are complex
|
|
4
1
|
import type { InjectionKey } from 'vue'
|
|
5
2
|
import { mix as tslMix } from 'three/tsl'
|
|
6
3
|
|
|
@@ -64,12 +61,14 @@ export function useShaderGraph(): ShaderGraph {
|
|
|
64
61
|
void version.value
|
|
65
62
|
|
|
66
63
|
const sorted = [...entries.values()].sort((a, b) => a.order - b.order)
|
|
67
|
-
|
|
64
|
+
const [first] = sorted
|
|
65
|
+
if (!first) return null
|
|
68
66
|
|
|
69
|
-
let result =
|
|
67
|
+
let result = first.node
|
|
70
68
|
|
|
71
69
|
for (let i = 1; i < sorted.length; i++) {
|
|
72
70
|
const entry = sorted[i]
|
|
71
|
+
if (!entry) continue
|
|
73
72
|
result = applyBlend(result, entry.node, entry.blend, entry.opacity)
|
|
74
73
|
}
|
|
75
74
|
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
|
-
// @ts-nocheck - TSL types are complex
|
|
4
1
|
import type { InjectionKey } from 'vue'
|
|
5
2
|
import { Color } from 'three'
|
|
6
3
|
import { uniform } from 'three/tsl'
|
|
7
4
|
|
|
8
|
-
import type { MousePositionOptions } from './useMousePosition'
|
|
9
|
-
import type { ShaderTimeOptions } from './useShaderTime'
|
|
10
5
|
|
|
11
6
|
export type ShaderRuntimeOptions = {
|
|
12
7
|
speed?: number
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-params */
|
|
2
|
-
/* eslint-disable no-restricted-syntax */
|
|
3
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
4
|
-
// @ts-nocheck - TSL types are complex
|
|
5
1
|
import { Vector2 } from 'three'
|
|
6
2
|
import { uniform } from 'three/tsl'
|
|
7
3
|
|
|
@@ -66,11 +62,11 @@ export function useShaderVec2(initialX = 0, initialY = 0) {
|
|
|
66
62
|
|
|
67
63
|
if (rawT < 1) {
|
|
68
64
|
requestAnimationFrame(tick)
|
|
69
|
-
|
|
70
|
-
x.value = targetX
|
|
71
|
-
y.value = targetY
|
|
72
|
-
resolvePromise()
|
|
65
|
+
return
|
|
73
66
|
}
|
|
67
|
+
x.value = targetX
|
|
68
|
+
y.value = targetY
|
|
69
|
+
resolvePromise()
|
|
74
70
|
}
|
|
75
71
|
|
|
76
72
|
requestAnimationFrame(tick)
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
2
1
|
import { Vector2 } from 'three'
|
|
3
2
|
import { float, time, uniform, vec3 } from 'three/tsl'
|
|
4
3
|
|
|
@@ -26,12 +25,10 @@ export function useSunDirectionUniform(options: SunDirectionOptions = {}) {
|
|
|
26
25
|
const { speed = 0.05, useMouseY = false } = options
|
|
27
26
|
|
|
28
27
|
if (useMouseY) {
|
|
29
|
-
// @ts-expect-error
|
|
30
28
|
const mouse = uniform(new Vector2(0.5, 0.5))
|
|
31
29
|
|
|
32
30
|
onMounted(() => {
|
|
33
31
|
const onMove = (e: MouseEvent) => {
|
|
34
|
-
// @ts-expect-error
|
|
35
32
|
mouse.value.set(e.clientX / window.innerWidth, e.clientY / window.innerHeight)
|
|
36
33
|
}
|
|
37
34
|
window.addEventListener('mousemove', onMove)
|
|
@@ -41,15 +38,12 @@ export function useSunDirectionUniform(options: SunDirectionOptions = {}) {
|
|
|
41
38
|
// angle = -(mouseY - 0.5) — top of screen = sun high, bottom = sun low
|
|
42
39
|
const angle = mouse.y.oneMinus().sub(0.5)
|
|
43
40
|
const a = angle.mul(5).add(0.5)
|
|
44
|
-
// @ts-expect-error
|
|
45
41
|
return vec3(float(0), a.sin().negate(), a.cos())
|
|
46
42
|
}
|
|
47
43
|
|
|
48
44
|
// Animated mode — pure TSL expression, no JS uniform needed
|
|
49
|
-
// @ts-expect-error
|
|
50
45
|
const speedNode = uniform(speed)
|
|
51
46
|
const angle = time.mul(speedNode).sin().div(8).sub(0.2)
|
|
52
47
|
const a = angle.mul(5).add(0.5)
|
|
53
|
-
// @ts-expect-error
|
|
54
48
|
return vec3(float(0), a.sin().negate(), a.cos())
|
|
55
49
|
}
|
|
@@ -1,23 +1,39 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
|
-
// @ts-nocheck
|
|
4
1
|
|
|
5
2
|
import { reactive, ref, watch } from 'vue'
|
|
6
|
-
import { Color, Vector2, Vector3 } from 'three'
|
|
3
|
+
import { Color, Matrix3, Matrix4, Vector2, Vector3, Vector4 } from 'three'
|
|
7
4
|
import { uniform } from 'three/tsl'
|
|
8
5
|
|
|
9
|
-
import type { UniformValue, UniformValues } from '../types'
|
|
6
|
+
import type { TSLNode, UniformValue, UniformValues } from '../types'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* `uniform()` is typed with per-type overloads, so a `UniformValue` union
|
|
10
|
+
* needs narrowing before the call resolves.
|
|
11
|
+
*/
|
|
12
|
+
function createUniformNode(value: UniformValue): TSLNode {
|
|
13
|
+
if (typeof value === 'number') return uniform(value)
|
|
14
|
+
if (typeof value === 'boolean') return uniform(value)
|
|
15
|
+
if (value instanceof Vector2) return uniform(value)
|
|
16
|
+
if (value instanceof Vector3) return uniform(value)
|
|
17
|
+
if (value instanceof Vector4) return uniform(value)
|
|
18
|
+
if (value instanceof Matrix3) return uniform(value)
|
|
19
|
+
if (value instanceof Matrix4) return uniform(value)
|
|
20
|
+
if (value instanceof Color) return uniform(value)
|
|
21
|
+
// Strings (node type names) and textures are handled by uniform() at runtime
|
|
22
|
+
// but aren't covered by its typed overloads
|
|
23
|
+
const loose = uniform as unknown as (v: UniformValue) => TSLNode
|
|
24
|
+
return loose(value)
|
|
25
|
+
}
|
|
10
26
|
|
|
11
27
|
/**
|
|
12
28
|
* Creates reactive uniforms that bridge Vue state to TSL shaders
|
|
13
29
|
*/
|
|
14
30
|
export function useUniforms<T extends UniformValues>(initialValues: T) {
|
|
15
31
|
const values = reactive({ ...initialValues }) as T
|
|
16
|
-
const nodes: Record<string,
|
|
32
|
+
const nodes: Record<string, TSLNode> = {}
|
|
17
33
|
|
|
18
34
|
// Create uniform nodes for each value
|
|
19
35
|
for (const [key, value] of Object.entries(initialValues)) {
|
|
20
|
-
nodes[key] =
|
|
36
|
+
nodes[key] = createUniformNode(value)
|
|
21
37
|
}
|
|
22
38
|
|
|
23
39
|
// Watch for changes and update uniform nodes
|
|
@@ -79,7 +95,7 @@ export function useUniforms<T extends UniformValues>(initialValues: T) {
|
|
|
79
95
|
* Get all uniform nodes as an object
|
|
80
96
|
*/
|
|
81
97
|
function getNodes() {
|
|
82
|
-
return nodes as Record<keyof T,
|
|
98
|
+
return nodes as Record<keyof T, TSLNode>
|
|
83
99
|
}
|
|
84
100
|
|
|
85
101
|
return {
|
|
@@ -98,7 +114,7 @@ export function useUniforms<T extends UniformValues>(initialValues: T) {
|
|
|
98
114
|
*/
|
|
99
115
|
export function useUniform<T extends UniformValue>(initialValue: T) {
|
|
100
116
|
const value = ref(initialValue) as Ref<T>
|
|
101
|
-
const node =
|
|
117
|
+
const node = createUniformNode(initialValue)
|
|
102
118
|
|
|
103
119
|
watch(value, (newValue) => {
|
|
104
120
|
node.value = newValue
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
/* eslint-disable no-restricted-syntax */
|
|
2
|
-
/* eslint-disable @typescript-eslint/consistent-type-assertions */
|
|
3
1
|
import { checkWebGPUSupport } from '#layers/canvas/app/composables/useRendererCapabilities'
|
|
4
2
|
|
|
5
|
-
export default defineNuxtPlugin(
|
|
3
|
+
export default defineNuxtPlugin({
|
|
4
|
+
name: 'shader:shader',
|
|
5
|
+
async setup() {
|
|
6
6
|
const config = useAppConfig()
|
|
7
7
|
const shaderConfig = (config.shader || {}) as {
|
|
8
8
|
preferWebGPU?: boolean
|
|
@@ -28,4 +28,5 @@ export default defineNuxtPlugin(async () => {
|
|
|
28
28
|
},
|
|
29
29
|
},
|
|
30
30
|
}
|
|
31
|
+
},
|
|
31
32
|
})
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-params */
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
|
-
// @ts-nocheck - TSL types are complex and not fully exported from three/tsl
|
|
4
1
|
/**
|
|
5
2
|
* Modular TSL Color Blending Utilities
|
|
6
3
|
* Provides composable blend mode functions for shader effects
|
|
@@ -194,7 +191,8 @@ export function blendLayers(
|
|
|
194
191
|
let result = base
|
|
195
192
|
|
|
196
193
|
for (const layer of layers) {
|
|
197
|
-
|
|
194
|
+
// Default to normal blending — blendWithOpacity already mixes with base by opacity
|
|
195
|
+
const blendFn = layer.blendMode ?? ((_base: TSLNode, blend: TSLNode) => blend)
|
|
198
196
|
result = blendWithOpacity(result, layer.color, blendFn, layer.opacity)
|
|
199
197
|
}
|
|
200
198
|
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/* eslint-disable complexity */
|
|
2
|
-
/* eslint-disable no-restricted-syntax */
|
|
3
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
4
|
-
// @ts-nocheck - TSL types are complex and not fully exported from three/tsl
|
|
5
1
|
/**
|
|
6
2
|
* Modular TSL Post-Processing Effects
|
|
7
3
|
* Provides effects that sample and process textures
|
|
@@ -237,18 +233,14 @@ export function waveDistortionEffect(
|
|
|
237
233
|
|
|
238
234
|
const _uv = inputUV().toVar()
|
|
239
235
|
|
|
240
|
-
|
|
236
|
+
const _eX = _uv.y.mul(_freq).add(_time).sin().mul(_amp)
|
|
237
|
+
const _eY = _uv.x.mul(_freq).add(_time.mul(1.3)).sin().mul(_amp)
|
|
238
|
+
let distortedUV: TSLNode = vec2(_uv.x.add(_eX), _uv.y.add(_eY))
|
|
241
239
|
|
|
242
240
|
if (direction === 'x') {
|
|
243
|
-
|
|
244
|
-
distortedUV = vec2(_uv.x.add(offsetX), _uv.y)
|
|
241
|
+
distortedUV = vec2(_uv.x.add(_eX), _uv.y)
|
|
245
242
|
} else if (direction === 'y') {
|
|
246
|
-
|
|
247
|
-
distortedUV = vec2(_uv.x, _uv.y.add(offsetY))
|
|
248
|
-
} else {
|
|
249
|
-
const offsetX = _uv.y.mul(_freq).add(_time).sin().mul(_amp)
|
|
250
|
-
const offsetY = _uv.x.mul(_freq).add(_time.mul(1.3)).sin().mul(_amp)
|
|
251
|
-
distortedUV = vec2(_uv.x.add(offsetX), _uv.y.add(offsetY))
|
|
243
|
+
distortedUV = vec2(_uv.x, _uv.y.add(_uv.x.mul(_freq).add(_time).sin().mul(_amp)))
|
|
252
244
|
}
|
|
253
245
|
|
|
254
246
|
return input.sample(distortedUV)
|
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-params */
|
|
2
|
-
/* eslint-disable @typescript-eslint/no-unused-vars */
|
|
3
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
4
|
-
// @ts-nocheck - TSL types are complex and not fully exported from three/tsl
|
|
5
1
|
/**
|
|
6
2
|
* Modular TSL Grain & Film Effects
|
|
7
3
|
* Provides composable grain and texture overlay functions
|
|
@@ -73,7 +69,7 @@ export function coloredGrain(
|
|
|
73
69
|
*/
|
|
74
70
|
export function bayer2x2(uv: TSLNode, scale: TSLNode | number = 1): TSLNode {
|
|
75
71
|
const s = typeof scale === 'number' ? float(scale) : scale
|
|
76
|
-
const pos = floor(uv.mul(s)).mod(2)
|
|
72
|
+
const pos: TSLNode = floor(uv.mul(s)).mod(2)
|
|
77
73
|
const matrix = vec2(0.25, 0.75)
|
|
78
74
|
return mix(mix(matrix.x, matrix.y, pos.x), mix(matrix.y, matrix.x, pos.x), pos.y)
|
|
79
75
|
}
|
|
@@ -83,7 +79,6 @@ export function bayer2x2(uv: TSLNode, scale: TSLNode | number = 1): TSLNode {
|
|
|
83
79
|
*/
|
|
84
80
|
export function bayer4x4(uv: TSLNode, scale: TSLNode | number = 1): TSLNode {
|
|
85
81
|
const s = typeof scale === 'number' ? float(scale) : scale
|
|
86
|
-
const pos = floor(uv.mul(s)).mod(4)
|
|
87
82
|
|
|
88
83
|
// Simplified 4x4 Bayer matrix approximation
|
|
89
84
|
const bayer2 = bayer2x2(uv, s)
|
|
@@ -427,7 +422,7 @@ function getBayer8x8Value(x: TSLNode, y: TSLNode): TSLNode {
|
|
|
427
422
|
*/
|
|
428
423
|
export function bayer8x8(uv: TSLNode, scale: TSLNode | number = 1): TSLNode {
|
|
429
424
|
const s = typeof scale === 'number' ? float(scale) : scale
|
|
430
|
-
const pos = floor(uv.mul(s)).mod(8)
|
|
425
|
+
const pos: TSLNode = floor(uv.mul(s)).mod(8)
|
|
431
426
|
return getBayer8x8Value(pos.x, pos.y)
|
|
432
427
|
}
|
|
433
428
|
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/* eslint-disable max-params */
|
|
2
|
-
/* eslint-disable @typescript-eslint/ban-ts-comment */
|
|
3
|
-
// @ts-nocheck - TSL types are complex and not fully exported from three/tsl
|
|
4
1
|
/**
|
|
5
2
|
* Modular TSL Math Utilities
|
|
6
3
|
* Provides hyperbolic functions, complex number operations, and coordinate utilities
|
|
@@ -8,13 +5,16 @@
|
|
|
8
5
|
import {
|
|
9
6
|
abs,
|
|
10
7
|
add,
|
|
8
|
+
atan,
|
|
11
9
|
clamp,
|
|
12
10
|
cos,
|
|
13
11
|
div,
|
|
14
12
|
exp,
|
|
13
|
+
float,
|
|
15
14
|
If,
|
|
16
15
|
length,
|
|
17
16
|
log,
|
|
17
|
+
mix,
|
|
18
18
|
mul,
|
|
19
19
|
PI,
|
|
20
20
|
pow,
|
|
@@ -127,7 +127,9 @@ export function complexPow(v: TSLNode, p: TSLNode | number): TSLNode {
|
|
|
127
127
|
* @returns Sine in complex form
|
|
128
128
|
*/
|
|
129
129
|
export function complexSin(a: TSLNode): TSLNode {
|
|
130
|
-
|
|
130
|
+
const re: TSLNode = sin(a.x).mul(cosh(a.y))
|
|
131
|
+
const im: TSLNode = cos(a.x).mul(sinh(a.y))
|
|
132
|
+
return vec2(re, im)
|
|
131
133
|
}
|
|
132
134
|
|
|
133
135
|
/**
|
|
@@ -136,7 +138,9 @@ export function complexSin(a: TSLNode): TSLNode {
|
|
|
136
138
|
* @returns Cosine in complex form
|
|
137
139
|
*/
|
|
138
140
|
export function complexCos(a: TSLNode): TSLNode {
|
|
139
|
-
|
|
141
|
+
const re: TSLNode = cos(a.x).mul(cosh(a.y))
|
|
142
|
+
const im: TSLNode = sin(a.x).mul(sinh(a.y)).negate()
|
|
143
|
+
return vec2(re, im)
|
|
140
144
|
}
|
|
141
145
|
|
|
142
146
|
/**
|
|
@@ -223,10 +227,10 @@ export function grad(
|
|
|
223
227
|
t.assign(smoothstep(0.0, 1.0, t))
|
|
224
228
|
u.assign(smoothstep(0.0, 1.0, u))
|
|
225
229
|
|
|
226
|
-
const colorA = vec4(_color0.xyz
|
|
227
|
-
const colorB = vec4(_color2.xyz
|
|
230
|
+
const colorA: TSLNode = vec4(mix(_color0.xyz, _color1.xyz, u), 1.0).toVar()
|
|
231
|
+
const colorB: TSLNode = vec4(mix(_color2.xyz, _color3.xyz, u), 1.0).toVar()
|
|
228
232
|
|
|
229
|
-
return colorA.xyz
|
|
233
|
+
return mix(colorA.xyz, colorB.xyz, t)
|
|
230
234
|
}
|
|
231
235
|
|
|
232
236
|
/**
|