shaders 2.2.28 → 2.2.30
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/README.md +73 -4
- package/dist/core/{AngularBlur-DKFExWUF.js → AngularBlur-CuwAjUOA.js} +1 -1
- package/dist/core/{Ascii-BRApYlD4.js → Ascii-Dxk6VaBp.js} +30 -7
- package/dist/core/{Beam-DU7wxmIh.js → Beam-DCaOPIk_.js} +1 -1
- package/dist/core/{Blob-nssNzEgN.js → Blob-8YqXuE5v.js} +2 -2
- package/dist/core/{Bulge-Dm02_fG6.js → Bulge-D9mLn8-p.js} +1 -1
- package/dist/core/{Checkerboard-SKsXoUXE.js → Checkerboard-DjrQsDvl.js} +1 -1
- package/dist/core/{ChromaFlow-VpfgLFbs.js → ChromaFlow-DhzC_8Ne.js} +19 -17
- package/dist/core/{ChromaticAberration-CaCyXMyE.js → ChromaticAberration-hi7WGiVk.js} +1 -1
- package/dist/core/{Circle-BHnAmzVb.js → Circle-BSAdYHYZ.js} +1 -1
- package/dist/core/{CursorTrail-CfVWIKok.js → CursorTrail-B9EQ9FsP.js} +1 -1
- package/dist/core/{DiffuseBlur-GWPb8Zht.js → DiffuseBlur-B-QHWSjt.js} +1 -1
- package/dist/core/{Dither-BNEeyo0u.js → Dither-Bb5rLGEI.js} +1 -1
- package/dist/core/{DotGrid-CRRS6nbt.js → DotGrid-BJyEY7YH.js} +1 -1
- package/dist/core/{Duotone-5gKND3an.js → Duotone-CRwhugbV.js} +1 -1
- package/dist/core/{FloatingParticles-CULOurGT.js → FloatingParticles-Ct7GMVzZ.js} +1 -1
- package/dist/core/{Godrays-BQsDwU26.js → Godrays-fJIUiGke.js} +1 -1
- package/dist/core/{Grid-CWHxwO7R.js → Grid-o_nFs0CE.js} +1 -1
- package/dist/core/{GridDistortion-CZB9w-rv.js → GridDistortion-xuUXyMGP.js} +1 -1
- package/dist/core/{Halftone-MMcLMRpL.js → Halftone-Ddrldk6b.js} +1 -1
- package/dist/core/{LinearBlur-B-Ikurxt.js → LinearBlur-cYfqaOhb.js} +1 -1
- package/dist/core/{LinearGradient-DV6UkhZk.js → LinearGradient-DN_FYXL2.js} +1 -1
- package/dist/core/{Liquify-W8UQNeEM.js → Liquify-Qm_y-apj.js} +1 -1
- package/dist/core/{PolarCoordinates-D63xm0oJ.js → PolarCoordinates-DfjOpgDQ.js} +1 -1
- package/dist/core/{ProgressiveBlur-G-s-o9ic.js → ProgressiveBlur-XD4ivmMn.js} +1 -1
- package/dist/core/{RadialGradient-BGVqSwh0.js → RadialGradient-DGmfTA60.js} +1 -1
- package/dist/core/{RectangularCoordinates-DyHBo456.js → RectangularCoordinates-TM8tkEBk.js} +1 -1
- package/dist/core/{Ripples-2FGWCZlp.js → Ripples-D60vIa8s.js} +2 -2
- package/dist/core/{SimplexNoise-B6dtUCmn.js → SimplexNoise-CI-FEJ6v.js} +2 -2
- package/dist/core/{SineWave-BtPf6-2H.js → SineWave-CQIQ0oCt.js} +1 -1
- package/dist/core/{SolidColor-CETl1cEr.js → SolidColor-CTN8J944.js} +1 -1
- package/dist/core/{Spherize-BwvUcorJ.js → Spherize-DDP0_5VP.js} +1 -1
- package/dist/core/{Spiral-DmJWmUmr.js → Spiral-DIzFj8Xi.js} +1 -1
- package/dist/core/{Strands-CV1oCmHx.js → Strands-WwfH6CNO.js} +2 -2
- package/dist/core/{Stretch-pl-Cn2F8.js → Stretch-DxuMSLMk.js} +1 -1
- package/dist/core/{Swirl-D65vXLDw.js → Swirl-SrhhoVBs.js} +2 -2
- package/dist/core/{TiltShift-CFcK6Hzg.js → TiltShift-CvKqM1xk.js} +1 -1
- package/dist/core/{Tritone-EmnjV2rX.js → Tritone-BeEJj4U0.js} +1 -1
- package/dist/core/{Twirl-HSMyRx5I.js → Twirl-DRomCc8u.js} +1 -1
- package/dist/core/{WaveDistortion-DG8GO_l8.js → WaveDistortion-Btn7OJ4m.js} +1 -1
- package/dist/core/{ZoomBlur-C01oGwwG.js → ZoomBlur-gB0BxldE.js} +1 -1
- package/dist/core/index.js +117 -91
- package/dist/core/performanceTracker.d.ts +7 -1
- package/dist/core/performanceTracker.d.ts.map +1 -1
- package/dist/core/renderer.d.ts.map +1 -1
- package/dist/core/shaders/AngularBlur/index.js +2 -2
- package/dist/core/shaders/Ascii/index.d.ts.map +1 -1
- package/dist/core/shaders/Ascii/index.js +1 -1
- package/dist/core/shaders/Beam/index.js +2 -2
- package/dist/core/shaders/Blob/index.js +3 -3
- package/dist/core/shaders/Bulge/index.js +2 -2
- package/dist/core/shaders/Checkerboard/index.js +2 -2
- package/dist/core/shaders/ChromaFlow/index.d.ts.map +1 -1
- package/dist/core/shaders/ChromaFlow/index.js +2 -2
- package/dist/core/shaders/ChromaticAberration/index.js +2 -2
- package/dist/core/shaders/Circle/index.js +2 -2
- package/dist/core/shaders/CursorTrail/index.js +2 -2
- package/dist/core/shaders/DiffuseBlur/index.js +2 -2
- package/dist/core/shaders/Dither/index.js +2 -2
- package/dist/core/shaders/DotGrid/index.js +2 -2
- package/dist/core/shaders/Duotone/index.js +2 -2
- package/dist/core/shaders/FloatingParticles/index.js +2 -2
- package/dist/core/shaders/Godrays/index.js +2 -2
- package/dist/core/shaders/Grid/index.js +2 -2
- package/dist/core/shaders/GridDistortion/index.js +2 -2
- package/dist/core/shaders/Halftone/index.js +2 -2
- package/dist/core/shaders/LinearBlur/index.js +2 -2
- package/dist/core/shaders/LinearGradient/index.js +2 -2
- package/dist/core/shaders/Liquify/index.js +2 -2
- package/dist/core/shaders/PolarCoordinates/index.js +2 -2
- package/dist/core/shaders/ProgressiveBlur/index.js +2 -2
- package/dist/core/shaders/RadialGradient/index.js +2 -2
- package/dist/core/shaders/RectangularCoordinates/index.js +2 -2
- package/dist/core/shaders/Ripples/index.js +3 -3
- package/dist/core/shaders/SimplexNoise/index.js +3 -3
- package/dist/core/shaders/SineWave/index.js +2 -2
- package/dist/core/shaders/SolidColor/index.js +2 -2
- package/dist/core/shaders/Spherize/index.js +2 -2
- package/dist/core/shaders/Spiral/index.js +2 -2
- package/dist/core/shaders/Strands/index.js +3 -3
- package/dist/core/shaders/Stretch/index.js +2 -2
- package/dist/core/shaders/Swirl/index.js +3 -3
- package/dist/core/shaders/TiltShift/index.js +2 -2
- package/dist/core/shaders/Tritone/index.js +2 -2
- package/dist/core/shaders/Twirl/index.js +2 -2
- package/dist/core/shaders/WaveDistortion/index.js +2 -2
- package/dist/core/shaders/ZoomBlur/index.js +2 -2
- package/dist/core/{transformations-Dv5JW9ck.js → transformations-YbhRK-rd.js} +51 -1
- package/dist/core/utilities/transformations.d.ts +17 -0
- package/dist/core/utilities/transformations.d.ts.map +1 -1
- package/dist/core/utilities/uniforms.d.ts.map +1 -1
- package/package.json +1 -1
- /package/dist/core/{time-CTJvRUZ4.js → time-DgRTVr2F.js} +0 -0
package/README.md
CHANGED
|
@@ -1,11 +1,80 @@
|
|
|
1
1
|
# Shaders
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
## Shader magic for modern frontends
|
|
4
|
+
|
|
5
|
+
<img alt="image" src="https://shaders.com/og.png" />
|
|
6
|
+
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/shaders" rel="noopener noreferrer nofollow" ><img src="https://img.shields.io/npm/v/shaders?color=0368FF&label=version" alt="npm version"></a>
|
|
9
|
+
<a href="https://www.npmjs.com/package/shaders" rel="noopener noreferrer nofollow" ><img src="https://img.shields.io/npm/dm/shaders?color=8D30FF&label=npm" alt="npm downloads per month"></a>
|
|
10
|
+
<a target="_blank" rel="noopener noreferrer nofollow" href="https://www.jsdelivr.com/package/npm/shaders"><img alt="jsDelivr hits (npm)" src="https://img.shields.io/jsdelivr/npm/hm/shaders?logo=jsdeliver&color=FF4FBA"></a>
|
|
11
|
+
<a href="https://img.shields.io/twitter/follow/npm_i_shaders" target="_blank"><img alt="X (formerly Twitter) Follow" src="https://img.shields.io/twitter/follow/npm_i_shaders"></a>
|
|
12
|
+
</p>
|
|
13
|
+
|
|
14
|
+
## Getting Started
|
|
15
|
+
|
|
16
|
+
Shaders is available as component libraries for Vue, React & Svelte. No matter which framework you use, you always install `npm install shaders` and then import components from the framework-specific directory, such as `shaders/vue`.
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
# Install
|
|
20
|
+
npm install shaders
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
<details>
|
|
24
|
+
<summary>Usage (Vue)</summary>
|
|
25
|
+
|
|
26
|
+
```html
|
|
27
|
+
<script>
|
|
28
|
+
import { Shader, LinearGradient } from "shaders/vue"
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
<template>
|
|
32
|
+
<Shader>
|
|
33
|
+
<LinearGradient/>
|
|
34
|
+
</Shader>
|
|
35
|
+
</template>
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
</details>
|
|
39
|
+
|
|
40
|
+
<details>
|
|
41
|
+
<summary>Usage (React)</summary>
|
|
42
|
+
|
|
43
|
+
```html
|
|
44
|
+
<script>
|
|
45
|
+
import { Shader, LinearGradient } from "shaders/react"
|
|
46
|
+
</script>
|
|
47
|
+
|
|
48
|
+
<template>
|
|
49
|
+
<Shader>
|
|
50
|
+
<LinearGradient/>
|
|
51
|
+
</Shader>
|
|
52
|
+
</template>
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
</details>
|
|
56
|
+
|
|
57
|
+
<details>
|
|
58
|
+
<summary>Usage (Svelte)</summary>
|
|
59
|
+
|
|
60
|
+
```svelte
|
|
61
|
+
<script>
|
|
62
|
+
import { Shader, LinearGradient } from "shaders/svelte"
|
|
63
|
+
</script>
|
|
64
|
+
|
|
65
|
+
<Shader>
|
|
66
|
+
<LinearGradient/>
|
|
67
|
+
</Shader>
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
</details>
|
|
71
|
+
|
|
72
|
+
**Learn more and try the Design Editor at https://shaders.com**
|
|
73
|
+
|
|
74
|
+
---
|
|
4
75
|
|
|
5
76
|
Shaders © Shader Effects, Inc.
|
|
6
77
|
|
|
7
78
|
Licensed under the Shader Effects License Agreement (v1.1).
|
|
8
79
|
You may use Shaders freely for non-production or educational use.
|
|
9
|
-
A valid paid license is required for production deployment.
|
|
10
|
-
|
|
11
|
-
See full terms in the [LICENSE](LICENSE)
|
|
80
|
+
A valid paid license is required for production deployment.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { Fn, convertToTexture, cos, float, screenUV, sin, vec2, vec4 } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "AngularBlur",
|
|
@@ -124,6 +124,9 @@ const componentDefinition = {
|
|
|
124
124
|
}
|
|
125
125
|
} catch (error) {}
|
|
126
126
|
}
|
|
127
|
+
let reusableCanvas = null;
|
|
128
|
+
let reusableCtx = null;
|
|
129
|
+
let reusableDataBuffer = null;
|
|
127
130
|
const createCharacterAtlas = async (characters, cellSize, fontFamily, spacing) => {
|
|
128
131
|
if (!characters || characters.length === 0) throw new Error("Characters string cannot be empty");
|
|
129
132
|
const charCount$1 = characters.length;
|
|
@@ -132,11 +135,22 @@ const componentDefinition = {
|
|
|
132
135
|
const spacingMultiplier = Math.max(1, 2 / spacing);
|
|
133
136
|
const actualCellSize = Math.min(baseAtlasCellSize * spacingMultiplier, ATLAS_TEXTURE_SIZE / atlasSize$1);
|
|
134
137
|
const fontSize = actualCellSize * .75;
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
138
|
+
if (!reusableCanvas) {
|
|
139
|
+
reusableCanvas = document.createElement("canvas");
|
|
140
|
+
reusableCanvas.width = ATLAS_TEXTURE_SIZE;
|
|
141
|
+
reusableCanvas.height = ATLAS_TEXTURE_SIZE;
|
|
142
|
+
reusableCtx = reusableCanvas.getContext("2d");
|
|
143
|
+
if (!reusableCtx) {
|
|
144
|
+
console.error("[Ascii] Failed to create 2D canvas context for character atlas");
|
|
145
|
+
throw new Error("Ascii shader: Canvas 2D context unavailable");
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
if (!reusableCtx) {
|
|
149
|
+
console.error("[Ascii] Canvas context unexpectedly null during atlas creation");
|
|
150
|
+
throw new Error("Ascii shader: Canvas 2D context unavailable");
|
|
151
|
+
}
|
|
152
|
+
const ctx = reusableCtx;
|
|
153
|
+
ctx.clearRect(0, 0, ATLAS_TEXTURE_SIZE, ATLAS_TEXTURE_SIZE);
|
|
140
154
|
ctx.fillStyle = "#ffffff";
|
|
141
155
|
ctx.font = `${fontSize}px "${fontFamily}", ${fontFamily}, monospace`;
|
|
142
156
|
if (!ctx.font.includes(fontFamily) && !ctx.font.includes("IBM") && !ctx.font.includes("Plex")) ctx.font = `${fontSize}px ${fontFamily}, monospace`;
|
|
@@ -149,9 +163,11 @@ const componentDefinition = {
|
|
|
149
163
|
const y = row * actualCellSize + actualCellSize / 2;
|
|
150
164
|
ctx.fillText(char, x, y);
|
|
151
165
|
}
|
|
152
|
-
const imageData = ctx.getImageData(0, 0,
|
|
166
|
+
const imageData = ctx.getImageData(0, 0, ATLAS_TEXTURE_SIZE, ATLAS_TEXTURE_SIZE);
|
|
167
|
+
if (!reusableDataBuffer) reusableDataBuffer = new Uint8Array(ATLAS_TEXTURE_SIZE * ATLAS_TEXTURE_SIZE * 4);
|
|
168
|
+
reusableDataBuffer.set(imageData.data);
|
|
153
169
|
return {
|
|
154
|
-
data:
|
|
170
|
+
data: reusableDataBuffer,
|
|
155
171
|
width: ATLAS_TEXTURE_SIZE,
|
|
156
172
|
height: ATLAS_TEXTURE_SIZE,
|
|
157
173
|
atlasSize: atlasSize$1,
|
|
@@ -255,6 +271,13 @@ const componentDefinition = {
|
|
|
255
271
|
});
|
|
256
272
|
onCleanup(() => {
|
|
257
273
|
atlasTexture.dispose();
|
|
274
|
+
if (reusableCanvas) {
|
|
275
|
+
reusableCanvas.width = 0;
|
|
276
|
+
reusableCanvas.height = 0;
|
|
277
|
+
reusableCanvas = null;
|
|
278
|
+
reusableCtx = null;
|
|
279
|
+
}
|
|
280
|
+
reusableDataBuffer = null;
|
|
258
281
|
});
|
|
259
282
|
const effectiveCellSize = cellSizeUniform.mul(1.5);
|
|
260
283
|
const mainGridSize = viewportSize.div(effectiveCellSize);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as transformColorSpace,
|
|
1
|
+
import { i as transformColorSpace, r as transformColor, s as transformPosition, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
3
3
|
import { clamp, float, max, mix, pow, screenUV, smoothstep, sqrt, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
1
|
+
import { i as transformColorSpace, r as transformColor, s as transformPosition, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
|
|
2
|
+
import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
|
|
3
3
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
4
4
|
import { dot, float, length, max, normalize, pow, reflect, screenUV, sin, smoothstep, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as applyEdgeHandling } from "./edges-Djr_12SL.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as transformEdges, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
3
3
|
import { convertToTexture, float, length, max, screenUV, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "Bulge",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-
|
|
1
|
+
import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
3
3
|
import { float, floor, fract, min, mod, screenUV, smoothstep, vec2, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as transformColor } from "./transformations-
|
|
1
|
+
import { r as transformColor } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { DataTexture, FloatType, LinearFilter, RGFormat } from "three";
|
|
3
3
|
import { float, mix, screenUV, smoothstep, texture, uniform, vec2, vec4 } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
@@ -89,6 +89,8 @@ const componentDefinition = {
|
|
|
89
89
|
const GRID_SIZE = 128;
|
|
90
90
|
const displacementData = new Float32Array(GRID_SIZE * GRID_SIZE * 2);
|
|
91
91
|
const liquidData = new Float32Array(GRID_SIZE * GRID_SIZE * 2);
|
|
92
|
+
const tempDisplacementData = new Float32Array(GRID_SIZE * GRID_SIZE * 2);
|
|
93
|
+
const tempLiquidData = new Float32Array(GRID_SIZE * GRID_SIZE * 2);
|
|
92
94
|
const displacementTexture = new DataTexture(displacementData, GRID_SIZE, GRID_SIZE, RGFormat, FloatType);
|
|
93
95
|
displacementTexture.magFilter = LinearFilter;
|
|
94
96
|
displacementTexture.minFilter = LinearFilter;
|
|
@@ -119,15 +121,15 @@ const componentDefinition = {
|
|
|
119
121
|
const intensity = uniforms.intensity.uniform.value;
|
|
120
122
|
const radius = uniforms.radius.uniform.value * .05;
|
|
121
123
|
const momentum = uniforms.momentum.uniform.value;
|
|
122
|
-
|
|
123
|
-
|
|
124
|
+
tempDisplacementData.set(displacementData);
|
|
125
|
+
tempLiquidData.set(liquidData);
|
|
124
126
|
const flowFadeRate = 1 - dt / Math.max(.1, 1);
|
|
125
|
-
for (let i = 0; i < GRID_SIZE * GRID_SIZE * 2; i++)
|
|
127
|
+
for (let i = 0; i < GRID_SIZE * GRID_SIZE * 2; i++) tempDisplacementData[i] = displacementData[i] * flowFadeRate;
|
|
126
128
|
for (let i = 0; i < GRID_SIZE; i++) for (let j = 0; j < GRID_SIZE; j++) {
|
|
127
129
|
const idx = (i * GRID_SIZE + j) * 2;
|
|
128
130
|
const liquidFadeRate = 1 - dt / Math.max(.4, 1);
|
|
129
|
-
|
|
130
|
-
|
|
131
|
+
tempLiquidData[idx] = liquidData[idx] * liquidFadeRate;
|
|
132
|
+
tempLiquidData[idx + 1] = liquidData[idx + 1] * liquidFadeRate;
|
|
131
133
|
if (Math.abs(displacementData[idx]) > .001 || Math.abs(displacementData[idx + 1]) > .001) {
|
|
132
134
|
const flowSpeed = momentum * 50 * dt;
|
|
133
135
|
const advectX = j - displacementData[idx] * flowSpeed;
|
|
@@ -143,7 +145,7 @@ const componentDefinition = {
|
|
|
143
145
|
const idx01 = (y0 * GRID_SIZE + x1) * 2;
|
|
144
146
|
const idx10 = (y1 * GRID_SIZE + x0) * 2;
|
|
145
147
|
const idx11 = (y1 * GRID_SIZE + x1) * 2;
|
|
146
|
-
|
|
148
|
+
tempLiquidData[idx] = (liquidData[idx00] * (1 - fx) * (1 - fy) + liquidData[idx01] * fx * (1 - fy) + liquidData[idx10] * (1 - fx) * fy + liquidData[idx11] * fx * fy) * liquidFadeRate;
|
|
147
149
|
}
|
|
148
150
|
}
|
|
149
151
|
}
|
|
@@ -158,19 +160,19 @@ const componentDefinition = {
|
|
|
158
160
|
const effectiveRadius = radius * Math.min(speed * speed * 20, 1);
|
|
159
161
|
if (dist < effectiveRadius * 2 && Math.abs(velX) + Math.abs(velY) > .01) {
|
|
160
162
|
const influence = Math.exp(-dist * dist / (effectiveRadius * effectiveRadius));
|
|
161
|
-
|
|
162
|
-
|
|
163
|
+
tempDisplacementData[idx] += mouseVelX.value * influence * (intensity * 100) * dt * .01;
|
|
164
|
+
tempDisplacementData[idx + 1] += mouseVelY.value * influence * (intensity * 100) * dt * .01;
|
|
163
165
|
const speedMultiplier = Math.min(speed * 10, 1);
|
|
164
|
-
|
|
165
|
-
|
|
166
|
+
tempLiquidData[idx] += influence * (intensity * 100) * dt * .01 * speedMultiplier;
|
|
167
|
+
tempLiquidData[idx + 1] = 0;
|
|
166
168
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
169
|
+
tempDisplacementData[idx] = Math.max(-1, Math.min(1, tempDisplacementData[idx]));
|
|
170
|
+
tempDisplacementData[idx + 1] = Math.max(-1, Math.min(1, tempDisplacementData[idx + 1]));
|
|
171
|
+
tempLiquidData[idx] = Math.max(0, Math.min(1, tempLiquidData[idx]));
|
|
172
|
+
tempLiquidData[idx + 1] = 0;
|
|
171
173
|
}
|
|
172
|
-
displacementData.set(
|
|
173
|
-
liquidData.set(
|
|
174
|
+
displacementData.set(tempDisplacementData);
|
|
175
|
+
liquidData.set(tempLiquidData);
|
|
174
176
|
displacementTexture.needsUpdate = true;
|
|
175
177
|
liquidTexture.needsUpdate = true;
|
|
176
178
|
prevX = pointer.x;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as transformAngle } from "./transformations-
|
|
1
|
+
import { n as transformAngle } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { convertToTexture, cos, radians, screenUV, sin, vec2, vec4 } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "ChromaticAberration",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { length, screenUV, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "Circle",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-
|
|
1
|
+
import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
3
3
|
import { DataTexture, FloatType, LinearFilter, RGBAFormat } from "three";
|
|
4
4
|
import { float, screenUV, step, texture, vec2, vec4 } from "three/tsl";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as applyEdgeHandling } from "./edges-Djr_12SL.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as transformEdges } from "./transformations-YbhRK-rd.js";
|
|
3
3
|
import { convertToTexture, dot, fract, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "DiffuseBlur",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as transformColor } from "./transformations-
|
|
1
|
+
import { r as transformColor } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { dot, floor, mix, screenUV, step, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "Dither",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as transformColor } from "./transformations-
|
|
1
|
+
import { r as transformColor } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { float, floor, fwidth, length, mix, screenUV, sin, smoothstep, time, vec2, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "DotGrid",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-
|
|
1
|
+
import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
3
3
|
import { convertToTexture, dot, screenUV, smoothstep, vec3, vec4 } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as transformColor } from "./transformations-
|
|
1
|
+
import { r as transformColor } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { Fn, cos, dot, float, floor, fract, length, min, mix, screenUV, sin, smoothstep, time, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
var hash1_2 = Fn(([p]) => {
|
|
4
4
|
return fract(sin(dot(p, vec2(127.1, 311.7))).mul(43758.5453123));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { Fn, PI, abs, atan, clamp, float, length, mix, pow, screenUV, sin, smoothstep, time, vec2, vec4 } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "Godrays",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { r as transformColor } from "./transformations-
|
|
1
|
+
import { r as transformColor } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { fract, fwidth, max, screenUV, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "Grid",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as applyEdgeHandling } from "./edges-Djr_12SL.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as transformEdges } from "./transformations-YbhRK-rd.js";
|
|
3
3
|
import { DataTexture, FloatType, LinearFilter, RGFormat } from "three";
|
|
4
4
|
import { convertToTexture, float, screenUV, texture, uniform, vec2, vec4 } from "three/tsl";
|
|
5
5
|
var DEFAULT_GRID_SIZE = 20;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as transformAngle } from "./transformations-
|
|
1
|
+
import { n as transformAngle } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { cos, dot, fract, length, radians, screenUV, sin, smoothstep, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "Halftone",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as transformAngle } from "./transformations-
|
|
1
|
+
import { n as transformAngle } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { Fn, convertToTexture, cos, float, radians, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "LinearBlur",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as transformColorSpace, n as transformAngle, o as transformEdges, r as transformColor, s as transformPosition, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
3
3
|
import { abs, cos, dot, float, fract, length, mod, normalize, radians, screenUV, sin, vec2, vec4 } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as applyEdgeHandling } from "./edges-Djr_12SL.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as transformEdges } from "./transformations-YbhRK-rd.js";
|
|
3
3
|
import { DataTexture, FloatType, LinearFilter, RGFormat } from "three";
|
|
4
4
|
import { convertToTexture, float, screenUV, texture, uniform, vec2, vec4 } from "three/tsl";
|
|
5
5
|
var GRID_SIZE = 32;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as applyEdgeHandling } from "./edges-Djr_12SL.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as transformEdges, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
3
3
|
import { PI, atan, convertToTexture, length, mix, screenUV, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "PolarCoordinates",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as transformAngle,
|
|
1
|
+
import { n as transformAngle, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { Fn, convertToTexture, cos, float, max, radians, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "ProgressiveBlur",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as transformColorSpace,
|
|
1
|
+
import { i as transformColorSpace, r as transformColor, s as transformPosition, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
3
3
|
import { distance, float, screenUV, vec2, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as applyEdgeHandling } from "./edges-Djr_12SL.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as transformEdges, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
3
3
|
import { PI, convertToTexture, cos, mix, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "RectangularCoordinates",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
|
+
import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
|
|
3
3
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
4
4
|
import { distance, float, screenUV, sin, smoothstep, vec2, viewportSize } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { r as transformColor } from "./transformations-YbhRK-rd.js";
|
|
2
|
+
import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
|
|
3
3
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
4
4
|
import { clamp, exp, float, mx_noise_float, screenUV, vec2, vec3, viewportSize } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as transformAngle,
|
|
1
|
+
import { n as transformAngle, r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { PI, abs, cos, radians, screenUV, sin, smoothstep, time, vec2, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "SineWave",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { convertToTexture, dot, float, max, normalize, pow, screenUV, smoothstep, sqrt, vec2, vec3, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "Spherize",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as transformColorSpace,
|
|
1
|
+
import { i as transformColorSpace, r as transformColor, s as transformPosition, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
3
3
|
import { abs, atan, clamp, float, fract, fwidth, length, mix, screenUV, smoothstep, time, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { r as transformColor, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
|
+
import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
|
|
3
3
|
import { Fn, abs, cos, float, max, mix, screenUV, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "Strands",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as applyEdgeHandling } from "./edges-Djr_12SL.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as transformEdges, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
3
3
|
import { clamp, convertToTexture, cos, float, mix, screenUV, sin, vec2, vec4, viewportSize } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "Stretch",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import {
|
|
1
|
+
import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
|
|
2
|
+
import { t as createAnimatedTime } from "./time-DgRTVr2F.js";
|
|
3
3
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
4
4
|
import { cos, float, screenUV, sin, smoothstep, vec2, vec4 } from "three/tsl";
|
|
5
5
|
const componentDefinition = {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { n as transformAngle,
|
|
1
|
+
import { n as transformAngle, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { Fn, abs, convertToTexture, cos, dot, float, mix, radians, screenUV, sin, smoothstep, vec2, vec4, viewportSize } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "TiltShift",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-
|
|
1
|
+
import { i as transformColorSpace, r as transformColor, t as colorSpaceOptions } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { t as mixColors } from "./colorMixing-CZPFmiT4.js";
|
|
3
3
|
import { convertToTexture, dot, screenUV, smoothstep, vec3, vec4 } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as applyEdgeHandling } from "./edges-Djr_12SL.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as transformEdges, s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
3
3
|
import { convertToTexture, cos, length, screenUV, sin, vec2, vec4 } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "Twirl",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as applyEdgeHandling } from "./edges-Djr_12SL.js";
|
|
2
|
-
import {
|
|
2
|
+
import { o as transformEdges } from "./transformations-YbhRK-rd.js";
|
|
3
3
|
import { PI, abs, convertToTexture, cos, float, fract, screenUV, sin, step, time, vec2, vec4 } from "three/tsl";
|
|
4
4
|
const componentDefinition = {
|
|
5
5
|
name: "WaveDistortion",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { s as transformPosition } from "./transformations-YbhRK-rd.js";
|
|
2
2
|
import { Fn, convertToTexture, float, screenUV, vec2, vec4 } from "three/tsl";
|
|
3
3
|
const componentDefinition = {
|
|
4
4
|
name: "ZoomBlur",
|