tsl-textures 1.10.0 → 1.11.0

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 CHANGED
@@ -5,6 +5,15 @@ these are online real-time procedural generators of 3D textures.
5
5
  Pick a texture from the [Project home page](https://boytchev.github.io/tsl-textures/).
6
6
 
7
7
 
8
+ [<img src="https://boytchev.github.io/tsl-textures/examples/example-planet.jpg" width="200">](https://boytchev.github.io/tsl-textures/examples/example-planet.html)
9
+ [<img src="https://boytchev.github.io/tsl-textures/examples/example-normal-map.jpg" width="200">](https://boytchev.github.io/tsl-textures/examples/example-normal-map.html)
10
+ [<img src="https://boytchev.github.io/tsl-textures/examples/example-wooden-toys.jpg" width="200">](https://boytchev.github.io/tsl-textures/examples/example-wooden-toys.html)
11
+ [<img src="https://boytchev.github.io/tsl-textures/examples/example-protozoa.jpg" width="200">](https://boytchev.github.io/tsl-textures/examples/example-protozoa.html)
12
+ [<img src="https://boytchev.github.io/tsl-textures/examples/example-neck-massage.jpg" width="200">](https://boytchev.github.io/tsl-textures/examples/example-neck-massage.html)
13
+ [<img src="https://boytchev.github.io/tsl-textures/examples/example-watermelon-supersphere.jpg" width="200">](https://boytchev.github.io/tsl-textures/examples/example-watermelon-supersphere.html)
14
+ [<img src="https://boytchev.github.io/tsl-textures/examples/example-texture-in-motion.jpg" width="200">](https://boytchev.github.io/tsl-textures/examples/example-texture-in-motion.html)
15
+
16
+ <!--
8
17
  #### Example "Planet"
9
18
 
10
19
  Uses [planet.js](https://boytchev.github.io/tsl-textures/docs/planet.html)
@@ -79,3 +88,52 @@ via a TSL function. Click on the image for a live demo. (Note: non-WebGPU browse
79
88
  might need 30+ seconds to start up.)
80
89
 
81
90
  [<img src="https://boytchev.github.io/tsl-textures/examples/example-texture-in-motion.jpg">](https://boytchev.github.io/tsl-textures/examples/example-texture-in-motion.html)
91
+ -->
92
+
93
+ ## Usage
94
+
95
+ ### Use with NPM
96
+
97
+ **Install**
98
+ ```bat
99
+ npm install three tsl-textures
100
+ ```
101
+
102
+ **Use in a javascript file**
103
+ ```js
104
+ // Important: Use `webgpu` version of Three.js
105
+ import * as THREE from 'three/webgpu';
106
+
107
+ // Import your desired texture
108
+ import { polkaDots } from 'tsl-textures/polka-dots';
109
+
110
+ // Create the renderer. Important: Use `WebGPURenderer`
111
+ renderer = new THREE.WebGPURenderer({antialias: true});
112
+
113
+ // ... Create your Three.js scene, camera, lights, etc.
114
+
115
+ // Create geometry
116
+ const objectGeometry = new THREE.IcosahedronGeometry(1, 12)
117
+
118
+ // Create material: Important: Use `Node` Material
119
+ objectMaterial = new THREE.MeshStandardNodeMaterial({
120
+ color: 0xCCCCCC,
121
+ roughness: 0.5,
122
+ metalness: 0.0,
123
+ });
124
+
125
+ // Apply texture to the material's `colorNode` property
126
+ objectMaterial.colorNode = polkaDots ( {
127
+ count: 2,
128
+ size: 0.6,
129
+ blur: 0.22,
130
+ color: new THREE.Color(0),
131
+ background: new THREE.Color(16777215)
132
+ } );
133
+
134
+ // Assign Geometry and Material to a Mesh
135
+ object = new THREE.Mesh(objectGeometry, objectMaterial);
136
+
137
+ // Render
138
+ renderer.render( scene, camera );
139
+ ```
package/package.json CHANGED
@@ -1,33 +1,204 @@
1
- {
2
- "name": "tsl-textures",
3
- "version": "1.10.0",
4
- "description": "A collection of Three.js Shading Language (TSL) textures ",
5
- "main": "index.js",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/boytchev/tsl-textures.git"
9
- },
10
- "scripts": {
11
- "test": "echo \"Error: no test specified\" && exit 1"
12
- },
13
- "keywords": [
14
- "texture",
15
- "tsl",
16
- "three.js"
17
- ],
18
- "homepage": "https://boytchev.github.io/tsl-textures/",
19
- "author": "Pavel Boytchev",
20
- "files": [
21
- "LICENSE",
22
- "package.json",
23
- "README.md",
24
- "src"
25
- ],
26
- "license": "MIT",
27
- "devDependencies": {
28
- "@eslint/js": "^9.4.0",
29
- "eslint": "^9.4.0",
30
- "eslint-plugin-html": "^8.1.1",
31
- "globals": "^15.4.0"
32
- }
33
- }
1
+ {
2
+ "name": "tsl-textures",
3
+ "version": "1.11.0",
4
+ "description": "A collection of Three.js Shading Language (TSL) textures ",
5
+ "main": "./src/tsl-utils.js",
6
+ "module": "./src/tsl-utils.js",
7
+ "exports": {
8
+ ".": {
9
+ "require": "./src/tsl-utils.js",
10
+ "import": "./src/tsl-utils.js"
11
+ },
12
+ "./camouflage": {
13
+ "require": "./src/camouflage.js",
14
+ "import": "./src/camouflage.js"
15
+ },
16
+ "./cave-art": {
17
+ "require": "./src/cave-art.js",
18
+ "import": "./src/cave-art.js"
19
+ },
20
+ "./circles": {
21
+ "require": "./src/circles.js",
22
+ "import": "./src/circles.js"
23
+ },
24
+ "./clouds": {
25
+ "require": "./src/clouds.js",
26
+ "import": "./src/clouds.js"
27
+ },
28
+ "./concrete": {
29
+ "require": "./src/concrete.js",
30
+ "import": "./src/concrete.js"
31
+ },
32
+ "./cork": {
33
+ "require": "./src/cork.js",
34
+ "import": "./src/cork.js"
35
+ },
36
+ "./dalmatian-spots": {
37
+ "require": "./src/dalmatian-spots.js",
38
+ "import": "./src/dalmatian-spots.js"
39
+ },
40
+ "./darth-maul": {
41
+ "require": "./src/darth-maul.js",
42
+ "import": "./src/darth-maul.js"
43
+ },
44
+ "./dyson-sphere": {
45
+ "require": "./src/dyson-sphere.js",
46
+ "import": "./src/dyson-sphere.js"
47
+ },
48
+ "./entangled": {
49
+ "require": "./src/entangled.js",
50
+ "import": "./src/entangled.js"
51
+ },
52
+ "./fordite": {
53
+ "require": "./src/fordite.js",
54
+ "import": "./src/fordite.js"
55
+ },
56
+ "./gas-giant": {
57
+ "require": "./src/gas-giant.js",
58
+ "import": "./src/gas-giant.js"
59
+ },
60
+ "./grid": {
61
+ "require": "./src/grid.js",
62
+ "import": "./src/grid.js"
63
+ },
64
+ "./isolines": {
65
+ "require": "./src/isolines.js",
66
+ "import": "./src/isolines.js"
67
+ },
68
+ "./karst-rock": {
69
+ "require": "./src/karst-rock.js",
70
+ "import": "./src/karst-rock.js"
71
+ },
72
+ "./marble": {
73
+ "require": "./src/marble.js",
74
+ "import": "./src/marble.js"
75
+ },
76
+ "./neon-lights": {
77
+ "require": "./src/neon-lights.js",
78
+ "import": "./src/neon-lights.js"
79
+ },
80
+ "./photosphere": {
81
+ "require": "./src/photosphere.js",
82
+ "import": "./src/photosphere.js"
83
+ },
84
+ "./planet": {
85
+ "require": "./src/planet.js",
86
+ "import": "./src/planet.js"
87
+ },
88
+ "./polka-dots": {
89
+ "require": "./src/polka-dots.js",
90
+ "import": "./src/polka-dots.js"
91
+ },
92
+ "./processed-wood": {
93
+ "require": "./src/processed-wood.js",
94
+ "import": "./src/processed-wood.js"
95
+ },
96
+ "./protozoa": {
97
+ "require": "./src/protozoa.js",
98
+ "import": "./src/protozoa.js"
99
+ },
100
+ "./rotator": {
101
+ "require": "./src/rotator.js",
102
+ "import": "./src/rotator.js"
103
+ },
104
+ "./rough-clay": {
105
+ "require": "./src/rough-clay.js",
106
+ "import": "./src/rough-clay.js"
107
+ },
108
+ "./runny-eggs": {
109
+ "require": "./src/runny-eggs.js",
110
+ "import": "./src/runny-eggs.js"
111
+ },
112
+ "./rust": {
113
+ "require": "./src/rust.js",
114
+ "import": "./src/rust.js"
115
+ },
116
+ "./satin": {
117
+ "require": "./src/satin.js",
118
+ "import": "./src/satin.js"
119
+ },
120
+ "./scaler": {
121
+ "require": "./src/scaler.js",
122
+ "import": "./src/scaler.js"
123
+ },
124
+ "./scepter-head": {
125
+ "require": "./src/scepter-head.js",
126
+ "import": "./src/scepter-head.js"
127
+ },
128
+ "./scream": {
129
+ "require": "./src/scream.js",
130
+ "import": "./src/scream.js"
131
+ },
132
+ "./simplex-noise": {
133
+ "require": "./src/simplex-noise.js",
134
+ "import": "./src/simplex-noise.js"
135
+ },
136
+ "./stars": {
137
+ "require": "./src/stars.js",
138
+ "import": "./src/stars.js"
139
+ },
140
+ "./supersphere": {
141
+ "require": "./src/supersphere.js",
142
+ "import": "./src/supersphere.js"
143
+ },
144
+ "./tiger-fur": {
145
+ "require": "./src/tiger-fur.js",
146
+ "import": "./src/tiger-fur.js"
147
+ },
148
+ "./translator": {
149
+ "require": "./src/translator.js",
150
+ "import": "./src/translator.js"
151
+ },
152
+ "./tsl-utils": {
153
+ "require": "./src/tsl-utils.js",
154
+ "import": "./src/tsl-utils.js"
155
+ },
156
+ "./voronoi-cells": {
157
+ "require": "./src/voronoi-cells.js",
158
+ "import": "./src/voronoi-cells.js"
159
+ },
160
+ "./water-drops": {
161
+ "require": "./src/water-drops.js",
162
+ "import": "./src/water-drops.js"
163
+ },
164
+ "./watermelon": {
165
+ "require": "./src/watermelon.js",
166
+ "import": "./src/watermelon.js"
167
+ },
168
+ "./wood": {
169
+ "require": "./src/wood.js",
170
+ "import": "./src/wood.js"
171
+ },
172
+ "./zebra-lines": {
173
+ "require": "./src/zebra-lines.js",
174
+ "import": "./src/zebra-lines.js"
175
+ }
176
+ },
177
+ "repository": {
178
+ "type": "git",
179
+ "url": "git+https://github.com/boytchev/tsl-textures.git"
180
+ },
181
+ "scripts": {
182
+ "test": "echo \"Error: no test specified\" && exit 1"
183
+ },
184
+ "keywords": [
185
+ "texture",
186
+ "tsl",
187
+ "three.js"
188
+ ],
189
+ "homepage": "https://boytchev.github.io/tsl-textures/",
190
+ "author": "Pavel Boytchev",
191
+ "files": [
192
+ "LICENSE",
193
+ "package.json",
194
+ "README.md",
195
+ "src"
196
+ ],
197
+ "license": "MIT",
198
+ "devDependencies": {
199
+ "@eslint/js": "^9.4.0",
200
+ "eslint": "^9.4.0",
201
+ "eslint-plugin-html": "^8.1.1",
202
+ "globals": "^15.4.0"
203
+ }
204
+ }
package/src/camouflage.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from 'three';
7
7
  import { exp, Fn, If, positionGeometry, round, vec3 } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -17,33 +17,33 @@ var camouflage = Fn( ( params )=>{
17
17
 
18
18
  var color = vec3( 0, 0, 0 ).toVar( );
19
19
 
20
- If( round( noise( pos, 1, 0.2 ) ).greaterThanEqual( 1 ), () => {
21
-
22
- color.assign( params.colorA );
23
-
20
+ If( round( noise( pos, 1, 0.2 ) ).greaterThanEqual( 1 ), () => {
21
+
22
+ color.assign( params.colorA );
23
+
24
24
  }
25
25
  )
26
- .ElseIf( round( noise( pos.yzx, 1, 0.3 ) ).greaterThanEqual( 1 ), () => {
27
-
28
- color.assign( params.colorB );
29
-
26
+ .ElseIf( round( noise( pos.yzx, 1, 0.3 ) ).greaterThanEqual( 1 ), () => {
27
+
28
+ color.assign( params.colorB );
29
+
30
30
  }
31
31
  )
32
- .ElseIf( round( noise( pos.zxy, 1, 0.4 ) ).greaterThanEqual( 1 ), () => {
33
-
34
- color.assign( params.colorC );
35
-
32
+ .ElseIf( round( noise( pos.zxy, 1, 0.4 ) ).greaterThanEqual( 1 ), () => {
33
+
34
+ color.assign( params.colorC );
35
+
36
36
  }
37
37
  )
38
- .Else( () => {
39
-
40
- color.assign( params.colorD );
41
-
38
+ .Else( () => {
39
+
40
+ color.assign( params.colorD );
41
+
42
42
  }
43
43
  );
44
44
 
45
45
  return color;
46
-
46
+
47
47
  } );
48
48
 
49
49
 
@@ -63,4 +63,4 @@ camouflage.defaults = {
63
63
 
64
64
 
65
65
 
66
- export { camouflage };
66
+ export { camouflage };
package/src/cave-art.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { abs, add, exp, float, Fn, If, mix, or, positionGeometry, pow2, sub } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
  var caveArt = Fn( ( params ) => {
package/src/circles.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { acos, clamp, exp, float, Fn, positionGeometry, select, sin } from 'three/tsl';
8
- import { hsl, prepare, toHsl } from 'tsl-textures/tsl-utils.js';
8
+ import { hsl, prepare, toHsl } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/clouds.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { clamp, exp, Fn, min, mix, mul, positionGeometry, vec4 } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -23,7 +23,7 @@ var _clouds = Fn( ( params ) => {
23
23
  var a = clamp( 0, 1, mul( k, 2 ).pow( 1.5 ).sub( 1 ).mul( params.opacity ) ).toVar();
24
24
 
25
25
  return vec4( mix( params.subcolor, params.color, min( 1, k ) ), a );
26
-
26
+
27
27
  } );
28
28
 
29
29
 
@@ -32,7 +32,7 @@ var clouds = Fn( ( params ) => {
32
32
  params = prepare( { ...clouds.defaults, ...params } );
33
33
 
34
34
  return _clouds( params ).rgb;
35
-
35
+
36
36
  } );
37
37
 
38
38
 
package/src/concrete.js CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
  import { abs, cos, cross, exp, Fn, normalLocal, positionGeometry, pow, remap, sin, sub, tangentLocal, transformNormalToView, vec3 } from 'three/tsl';
7
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
7
+ import { noise, prepare } from './tsl-utils.js';
8
8
 
9
9
 
10
10
 
package/src/cork.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from 'three';
7
7
  import { exp, float, Fn, If, Loop, mix, positionGeometry, vec3 } from 'three/tsl';
8
- import { noise, prepare, vnoise } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare, vnoise } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { exp, float, Fn, Loop, mix, positionGeometry } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
  var dalmatianSpots = Fn( ( params )=>{
@@ -19,7 +19,7 @@ var dalmatianSpots = Fn( ( params )=>{
19
19
  var d = float( 1.5 ).sub( params.density ).mul( 2 ).toVar();
20
20
  var count = params.density.mul( 5 ).add( 5 ).toVar();
21
21
 
22
- Loop( count, ()=> {
22
+ Loop( count, ()=> {
23
23
 
24
24
  k.mulAssign( noise( pos ).abs().pow( d ).mul( 100 ).sub( 50 ).clamp( 0, 1 ).oneMinus() );
25
25
  pos.assign( pos.mul( 1.01 ) );
@@ -27,7 +27,7 @@ var dalmatianSpots = Fn( ( params )=>{
27
27
  pos.assign( pos.mul( 1.01 ) );
28
28
  k.mulAssign( noise( pos.zxy ).abs().pow( d ).mul( 100 ).sub( 50 ).clamp( 0, 1 ).oneMinus() );
29
29
  pos.assign( pos.mul( 1.01 ) );
30
-
30
+
31
31
  } );
32
32
 
33
33
  return mix( params.background, params.color, k.clamp( 0, 1 ) );
package/src/darth-maul.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color, Vector3 } from "three";
7
7
  import { abs, exp, Fn, mix, positionGeometry, pow, select, vec3 } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from 'three';
7
7
  import { exp, float, Fn, Loop, mix, positionGeometry, vec3 } from 'three/tsl';
8
- import { prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/entangled.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { abs, exp, float, floor, Fn, Loop, max, mix, mul, oneMinus, positionGeometry, pow, sin } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -18,18 +18,18 @@ var entangled = Fn( ( params ) => {
18
18
  var k = float( -10000 ).toVar( );
19
19
  var k1 = float( 0 ).toVar( );
20
20
 
21
- Loop( floor( float( params.density ) ), ()=> {
21
+ Loop( floor( float( params.density ) ), ()=> {
22
22
 
23
23
  k1.assign( sin( noise( mul( pos, scale ) ).mul( 3*Math.PI ) ) );
24
24
  k.assign( max( k, k1 ) );
25
25
  scale.mulAssign( 1.2 );
26
-
26
+
27
27
  } );
28
28
 
29
29
  k.assign( oneMinus( pow( abs( k ), 5 ) ).mul( 6 ) );
30
30
 
31
31
  return mix( params.color, params.background, k );
32
-
32
+
33
33
  } );
34
34
 
35
35
 
package/src/fordite.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from 'three';
7
7
  import { exp, Fn, mul, positionGeometry, sin, vec3 } from 'three/tsl';
8
- import { hsl, noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { hsl, noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/gas-giant.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { exp, Fn, mix, positionGeometry, vec3 } from 'three/tsl';
8
- import { hsl, noise, prepare, toHsl } from 'tsl-textures/tsl-utils.js';
8
+ import { hsl, noise, prepare, toHsl } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/grid.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { abs, add, div, equirectUV, Fn, min, mix, mul, oneMinus, positionGeometry, pow, remapClamp, round, sin, smoothstep, sub } from 'three/tsl';
8
- import { prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -30,7 +30,7 @@ var grid = Fn( ( params ) => {
30
30
  var k = oneMinus( smoothstep( sub( treshold, 0.002 ), add( treshold, 0.002 ), angle ) );
31
31
 
32
32
  return mix( params.background, params.color, k );
33
-
33
+
34
34
  } );
35
35
 
36
36
 
package/src/isolines.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { add, exp, Fn, mix, oneMinus, positionGeometry, sin, smoothstep, sub } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/karst-rock.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { exp, Fn, mix, positionGeometry } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/marble.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { add, div, exp, Fn, If, mix, mul, oneMinus, positionGeometry, pow } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -26,23 +26,23 @@ var marble = Fn( ( params ) => {
26
26
  var maxSmooth = oneMinus( pow( 0.5, params.thinness.add( 7 ) ) ).toVar(),
27
27
  minSmooth = oneMinus( pow( 0.5, params.thinness.add( 7 ).mul( 0.5 ) ) ).toVar();
28
28
 
29
- If( k.greaterThan( maxSmooth ), ()=>{
30
-
31
- k.assign( 1 );
32
-
29
+ If( k.greaterThan( maxSmooth ), ()=>{
30
+
31
+ k.assign( 1 );
32
+
33
33
  } )
34
- .ElseIf( k.lessThan( minSmooth ), ()=>{
35
-
36
- k.assign( 0 );
37
-
34
+ .ElseIf( k.lessThan( minSmooth ), ()=>{
35
+
36
+ k.assign( 0 );
37
+
38
38
  } )
39
- .Else( ()=> {
39
+ .Else( ()=> {
40
40
 
41
41
  var a = k.sub( minSmooth );
42
42
  var b = maxSmooth.sub( minSmooth );
43
43
  k.assign( pow( div( a, b ), 5 ).mul( 0.75 ) );
44
44
  k.assign( k.mul( add( 0.5, noise( pos.mul( 2 ) ).mul( 1.5 ) ) ) );
45
-
45
+
46
46
  } );
47
47
 
48
48
  k.assign( k.add( mul( params.noise, noise( pos.mul( 150 ) ).abs().pow3() ) ) );
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { abs, exp, Fn, oneMinus, positionGeometry, select, sqrt, vec3 } from 'three/tsl';
8
- import { hsl, noise, prepare, toHsl } from 'tsl-textures/tsl-utils.js';
8
+ import { hsl, noise, prepare, toHsl } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { exp, Fn, Loop, mix, positionGeometry, vec3 } from 'three/tsl';
8
- import { applyEuler, noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { applyEuler, noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/planet.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from 'three';
7
7
  import { exp, float, Fn, If, Loop, mix, mul, positionGeometry, remap, smoothstep, vec3 } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/polka-dots.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { acos, add, distance, exp, float, Fn, Loop, max, min, mix, mod, mul, oneMinus, positionGeometry, pow, smoothstep, } from 'three/tsl';
8
- import { prepare, spherical } from 'tsl-textures/tsl-utils.js';
8
+ import { prepare, spherical } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -28,14 +28,14 @@ var polkaDots = Fn( ( params ) => {
28
28
  var maxi = besti.add( span ).floor().clamp( 0, cnt );
29
29
 
30
30
  var dist = float( 1 ).toVar();
31
- Loop( maxi.sub( mini ), ( { i } )=> {
31
+ Loop( maxi.sub( mini ), ( { i } )=> {
32
32
 
33
33
  var j = add( i, mini );
34
34
  var theta = mod( mul( 2*Math.PI/goldenRatio, j ), 2*Math.PI );
35
35
  var phi = acos( oneMinus( float( j ).mul( 2 ).add( 1 ).div( cnt ) ) );
36
36
  var pnt = spherical( phi, theta );//.normalize();
37
37
  dist.assign( min( dist, distance( vec, pnt ) ) );
38
-
38
+
39
39
  } );
40
40
 
41
41
  var size = exp( params.size.mul( 5 ).sub( 5 ) ).toVar();
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { add, cos, exp, Fn, mix, positionGeometry, radians, sin, sub, vec3 } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/protozoa.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { exp, float, Fn, Loop, matcapUV, mix, positionGeometry, vec3 } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/rotator.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Vector2, Vector3 } from "three";
7
7
  import { cross, Fn, normalLocal, positionGeometry, sub, tangentLocal, transformNormalToView, vec4 } from 'three/tsl';
8
- import { matRotYXZ, matTrans, prepare, selectPlanar } from 'tsl-textures/tsl-utils.js';
8
+ import { matRotYXZ, matTrans, prepare, selectPlanar } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/rough-clay.js CHANGED
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
  import { cross, exp, Fn, mx_worley_noise_float, normalLocal, positionGeometry, sub, tangentLocal, transformNormalToView } from 'three/tsl';
7
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
7
+ import { noise, prepare } from './tsl-utils.js';
8
8
 
9
9
 
10
10
 
package/src/runny-eggs.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from 'three';
7
7
  import { cross, exp, Fn, mix, mx_worley_noise_float, normalLocal, positionGeometry, sub, tangentLocal, transformNormalToView } from 'three/tsl';
8
- import { prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/rust.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from 'three';
7
7
  import { exp, Fn, Loop, mix, positionGeometry } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -17,11 +17,11 @@ var _rust = Fn( ( params )=>{
17
17
 
18
18
  var k = noise( pos ).toVar();
19
19
 
20
- Loop( params.iterations, ()=>{
20
+ Loop( params.iterations, ()=>{
21
21
 
22
22
  pos.mulAssign( 2 );
23
23
  k.addAssign( noise( pos ) );
24
-
24
+
25
25
  } );
26
26
 
27
27
  k.subAssign( noise( pos.mul( 2 ) ).abs() );
package/src/satin.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { abs, exp, Fn, mix, positionGeometry, pow, vec3 } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/scaler.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Vector2, Vector3 } from "three";
7
7
  import { cross, Fn, mix, normalLocal, positionGeometry, sub, tangentLocal, transformNormalToView, vec3, vec4 } from 'three/tsl';
8
- import { matScale, matTrans, prepare, selectPlanar } from 'tsl-textures/tsl-utils.js';
8
+ import { matScale, matTrans, prepare, selectPlanar } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { abs, add, cos, floor, Fn, max, mix, mod, mul, positionGeometry, remapClamp, sign, tan, vec3 } from 'three/tsl';
8
- import { hsl, noise, prepare, remapExp, toHsl } from 'tsl-textures/tsl-utils.js';
8
+ import { hsl, noise, prepare, remapExp, toHsl } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/scream.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { add, cos, exp, Fn, mix, positionGeometry, sin } from 'three/tsl';
8
- import { hsl, noise, prepare, toHsl } from 'tsl-textures/tsl-utils.js';
8
+ import { hsl, noise, prepare, toHsl } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { clamp, exp, Fn, mix, positionGeometry } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/stars.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { abs, add, exp, Fn, mix, positionGeometry, select } from 'three/tsl';
8
- import { hsl, noise, prepare, toHsl } from 'tsl-textures/tsl-utils.js';
8
+ import { hsl, noise, prepare, toHsl } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
  import { cross, float, Fn, normalLocal, positionGeometry, sub, tangentLocal, transformNormalToView } from 'three/tsl';
7
- import { prepare } from 'tsl-textures/tsl-utils.js';
7
+ import { prepare } from './tsl-utils.js';
8
8
 
9
9
 
10
10
 
package/src/tiger-fur.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { exp, Fn, mix, positionGeometry, vec3 } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/translator.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Vector2, Vector3 } from "three";
7
7
  import { cross, Fn, normalLocal, positionGeometry, sub, tangentLocal, transformNormalToView, vec4 } from 'three/tsl';
8
- import { matTrans, prepare, selectPlanar } from 'tsl-textures/tsl-utils.js';
8
+ import { matTrans, prepare, selectPlanar } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from 'three';
7
7
  import { exp, float, Fn, If, Loop, mix, positionGeometry, vec3 } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -4,7 +4,7 @@
4
4
 
5
5
 
6
6
  import { cos, cross, exp, Fn, normalLocal, positionGeometry, remap, sin, sub, tangentLocal, transformNormalToView, vec3 } from 'three/tsl';
7
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
7
+ import { noise, prepare } from './tsl-utils.js';
8
8
 
9
9
 
10
10
 
package/src/watermelon.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from 'three';
7
7
  import { equirectUV, exp, Fn, mix, positionGeometry, vec3 } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
package/src/wood.js CHANGED
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from 'three';
7
7
  import { add, cos, exp, float, Fn, Loop, mix, mul, positionGeometry, radians, reciprocal, sin, sub, vec3 } from 'three/tsl';
8
- import { noise, prepare } from 'tsl-textures/tsl-utils.js';
8
+ import { noise, prepare } from './tsl-utils.js';
9
9
 
10
10
 
11
11
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  import { Color } from "three";
7
7
  import { acos, clamp, exp, Fn, mix, positionGeometry, sin } from 'three/tsl';
8
- import { prepare, spherical } from 'tsl-textures/tsl-utils.js';
8
+ import { prepare, spherical } from './tsl-utils.js';
9
9
 
10
10
 
11
11