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.
Files changed (167) hide show
  1. package/layers/core/app/.DS_Store +0 -0
  2. package/layers/core/app/assets/.DS_Store +0 -0
  3. package/layers/core/app/assets/css/main.css +2 -0
  4. package/layers/core/app/components/ErrorBoundary.vue +1 -1
  5. package/layers/core/nuxt.config.ts +0 -8
  6. package/layers/motion/app/plugins/locomotive-scroll.client.ts +14 -11
  7. package/layers/motion/app.config.ts +6 -0
  8. package/layers/shader/app/components/Pipeline/ACESTonemap.client.vue +14 -0
  9. package/layers/shader/app/components/Pipeline/AddBlend.client.vue +24 -0
  10. package/layers/shader/app/components/Pipeline/AgedFilm.client.vue +62 -0
  11. package/layers/shader/app/components/Pipeline/Aurora.client.vue +81 -0
  12. package/layers/shader/app/components/Pipeline/BilinearGradient.client.vue +46 -0
  13. package/layers/shader/app/components/Pipeline/BillowNoise.client.vue +42 -0
  14. package/layers/shader/app/components/Pipeline/BrightnessContrast.client.vue +25 -0
  15. package/layers/shader/app/components/Pipeline/CellularNoise.client.vue +41 -0
  16. package/layers/shader/app/components/Pipeline/ChannelMixer.client.vue +44 -0
  17. package/layers/shader/app/components/Pipeline/ChebyshevNoiseField.client.vue +60 -0
  18. package/layers/shader/app/components/Pipeline/Checkerboard.client.vue +41 -0
  19. package/layers/shader/app/components/Pipeline/ChromaticAberration.client.vue +52 -0
  20. package/layers/shader/app/components/Pipeline/ChromaticScreenWaves.client.vue +49 -0
  21. package/layers/shader/app/components/Pipeline/Circle.client.vue +41 -0
  22. package/layers/shader/app/components/Pipeline/Clouds.client.vue +60 -0
  23. package/layers/shader/app/components/Pipeline/ColorBurnBlend.client.vue +24 -0
  24. package/layers/shader/app/components/Pipeline/ColorDodgeBlend.client.vue +24 -0
  25. package/layers/shader/app/components/Pipeline/ColourRamp.client.vue +57 -0
  26. package/layers/shader/app/components/Pipeline/ComplexPlaneField.client.vue +77 -0
  27. package/layers/shader/app/components/Pipeline/ConicGradient.client.vue +40 -0
  28. package/layers/shader/app/components/Pipeline/CosinePalette.client.vue +71 -0
  29. package/layers/shader/app/components/Pipeline/CoverageAlpha.client.vue +18 -0
  30. package/layers/shader/app/components/Pipeline/Cross.client.vue +51 -0
  31. package/layers/shader/app/components/Pipeline/CurlNoise.client.vue +48 -0
  32. package/layers/shader/app/components/Pipeline/DarkenBlend.client.vue +24 -0
  33. package/layers/shader/app/components/Pipeline/DayNightCycle.client.vue +48 -0
  34. package/layers/shader/app/components/Pipeline/Desaturate.client.vue +21 -0
  35. package/layers/shader/app/components/Pipeline/DiagonalGradient.client.vue +38 -0
  36. package/layers/shader/app/components/Pipeline/DiamondGradient.client.vue +40 -0
  37. package/layers/shader/app/components/Pipeline/DifferenceBlend.client.vue +24 -0
  38. package/layers/shader/app/components/Pipeline/DivideBlend.client.vue +26 -0
  39. package/layers/shader/app/components/Pipeline/DomainWarpedNoise.client.vue +48 -0
  40. package/layers/shader/app/components/Pipeline/Dots.client.vue +44 -0
  41. package/layers/shader/app/components/Pipeline/DuoTone.client.vue +34 -0
  42. package/layers/shader/app/components/Pipeline/ExclusionBlend.client.vue +24 -0
  43. package/layers/shader/app/components/Pipeline/ExponentialFog.client.vue +46 -0
  44. package/layers/shader/app/components/Pipeline/Exposure.client.vue +23 -0
  45. package/layers/shader/app/components/Pipeline/FBMNoise.client.vue +50 -0
  46. package/layers/shader/app/components/Pipeline/FilmBurn.client.vue +49 -0
  47. package/layers/shader/app/components/Pipeline/FilmGrain.client.vue +69 -0
  48. package/layers/shader/app/components/Pipeline/FisheyeRay.client.vue +35 -0
  49. package/layers/shader/app/components/Pipeline/Flame.client.vue +51 -0
  50. package/layers/shader/app/components/Pipeline/FocalGradient.client.vue +43 -0
  51. package/layers/shader/app/components/Pipeline/Gamma.client.vue +23 -0
  52. package/layers/shader/app/components/Pipeline/GodRays.client.vue +64 -0
  53. package/layers/shader/app/components/Pipeline/GradientNoise.client.vue +42 -0
  54. package/layers/shader/app/components/Pipeline/Grain.client.vue +81 -0
  55. package/layers/shader/app/components/Pipeline/Grid.client.vue +43 -0
  56. package/layers/shader/app/components/Pipeline/Halation.client.vue +43 -0
  57. package/layers/shader/app/components/Pipeline/Halftone.client.vue +33 -0
  58. package/layers/shader/app/components/Pipeline/HardLightBlend.client.vue +24 -0
  59. package/layers/shader/app/components/Pipeline/Haze.client.vue +50 -0
  60. package/layers/shader/app/components/Pipeline/Hexagon.client.vue +42 -0
  61. package/layers/shader/app/components/Pipeline/Hue.client.vue +21 -0
  62. package/layers/shader/app/components/Pipeline/Invert.client.vue +14 -0
  63. package/layers/shader/app/components/Pipeline/LensFlare.client.vue +67 -0
  64. package/layers/shader/app/components/Pipeline/LightenBlend.client.vue +24 -0
  65. package/layers/shader/app/components/Pipeline/LinearGradient.client.vue +36 -0
  66. package/layers/shader/app/components/Pipeline/LinearGradient4.client.vue +67 -0
  67. package/layers/shader/app/components/Pipeline/LinearToSRGB.client.vue +25 -0
  68. package/layers/shader/app/components/Pipeline/Marble.client.vue +69 -0
  69. package/layers/shader/app/components/Pipeline/MixBlend.client.vue +45 -0
  70. package/layers/shader/app/components/Pipeline/MonochromeTint.client.vue +31 -0
  71. package/layers/shader/app/components/Pipeline/MultiplyBlend.client.vue +24 -0
  72. package/layers/shader/app/components/Pipeline/NoisyGradient.client.vue +54 -0
  73. package/layers/shader/app/components/Pipeline/NoisyGradientBlend.client.vue +116 -0
  74. package/layers/shader/app/components/Pipeline/OverlayBlend.client.vue +24 -0
  75. package/layers/shader/app/components/Pipeline/PaperTexture.client.vue +41 -0
  76. package/layers/shader/app/components/Pipeline/Polygon.client.vue +47 -0
  77. package/layers/shader/app/components/Pipeline/Posterise.client.vue +23 -0
  78. package/layers/shader/app/components/Pipeline/RadialGradient.client.vue +39 -0
  79. package/layers/shader/app/components/Pipeline/RayAutoOrbit.client.vue +37 -0
  80. package/layers/shader/app/components/Pipeline/RayMouseOrbit.client.vue +49 -0
  81. package/layers/shader/app/components/Pipeline/RayRotateX.client.vue +25 -0
  82. package/layers/shader/app/components/Pipeline/RayRotateY.client.vue +25 -0
  83. package/layers/shader/app/components/Pipeline/RayRotateZ.client.vue +25 -0
  84. package/layers/shader/app/components/Pipeline/RayTiltBasis.client.vue +41 -0
  85. package/layers/shader/app/components/Pipeline/RaymarchTunnel.client.vue +101 -0
  86. package/layers/shader/app/components/Pipeline/Rectangle.client.vue +47 -0
  87. package/layers/shader/app/components/Pipeline/ReinhardTonemap.client.vue +18 -0
  88. package/layers/shader/app/components/Pipeline/RidgedNoise.client.vue +41 -0
  89. package/layers/shader/app/components/Pipeline/Ring.client.vue +44 -0
  90. package/layers/shader/app/components/Pipeline/RingField.client.vue +69 -0
  91. package/layers/shader/app/components/Pipeline/RisographGrain.client.vue +74 -0
  92. package/layers/shader/app/components/Pipeline/RotatedGradientBlend.client.vue +61 -0
  93. package/layers/shader/app/components/Pipeline/SDFColourMask.client.vue +33 -0
  94. package/layers/shader/app/components/Pipeline/SDFRadialMask.client.vue +31 -0
  95. package/layers/shader/app/components/Pipeline/SRGBToLinear.client.vue +25 -0
  96. package/layers/shader/app/components/Pipeline/Saturation.client.vue +21 -0
  97. package/layers/shader/app/components/Pipeline/Scanlines.client.vue +36 -0
  98. package/layers/shader/app/components/Pipeline/ScreenBlend.client.vue +24 -0
  99. package/layers/shader/app/components/Pipeline/ShaderDebugger.client.vue +74 -0
  100. package/layers/shader/app/components/Pipeline/SimplexNoise.client.vue +49 -0
  101. package/layers/shader/app/components/Pipeline/SkyAtmosphere.client.vue +75 -0
  102. package/layers/shader/app/components/Pipeline/SoftLightBlend.client.vue +24 -0
  103. package/layers/shader/app/components/Pipeline/SolidColour.client.vue +21 -0
  104. package/layers/shader/app/components/Pipeline/SplitTone.client.vue +47 -0
  105. package/layers/shader/app/components/Pipeline/Star.client.vue +47 -0
  106. package/layers/shader/app/components/Pipeline/Starfield.client.vue +65 -0
  107. package/layers/shader/app/components/Pipeline/Stripes.client.vue +46 -0
  108. package/layers/shader/app/components/Pipeline/SubtractBlend.client.vue +24 -0
  109. package/layers/shader/app/components/Pipeline/TanhTonemap.client.vue +24 -0
  110. package/layers/shader/app/components/Pipeline/Threshold.client.vue +25 -0
  111. package/layers/shader/app/components/Pipeline/Tint.client.vue +33 -0
  112. package/layers/shader/app/components/Pipeline/Triangle.client.vue +42 -0
  113. package/layers/shader/app/components/Pipeline/UVAspectCorrect.client.vue +14 -0
  114. package/layers/shader/app/components/Pipeline/UVBreath.client.vue +36 -0
  115. package/layers/shader/app/components/Pipeline/UVBulge.client.vue +26 -0
  116. package/layers/shader/app/components/Pipeline/UVClamp.client.vue +18 -0
  117. package/layers/shader/app/components/Pipeline/UVColumnOffset.client.vue +28 -0
  118. package/layers/shader/app/components/Pipeline/UVFlipX.client.vue +14 -0
  119. package/layers/shader/app/components/Pipeline/UVFlipXY.client.vue +14 -0
  120. package/layers/shader/app/components/Pipeline/UVFlipY.client.vue +14 -0
  121. package/layers/shader/app/components/Pipeline/UVFractBand.client.vue +31 -0
  122. package/layers/shader/app/components/Pipeline/UVMousePull.client.vue +39 -0
  123. package/layers/shader/app/components/Pipeline/UVNoiseRotate.client.vue +54 -0
  124. package/layers/shader/app/components/Pipeline/UVNoiseWarp.client.vue +35 -0
  125. package/layers/shader/app/components/Pipeline/UVOrbit.client.vue +34 -0
  126. package/layers/shader/app/components/Pipeline/UVParallax.client.vue +39 -0
  127. package/layers/shader/app/components/Pipeline/UVPixelate.client.vue +21 -0
  128. package/layers/shader/app/components/Pipeline/UVPulse.client.vue +33 -0
  129. package/layers/shader/app/components/Pipeline/UVRipple.client.vue +34 -0
  130. package/layers/shader/app/components/Pipeline/UVRotate.client.vue +37 -0
  131. package/layers/shader/app/components/Pipeline/UVScale.client.vue +30 -0
  132. package/layers/shader/app/components/Pipeline/UVScroll.client.vue +27 -0
  133. package/layers/shader/app/components/Pipeline/UVScrollX.client.vue +21 -0
  134. package/layers/shader/app/components/Pipeline/UVScrollY.client.vue +21 -0
  135. package/layers/shader/app/components/Pipeline/UVShear.client.vue +25 -0
  136. package/layers/shader/app/components/Pipeline/UVSineWarpXY.client.vue +46 -0
  137. package/layers/shader/app/components/Pipeline/UVSwapAxes.client.vue +14 -0
  138. package/layers/shader/app/components/Pipeline/UVTile.client.vue +27 -0
  139. package/layers/shader/app/components/Pipeline/UVTwirl.client.vue +26 -0
  140. package/layers/shader/app/components/Pipeline/UVWarp.client.vue +30 -0
  141. package/layers/shader/app/components/Pipeline/VHSBleed.client.vue +58 -0
  142. package/layers/shader/app/components/Pipeline/ValueNoise.client.vue +41 -0
  143. package/layers/shader/app/components/Pipeline/Vibrance.client.vue +24 -0
  144. package/layers/shader/app/components/Pipeline/Vignette.client.vue +32 -0
  145. package/layers/shader/app/components/Pipeline/VoronoiEdges.client.vue +50 -0
  146. package/layers/shader/app/components/Pipeline/Water.client.vue +53 -0
  147. package/layers/shader/app/components/Pipeline/WaveBendLayer.client.vue +61 -0
  148. package/layers/shader/app/components/Pipeline/WaveColourLayer.client.vue +56 -0
  149. package/layers/shader/app/components/Pipeline/WhiteBalance.client.vue +40 -0
  150. package/layers/shader/app/components/Pipeline/Wood.client.vue +63 -0
  151. package/layers/shader/app/components/Shader/Canvas.vue +24 -0
  152. package/layers/shader/app/components/Shader/Pipeline.client.vue +56 -0
  153. package/layers/shader/app/components/Shader/PipelineContext.vue +18 -0
  154. package/layers/shader/app/composables/useCSSColourUniform.ts +41 -0
  155. package/layers/shader/app/composables/useCSSFloatUniform.ts +34 -0
  156. package/layers/shader/app/composables/useShaderPerf.ts +73 -0
  157. package/layers/shader/app/composables/useShaderPipeline.ts +99 -0
  158. package/layers/shader/app/composables/useSunDirectionUniform.ts +54 -0
  159. package/layers/shader/app/composables/useTSLNodes.ts +0 -1
  160. package/layers/shader/app/shaders/common/complex.ts +29 -0
  161. package/layers/shader/app/shaders/common/shapes.ts +4 -4
  162. package/layers/shader/app/shaders/common/uv.ts +2 -2
  163. package/layers/shader/app/utils/tsl/patterns.ts +1 -1
  164. package/layers/shader/app/utils/tsl/uv.ts +3 -3
  165. package/layers/ui/app/app.config.ts +2 -16
  166. package/layers/ui/app/types/app-config.d.ts +17 -0
  167. package/package.json +9 -7
@@ -0,0 +1,46 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { time, uniform, vec2 } from 'three/tsl'
4
+
5
+ /**
6
+ * Asymmetric sine warp — the core Grainient/Shadertoy UV distortion.
7
+ * tuv.x += sin(tuv.y * freq + time * speed) / amplitude
8
+ * tuv.y += sin(tuv.x * freq * 1.5 + time * speed) / (amplitude * 0.5)
9
+ * The 1.5× frequency on Y and halved amplitude on Y are intentional — they give
10
+ * the characteristic flowing, non-repeating Grainient look.
11
+ */
12
+ const props = withDefaults(defineProps<{
13
+ frequency?: number
14
+ amplitude?: number
15
+ speed?: number
16
+ order?: number
17
+ }>(), {
18
+ frequency: 5,
19
+ amplitude: 30,
20
+ speed: 2,
21
+ order: 0,
22
+ })
23
+
24
+ const freqNode = uniform(props.frequency)
25
+ const ampNode = uniform(props.amplitude)
26
+ const speedNode = uniform(props.speed)
27
+
28
+ watch(() => props.frequency, v => { freqNode.value = v })
29
+ watch(() => props.amplitude, v => { ampNode.value = v })
30
+ watch(() => props.speed, v => { speedNode.value = v })
31
+
32
+ // Pure expression — no toVar/addAssign needed, so no Fn() stack required.
33
+ // Sequential dependency preserved: warpedY uses warpedX (the already-warped X component).
34
+ useShaderStage(
35
+ (uvIn) => {
36
+ const t = time.mul(speedNode)
37
+ const warpedX = uvIn.x.add(uvIn.y.mul(freqNode).add(t).sin().div(ampNode))
38
+ const warpedY = uvIn.y.add(warpedX.mul(freqNode).mul(1.5).add(t).sin().div(ampNode.mul(0.5)))
39
+ return vec2(warpedX, warpedY)
40
+ },
41
+ props.order,
42
+ 'uv',
43
+ )
44
+ </script>
45
+
46
+ <template><!-- --></template>
@@ -0,0 +1,14 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { vec2 } from 'three/tsl'
4
+
5
+ const { order = 0 } = defineProps<{ order?: number }>()
6
+
7
+ useShaderStage(
8
+ (uvIn) => vec2(uvIn.y, uvIn.x),
9
+ order,
10
+ 'uv',
11
+ )
12
+ </script>
13
+
14
+ <template><!-- --></template>
@@ -0,0 +1,27 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { Vector2 } from 'three'
4
+ import { uniform } from 'three/tsl'
5
+
6
+ const props = withDefaults(defineProps<{
7
+ repeatX?: number
8
+ repeatY?: number
9
+ order?: number
10
+ }>(), {
11
+ repeatX: 2,
12
+ repeatY: 2,
13
+ order: 0,
14
+ })
15
+
16
+ const repeatVal = new Vector2(props.repeatX, props.repeatY)
17
+ const repeatNode = uniform(repeatVal)
18
+ watch(() => [props.repeatX, props.repeatY], ([x, y]) => { repeatNode.value.set(x, y) })
19
+
20
+ useShaderStage(
21
+ (uvIn) => uvIn.mul(repeatNode).fract(),
22
+ props.order,
23
+ 'uv',
24
+ )
25
+ </script>
26
+
27
+ <template><!-- --></template>
@@ -0,0 +1,26 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { uniform } from 'three/tsl'
4
+ import { swirlUV } from '../../shaders/common/uv'
5
+
6
+ const props = withDefaults(defineProps<{
7
+ /** Swirl strength in radians */
8
+ strength?: number
9
+ /** Effective radius of the swirl */
10
+ radius?: number
11
+ order?: number
12
+ }>(), { strength: 3, 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) => swirlUV(uvIn, [0.5, 0.5], strengthNode, radiusNode),
21
+ props.order,
22
+ 'uv',
23
+ )
24
+ </script>
25
+
26
+ <template><!-- --></template>
@@ -0,0 +1,30 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { uniform, time } from 'three/tsl'
4
+ import { waveUV } from '../../shaders/common/uv'
5
+
6
+ const props = withDefaults(defineProps<{
7
+ /** Wave frequency */
8
+ frequency?: number
9
+ /** Warp amplitude */
10
+ amplitude?: number
11
+ /** Animation speed */
12
+ speed?: number
13
+ order?: number
14
+ }>(), { frequency: 10, amplitude: 0.05, speed: 1, order: 0 })
15
+
16
+ const freqNode = uniform(props.frequency)
17
+ const ampNode = uniform(props.amplitude)
18
+ const speedNode = uniform(props.speed)
19
+ watch(() => props.frequency, v => { freqNode.value = v })
20
+ watch(() => props.amplitude, v => { ampNode.value = v })
21
+ watch(() => props.speed, v => { speedNode.value = v })
22
+
23
+ useShaderStage(
24
+ (uvIn) => waveUV(uvIn, freqNode, ampNode, time.mul(speedNode), 'both'),
25
+ props.order,
26
+ 'uv',
27
+ )
28
+ </script>
29
+
30
+ <template><!-- --></template>
@@ -0,0 +1,58 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { uniform, time, vec3, vec4, sin, floor, fract, float } from 'three/tsl'
4
+
5
+ /**
6
+ * VHS colour bleed + horizontal noise drift.
7
+ * Shifts R/B channels horizontally by a noise-driven amount and adds scanline banding.
8
+ */
9
+ const props = withDefaults(defineProps<{
10
+ /** Channel bleed strength */
11
+ bleedStrength?: number
12
+ /** Horizontal noise frequency */
13
+ noiseFreq?: number
14
+ /** Tracking error intensity */
15
+ trackingNoise?: number
16
+ /** Animation speed */
17
+ speed?: number
18
+ order?: number
19
+ }>(), { bleedStrength: 0.015, noiseFreq: 8, trackingNoise: 0.3, speed: 1, order: 0 })
20
+
21
+ const bleedNode = uniform(props.bleedStrength)
22
+ const noiseFreqNode = uniform(props.noiseFreq)
23
+ const trackingNode = uniform(props.trackingNoise)
24
+ const speedNode = uniform(props.speed)
25
+ watch(() => props.bleedStrength, v => { bleedNode.value = v })
26
+ watch(() => props.noiseFreq, v => { noiseFreqNode.value = v })
27
+ watch(() => props.trackingNoise, v => { trackingNode.value = v })
28
+ watch(() => props.speed, v => { speedNode.value = v })
29
+
30
+ const pipeline = useShaderPipelineContext()
31
+
32
+ useShaderStage(
33
+ (prev) => {
34
+ const uv = pipeline.uvNode.value
35
+ const t = time.mul(speedNode)
36
+
37
+ // Horizontal tracking noise — quantised to simulate tape jitter
38
+ const scanLine = floor(uv.y.mul(noiseFreqNode))
39
+ const jitter = fract(sin(scanLine.add(t.mul(7.1731)).mul(43758.5453))).sub(0.5)
40
+ const drift = jitter.mul(trackingNode).mul(bleedNode)
41
+
42
+ // Channel separation: R shifts right, B shifts left relative to G
43
+ const rBleed = fract(prev.r.add(drift))
44
+ const bBleed = fract(prev.b.sub(drift))
45
+
46
+ // Scanline brightness variation
47
+ const scanBrightness = sin(uv.y.mul(400).add(t.mul(3))).mul(0.03).add(1)
48
+
49
+ return vec4(
50
+ vec3(rBleed, prev.g, bBleed).mul(scanBrightness),
51
+ prev.w,
52
+ )
53
+ },
54
+ props.order,
55
+ )
56
+ </script>
57
+
58
+ <template><!-- --></template>
@@ -0,0 +1,41 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { Color, Vector3 } from 'three'
4
+ import { uniform, time, vec4, mix, float } from 'three/tsl'
5
+ import { valueNoise2D } from '../../shaders/common/noise'
6
+
7
+ const props = withDefaults(defineProps<{
8
+ colorA?: string
9
+ colorB?: string
10
+ scale?: number
11
+ speed?: number
12
+ order?: number
13
+ }>(), { colorA: '#000000', colorB: '#ffffff', scale: 4, speed: 0.2, order: 0 })
14
+
15
+ function toVec3Node(hex: string) {
16
+ const c = new Color(hex)
17
+ return uniform(new Vector3(c.r, c.g, c.b))
18
+ }
19
+
20
+ const colorANode = toVec3Node(props.colorA)
21
+ const colorBNode = toVec3Node(props.colorB)
22
+ const scaleNode = uniform(props.scale)
23
+ const speedNode = uniform(props.speed)
24
+ watch(() => props.colorA, v => { const c = new Color(v); colorANode.value.set(c.r, c.g, c.b) })
25
+ watch(() => props.colorB, v => { const c = new Color(v); colorBNode.value.set(c.r, c.g, c.b) })
26
+ watch(() => props.scale, v => { scaleNode.value = v })
27
+ watch(() => props.speed, v => { speedNode.value = v })
28
+
29
+ const pipeline = useShaderPipelineContext()
30
+
31
+ useShaderStage(
32
+ () => {
33
+ const uv = pipeline.uvNode.value
34
+ const t = valueNoise2D(uv.mul(scaleNode).add(time.mul(speedNode))).mul(0.5).add(0.5)
35
+ return vec4(mix(colorANode, colorBNode, t), float(1))
36
+ },
37
+ props.order,
38
+ )
39
+ </script>
40
+
41
+ <template><!-- --></template>
@@ -0,0 +1,24 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { uniform, vec4 } from 'three/tsl'
4
+ import { vibrance } from '../../shaders/common/palette'
5
+
6
+ const props = withDefaults(defineProps<{
7
+ /**
8
+ * Saturation boost that protects already-saturated colours.
9
+ * 0 = unchanged, positive = more vivid, negative = less.
10
+ */
11
+ amount?: number
12
+ order?: number
13
+ }>(), { amount: 0.5, order: 0 })
14
+
15
+ const amountNode = uniform(props.amount)
16
+ watch(() => props.amount, v => { amountNode.value = v })
17
+
18
+ useShaderStage(
19
+ (prev) => vec4(vibrance(prev.xyz, amountNode), prev.w),
20
+ props.order,
21
+ )
22
+ </script>
23
+
24
+ <template><!-- --></template>
@@ -0,0 +1,32 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { uniform, vec4 } from 'three/tsl'
4
+ import { vignette } from '../../shaders/common/grain'
5
+
6
+ const props = withDefaults(defineProps<{
7
+ intensity?: number
8
+ smoothness?: number
9
+ order?: number
10
+ }>(), {
11
+ intensity: 0.5,
12
+ smoothness: 0.5,
13
+ order: 0,
14
+ })
15
+
16
+ const intensityNode = uniform(props.intensity)
17
+ const smoothnessNode = uniform(props.smoothness)
18
+ watch(() => props.intensity, v => { intensityNode.value = v })
19
+ watch(() => props.smoothness, v => { smoothnessNode.value = v })
20
+
21
+ const { uvNode } = useShaderPipelineContext()
22
+
23
+ useShaderStage(
24
+ (prev) => {
25
+ const v = vignette(uvNode.value, intensityNode, smoothnessNode)
26
+ return vec4(prev.xyz.mul(v), prev.w)
27
+ },
28
+ props.order,
29
+ )
30
+ </script>
31
+
32
+ <template><!-- --></template>
@@ -0,0 +1,50 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { Color, Vector3 } from 'three'
4
+ import { uniform, time, vec4, mix, smoothstep, float } from 'three/tsl'
5
+ import { voronoi2D } from '../../shaders/common/noise'
6
+
7
+ /** Voronoi cell edge lines only — the cell boundaries as thin lines. */
8
+ const props = withDefaults(defineProps<{
9
+ /** Cell background colour */
10
+ colorA?: string
11
+ /** Edge line colour */
12
+ colorB?: string
13
+ scale?: number
14
+ /** Edge line thickness */
15
+ edgeWidth?: number
16
+ speed?: number
17
+ order?: number
18
+ }>(), { colorA: '#000000', colorB: '#ffffff', scale: 8, edgeWidth: 0.05, speed: 0.1, order: 0 })
19
+
20
+ function toVec3Node(hex: string) {
21
+ const c = new Color(hex)
22
+ return uniform(new Vector3(c.r, c.g, c.b))
23
+ }
24
+
25
+ const colorANode = toVec3Node(props.colorA)
26
+ const colorBNode = toVec3Node(props.colorB)
27
+ const scaleNode = uniform(props.scale)
28
+ const edgeNode = uniform(props.edgeWidth)
29
+ const speedNode = uniform(props.speed)
30
+ watch(() => props.colorA, v => { const c = new Color(v); colorANode.value.set(c.r, c.g, c.b) })
31
+ watch(() => props.colorB, v => { const c = new Color(v); colorBNode.value.set(c.r, c.g, c.b) })
32
+ watch(() => props.scale, v => { scaleNode.value = v })
33
+ watch(() => props.edgeWidth, v => { edgeNode.value = v })
34
+ watch(() => props.speed, v => { speedNode.value = v })
35
+
36
+ const pipeline = useShaderPipelineContext()
37
+
38
+ useShaderStage(
39
+ () => {
40
+ const uv = pipeline.uvNode.value
41
+ const { distance } = voronoi2D(uv.add(time.mul(speedNode)), scaleNode)
42
+ // Edge = near-zero distance → smooth threshold
43
+ const edge = smoothstep(edgeNode, edgeNode.mul(0.1), distance)
44
+ return vec4(mix(colorANode, colorBNode, edge), float(1))
45
+ },
46
+ props.order,
47
+ )
48
+ </script>
49
+
50
+ <template><!-- --></template>
@@ -0,0 +1,53 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { Color, Vector3 } from 'three'
4
+ import { uniform, time, vec4, mix, sin, float } from 'three/tsl'
5
+
6
+ const props = withDefaults(defineProps<{
7
+ /** Deep water colour */
8
+ colorDeep?: string
9
+ /** Shallow/crest colour */
10
+ colorShallow?: string
11
+ /** Wave frequency */
12
+ frequency?: number
13
+ /** Wave height */
14
+ amplitude?: number
15
+ /** Animation speed */
16
+ speed?: number
17
+ order?: number
18
+ }>(), { colorDeep: '#003366', colorShallow: '#66ccff', frequency: 8, amplitude: 0.5, speed: 1, order: 0 })
19
+
20
+ function toVec3Node(hex: string) {
21
+ const c = new Color(hex)
22
+ return uniform(new Vector3(c.r, c.g, c.b))
23
+ }
24
+
25
+ const colorDeepNode = toVec3Node(props.colorDeep)
26
+ const colorShallowNode = toVec3Node(props.colorShallow)
27
+ const freqNode = uniform(props.frequency)
28
+ const ampNode = uniform(props.amplitude)
29
+ const speedNode = uniform(props.speed)
30
+ watch(() => props.colorDeep, v => { const c = new Color(v); colorDeepNode.value.set(c.r, c.g, c.b) })
31
+ watch(() => props.colorShallow, v => { const c = new Color(v); colorShallowNode.value.set(c.r, c.g, c.b) })
32
+ watch(() => props.frequency, v => { freqNode.value = v })
33
+ watch(() => props.amplitude, v => { ampNode.value = v })
34
+ watch(() => props.speed, v => { speedNode.value = v })
35
+
36
+ const pipeline = useShaderPipelineContext()
37
+
38
+ useShaderStage(
39
+ () => {
40
+ const uv = pipeline.uvNode.value
41
+ const t = time.mul(speedNode)
42
+ // Layered sine waves at different frequencies and phases
43
+ const w1 = sin(uv.x.mul(freqNode).add(t))
44
+ const w2 = sin(uv.x.mul(freqNode.mul(0.7)).add(uv.y.mul(freqNode.mul(0.5))).add(t.mul(0.8)))
45
+ const w3 = sin(uv.y.mul(freqNode.mul(1.3)).add(t.mul(1.1)))
46
+ const wave = w1.add(w2).add(w3).div(3).mul(ampNode).mul(0.5).add(0.5)
47
+ return vec4(mix(colorDeepNode, colorShallowNode, wave), float(1))
48
+ },
49
+ props.order,
50
+ )
51
+ </script>
52
+
53
+ <template><!-- --></template>
@@ -0,0 +1,61 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { Color, Vector3 } from 'three'
4
+ import { uniform, time, vec4, vec2, mix, sin } from 'three/tsl'
5
+
6
+ const props = withDefaults(defineProps<{
7
+ color?: string
8
+ opacity?: number
9
+ frequency?: number
10
+ speed?: number
11
+ warpStrength?: number
12
+ order?: number
13
+ }>(), {
14
+ color: '#4488ff',
15
+ opacity: 0.8,
16
+ frequency: 3,
17
+ speed: 0.5,
18
+ warpStrength: 0.15,
19
+ order: 0,
20
+ })
21
+
22
+ function toVec3Node(hex: string) {
23
+ const c = new Color(hex)
24
+ return uniform(new Vector3(c.r, c.g, c.b))
25
+ }
26
+
27
+ const colorNode = toVec3Node(props.color)
28
+ const opacityNode = uniform(props.opacity)
29
+ const freqNode = uniform(props.frequency)
30
+ const speedNode = uniform(props.speed)
31
+ const warpNode = uniform(props.warpStrength)
32
+ watch(() => props.color, v => { const c = new Color(v); colorNode.value.set(c.r, c.g, c.b) })
33
+ watch(() => props.opacity, v => { opacityNode.value = v })
34
+ watch(() => props.frequency, v => { freqNode.value = v })
35
+ watch(() => props.speed, v => { speedNode.value = v })
36
+ watch(() => props.warpStrength, v => { warpNode.value = v })
37
+
38
+ const pipeline = useShaderPipelineContext()
39
+
40
+ useShaderStage(
41
+ (prev) => {
42
+ const uvCurrent = pipeline.uvNode.value
43
+ if (!prev || !uvCurrent) return vec4(0, 0, 0, 1)
44
+
45
+ const t = time.mul(speedNode)
46
+
47
+ // Domain warp — pure functional (both x and y use original uvCurrent coords)
48
+ const warpX = uvCurrent.x.add(sin(uvCurrent.y.mul(freqNode).add(t)).mul(warpNode))
49
+ const warpY = uvCurrent.y.add(sin(uvCurrent.x.mul(freqNode).add(t)).mul(warpNode))
50
+ const s = vec2(warpX, warpY)
51
+
52
+ const band = sin(s.length().mul(freqNode.mul(4.0)).add(t)).mul(0.5).add(0.5)
53
+ const alpha = band.mul(opacityNode)
54
+
55
+ return vec4(mix(prev.xyz, colorNode, alpha), prev.w)
56
+ },
57
+ props.order,
58
+ )
59
+ </script>
60
+
61
+ <template><!-- --></template>
@@ -0,0 +1,56 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { Color, Vector3 } from 'three'
4
+ import { uniform, time, vec4, mix, smoothstep, float } from 'three/tsl'
5
+ import { simplexNoise2D } from '../../shaders/common/noise'
6
+
7
+ const props = withDefaults(defineProps<{
8
+ /** Band fill colour */
9
+ color?: string
10
+ /** Opacity of the band layer */
11
+ opacity?: number
12
+ /** Noise input scale */
13
+ scale?: number
14
+ /** Smoothstep lower edge for band threshold */
15
+ edge0?: number
16
+ /** Smoothstep upper edge for band threshold */
17
+ edge1?: number
18
+ /** Animation speed */
19
+ speed?: number
20
+ order?: number
21
+ }>(), { color: '#ffffff', opacity: 1, scale: 2, edge0: 0.3, edge1: 0.7, speed: 0.3, order: 0 })
22
+
23
+ function toVec3Node(hex: string) {
24
+ const c = new Color(hex)
25
+ return uniform(new Vector3(c.r, c.g, c.b))
26
+ }
27
+
28
+ const colorNode = toVec3Node(props.color)
29
+ const opacityNode = uniform(props.opacity)
30
+ const scaleNode = uniform(props.scale)
31
+ const edge0Node = uniform(props.edge0)
32
+ const edge1Node = uniform(props.edge1)
33
+ const speedNode = uniform(props.speed)
34
+ watch(() => props.color, v => { const c = new Color(v); colorNode.value.set(c.r, c.g, c.b) })
35
+ watch(() => props.opacity, v => { opacityNode.value = v })
36
+ watch(() => props.scale, v => { scaleNode.value = v })
37
+ watch(() => props.edge0, v => { edge0Node.value = v })
38
+ watch(() => props.edge1, v => { edge1Node.value = v })
39
+ watch(() => props.speed, v => { speedNode.value = v })
40
+
41
+ const pipeline = useShaderPipelineContext()
42
+
43
+ useShaderStage(
44
+ (prev) => {
45
+ const uvCurrent = pipeline.uvNode.value
46
+ if (!uvCurrent) return prev
47
+ const t = time.mul(speedNode)
48
+ const n = simplexNoise2D(uvCurrent.mul(scaleNode).add(t)).mul(0.5).add(0.5)
49
+ const band = smoothstep(edge0Node, edge1Node, n).mul(opacityNode)
50
+ return vec4(mix(prev.xyz, colorNode, band), prev.w)
51
+ },
52
+ props.order,
53
+ )
54
+ </script>
55
+
56
+ <template><!-- --></template>
@@ -0,0 +1,40 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { uniform, vec3, vec4, mix, float } from 'three/tsl'
4
+
5
+ const props = withDefaults(defineProps<{
6
+ /**
7
+ * Colour temperature shift:
8
+ * positive → warmer (orange), negative → cooler (blue). Range: -1 to 1.
9
+ */
10
+ temperature?: number
11
+ /**
12
+ * Tint shift:
13
+ * positive → green, negative → magenta. Range: -1 to 1.
14
+ */
15
+ tint?: number
16
+ order?: number
17
+ }>(), { temperature: 0, tint: 0, order: 0 })
18
+
19
+ const tempNode = uniform(props.temperature)
20
+ const tintNode = uniform(props.tint)
21
+ watch(() => props.temperature, v => { tempNode.value = v })
22
+ watch(() => props.tint, v => { tintNode.value = v })
23
+
24
+ useShaderStage(
25
+ (prev) => {
26
+ // Temperature: mix toward warm (orange) or cool (blue)
27
+ const warm = vec3(float(1).add(tempNode.mul(0.15)), float(1), float(1).sub(tempNode.mul(0.25)))
28
+ // Tint: mix toward green or magenta on the G channel
29
+ const tinted = vec3(
30
+ float(1).sub(tintNode.negate().max(float(0)).mul(0.1)),
31
+ float(1).add(tintNode.mul(0.1)),
32
+ float(1).sub(tintNode.max(float(0)).mul(0.1)),
33
+ )
34
+ return vec4(prev.xyz.mul(warm).mul(tinted), prev.w)
35
+ },
36
+ props.order,
37
+ )
38
+ </script>
39
+
40
+ <template><!-- --></template>
@@ -0,0 +1,63 @@
1
+ <script setup lang="ts">
2
+ // @ts-nocheck
3
+ import { Color, Vector3 } from 'three'
4
+ import { uniform, time, vec4, mix, sin, float } from 'three/tsl'
5
+ import { fbm2D } from '../../shaders/common/noise'
6
+
7
+ const props = withDefaults(defineProps<{
8
+ colorA?: string
9
+ colorB?: string
10
+ /** Number of rings across the UV space */
11
+ ringFrequency?: number
12
+ /** Noise distortion scale */
13
+ noiseScale?: number
14
+ /** Noise displacement strength */
15
+ noiseStrength?: number
16
+ /** Very slow rotation speed for living wood effect */
17
+ speed?: number
18
+ order?: number
19
+ }>(), {
20
+ colorA: '#8b5e3c',
21
+ colorB: '#4a2e1a',
22
+ ringFrequency: 12,
23
+ noiseScale: 3,
24
+ noiseStrength: 0.4,
25
+ speed: 0,
26
+ order: 0,
27
+ })
28
+
29
+ function toVec3Node(hex: string) {
30
+ const c = new Color(hex)
31
+ return uniform(new Vector3(c.r, c.g, c.b))
32
+ }
33
+
34
+ const colorANode = toVec3Node(props.colorA)
35
+ const colorBNode = toVec3Node(props.colorB)
36
+ const ringFreqNode = uniform(props.ringFrequency)
37
+ const noiseScaleNode = uniform(props.noiseScale)
38
+ const noiseStrNode = uniform(props.noiseStrength)
39
+ const speedNode = uniform(props.speed)
40
+ watch(() => props.colorA, v => { const c = new Color(v); colorANode.value.set(c.r, c.g, c.b) })
41
+ watch(() => props.colorB, v => { const c = new Color(v); colorBNode.value.set(c.r, c.g, c.b) })
42
+ watch(() => props.ringFrequency, v => { ringFreqNode.value = v })
43
+ watch(() => props.noiseScale, v => { noiseScaleNode.value = v })
44
+ watch(() => props.noiseStrength, v => { noiseStrNode.value = v })
45
+ watch(() => props.speed, v => { speedNode.value = v })
46
+
47
+ const pipeline = useShaderPipelineContext()
48
+
49
+ useShaderStage(
50
+ () => {
51
+ const uv = pipeline.uvNode.value
52
+ const t = time.mul(speedNode)
53
+ const n = fbm2D(uv.mul(noiseScaleNode).add(t)).mul(noiseStrNode)
54
+ // Concentric rings from centre with noise offset
55
+ const dist = uv.sub(0.5).length().add(n)
56
+ const ring = sin(dist.mul(ringFreqNode).mul(Math.PI * 2)).mul(0.5).add(0.5)
57
+ return vec4(mix(colorANode, colorBNode, ring), float(1))
58
+ },
59
+ props.order,
60
+ )
61
+ </script>
62
+
63
+ <template><!-- --></template>