kmcom-nuxt-layers 2.2.6 → 2.2.8
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/docs/FEEDS.md +197 -0
- package/docs/LAYERS-FIXES.md +101 -0
- package/docs/MIGRATION.md +627 -0
- package/docs/feed-layer.md +374 -0
- package/docs/patch-picture-provider-type.md +52 -0
- package/docs/shaderGuide.md +2071 -0
- package/docs/types-architecture.md +234 -0
- package/layers/animations/app/components/Motion/CountUp.vue +1 -2
- package/layers/animations/app/components/Motion/Magnetic.vue +1 -2
- package/layers/animations/app/components/Motion/Marquee.vue +2 -5
- package/layers/animations/app/components/Motion/MarqueeText.vue +1 -2
- package/layers/animations/app/components/Motion/Tilt.vue +1 -2
- package/layers/animations/app/composables/useCountUp.ts +4 -1
- package/layers/animations/app/composables/useMagneticElement.ts +1 -3
- package/layers/animations/app/composables/useMarqueeCopies.ts +3 -3
- package/layers/animations/app/types/animations.ts +8 -0
- package/layers/animations/app/types/index.ts +1 -0
- package/layers/animations/package.json +4 -1
- package/layers/canvas/app/components/ShaderCanvas.vue +4 -4
- package/layers/canvas/app/composables/useRendererCapabilities.ts +19 -15
- package/layers/canvas/app/types/index.ts +1 -0
- package/layers/canvas/package.json +2 -1
- package/layers/canvas/tsconfig.json +2 -1
- package/layers/content/app/components/Blog/Card.vue +5 -5
- package/layers/content/app/components/Gallery/AmbientImage.vue +3 -3
- package/layers/content/app/components/Gallery/Card.vue +3 -3
- package/layers/content/app/components/NuxtContent/Detail.vue +5 -1
- package/layers/content/app/components/NuxtContent/Surround.vue +5 -3
- package/layers/content/app/components/NuxtContent/Toc.vue +1 -1
- package/layers/content/app/components/Portfolio/Card.vue +5 -5
- package/layers/content/app/components/content/Figure.vue +3 -3
- package/layers/content/app/types/index.ts +1 -0
- package/layers/content/package.json +2 -1
- package/layers/core/app/composables/useErrorLog.ts +9 -11
- package/layers/core/app/utils/helpers.ts +14 -12
- package/layers/core/nuxt.config.ts +1 -0
- package/layers/feeds/app/plugins/feed-head.ts +1 -2
- package/layers/feeds/package.json +2 -1
- package/layers/feeds/server/routes/feed/discovery.get.ts +1 -2
- package/layers/feeds/server/utils/content-adapter.ts +3 -2
- package/layers/forms/app/components/Form/Field.vue +4 -4
- package/layers/forms/app/types/index.ts +1 -0
- package/layers/forms/package.json +2 -1
- package/layers/layout/app/components/Layout/Grid/Item.vue +33 -19
- package/layers/layout/app/components/Layout/Page/Container.vue +11 -11
- package/layers/layout/app/components/Layout/Page/Header.vue +1 -1
- package/layers/layout/app/components/Layout/Page/index.vue +1 -1
- package/layers/layout/app/components/Layout/Section/Gallery.vue +6 -1
- package/layers/layout/app/components/Layout/Section/Title.vue +1 -1
- package/layers/layout/app/types/index.ts +1 -0
- package/layers/layout/package.json +2 -1
- package/layers/mailer/app/types/index.ts +1 -0
- package/layers/mailer/app/types/mailer.ts +25 -0
- package/layers/mailer/package.json +2 -1
- package/layers/motion/package.json +2 -1
- package/layers/navigation/app/components/Links/Group.vue +1 -0
- package/layers/navigation/app/components/Links/Named.vue +2 -0
- package/layers/navigation/app/types/index.ts +1 -0
- package/layers/navigation/package.json +4 -1
- package/layers/page-transitions/package.json +4 -1
- package/layers/routing/app/types/app-config.d.ts +3 -1
- package/layers/routing/app/types/index.ts +1 -0
- package/layers/routing/package.json +2 -1
- package/layers/scripts/app/composables/useGtm.ts +1 -1
- package/layers/scripts/app/types/index.ts +1 -0
- package/layers/scripts/app/types/scripts.ts +14 -0
- package/layers/scripts/package.json +2 -1
- package/layers/scroll/app/components/Motion/ScrollScene.vue +3 -1
- package/layers/scroll/app/composables/useScrollSteps.ts +2 -9
- package/layers/scroll/app/composables/useSectionProgress.ts +2 -1
- package/layers/scroll/app/plugins/locomotive-scroll.client.ts +1 -8
- package/layers/scroll/app/types/index.ts +1 -0
- package/layers/scroll/app/types/scroll.ts +32 -0
- package/layers/scroll/package.json +3 -0
- package/layers/seo/package.json +2 -1
- package/layers/shader/app/components/Material/Fresnel.client.vue +1 -1
- package/layers/shader/app/components/Material/Image.client.vue +1 -1
- package/layers/shader/app/components/Material/Node.client.vue +7 -7
- package/layers/shader/app/components/Material/Noise.client.vue +1 -1
- package/layers/shader/app/components/Node/Color.client.vue +17 -20
- package/layers/shader/app/components/Node/Noise.client.vue +31 -34
- package/layers/shader/app/components/Pipeline/Aurora.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/BilinearGradient.client.vue +8 -11
- package/layers/shader/app/components/Pipeline/BillowNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/BrightnessContrast.client.vue +6 -2
- package/layers/shader/app/components/Pipeline/CellularNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Checkerboard.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Circle.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/Clouds.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/ColorBurnBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/ColorDodgeBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/ColourRamp.client.vue +5 -9
- package/layers/shader/app/components/Pipeline/ConicGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/Cross.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/CurlNoise.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/DarkenBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/DayNightCycle.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/DiagonalGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/DiamondGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/DifferenceBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/DomainWarpedNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Dots.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/DuoTone.client.vue +5 -9
- package/layers/shader/app/components/Pipeline/ExclusionBlend.client.vue +3 -23
- package/layers/shader/app/components/Pipeline/ExponentialFog.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/FilmBurn.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Flame.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/FocalGradient.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/GodRays.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/GradientNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Grid.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Halation.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/HardLightBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/Haze.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Hexagon.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/LensFlare.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/LightenBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/LinearGradient4.client.vue +2 -2
- package/layers/shader/app/components/Pipeline/Marble.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/MonochromeTint.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/MultiplyBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/NoisyGradient.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/NoisyGradientBlend.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/OverlayBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/Polygon.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/RaymarchTunnel.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Rectangle.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/RidgedNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Ring.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/ScreenBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/SkyAtmosphere.client.vue +6 -9
- package/layers/shader/app/components/Pipeline/SoftLightBlend.client.vue +2 -19
- package/layers/shader/app/components/Pipeline/SplitTone.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Star.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Stripes.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Tint.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/Triangle.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/ValueNoise.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/VoronoiEdges.client.vue +4 -8
- package/layers/shader/app/components/Pipeline/Water.client.vue +5 -8
- package/layers/shader/app/components/Pipeline/WaveBendLayer.client.vue +4 -7
- package/layers/shader/app/components/Pipeline/WaveColourLayer.client.vue +3 -7
- package/layers/shader/app/components/Pipeline/Wood.client.vue +4 -8
- package/layers/shader/app/components/Preset/Aurora.client.vue +15 -21
- package/layers/shader/app/components/Preset/Flow.client.vue +2 -1
- package/layers/shader/app/components/Preset/GradientMesh.client.vue +2 -1
- package/layers/shader/app/components/Preset/Nebula.client.vue +2 -1
- package/layers/shader/app/components/Preset/Ocean.client.vue +2 -1
- package/layers/shader/app/components/Preset/ThemeAurora.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemeBubble.client.vue +30 -91
- package/layers/shader/app/components/Preset/ThemeFlow.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemeGradient.client.vue +30 -91
- package/layers/shader/app/components/Preset/ThemeLavaLamp.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemePlasma.client.vue +30 -90
- package/layers/shader/app/components/Preset/ThemeWave.client.vue +30 -90
- package/layers/shader/app/components/Shader/Background.client.vue +4 -4
- package/layers/shader/app/components/Shader/Host.client.vue +31 -33
- package/layers/shader/app/components/Shader/Runtime.client.vue +15 -23
- package/layers/shader/app/composables/useAmbientMaterials.ts +53 -51
- package/layers/shader/app/composables/useShaderMixBlend.ts +26 -0
- package/layers/shader/app/composables/useThemePreset.ts +75 -0
- package/layers/shader/app/shaders/common/noise.ts +2 -7
- package/layers/shader/app/shaders/types.ts +6 -6
- package/layers/shader/app/types/tsl.ts +7 -25
- package/layers/shader/app/types/uniforms.ts +2 -1
- package/layers/shader/app/utils/tsl/color.ts +7 -1
- package/layers/shader/package.json +2 -1
- package/layers/theme/app/components/ThemePicker/Colors.vue +1 -3
- package/layers/theme/app/types/app-config.d.ts +4 -2
- package/layers/theme/app/types/index.ts +1 -0
- package/layers/theme/app/types/theme.ts +3 -18
- package/layers/theme/package.json +2 -1
- package/layers/theme/server/plugins/theme-fouc.ts +1 -1
- package/layers/transitions/package.json +4 -1
- package/layers/typography/app/components/Typography/CodeBlock.vue +2 -2
- package/layers/typography/app/components/Typography/Headline.vue +2 -2
- package/layers/typography/app/components/Typography/HeadlineScreen.vue +1 -1
- package/layers/typography/app/components/Typography/QuoteBlock.vue +4 -1
- package/layers/typography/app/components/Typography/TextStroke.vue +2 -0
- package/layers/typography/app/components/Typography/index.vue +36 -27
- package/layers/typography/app/composables/typography.ts +27 -21
- package/layers/typography/app/types/colors.ts +9 -29
- package/layers/typography/app/types/index.ts +2 -0
- package/layers/typography/package.json +4 -1
- package/layers/ui/package.json +2 -1
- package/layers/visual/app/app.config.ts +5 -2
- package/layers/visual/app/components/Accent/Blob.vue +20 -20
- package/layers/visual/app/components/Accent/Scene.vue +2 -2
- package/layers/visual/app/components/Base/Modal.vue +2 -2
- package/layers/visual/app/components/Gradient/Background.vue +2 -2
- package/layers/visual/app/components/Gradient/Text.vue +2 -2
- package/layers/visual/app/components/Media/Picture.vue +3 -1
- package/layers/visual/app/components/Progress/Bar.vue +6 -6
- package/layers/visual/app/components/Tint/Overlay.vue +14 -14
- package/layers/visual/app/composables/accent.ts +10 -8
- package/layers/visual/app/composables/tint.ts +7 -7
- package/layers/visual/app/types/index.ts +6 -0
- package/layers/visual/app/types/media.ts +4 -2
- package/layers/visual/app/types/tint.ts +2 -1
- package/layers/visual/package.json +4 -1
- package/package.json +5 -2
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { mix, time, uniform, vec3, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { curlNoise3d } from '../../shaders/common/noise'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
color = '#ffffff',
|
|
@@ -22,12 +23,7 @@
|
|
|
22
23
|
order?: number
|
|
23
24
|
}>()
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
const c = new Color(hex)
|
|
27
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const colorNode = toVec3Node(color)
|
|
26
|
+
const colorNode = hexToVec3Uniform(color)
|
|
31
27
|
const opacityNode = uniform(opacity)
|
|
32
28
|
const scaleNode = uniform(scale)
|
|
33
29
|
const speedNode = uniform(speed)
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color } from 'three'
|
|
3
|
-
import { mix, uniform, vec4 } from 'three/tsl'
|
|
4
|
-
|
|
5
2
|
import { blendDarken } from '../../shaders/common/blend'
|
|
6
|
-
import type { TSLNode } from '../../shaders/types'
|
|
7
3
|
|
|
8
4
|
const {
|
|
9
5
|
color = '#808080',
|
|
@@ -15,23 +11,10 @@
|
|
|
15
11
|
order?: number
|
|
16
12
|
}>()
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
watch(
|
|
14
|
+
useShaderMixBlend(
|
|
15
|
+
blendDarken,
|
|
21
16
|
() => color,
|
|
22
|
-
(v) => {
|
|
23
|
-
colorNode.value.set(v)
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
watch(
|
|
27
17
|
() => opacity,
|
|
28
|
-
(v) => {
|
|
29
|
-
opacityNode.value = v
|
|
30
|
-
}
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
useShaderStage(
|
|
34
|
-
(prev) => vec4(mix(prev.xyz, blendDarken(prev.xyz, colorNode), opacityNode), prev.w),
|
|
35
18
|
order
|
|
36
19
|
)
|
|
37
20
|
</script>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { abs, float, mix, pow, sign, time, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Sinusoidal interpolation between a light and dark colour over time.
|
|
7
9
|
* The phobon easing: t = (sign(cycle) * pow(abs(cycle), 0.6) + 1) / 2
|
|
@@ -25,13 +27,8 @@
|
|
|
25
27
|
order?: number
|
|
26
28
|
}>()
|
|
27
29
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const lightNode = toVec3Node(colorLight)
|
|
34
|
-
const darkNode = toVec3Node(colorDark)
|
|
30
|
+
const lightNode = hexToVec3Uniform(colorLight)
|
|
31
|
+
const darkNode = hexToVec3Uniform(colorDark)
|
|
35
32
|
const speedNode = uniform(speed)
|
|
36
33
|
const opacityNode = uniform(opacity)
|
|
37
34
|
watch(
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { cos, float, mix, sin, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
|
+
|
|
5
7
|
const {
|
|
6
8
|
colorA = '#000000',
|
|
7
9
|
colorB = '#ffffff',
|
|
@@ -15,13 +17,8 @@
|
|
|
15
17
|
order?: number
|
|
16
18
|
}>()
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
const colorANode = toVec3Node(colorA)
|
|
24
|
-
const colorBNode = toVec3Node(colorB)
|
|
20
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
21
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
25
22
|
const angleNode = uniform((angle * Math.PI) / 180)
|
|
26
23
|
watch(
|
|
27
24
|
() => colorA,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, mix, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
|
+
|
|
5
7
|
/** Chebyshev-distance diamond gradient: max(|x|, |y|) from centre. */
|
|
6
8
|
const {
|
|
7
9
|
colorA = '#000000',
|
|
@@ -16,13 +18,8 @@
|
|
|
16
18
|
order?: number
|
|
17
19
|
}>()
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const colorANode = toVec3Node(colorA)
|
|
25
|
-
const colorBNode = toVec3Node(colorB)
|
|
21
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
22
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
26
23
|
const scaleNode = uniform(scale)
|
|
27
24
|
watch(
|
|
28
25
|
() => colorA,
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color } from 'three'
|
|
3
|
-
import { mix, uniform, vec4 } from 'three/tsl'
|
|
4
|
-
|
|
5
2
|
import { blendDifference } from '../../shaders/common/blend'
|
|
6
|
-
import type { TSLNode } from '../../shaders/types'
|
|
7
3
|
|
|
8
4
|
const {
|
|
9
5
|
color = '#808080',
|
|
@@ -15,23 +11,10 @@
|
|
|
15
11
|
order?: number
|
|
16
12
|
}>()
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
watch(
|
|
14
|
+
useShaderMixBlend(
|
|
15
|
+
blendDifference,
|
|
21
16
|
() => color,
|
|
22
|
-
(v) => {
|
|
23
|
-
colorNode.value.set(v)
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
watch(
|
|
27
17
|
() => opacity,
|
|
28
|
-
(v) => {
|
|
29
|
-
opacityNode.value = v
|
|
30
|
-
}
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
useShaderStage(
|
|
34
|
-
(prev) => vec4(mix(prev.xyz, blendDifference(prev.xyz, colorNode), opacityNode), prev.w),
|
|
35
18
|
order
|
|
36
19
|
)
|
|
37
20
|
</script>
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, mix, time, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { domainWarp2D } from '../../shaders/common/noise'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
colorA = '#000000',
|
|
@@ -22,13 +23,8 @@
|
|
|
22
23
|
order?: number
|
|
23
24
|
}>()
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const colorANode = toVec3Node(colorA)
|
|
31
|
-
const colorBNode = toVec3Node(colorB)
|
|
26
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
27
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
32
28
|
const scaleNode = uniform(scale)
|
|
33
29
|
const warpStrNode = uniform(warpStrength)
|
|
34
30
|
const warpScaleNode = uniform(warpScale)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, mix, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { dots } from '../../shaders/common/shapes'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
colorA = '#000000',
|
|
@@ -20,13 +21,8 @@
|
|
|
20
21
|
order?: number
|
|
21
22
|
}>()
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const colorANode = toVec3Node(colorA)
|
|
29
|
-
const colorBNode = toVec3Node(colorB)
|
|
24
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
25
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
30
26
|
const cellNode = uniform(cellSize)
|
|
31
27
|
const dotNode = uniform(dotRadius)
|
|
32
28
|
const softNode = uniform(softness)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
3
|
-
import { mix,
|
|
2
|
+
import { Color } from 'three'
|
|
3
|
+
import { mix, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { luminance } from '../../shaders/common/blend'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
shadowColor = '#1a0033',
|
|
@@ -16,13 +17,8 @@
|
|
|
16
17
|
order?: number
|
|
17
18
|
}>()
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
const shadowNode = toVec3Node(shadowColor)
|
|
25
|
-
const highlightNode = toVec3Node(highlightColor)
|
|
20
|
+
const shadowNode = hexToVec3Uniform(shadowColor)
|
|
21
|
+
const highlightNode = hexToVec3Uniform(highlightColor)
|
|
26
22
|
watch(
|
|
27
23
|
() => shadowColor,
|
|
28
24
|
(v) => {
|
|
@@ -1,11 +1,8 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color, Vector3 } from 'three'
|
|
3
|
-
import { mix, uniform, vec4 } from 'three/tsl'
|
|
4
|
-
|
|
5
2
|
import { blendExclusion } from '../../shaders/common/blend'
|
|
6
3
|
|
|
7
4
|
const {
|
|
8
|
-
color = '#
|
|
5
|
+
color = '#808080',
|
|
9
6
|
opacity = 1,
|
|
10
7
|
order = 0,
|
|
11
8
|
} = defineProps<{
|
|
@@ -14,27 +11,10 @@
|
|
|
14
11
|
order?: number
|
|
15
12
|
}>()
|
|
16
13
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
20
|
-
})()
|
|
21
|
-
const opacityNode = uniform(opacity)
|
|
22
|
-
watch(
|
|
14
|
+
useShaderMixBlend(
|
|
15
|
+
blendExclusion,
|
|
23
16
|
() => color,
|
|
24
|
-
(v) => {
|
|
25
|
-
const c = new Color(v)
|
|
26
|
-
colorNode.value.set(c.r, c.g, c.b)
|
|
27
|
-
}
|
|
28
|
-
)
|
|
29
|
-
watch(
|
|
30
17
|
() => opacity,
|
|
31
|
-
(v) => {
|
|
32
|
-
opacityNode.value = v
|
|
33
|
-
}
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
useShaderStage(
|
|
37
|
-
(prev) => vec4(mix(prev.xyz, blendExclusion(prev.xyz, colorNode), opacityNode), prev.w),
|
|
38
18
|
order
|
|
39
19
|
)
|
|
40
20
|
</script>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { mix, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Height-based exponential fog: exp2(-ray.y * density).
|
|
7
9
|
* Blends prev colour toward fogColor as the ray approaches the horizon.
|
|
@@ -22,12 +24,7 @@
|
|
|
22
24
|
order?: number
|
|
23
25
|
}>()
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
const c = new Color(hex)
|
|
27
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const fogColorNode = toVec3Node(fogColor)
|
|
27
|
+
const fogColorNode = hexToVec3Uniform(fogColor)
|
|
31
28
|
const densityNode = uniform(density)
|
|
32
29
|
const horizonBiasNode = uniform(horizonBias)
|
|
33
30
|
watch(
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color, Vector2
|
|
2
|
+
import { Color, Vector2 } from 'three'
|
|
3
3
|
import { float, smoothstep, uniform, vec2, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Orange/warm light leak emanating from a screen corner.
|
|
7
9
|
* Additive over-exposure effect — common in analogue film.
|
|
@@ -24,12 +26,7 @@
|
|
|
24
26
|
order?: number
|
|
25
27
|
}>()
|
|
26
28
|
|
|
27
|
-
|
|
28
|
-
const c = new Color(hex)
|
|
29
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
const colorNode = toVec3Node(color)
|
|
29
|
+
const colorNode = hexToVec3Uniform(color)
|
|
33
30
|
const originNode = uniform(new Vector2(...origin))
|
|
34
31
|
const radiusNode = uniform(radius)
|
|
35
32
|
const intensityNode = uniform(intensity)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { clamp, float, mix, time, uniform, vec3, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { fbm2D } from '../../shaders/common/noise'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
colorBase = '#ffcc00',
|
|
@@ -22,13 +23,8 @@
|
|
|
22
23
|
order?: number
|
|
23
24
|
}>()
|
|
24
25
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
const colorBaseNode = toVec3Node(colorBase)
|
|
31
|
-
const colorTipNode = toVec3Node(colorTip)
|
|
26
|
+
const colorBaseNode = hexToVec3Uniform(colorBase)
|
|
27
|
+
const colorTipNode = hexToVec3Uniform(colorTip)
|
|
32
28
|
const scaleNode = uniform(scale)
|
|
33
29
|
const speedNode = uniform(speed)
|
|
34
30
|
watch(
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color, Vector2
|
|
2
|
+
import { Color, Vector2 } from 'three'
|
|
3
3
|
import { float, mix, uniform, vec2, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
|
+
|
|
5
7
|
/** Radial gradient with an offset focal point — asymmetric radial. */
|
|
6
8
|
const {
|
|
7
9
|
colorA = '#ffffff',
|
|
@@ -19,13 +21,8 @@
|
|
|
19
21
|
order?: number
|
|
20
22
|
}>()
|
|
21
23
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const colorANode = toVec3Node(colorA)
|
|
28
|
-
const colorBNode = toVec3Node(colorB)
|
|
24
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
25
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
29
26
|
const focalNode = uniform(new Vector2(...focal))
|
|
30
27
|
const radiusNode = uniform(radius)
|
|
31
28
|
watch(
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color, Vector2
|
|
2
|
+
import { Color, Vector2 } from 'three'
|
|
3
3
|
import { cos, float, smoothstep, uniform, vec2, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Radial god rays — procedural volumetric light shafts emanating from a source point.
|
|
7
9
|
* Uses angular spokes in UV space to approximate crepuscular rays.
|
|
@@ -27,13 +29,8 @@
|
|
|
27
29
|
order?: number
|
|
28
30
|
}>()
|
|
29
31
|
|
|
30
|
-
function toVec3Node(hex: string) {
|
|
31
|
-
const c = new Color(hex)
|
|
32
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
33
|
-
}
|
|
34
|
-
|
|
35
32
|
const posNode = uniform(new Vector2(...position))
|
|
36
|
-
const colorNode =
|
|
33
|
+
const colorNode = hexToVec3Uniform(color)
|
|
37
34
|
const intensityNode = uniform(intensity)
|
|
38
35
|
const rayCountNode = uniform(rayCount)
|
|
39
36
|
const decayNode = uniform(decay)
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, mix, time, uniform, vec3, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { gradientNoise3D } from '../../shaders/common/noise'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
colorA = '#000000',
|
|
@@ -18,13 +19,8 @@
|
|
|
18
19
|
order?: number
|
|
19
20
|
}>()
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const colorANode = toVec3Node(colorA)
|
|
27
|
-
const colorBNode = toVec3Node(colorB)
|
|
22
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
23
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
28
24
|
const scaleNode = uniform(scale)
|
|
29
25
|
const speedNode = uniform(speed)
|
|
30
26
|
watch(
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, mix, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { grid } from '../../shaders/common/shapes'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
colorA = '#000000',
|
|
@@ -20,13 +21,8 @@
|
|
|
20
21
|
order?: number
|
|
21
22
|
}>()
|
|
22
23
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const colorANode = toVec3Node(colorA)
|
|
29
|
-
const colorBNode = toVec3Node(colorB)
|
|
24
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
25
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
30
26
|
const cellNode = uniform(cellSize)
|
|
31
27
|
const lineNode = uniform(lineWidth)
|
|
32
28
|
watch(
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, smoothstep, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { luminance } from '../../shaders/common/blend'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Red/warm glow bleed around highlight areas — the analogue film halation effect.
|
|
@@ -23,12 +24,7 @@
|
|
|
23
24
|
order?: number
|
|
24
25
|
}>()
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
const c = new Color(hex)
|
|
28
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
const colorNode = toVec3Node(color)
|
|
27
|
+
const colorNode = hexToVec3Uniform(color)
|
|
32
28
|
const thresholdNode = uniform(threshold)
|
|
33
29
|
const intensityNode = uniform(intensity)
|
|
34
30
|
watch(
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color } from 'three'
|
|
3
|
-
import { mix, uniform, vec4 } from 'three/tsl'
|
|
4
|
-
|
|
5
2
|
import { blendHardLight } from '../../shaders/common/blend'
|
|
6
|
-
import type { TSLNode } from '../../shaders/types'
|
|
7
3
|
|
|
8
4
|
const {
|
|
9
5
|
color = '#808080',
|
|
@@ -15,23 +11,10 @@
|
|
|
15
11
|
order?: number
|
|
16
12
|
}>()
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
watch(
|
|
14
|
+
useShaderMixBlend(
|
|
15
|
+
blendHardLight,
|
|
21
16
|
() => color,
|
|
22
|
-
(v) => {
|
|
23
|
-
colorNode.value.set(v)
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
watch(
|
|
27
17
|
() => opacity,
|
|
28
|
-
(v) => {
|
|
29
|
-
opacityNode.value = v
|
|
30
|
-
}
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
useShaderStage(
|
|
34
|
-
(prev) => vec4(mix(prev.xyz, blendHardLight(prev.xyz, colorNode), opacityNode), prev.w),
|
|
35
18
|
order
|
|
36
19
|
)
|
|
37
20
|
</script>
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, smoothstep, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Edge haze — additive fog/bloom at screen boundaries.
|
|
7
9
|
* Useful for dreamlike or atmospheric borders.
|
|
@@ -21,12 +23,7 @@
|
|
|
21
23
|
order?: number
|
|
22
24
|
}>()
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
const c = new Color(hex)
|
|
26
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const colorNode = toVec3Node(color)
|
|
26
|
+
const colorNode = hexToVec3Uniform(color)
|
|
30
27
|
const reachNode = uniform(reach)
|
|
31
28
|
const intensityNode = uniform(intensity)
|
|
32
29
|
watch(
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color
|
|
2
|
+
import { Color } from 'three'
|
|
3
3
|
import { float, mix, smoothstep, uniform, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
5
|
import { sdHexagon } from '../../shaders/common/sdf'
|
|
6
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
7
|
|
|
7
8
|
const {
|
|
8
9
|
colorA = '#000000',
|
|
@@ -18,13 +19,8 @@
|
|
|
18
19
|
order?: number
|
|
19
20
|
}>()
|
|
20
21
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const colorANode = toVec3Node(colorA)
|
|
27
|
-
const colorBNode = toVec3Node(colorB)
|
|
22
|
+
const colorANode = hexToVec3Uniform(colorA)
|
|
23
|
+
const colorBNode = hexToVec3Uniform(colorB)
|
|
28
24
|
const radiusNode = uniform(radius)
|
|
29
25
|
const softnessNode = uniform(softness)
|
|
30
26
|
watch(
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color, Vector2
|
|
2
|
+
import { Color, Vector2 } from 'three'
|
|
3
3
|
import { float, smoothstep, uniform, vec2, vec4 } from 'three/tsl'
|
|
4
4
|
|
|
5
|
+
import { hexToVec3Uniform } from '../../utils/tsl/color'
|
|
6
|
+
|
|
5
7
|
/**
|
|
6
8
|
* Procedural lens flare — starburst + ghost circle artefacts along the flare axis.
|
|
7
9
|
*/
|
|
@@ -23,13 +25,8 @@
|
|
|
23
25
|
order?: number
|
|
24
26
|
}>()
|
|
25
27
|
|
|
26
|
-
function toVec3Node(hex: string) {
|
|
27
|
-
const c = new Color(hex)
|
|
28
|
-
return uniform(new Vector3(c.r, c.g, c.b))
|
|
29
|
-
}
|
|
30
|
-
|
|
31
28
|
const posNode = uniform(new Vector2(...position))
|
|
32
|
-
const colorNode =
|
|
29
|
+
const colorNode = hexToVec3Uniform(color)
|
|
33
30
|
const intensityNode = uniform(intensity)
|
|
34
31
|
const ghostCountNode = uniform(ghostCount)
|
|
35
32
|
watch(
|
|
@@ -1,9 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import { Color } from 'three'
|
|
3
|
-
import { mix, uniform, vec4 } from 'three/tsl'
|
|
4
|
-
|
|
5
2
|
import { blendLighten } from '../../shaders/common/blend'
|
|
6
|
-
import type { TSLNode } from '../../shaders/types'
|
|
7
3
|
|
|
8
4
|
const {
|
|
9
5
|
color = '#808080',
|
|
@@ -15,23 +11,10 @@
|
|
|
15
11
|
order?: number
|
|
16
12
|
}>()
|
|
17
13
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
watch(
|
|
14
|
+
useShaderMixBlend(
|
|
15
|
+
blendLighten,
|
|
21
16
|
() => color,
|
|
22
|
-
(v) => {
|
|
23
|
-
colorNode.value.set(v)
|
|
24
|
-
}
|
|
25
|
-
)
|
|
26
|
-
watch(
|
|
27
17
|
() => opacity,
|
|
28
|
-
(v) => {
|
|
29
|
-
opacityNode.value = v
|
|
30
|
-
}
|
|
31
|
-
)
|
|
32
|
-
|
|
33
|
-
useShaderStage(
|
|
34
|
-
(prev) => vec4(mix(prev.xyz, blendLighten(prev.xyz, colorNode), opacityNode), prev.w),
|
|
35
18
|
order
|
|
36
19
|
)
|
|
37
20
|
</script>
|