kmcom-nuxt-layers 1.6.4 → 1.6.7
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/core/app/.DS_Store +0 -0
- package/layers/core/app/assets/.DS_Store +0 -0
- package/layers/core/app/assets/css/main.css +2 -0
- package/layers/core/app/components/ErrorBoundary.vue +1 -1
- package/layers/core/nuxt.config.ts +0 -8
- package/layers/motion/app/plugins/locomotive-scroll.client.ts +14 -11
- package/layers/motion/app.config.ts +6 -0
- package/layers/shader/app/components/Pipeline/ACESTonemap.client.vue +14 -0
- package/layers/shader/app/components/Pipeline/AddBlend.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/AgedFilm.client.vue +62 -0
- package/layers/shader/app/components/Pipeline/Aurora.client.vue +81 -0
- package/layers/shader/app/components/Pipeline/BilinearGradient.client.vue +46 -0
- package/layers/shader/app/components/Pipeline/BillowNoise.client.vue +42 -0
- package/layers/shader/app/components/Pipeline/BrightnessContrast.client.vue +25 -0
- package/layers/shader/app/components/Pipeline/CellularNoise.client.vue +41 -0
- package/layers/shader/app/components/Pipeline/ChannelMixer.client.vue +44 -0
- package/layers/shader/app/components/Pipeline/ChebyshevNoiseField.client.vue +60 -0
- package/layers/shader/app/components/Pipeline/Checkerboard.client.vue +41 -0
- package/layers/shader/app/components/Pipeline/ChromaticAberration.client.vue +52 -0
- package/layers/shader/app/components/Pipeline/ChromaticScreenWaves.client.vue +49 -0
- package/layers/shader/app/components/Pipeline/Circle.client.vue +41 -0
- package/layers/shader/app/components/Pipeline/Clouds.client.vue +60 -0
- package/layers/shader/app/components/Pipeline/ColorBurnBlend.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/ColorDodgeBlend.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/ColourRamp.client.vue +57 -0
- package/layers/shader/app/components/Pipeline/ComplexPlaneField.client.vue +77 -0
- package/layers/shader/app/components/Pipeline/ConicGradient.client.vue +40 -0
- package/layers/shader/app/components/Pipeline/CosinePalette.client.vue +71 -0
- package/layers/shader/app/components/Pipeline/CoverageAlpha.client.vue +18 -0
- package/layers/shader/app/components/Pipeline/Cross.client.vue +51 -0
- package/layers/shader/app/components/Pipeline/CurlNoise.client.vue +48 -0
- package/layers/shader/app/components/Pipeline/DarkenBlend.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/DayNightCycle.client.vue +48 -0
- package/layers/shader/app/components/Pipeline/Desaturate.client.vue +21 -0
- package/layers/shader/app/components/Pipeline/DiagonalGradient.client.vue +38 -0
- package/layers/shader/app/components/Pipeline/DiamondGradient.client.vue +40 -0
- package/layers/shader/app/components/Pipeline/DifferenceBlend.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/DivideBlend.client.vue +26 -0
- package/layers/shader/app/components/Pipeline/DomainWarpedNoise.client.vue +48 -0
- package/layers/shader/app/components/Pipeline/Dots.client.vue +44 -0
- package/layers/shader/app/components/Pipeline/DuoTone.client.vue +34 -0
- package/layers/shader/app/components/Pipeline/ExclusionBlend.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/ExponentialFog.client.vue +46 -0
- package/layers/shader/app/components/Pipeline/Exposure.client.vue +23 -0
- package/layers/shader/app/components/Pipeline/FBMNoise.client.vue +50 -0
- package/layers/shader/app/components/Pipeline/FilmBurn.client.vue +49 -0
- package/layers/shader/app/components/Pipeline/FilmGrain.client.vue +69 -0
- package/layers/shader/app/components/Pipeline/FisheyeRay.client.vue +35 -0
- package/layers/shader/app/components/Pipeline/Flame.client.vue +51 -0
- package/layers/shader/app/components/Pipeline/FocalGradient.client.vue +43 -0
- package/layers/shader/app/components/Pipeline/Gamma.client.vue +23 -0
- package/layers/shader/app/components/Pipeline/GodRays.client.vue +64 -0
- package/layers/shader/app/components/Pipeline/GradientNoise.client.vue +42 -0
- package/layers/shader/app/components/Pipeline/Grain.client.vue +81 -0
- package/layers/shader/app/components/Pipeline/Grid.client.vue +43 -0
- package/layers/shader/app/components/Pipeline/Halation.client.vue +43 -0
- package/layers/shader/app/components/Pipeline/Halftone.client.vue +33 -0
- package/layers/shader/app/components/Pipeline/HardLightBlend.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/Haze.client.vue +50 -0
- package/layers/shader/app/components/Pipeline/Hexagon.client.vue +42 -0
- package/layers/shader/app/components/Pipeline/Hue.client.vue +21 -0
- package/layers/shader/app/components/Pipeline/Invert.client.vue +14 -0
- package/layers/shader/app/components/Pipeline/LensFlare.client.vue +67 -0
- package/layers/shader/app/components/Pipeline/LightenBlend.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/LinearGradient.client.vue +36 -0
- package/layers/shader/app/components/Pipeline/LinearGradient4.client.vue +67 -0
- package/layers/shader/app/components/Pipeline/LinearToSRGB.client.vue +25 -0
- package/layers/shader/app/components/Pipeline/Marble.client.vue +69 -0
- package/layers/shader/app/components/Pipeline/MixBlend.client.vue +45 -0
- package/layers/shader/app/components/Pipeline/MonochromeTint.client.vue +31 -0
- package/layers/shader/app/components/Pipeline/MultiplyBlend.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/NoisyGradient.client.vue +54 -0
- package/layers/shader/app/components/Pipeline/NoisyGradientBlend.client.vue +116 -0
- package/layers/shader/app/components/Pipeline/OverlayBlend.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/PaperTexture.client.vue +41 -0
- package/layers/shader/app/components/Pipeline/Polygon.client.vue +47 -0
- package/layers/shader/app/components/Pipeline/Posterise.client.vue +23 -0
- package/layers/shader/app/components/Pipeline/RadialGradient.client.vue +39 -0
- package/layers/shader/app/components/Pipeline/RayAutoOrbit.client.vue +37 -0
- package/layers/shader/app/components/Pipeline/RayMouseOrbit.client.vue +49 -0
- package/layers/shader/app/components/Pipeline/RayRotateX.client.vue +25 -0
- package/layers/shader/app/components/Pipeline/RayRotateY.client.vue +25 -0
- package/layers/shader/app/components/Pipeline/RayRotateZ.client.vue +25 -0
- package/layers/shader/app/components/Pipeline/RayTiltBasis.client.vue +41 -0
- package/layers/shader/app/components/Pipeline/RaymarchTunnel.client.vue +101 -0
- package/layers/shader/app/components/Pipeline/Rectangle.client.vue +47 -0
- package/layers/shader/app/components/Pipeline/ReinhardTonemap.client.vue +18 -0
- package/layers/shader/app/components/Pipeline/RidgedNoise.client.vue +41 -0
- package/layers/shader/app/components/Pipeline/Ring.client.vue +44 -0
- package/layers/shader/app/components/Pipeline/RingField.client.vue +69 -0
- package/layers/shader/app/components/Pipeline/RisographGrain.client.vue +74 -0
- package/layers/shader/app/components/Pipeline/RotatedGradientBlend.client.vue +61 -0
- package/layers/shader/app/components/Pipeline/SDFColourMask.client.vue +33 -0
- package/layers/shader/app/components/Pipeline/SDFRadialMask.client.vue +31 -0
- package/layers/shader/app/components/Pipeline/SRGBToLinear.client.vue +25 -0
- package/layers/shader/app/components/Pipeline/Saturation.client.vue +21 -0
- package/layers/shader/app/components/Pipeline/Scanlines.client.vue +36 -0
- package/layers/shader/app/components/Pipeline/ScreenBlend.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/ShaderDebugger.client.vue +74 -0
- package/layers/shader/app/components/Pipeline/SimplexNoise.client.vue +49 -0
- package/layers/shader/app/components/Pipeline/SkyAtmosphere.client.vue +75 -0
- package/layers/shader/app/components/Pipeline/SoftLightBlend.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/SolidColour.client.vue +21 -0
- package/layers/shader/app/components/Pipeline/SplitTone.client.vue +47 -0
- package/layers/shader/app/components/Pipeline/Star.client.vue +47 -0
- package/layers/shader/app/components/Pipeline/Starfield.client.vue +65 -0
- package/layers/shader/app/components/Pipeline/Stripes.client.vue +46 -0
- package/layers/shader/app/components/Pipeline/SubtractBlend.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/TanhTonemap.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/Threshold.client.vue +25 -0
- package/layers/shader/app/components/Pipeline/Tint.client.vue +33 -0
- package/layers/shader/app/components/Pipeline/Triangle.client.vue +42 -0
- package/layers/shader/app/components/Pipeline/UVAspectCorrect.client.vue +14 -0
- package/layers/shader/app/components/Pipeline/UVBreath.client.vue +36 -0
- package/layers/shader/app/components/Pipeline/UVBulge.client.vue +26 -0
- package/layers/shader/app/components/Pipeline/UVClamp.client.vue +18 -0
- package/layers/shader/app/components/Pipeline/UVColumnOffset.client.vue +28 -0
- package/layers/shader/app/components/Pipeline/UVFlipX.client.vue +14 -0
- package/layers/shader/app/components/Pipeline/UVFlipXY.client.vue +14 -0
- package/layers/shader/app/components/Pipeline/UVFlipY.client.vue +14 -0
- package/layers/shader/app/components/Pipeline/UVFractBand.client.vue +31 -0
- package/layers/shader/app/components/Pipeline/UVMousePull.client.vue +39 -0
- package/layers/shader/app/components/Pipeline/UVNoiseRotate.client.vue +54 -0
- package/layers/shader/app/components/Pipeline/UVNoiseWarp.client.vue +35 -0
- package/layers/shader/app/components/Pipeline/UVOrbit.client.vue +34 -0
- package/layers/shader/app/components/Pipeline/UVParallax.client.vue +39 -0
- package/layers/shader/app/components/Pipeline/UVPixelate.client.vue +21 -0
- package/layers/shader/app/components/Pipeline/UVPulse.client.vue +33 -0
- package/layers/shader/app/components/Pipeline/UVRipple.client.vue +34 -0
- package/layers/shader/app/components/Pipeline/UVRotate.client.vue +37 -0
- package/layers/shader/app/components/Pipeline/UVScale.client.vue +30 -0
- package/layers/shader/app/components/Pipeline/UVScroll.client.vue +27 -0
- package/layers/shader/app/components/Pipeline/UVScrollX.client.vue +21 -0
- package/layers/shader/app/components/Pipeline/UVScrollY.client.vue +21 -0
- package/layers/shader/app/components/Pipeline/UVShear.client.vue +25 -0
- package/layers/shader/app/components/Pipeline/UVSineWarpXY.client.vue +46 -0
- package/layers/shader/app/components/Pipeline/UVSwapAxes.client.vue +14 -0
- package/layers/shader/app/components/Pipeline/UVTile.client.vue +27 -0
- package/layers/shader/app/components/Pipeline/UVTwirl.client.vue +26 -0
- package/layers/shader/app/components/Pipeline/UVWarp.client.vue +30 -0
- package/layers/shader/app/components/Pipeline/VHSBleed.client.vue +58 -0
- package/layers/shader/app/components/Pipeline/ValueNoise.client.vue +41 -0
- package/layers/shader/app/components/Pipeline/Vibrance.client.vue +24 -0
- package/layers/shader/app/components/Pipeline/Vignette.client.vue +32 -0
- package/layers/shader/app/components/Pipeline/VoronoiEdges.client.vue +50 -0
- package/layers/shader/app/components/Pipeline/Water.client.vue +53 -0
- package/layers/shader/app/components/Pipeline/WaveBendLayer.client.vue +61 -0
- package/layers/shader/app/components/Pipeline/WaveColourLayer.client.vue +56 -0
- package/layers/shader/app/components/Pipeline/WhiteBalance.client.vue +40 -0
- package/layers/shader/app/components/Pipeline/Wood.client.vue +63 -0
- package/layers/shader/app/components/Shader/Canvas.vue +24 -0
- package/layers/shader/app/components/Shader/Pipeline.client.vue +56 -0
- package/layers/shader/app/components/Shader/PipelineContext.vue +18 -0
- package/layers/shader/app/composables/useCSSColourUniform.ts +41 -0
- package/layers/shader/app/composables/useCSSFloatUniform.ts +34 -0
- package/layers/shader/app/composables/useShaderPerf.ts +73 -0
- package/layers/shader/app/composables/useShaderPipeline.ts +99 -0
- package/layers/shader/app/composables/useSunDirectionUniform.ts +54 -0
- package/layers/shader/app/composables/useTSLNodes.ts +0 -1
- package/layers/shader/app/shaders/common/complex.ts +29 -0
- package/layers/shader/app/shaders/common/shapes.ts +4 -4
- package/layers/shader/app/shaders/common/uv.ts +2 -2
- package/layers/shader/app/utils/tsl/patterns.ts +1 -1
- package/layers/shader/app/utils/tsl/uv.ts +3 -3
- package/layers/ui/app/app.config.ts +2 -16
- package/layers/ui/app/types/app-config.d.ts +17 -0
- package/package.json +9 -7
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { screenSize, vec2 } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
const { order = 0 } = defineProps<{ order?: number }>()
|
|
6
|
+
|
|
7
|
+
useShaderStage(
|
|
8
|
+
(uvIn) => uvIn.mul(vec2(screenSize.x.div(screenSize.y), 1.0)),
|
|
9
|
+
order,
|
|
10
|
+
'uv',
|
|
11
|
+
)
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform, time, vec2, sin, float, smoothstep } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Gentle eased scale oscillation — softer than UVPulse.
|
|
7
|
+
* Uses a smoothstepped sine so the scale dwells at min/max rather than
|
|
8
|
+
* passing through them instantly.
|
|
9
|
+
*/
|
|
10
|
+
const props = withDefaults(defineProps<{
|
|
11
|
+
/** Max scale deviation from 1.0 */
|
|
12
|
+
amount?: number
|
|
13
|
+
/** Breath cycle speed in radians per second */
|
|
14
|
+
speed?: number
|
|
15
|
+
order?: number
|
|
16
|
+
}>(), { amount: 0.05, speed: 0.8, order: 0 })
|
|
17
|
+
|
|
18
|
+
const amountNode = uniform(props.amount)
|
|
19
|
+
const speedNode = uniform(props.speed)
|
|
20
|
+
watch(() => props.amount, v => { amountNode.value = v })
|
|
21
|
+
watch(() => props.speed, v => { speedNode.value = v })
|
|
22
|
+
|
|
23
|
+
useShaderStage(
|
|
24
|
+
(uvIn) => {
|
|
25
|
+
const raw = sin(time.mul(speedNode)).mul(0.5).add(0.5)
|
|
26
|
+
const eased = smoothstep(float(0), float(1), raw)
|
|
27
|
+
const scale = float(1).add(eased.sub(0.5).mul(amountNode.mul(2)))
|
|
28
|
+
const centered = uvIn.sub(0.5).div(scale).add(0.5)
|
|
29
|
+
return vec2(centered.x, centered.y)
|
|
30
|
+
},
|
|
31
|
+
props.order,
|
|
32
|
+
'uv',
|
|
33
|
+
)
|
|
34
|
+
</script>
|
|
35
|
+
|
|
36
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform } from 'three/tsl'
|
|
4
|
+
import { bulgeUV } from '../../shaders/common/uv'
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(defineProps<{
|
|
7
|
+
/** Positive = bulge outward, negative = pinch inward */
|
|
8
|
+
strength?: number
|
|
9
|
+
/** Effective radius of the distortion */
|
|
10
|
+
radius?: number
|
|
11
|
+
order?: number
|
|
12
|
+
}>(), { strength: 0.5, radius: 0.5, order: 0 })
|
|
13
|
+
|
|
14
|
+
const strengthNode = uniform(props.strength)
|
|
15
|
+
const radiusNode = uniform(props.radius)
|
|
16
|
+
watch(() => props.strength, v => { strengthNode.value = v })
|
|
17
|
+
watch(() => props.radius, v => { radiusNode.value = v })
|
|
18
|
+
|
|
19
|
+
useShaderStage(
|
|
20
|
+
(uvIn) => bulgeUV(uvIn, { strength: strengthNode, radius: radiusNode }),
|
|
21
|
+
props.order,
|
|
22
|
+
'uv',
|
|
23
|
+
)
|
|
24
|
+
</script>
|
|
25
|
+
|
|
26
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { clamp, vec2, float } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Clamps UV to [0, 1] — prevents tiling/repeat artefacts at the edges.
|
|
7
|
+
* Equivalent to CSS background-repeat: no-repeat.
|
|
8
|
+
*/
|
|
9
|
+
const { order = 0 } = defineProps<{ order?: number }>()
|
|
10
|
+
|
|
11
|
+
useShaderStage(
|
|
12
|
+
(uvIn) => vec2(clamp(uvIn.x, float(0), float(1)), clamp(uvIn.y, float(0), float(1))),
|
|
13
|
+
order,
|
|
14
|
+
'uv',
|
|
15
|
+
)
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform, vec2 } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<{
|
|
6
|
+
/** Number of columns to divide into */
|
|
7
|
+
columns?: number
|
|
8
|
+
/** Vertical offset multiplied by column index */
|
|
9
|
+
factor?: number
|
|
10
|
+
order?: number
|
|
11
|
+
}>(), { columns: 6, factor: 0.15, order: 0 })
|
|
12
|
+
|
|
13
|
+
const columnsNode = uniform(props.columns)
|
|
14
|
+
const factorNode = uniform(props.factor)
|
|
15
|
+
watch(() => props.columns, v => { columnsNode.value = v })
|
|
16
|
+
watch(() => props.factor, v => { factorNode.value = v })
|
|
17
|
+
|
|
18
|
+
useShaderStage(
|
|
19
|
+
(uvIn) => {
|
|
20
|
+
const col = uvIn.x.mul(columnsNode).floor()
|
|
21
|
+
return vec2(uvIn.x, uvIn.y.add(col.mul(factorNode)))
|
|
22
|
+
},
|
|
23
|
+
props.order,
|
|
24
|
+
'uv',
|
|
25
|
+
)
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { float, vec2 } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
const { order = 0 } = defineProps<{ order?: number }>()
|
|
6
|
+
|
|
7
|
+
useShaderStage(
|
|
8
|
+
(uvIn) => vec2(float(1).sub(uvIn.x), uvIn.y),
|
|
9
|
+
order,
|
|
10
|
+
'uv',
|
|
11
|
+
)
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { float, vec2 } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
const { order = 0 } = defineProps<{ order?: number }>()
|
|
6
|
+
|
|
7
|
+
useShaderStage(
|
|
8
|
+
(uvIn) => vec2(float(1).sub(uvIn.x), float(1).sub(uvIn.y)),
|
|
9
|
+
order,
|
|
10
|
+
'uv',
|
|
11
|
+
)
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { float, vec2 } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
const { order = 0 } = defineProps<{ order?: number }>()
|
|
6
|
+
|
|
7
|
+
useShaderStage(
|
|
8
|
+
(uvIn) => vec2(uvIn.x, float(1).sub(uvIn.y)),
|
|
9
|
+
order,
|
|
10
|
+
'uv',
|
|
11
|
+
)
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform, vec4, clamp } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<{
|
|
6
|
+
/** Number of bands across the UV Y axis */
|
|
7
|
+
frequency?: number
|
|
8
|
+
/** Brightness addend at band peaks */
|
|
9
|
+
scale?: number
|
|
10
|
+
order?: number
|
|
11
|
+
}>(), { frequency: 8, scale: 0.15, order: 0 })
|
|
12
|
+
|
|
13
|
+
const freqNode = uniform(props.frequency)
|
|
14
|
+
const scaleNode = uniform(props.scale)
|
|
15
|
+
watch(() => props.frequency, v => { freqNode.value = v })
|
|
16
|
+
watch(() => props.scale, v => { scaleNode.value = v })
|
|
17
|
+
|
|
18
|
+
const pipeline = useShaderPipelineContext()
|
|
19
|
+
|
|
20
|
+
useShaderStage(
|
|
21
|
+
(prev) => {
|
|
22
|
+
const uvCurrent = pipeline.uvNode.value
|
|
23
|
+
const band = uvCurrent.y.mul(freqNode).fract().mul(scaleNode)
|
|
24
|
+
const rgb = clamp(prev.xyz.add(band), 0, 1)
|
|
25
|
+
return vec4(rgb, prev.w)
|
|
26
|
+
},
|
|
27
|
+
props.order,
|
|
28
|
+
)
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { Vector2 } from 'three'
|
|
4
|
+
import { uniform, vec2 } from 'three/tsl'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Warps UV toward the mouse cursor — different from UVParallax, which shifts
|
|
8
|
+
* the whole field. This pulls individual UV coords toward the pointer position.
|
|
9
|
+
* q += (pointer - uv) * influence * 0.2
|
|
10
|
+
*/
|
|
11
|
+
const props = withDefaults(defineProps<{
|
|
12
|
+
/** Pull strength toward the cursor */
|
|
13
|
+
influence?: number
|
|
14
|
+
order?: number
|
|
15
|
+
}>(), { influence: 0.5, order: 0 })
|
|
16
|
+
|
|
17
|
+
const mouse = uniform(new Vector2(0.5, 0.5))
|
|
18
|
+
const influenceNode = uniform(props.influence)
|
|
19
|
+
watch(() => props.influence, v => { influenceNode.value = v })
|
|
20
|
+
|
|
21
|
+
onMounted(() => {
|
|
22
|
+
const onMove = (e: MouseEvent) => {
|
|
23
|
+
mouse.value.set(e.clientX / window.innerWidth, 1 - e.clientY / window.innerHeight)
|
|
24
|
+
}
|
|
25
|
+
window.addEventListener('mousemove', onMove)
|
|
26
|
+
onUnmounted(() => window.removeEventListener('mousemove', onMove))
|
|
27
|
+
})
|
|
28
|
+
|
|
29
|
+
useShaderStage(
|
|
30
|
+
(uvIn) => {
|
|
31
|
+
const pointer = vec2(mouse.x, mouse.y)
|
|
32
|
+
return uvIn.add(pointer.sub(uvIn).mul(influenceNode).mul(0.2))
|
|
33
|
+
},
|
|
34
|
+
props.order,
|
|
35
|
+
'uv',
|
|
36
|
+
)
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { time, uniform, vec2 } from 'three/tsl'
|
|
4
|
+
import { simplexNoise2D } from '../../shaders/common/noise'
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(defineProps<{
|
|
7
|
+
/** Max rotation in degrees (default 720 = 2 full turns) */
|
|
8
|
+
rotationAmount?: number
|
|
9
|
+
/** Noise animation speed */
|
|
10
|
+
speed?: number
|
|
11
|
+
/** Noise spatial frequency */
|
|
12
|
+
noiseScale?: number
|
|
13
|
+
order?: number
|
|
14
|
+
}>(), {
|
|
15
|
+
rotationAmount: 720,
|
|
16
|
+
speed: 0.1,
|
|
17
|
+
noiseScale: 1,
|
|
18
|
+
order: 0,
|
|
19
|
+
})
|
|
20
|
+
|
|
21
|
+
const rotAmountNode = uniform(props.rotationAmount)
|
|
22
|
+
const speedNode = uniform(props.speed)
|
|
23
|
+
const noiseScaleNode = uniform(props.noiseScale)
|
|
24
|
+
|
|
25
|
+
watch(() => props.rotationAmount, v => { rotAmountNode.value = v })
|
|
26
|
+
watch(() => props.speed, v => { speedNode.value = v })
|
|
27
|
+
watch(() => props.noiseScale, v => { noiseScaleNode.value = v })
|
|
28
|
+
|
|
29
|
+
const DEG_TO_RAD = Math.PI / 180
|
|
30
|
+
|
|
31
|
+
useShaderStage(
|
|
32
|
+
(uvIn) => {
|
|
33
|
+
// Sample gradient noise at animated position: (time*speed, uv.x*uv.y) * noiseScale
|
|
34
|
+
const noiseInput = vec2(time.mul(speedNode), uvIn.x.mul(uvIn.y)).mul(noiseScaleNode)
|
|
35
|
+
const n = simplexNoise2D(noiseInput)
|
|
36
|
+
// Remap noise to angle: (n*0.5) * rotAmount + 180 degrees, avoids snapping to 0
|
|
37
|
+
const angleDeg = n.mul(0.5).mul(rotAmountNode).add(180.0)
|
|
38
|
+
const angle = angleDeg.mul(DEG_TO_RAD)
|
|
39
|
+
|
|
40
|
+
const pivot = vec2(0.5, 0.5)
|
|
41
|
+
const cosA = angle.cos()
|
|
42
|
+
const sinA = angle.sin()
|
|
43
|
+
const centered = uvIn.sub(pivot)
|
|
44
|
+
return vec2(
|
|
45
|
+
centered.x.mul(cosA).sub(centered.y.mul(sinA)),
|
|
46
|
+
centered.x.mul(sinA).add(centered.y.mul(cosA)),
|
|
47
|
+
).add(pivot)
|
|
48
|
+
},
|
|
49
|
+
props.order,
|
|
50
|
+
'uv',
|
|
51
|
+
)
|
|
52
|
+
</script>
|
|
53
|
+
|
|
54
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform, time, vec2 } from 'three/tsl'
|
|
4
|
+
import { fbm2D } from '../../shaders/common/noise'
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(defineProps<{
|
|
7
|
+
/** Warp strength in UV units */
|
|
8
|
+
strength?: number
|
|
9
|
+
/** Noise input scale */
|
|
10
|
+
scale?: number
|
|
11
|
+
/** Animation speed */
|
|
12
|
+
speed?: number
|
|
13
|
+
order?: number
|
|
14
|
+
}>(), { strength: 0.3, scale: 2, speed: 0.2, order: 0 })
|
|
15
|
+
|
|
16
|
+
const strengthNode = uniform(props.strength)
|
|
17
|
+
const scaleNode = uniform(props.scale)
|
|
18
|
+
const speedNode = uniform(props.speed)
|
|
19
|
+
watch(() => props.strength, v => { strengthNode.value = v })
|
|
20
|
+
watch(() => props.scale, v => { scaleNode.value = v })
|
|
21
|
+
watch(() => props.speed, v => { speedNode.value = v })
|
|
22
|
+
|
|
23
|
+
useShaderStage(
|
|
24
|
+
(uvIn) => {
|
|
25
|
+
const t = time.mul(speedNode)
|
|
26
|
+
const warpX = fbm2D(uvIn.mul(scaleNode).add(t))
|
|
27
|
+
const warpY = fbm2D(uvIn.mul(scaleNode).add(vec2(5.2, 1.3)).add(t))
|
|
28
|
+
return uvIn.add(vec2(warpX, warpY).mul(strengthNode))
|
|
29
|
+
},
|
|
30
|
+
props.order,
|
|
31
|
+
'uv',
|
|
32
|
+
)
|
|
33
|
+
</script>
|
|
34
|
+
|
|
35
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform, time, vec2, cos, sin } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Rotates UV around a centre point continuously over time.
|
|
7
|
+
* Distinct from UVRotate (static angle) — this is always animated.
|
|
8
|
+
*/
|
|
9
|
+
const props = withDefaults(defineProps<{
|
|
10
|
+
/** Orbit speed in radians per second */
|
|
11
|
+
speed?: number
|
|
12
|
+
order?: number
|
|
13
|
+
}>(), { speed: 0.5, order: 0 })
|
|
14
|
+
|
|
15
|
+
const speedNode = uniform(props.speed)
|
|
16
|
+
watch(() => props.speed, v => { speedNode.value = v })
|
|
17
|
+
|
|
18
|
+
useShaderStage(
|
|
19
|
+
(uvIn) => {
|
|
20
|
+
const angle = time.mul(speedNode)
|
|
21
|
+
const c = cos(angle)
|
|
22
|
+
const s = sin(angle)
|
|
23
|
+
const centered = uvIn.sub(0.5)
|
|
24
|
+
return vec2(
|
|
25
|
+
centered.x.mul(c).sub(centered.y.mul(s)),
|
|
26
|
+
centered.x.mul(s).add(centered.y.mul(c)),
|
|
27
|
+
).add(0.5)
|
|
28
|
+
},
|
|
29
|
+
props.order,
|
|
30
|
+
'uv',
|
|
31
|
+
)
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { Vector2 } from 'three'
|
|
4
|
+
import { uniform, vec2 } from 'three/tsl'
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Offsets UV by the pointer position scaled by a parallax factor.
|
|
8
|
+
* Creates the illusion of depth as the mouse moves — the ColorBends pattern.
|
|
9
|
+
* p += pointer * parallax * 0.1
|
|
10
|
+
*/
|
|
11
|
+
const props = withDefaults(defineProps<{
|
|
12
|
+
/** Parallax strength: 0 = no movement, 1 = full NDC range */
|
|
13
|
+
parallax?: number
|
|
14
|
+
order?: number
|
|
15
|
+
}>(), { parallax: 0.5, order: 0 })
|
|
16
|
+
|
|
17
|
+
const mouse = uniform(new Vector2(0, 0))
|
|
18
|
+
const parallaxNode = uniform(props.parallax)
|
|
19
|
+
watch(() => props.parallax, v => { parallaxNode.value = v })
|
|
20
|
+
|
|
21
|
+
onMounted(() => {
|
|
22
|
+
const onMove = (e: MouseEvent) => {
|
|
23
|
+
mouse.value.set(
|
|
24
|
+
(e.clientX / window.innerWidth) * 2 - 1,
|
|
25
|
+
-((e.clientY / window.innerHeight) * 2 - 1),
|
|
26
|
+
)
|
|
27
|
+
}
|
|
28
|
+
window.addEventListener('mousemove', onMove)
|
|
29
|
+
onUnmounted(() => window.removeEventListener('mousemove', onMove))
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
useShaderStage(
|
|
33
|
+
(uvIn) => uvIn.add(vec2(mouse.x, mouse.y).mul(parallaxNode).mul(0.1)),
|
|
34
|
+
props.order,
|
|
35
|
+
'uv',
|
|
36
|
+
)
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<{
|
|
6
|
+
/** Number of pixel columns/rows — lower = chunkier pixels */
|
|
7
|
+
gridSize?: number
|
|
8
|
+
order?: number
|
|
9
|
+
}>(), { gridSize: 64, order: 0 })
|
|
10
|
+
|
|
11
|
+
const gridSizeNode = uniform(props.gridSize)
|
|
12
|
+
watch(() => props.gridSize, v => { gridSizeNode.value = v })
|
|
13
|
+
|
|
14
|
+
useShaderStage(
|
|
15
|
+
(uvIn) => uvIn.mul(gridSizeNode).floor().div(gridSizeNode),
|
|
16
|
+
order,
|
|
17
|
+
'uv',
|
|
18
|
+
)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform, time, vec2, sin, float } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Oscillating UV scale over time — the UV breathes in and out.
|
|
7
|
+
* scale = 1 + sin(time * speed) * amount
|
|
8
|
+
*/
|
|
9
|
+
const props = withDefaults(defineProps<{
|
|
10
|
+
/** Pulse amplitude (fraction of UV range) */
|
|
11
|
+
amount?: number
|
|
12
|
+
/** Pulse speed in radians per second */
|
|
13
|
+
speed?: number
|
|
14
|
+
order?: number
|
|
15
|
+
}>(), { amount: 0.1, speed: 2, order: 0 })
|
|
16
|
+
|
|
17
|
+
const amountNode = uniform(props.amount)
|
|
18
|
+
const speedNode = uniform(props.speed)
|
|
19
|
+
watch(() => props.amount, v => { amountNode.value = v })
|
|
20
|
+
watch(() => props.speed, v => { speedNode.value = v })
|
|
21
|
+
|
|
22
|
+
useShaderStage(
|
|
23
|
+
(uvIn) => {
|
|
24
|
+
const scale = float(1).add(sin(time.mul(speedNode)).mul(amountNode))
|
|
25
|
+
const centered = uvIn.sub(0.5).div(scale).add(0.5)
|
|
26
|
+
return vec2(centered.x, centered.y)
|
|
27
|
+
},
|
|
28
|
+
props.order,
|
|
29
|
+
'uv',
|
|
30
|
+
)
|
|
31
|
+
</script>
|
|
32
|
+
|
|
33
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform, time } from 'three/tsl'
|
|
4
|
+
import { rippleUV } from '../../shaders/common/uv'
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(defineProps<{
|
|
7
|
+
/** Ripple frequency */
|
|
8
|
+
frequency?: number
|
|
9
|
+
/** Ripple amplitude */
|
|
10
|
+
amplitude?: number
|
|
11
|
+
/** Falloff rate from center */
|
|
12
|
+
falloff?: number
|
|
13
|
+
/** Animation speed */
|
|
14
|
+
speed?: number
|
|
15
|
+
order?: number
|
|
16
|
+
}>(), { frequency: 10, amplitude: 0.05, falloff: 1, speed: 1, order: 0 })
|
|
17
|
+
|
|
18
|
+
const freqNode = uniform(props.frequency)
|
|
19
|
+
const ampNode = uniform(props.amplitude)
|
|
20
|
+
const falloffNode = uniform(props.falloff)
|
|
21
|
+
const speedNode = uniform(props.speed)
|
|
22
|
+
watch(() => props.frequency, v => { freqNode.value = v })
|
|
23
|
+
watch(() => props.amplitude, v => { ampNode.value = v })
|
|
24
|
+
watch(() => props.falloff, v => { falloffNode.value = v })
|
|
25
|
+
watch(() => props.speed, v => { speedNode.value = v })
|
|
26
|
+
|
|
27
|
+
useShaderStage(
|
|
28
|
+
(uvIn) => rippleUV(uvIn, [0.5, 0.5], freqNode, ampNode, time.mul(speedNode), falloffNode),
|
|
29
|
+
props.order,
|
|
30
|
+
'uv',
|
|
31
|
+
)
|
|
32
|
+
</script>
|
|
33
|
+
|
|
34
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform, vec2 } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<{
|
|
6
|
+
/** Rotation in degrees */
|
|
7
|
+
angle?: number
|
|
8
|
+
pivotX?: number
|
|
9
|
+
pivotY?: number
|
|
10
|
+
order?: number
|
|
11
|
+
}>(), {
|
|
12
|
+
angle: 0,
|
|
13
|
+
pivotX: 0.5,
|
|
14
|
+
pivotY: 0.5,
|
|
15
|
+
order: 0,
|
|
16
|
+
})
|
|
17
|
+
|
|
18
|
+
const angleNode = uniform(props.angle * (Math.PI / 180))
|
|
19
|
+
watch(() => props.angle, v => { angleNode.value = v * (Math.PI / 180) })
|
|
20
|
+
|
|
21
|
+
useShaderStage(
|
|
22
|
+
(uvIn) => {
|
|
23
|
+
const pivot = vec2(props.pivotX, props.pivotY)
|
|
24
|
+
const cosA = angleNode.cos()
|
|
25
|
+
const sinA = angleNode.sin()
|
|
26
|
+
const centered = uvIn.sub(pivot)
|
|
27
|
+
return vec2(
|
|
28
|
+
centered.x.mul(cosA).sub(centered.y.mul(sinA)),
|
|
29
|
+
centered.x.mul(sinA).add(centered.y.mul(cosA)),
|
|
30
|
+
).add(pivot)
|
|
31
|
+
},
|
|
32
|
+
props.order,
|
|
33
|
+
'uv',
|
|
34
|
+
)
|
|
35
|
+
</script>
|
|
36
|
+
|
|
37
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<{
|
|
6
|
+
scale?: number
|
|
7
|
+
pivotX?: number
|
|
8
|
+
pivotY?: number
|
|
9
|
+
order?: number
|
|
10
|
+
}>(), {
|
|
11
|
+
scale: 1,
|
|
12
|
+
pivotX: 0.5,
|
|
13
|
+
pivotY: 0.5,
|
|
14
|
+
order: 0,
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
const scaleNode = uniform(props.scale)
|
|
18
|
+
watch(() => props.scale, v => { scaleNode.value = v })
|
|
19
|
+
|
|
20
|
+
useShaderStage(
|
|
21
|
+
(uvIn) => {
|
|
22
|
+
const pivot = vec2(props.pivotX, props.pivotY)
|
|
23
|
+
return uvIn.sub(pivot).div(scaleNode).add(pivot)
|
|
24
|
+
},
|
|
25
|
+
props.order,
|
|
26
|
+
'uv',
|
|
27
|
+
)
|
|
28
|
+
</script>
|
|
29
|
+
|
|
30
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { Vector2 } from 'three'
|
|
4
|
+
import { time, uniform } from 'three/tsl'
|
|
5
|
+
|
|
6
|
+
const props = withDefaults(defineProps<{
|
|
7
|
+
speedX?: number
|
|
8
|
+
speedY?: number
|
|
9
|
+
order?: number
|
|
10
|
+
}>(), {
|
|
11
|
+
speedX: 0,
|
|
12
|
+
speedY: 0.1,
|
|
13
|
+
order: 0,
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
const speedVal = new Vector2(props.speedX, props.speedY)
|
|
17
|
+
const speedNode = uniform(speedVal)
|
|
18
|
+
watch(() => [props.speedX, props.speedY], ([x, y]) => { speedNode.value.set(x, y) })
|
|
19
|
+
|
|
20
|
+
useShaderStage(
|
|
21
|
+
(uvIn) => uvIn.add(speedNode.mul(time)).fract(),
|
|
22
|
+
props.order,
|
|
23
|
+
'uv',
|
|
24
|
+
)
|
|
25
|
+
</script>
|
|
26
|
+
|
|
27
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform, time, vec2, fract } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<{
|
|
6
|
+
/** Scroll speed (UV units per second, positive = right) */
|
|
7
|
+
speed?: number
|
|
8
|
+
order?: number
|
|
9
|
+
}>(), { speed: 0.1, order: 0 })
|
|
10
|
+
|
|
11
|
+
const speedNode = uniform(props.speed)
|
|
12
|
+
watch(() => props.speed, v => { speedNode.value = v })
|
|
13
|
+
|
|
14
|
+
useShaderStage(
|
|
15
|
+
(uvIn) => vec2(fract(uvIn.x.add(time.mul(speedNode))), uvIn.y),
|
|
16
|
+
props.order,
|
|
17
|
+
'uv',
|
|
18
|
+
)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform, time, vec2, fract } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<{
|
|
6
|
+
/** Scroll speed (UV units per second, positive = up) */
|
|
7
|
+
speed?: number
|
|
8
|
+
order?: number
|
|
9
|
+
}>(), { speed: 0.1, order: 0 })
|
|
10
|
+
|
|
11
|
+
const speedNode = uniform(props.speed)
|
|
12
|
+
watch(() => props.speed, v => { speedNode.value = v })
|
|
13
|
+
|
|
14
|
+
useShaderStage(
|
|
15
|
+
(uvIn) => vec2(uvIn.x, fract(uvIn.y.add(time.mul(speedNode)))),
|
|
16
|
+
props.order,
|
|
17
|
+
'uv',
|
|
18
|
+
)
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<template><!-- --></template>
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
// @ts-nocheck
|
|
3
|
+
import { uniform, vec2 } from 'three/tsl'
|
|
4
|
+
|
|
5
|
+
const props = withDefaults(defineProps<{
|
|
6
|
+
/** Horizontal shear: shifts X by Y * shearX */
|
|
7
|
+
shearX?: number
|
|
8
|
+
/** Vertical shear: shifts Y by X * shearY */
|
|
9
|
+
shearY?: number
|
|
10
|
+
order?: number
|
|
11
|
+
}>(), { shearX: 0.2, shearY: 0, order: 0 })
|
|
12
|
+
|
|
13
|
+
const shearXNode = uniform(props.shearX)
|
|
14
|
+
const shearYNode = uniform(props.shearY)
|
|
15
|
+
watch(() => props.shearX, v => { shearXNode.value = v })
|
|
16
|
+
watch(() => props.shearY, v => { shearYNode.value = v })
|
|
17
|
+
|
|
18
|
+
useShaderStage(
|
|
19
|
+
(uvIn) => vec2(uvIn.x.add(uvIn.y.mul(shearXNode)), uvIn.y.add(uvIn.x.mul(shearYNode))),
|
|
20
|
+
props.order,
|
|
21
|
+
'uv',
|
|
22
|
+
)
|
|
23
|
+
</script>
|
|
24
|
+
|
|
25
|
+
<template><!-- --></template>
|