@takram/three-clouds 0.1.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.
Files changed (103) hide show
  1. package/CHANGELOG.md +5 -0
  2. package/README.md +1130 -0
  3. package/assets/local_weather.png +0 -0
  4. package/assets/shape.bin +1 -0
  5. package/assets/shape_detail.bin +1 -0
  6. package/assets/turbulence.png +0 -0
  7. package/build/index.cjs +583 -0
  8. package/build/index.cjs.map +1 -0
  9. package/build/index.js +728 -0
  10. package/build/index.js.map +1 -0
  11. package/build/r3f.cjs +2 -0
  12. package/build/r3f.cjs.map +1 -0
  13. package/build/r3f.js +205 -0
  14. package/build/r3f.js.map +1 -0
  15. package/build/shared.cjs +2189 -0
  16. package/build/shared.cjs.map +1 -0
  17. package/build/shared.js +3825 -0
  18. package/build/shared.js.map +1 -0
  19. package/package.json +77 -0
  20. package/src/CascadedShadowMaps.ts +288 -0
  21. package/src/CloudLayer.ts +85 -0
  22. package/src/CloudLayers.test.ts +61 -0
  23. package/src/CloudLayers.ts +181 -0
  24. package/src/CloudShape.ts +22 -0
  25. package/src/CloudShapeDetail.ts +22 -0
  26. package/src/CloudsEffect.ts +810 -0
  27. package/src/CloudsMaterial.ts +467 -0
  28. package/src/CloudsPass.ts +285 -0
  29. package/src/CloudsResolveMaterial.ts +108 -0
  30. package/src/DensityProfile.ts +38 -0
  31. package/src/LocalWeather.ts +21 -0
  32. package/src/PassBase.ts +28 -0
  33. package/src/Procedural3DTexture.ts +94 -0
  34. package/src/ProceduralTexture.ts +94 -0
  35. package/src/ShaderArrayPass.ts +32 -0
  36. package/src/ShadowMaterial.ts +141 -0
  37. package/src/ShadowPass.ts +185 -0
  38. package/src/ShadowResolveMaterial.ts +72 -0
  39. package/src/Turbulence.ts +21 -0
  40. package/src/bayer.ts +23 -0
  41. package/src/constants.ts +8 -0
  42. package/src/helpers/FrustumCorners.ts +138 -0
  43. package/src/helpers/setArrayRenderTargetLayers.ts +32 -0
  44. package/src/helpers/splitFrustum.ts +59 -0
  45. package/src/index.ts +14 -0
  46. package/src/qualityPresets.ts +117 -0
  47. package/src/r3f/CloudLayer.tsx +95 -0
  48. package/src/r3f/CloudLayers.tsx +54 -0
  49. package/src/r3f/Clouds.tsx +278 -0
  50. package/src/r3f/index.ts +2 -0
  51. package/src/shaders/catmullRomSampling.glsl +113 -0
  52. package/src/shaders/cloudShape.frag +78 -0
  53. package/src/shaders/cloudShapeDetail.frag +56 -0
  54. package/src/shaders/clouds.frag +996 -0
  55. package/src/shaders/clouds.glsl +190 -0
  56. package/src/shaders/clouds.vert +69 -0
  57. package/src/shaders/cloudsEffect.frag +11 -0
  58. package/src/shaders/cloudsResolve.frag +202 -0
  59. package/src/shaders/cloudsResolve.vert +10 -0
  60. package/src/shaders/localWeather.frag +83 -0
  61. package/src/shaders/parameters.glsl +64 -0
  62. package/src/shaders/perlin.glsl +211 -0
  63. package/src/shaders/shadow.frag +197 -0
  64. package/src/shaders/shadow.vert +16 -0
  65. package/src/shaders/shadowResolve.frag +76 -0
  66. package/src/shaders/shadowResolve.vert +10 -0
  67. package/src/shaders/structuredSampling.glsl +101 -0
  68. package/src/shaders/tileableNoise.glsl +88 -0
  69. package/src/shaders/turbulence.frag +51 -0
  70. package/src/shaders/types.glsl +18 -0
  71. package/src/shaders/varianceClipping.glsl +114 -0
  72. package/src/uniforms.ts +218 -0
  73. package/types/CascadedShadowMaps.d.ts +52 -0
  74. package/types/CloudLayer.d.ts +26 -0
  75. package/types/CloudLayers.d.ts +21 -0
  76. package/types/CloudShape.d.ts +5 -0
  77. package/types/CloudShapeDetail.d.ts +5 -0
  78. package/types/CloudsEffect.d.ts +170 -0
  79. package/types/CloudsMaterial.d.ts +86 -0
  80. package/types/CloudsPass.d.ts +44 -0
  81. package/types/CloudsResolveMaterial.d.ts +30 -0
  82. package/types/DensityProfile.d.ts +12 -0
  83. package/types/LocalWeather.d.ts +5 -0
  84. package/types/PassBase.d.ts +14 -0
  85. package/types/Procedural3DTexture.d.ts +20 -0
  86. package/types/ProceduralTexture.d.ts +24 -0
  87. package/types/ShaderArrayPass.d.ts +7 -0
  88. package/types/ShadowMaterial.d.ts +34 -0
  89. package/types/ShadowPass.d.ts +34 -0
  90. package/types/ShadowResolveMaterial.d.ts +20 -0
  91. package/types/Turbulence.d.ts +5 -0
  92. package/types/bayer.d.ts +4 -0
  93. package/types/constants.d.ts +6 -0
  94. package/types/helpers/FrustumCorners.d.ts +18 -0
  95. package/types/helpers/setArrayRenderTargetLayers.d.ts +3 -0
  96. package/types/helpers/splitFrustum.d.ts +9 -0
  97. package/types/index.d.ts +13 -0
  98. package/types/qualityPresets.d.ts +46 -0
  99. package/types/r3f/CloudLayer.d.ts +7 -0
  100. package/types/r3f/CloudLayers.d.ts +15 -0
  101. package/types/r3f/Clouds.d.ts +16 -0
  102. package/types/r3f/index.d.ts +2 -0
  103. package/types/uniforms.d.ts +66 -0
@@ -0,0 +1,583 @@
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./shared.cjs"),c=require("@takram/three-geospatial"),s=require("@takram/three-geospatial/shaders"),n=require("three");class f{constructor({size:t,fragmentShader:r}){this.needsRender=!0,this.camera=new n.Camera,this.size=t,this.material=new n.RawShaderMaterial({glslVersion:n.GLSL3,vertexShader:`
2
+ in vec3 position;
3
+ out vec2 vUv;
4
+ void main() {
5
+ vUv = position.xy * 0.5 + 0.5;
6
+ gl_Position = vec4(position.xy, 0.0, 1.0);
7
+ }
8
+ `,fragmentShader:r,uniforms:{layer:new n.Uniform(0)}}),this.mesh=new n.Mesh(new n.PlaneGeometry(2,2),this.material),this.renderTarget=new n.WebGL3DRenderTarget(t,t,t,{depthBuffer:!1,stencilBuffer:!1,format:n.RedFormat});const e=this.renderTarget.texture;e.minFilter=n.LinearFilter,e.magFilter=n.LinearFilter,e.wrapS=n.RepeatWrapping,e.wrapT=n.RepeatWrapping,e.wrapR=n.RepeatWrapping,e.colorSpace=n.NoColorSpace,e.needsUpdate=!0}dispose(){this.renderTarget.dispose(),this.material.dispose()}render(t,r){if(!this.needsRender)return;this.needsRender=!1;const e=t.getRenderTarget();for(let a=0;a<this.size;++a)this.material.uniforms.layer.value=a/this.size,t.setRenderTarget(this.renderTarget,a),t.render(this.mesh,this.camera);t.setRenderTarget(e)}get texture(){return this.renderTarget.texture}}const u=`// Based on the following work with slight modifications.
9
+ // https://github.com/sebh/TileableVolumeNoise
10
+
11
+ /**
12
+ * The MIT License (MIT)
13
+ *
14
+ * Copyright(c) 2017 Sébastien Hillaire
15
+ *
16
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
17
+ * of this software and associated documentation files (the "Software"), to deal
18
+ * in the Software without restriction, including without limitation the rights
19
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
20
+ * copies of the Software, and to permit persons to whom the Software is
21
+ * furnished to do so, subject to the following conditions:
22
+ *
23
+ * The above copyright notice and this permission notice shall be included in
24
+ * all copies or substantial portions of the Software.
25
+ *
26
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
27
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
28
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
29
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
30
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
31
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32
+ * SOFTWARE.
33
+ */
34
+
35
+ precision highp float;
36
+ precision highp int;
37
+
38
+ #include "core/math"
39
+ #include "perlin"
40
+ #include "tileableNoise"
41
+
42
+ uniform float layer;
43
+
44
+ in vec2 vUv;
45
+
46
+ layout(location = 0) out float outputColor;
47
+
48
+ float getPerlinWorley(const vec3 point) {
49
+ int octaveCount = 3;
50
+ float frequency = 8.0;
51
+ float perlin = getPerlinNoise(point, frequency, octaveCount);
52
+ perlin = clamp(perlin, 0.0, 1.0);
53
+
54
+ float cellCount = 4.0;
55
+ vec3 noise = vec3(
56
+ 1.0 - getWorleyNoise(point, cellCount * 2.0),
57
+ 1.0 - getWorleyNoise(point, cellCount * 8.0),
58
+ 1.0 - getWorleyNoise(point, cellCount * 14.0)
59
+ );
60
+ float fbm = dot(noise, vec3(0.625, 0.25, 0.125));
61
+ return remap(perlin, 0.0, 1.0, fbm, 1.0);
62
+ }
63
+
64
+ float getWorleyFbm(const vec3 point) {
65
+ float cellCount = 4.0;
66
+ vec4 noise = vec4(
67
+ 1.0 - getWorleyNoise(point, cellCount * 2.0),
68
+ 1.0 - getWorleyNoise(point, cellCount * 4.0),
69
+ 1.0 - getWorleyNoise(point, cellCount * 8.0),
70
+ 1.0 - getWorleyNoise(point, cellCount * 16.0)
71
+ );
72
+ vec3 fbm = vec3(
73
+ dot(noise.xyz, vec3(0.625, 0.25, 0.125)),
74
+ dot(noise.yzw, vec3(0.625, 0.25, 0.125)),
75
+ dot(noise.zw, vec2(0.75, 0.25))
76
+ );
77
+ return dot(fbm, vec3(0.625, 0.25, 0.125));
78
+ }
79
+
80
+ void main() {
81
+ vec3 point = vec3(vUv.x, vUv.y, layer);
82
+ float perlinWorley = getPerlinWorley(point);
83
+ float worleyFbm = getWorleyFbm(point);
84
+ outputColor = remap(perlinWorley, worleyFbm - 1.0, 1.0);
85
+ }
86
+ `,l=`// Ported from GLM: https://github.com/g-truc/glm/blob/master/glm/gtc/noise.inl
87
+
88
+ /**
89
+ * OpenGL Mathematics (GLM)
90
+ *
91
+ * GLM is licensed under The Happy Bunny License or MIT License
92
+ *
93
+ * The Happy Bunny License (Modified MIT License)
94
+ *
95
+ * Copyright (c) 2005 - G-Truc Creation
96
+ *
97
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
98
+ * of this software and associated documentation files (the "Software"), to deal
99
+ * in the Software without restriction, including without limitation the rights
100
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
101
+ * copies of the Software, and to permit persons to whom the Software is
102
+ * furnished to do so, subject to the following conditions:
103
+ *
104
+ * The above copyright notice and this permission notice shall be included in
105
+ * all copies or substantial portions of the Software.
106
+ *
107
+ * Restrictions:
108
+ * By making use of the Software for military purposes, you choose to make a
109
+ * Bunny unhappy.
110
+ *
111
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
112
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
113
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
114
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
115
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
116
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
117
+ * THE SOFTWARE.
118
+ *
119
+ * The MIT License
120
+ *
121
+ * Copyright (c) 2005 - G-Truc Creation
122
+ *
123
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
124
+ * of this software and associated documentation files (the "Software"), to deal
125
+ * in the Software without restriction, including without limitation the rights
126
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
127
+ * copies of the Software, and to permit persons to whom the Software is
128
+ * furnished to do so, subject to the following conditions:
129
+ *
130
+ * The above copyright notice and this permission notice shall be included in
131
+ * all copies or substantial portions of the Software.
132
+ *
133
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
134
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
135
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
136
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
137
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
138
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
139
+ * THE SOFTWARE.
140
+ */
141
+
142
+ vec4 mod289(const vec4 x) {
143
+ return x - floor(x * (1.0 / 289.0)) * 289.0;
144
+ }
145
+
146
+ vec4 permute(const vec4 v) {
147
+ return mod289((v * 34.0 + 1.0) * v);
148
+ }
149
+
150
+ vec4 taylorInvSqrt(const vec4 r) {
151
+ return 1.79284291400159 - 0.85373472095314 * r;
152
+ }
153
+
154
+ vec4 fade(const vec4 v) {
155
+ return v * v * v * (v * (v * 6.0 - 15.0) + 10.0);
156
+ }
157
+
158
+ // Classic Perlin noise, periodic version
159
+ float perlin(const vec4 position, const vec4 rep) {
160
+ vec4 Pi0 = mod(floor(position), rep); // Integer part modulo rep
161
+ vec4 Pi1 = mod(Pi0 + 1.0, rep); // Integer part + 1 mod rep
162
+ vec4 Pf0 = fract(position); // Fractional part for interpolation
163
+ vec4 Pf1 = Pf0 - 1.0; // Fractional part - 1.0
164
+ vec4 ix = vec4(Pi0.x, Pi1.x, Pi0.x, Pi1.x);
165
+ vec4 iy = vec4(Pi0.y, Pi0.y, Pi1.y, Pi1.y);
166
+ vec4 iz0 = vec4(Pi0.z);
167
+ vec4 iz1 = vec4(Pi1.z);
168
+ vec4 iw0 = vec4(Pi0.w);
169
+ vec4 iw1 = vec4(Pi1.w);
170
+
171
+ vec4 ixy = permute(permute(ix) + iy);
172
+ vec4 ixy0 = permute(ixy + iz0);
173
+ vec4 ixy1 = permute(ixy + iz1);
174
+ vec4 ixy00 = permute(ixy0 + iw0);
175
+ vec4 ixy01 = permute(ixy0 + iw1);
176
+ vec4 ixy10 = permute(ixy1 + iw0);
177
+ vec4 ixy11 = permute(ixy1 + iw1);
178
+
179
+ vec4 gx00 = ixy00 / 7.0;
180
+ vec4 gy00 = floor(gx00) / 7.0;
181
+ vec4 gz00 = floor(gy00) / 6.0;
182
+ gx00 = fract(gx00) - 0.5;
183
+ gy00 = fract(gy00) - 0.5;
184
+ gz00 = fract(gz00) - 0.5;
185
+ vec4 gw00 = vec4(0.75) - abs(gx00) - abs(gy00) - abs(gz00);
186
+ vec4 sw00 = step(gw00, vec4(0));
187
+ gx00 -= sw00 * (step(0.0, gx00) - 0.5);
188
+ gy00 -= sw00 * (step(0.0, gy00) - 0.5);
189
+
190
+ vec4 gx01 = ixy01 / 7.0;
191
+ vec4 gy01 = floor(gx01) / 7.0;
192
+ vec4 gz01 = floor(gy01) / 6.0;
193
+ gx01 = fract(gx01) - 0.5;
194
+ gy01 = fract(gy01) - 0.5;
195
+ gz01 = fract(gz01) - 0.5;
196
+ vec4 gw01 = vec4(0.75) - abs(gx01) - abs(gy01) - abs(gz01);
197
+ vec4 sw01 = step(gw01, vec4(0.0));
198
+ gx01 -= sw01 * (step(0.0, gx01) - 0.5);
199
+ gy01 -= sw01 * (step(0.0, gy01) - 0.5);
200
+
201
+ vec4 gx10 = ixy10 / 7.0;
202
+ vec4 gy10 = floor(gx10) / 7.0;
203
+ vec4 gz10 = floor(gy10) / 6.0;
204
+ gx10 = fract(gx10) - 0.5;
205
+ gy10 = fract(gy10) - 0.5;
206
+ gz10 = fract(gz10) - 0.5;
207
+ vec4 gw10 = vec4(0.75) - abs(gx10) - abs(gy10) - abs(gz10);
208
+ vec4 sw10 = step(gw10, vec4(0.0));
209
+ gx10 -= sw10 * (step(0.0, gx10) - 0.5);
210
+ gy10 -= sw10 * (step(0.0, gy10) - 0.5);
211
+
212
+ vec4 gx11 = ixy11 / 7.0;
213
+ vec4 gy11 = floor(gx11) / 7.0;
214
+ vec4 gz11 = floor(gy11) / 6.0;
215
+ gx11 = fract(gx11) - 0.5;
216
+ gy11 = fract(gy11) - 0.5;
217
+ gz11 = fract(gz11) - 0.5;
218
+ vec4 gw11 = vec4(0.75) - abs(gx11) - abs(gy11) - abs(gz11);
219
+ vec4 sw11 = step(gw11, vec4(0.0));
220
+ gx11 -= sw11 * (step(0.0, gx11) - 0.5);
221
+ gy11 -= sw11 * (step(0.0, gy11) - 0.5);
222
+
223
+ vec4 g0000 = vec4(gx00.x, gy00.x, gz00.x, gw00.x);
224
+ vec4 g1000 = vec4(gx00.y, gy00.y, gz00.y, gw00.y);
225
+ vec4 g0100 = vec4(gx00.z, gy00.z, gz00.z, gw00.z);
226
+ vec4 g1100 = vec4(gx00.w, gy00.w, gz00.w, gw00.w);
227
+ vec4 g0010 = vec4(gx10.x, gy10.x, gz10.x, gw10.x);
228
+ vec4 g1010 = vec4(gx10.y, gy10.y, gz10.y, gw10.y);
229
+ vec4 g0110 = vec4(gx10.z, gy10.z, gz10.z, gw10.z);
230
+ vec4 g1110 = vec4(gx10.w, gy10.w, gz10.w, gw10.w);
231
+ vec4 g0001 = vec4(gx01.x, gy01.x, gz01.x, gw01.x);
232
+ vec4 g1001 = vec4(gx01.y, gy01.y, gz01.y, gw01.y);
233
+ vec4 g0101 = vec4(gx01.z, gy01.z, gz01.z, gw01.z);
234
+ vec4 g1101 = vec4(gx01.w, gy01.w, gz01.w, gw01.w);
235
+ vec4 g0011 = vec4(gx11.x, gy11.x, gz11.x, gw11.x);
236
+ vec4 g1011 = vec4(gx11.y, gy11.y, gz11.y, gw11.y);
237
+ vec4 g0111 = vec4(gx11.z, gy11.z, gz11.z, gw11.z);
238
+ vec4 g1111 = vec4(gx11.w, gy11.w, gz11.w, gw11.w);
239
+
240
+ vec4 norm00 = taylorInvSqrt(
241
+ vec4(dot(g0000, g0000), dot(g0100, g0100), dot(g1000, g1000), dot(g1100, g1100))
242
+ );
243
+ g0000 *= norm00.x;
244
+ g0100 *= norm00.y;
245
+ g1000 *= norm00.z;
246
+ g1100 *= norm00.w;
247
+
248
+ vec4 norm01 = taylorInvSqrt(
249
+ vec4(dot(g0001, g0001), dot(g0101, g0101), dot(g1001, g1001), dot(g1101, g1101))
250
+ );
251
+ g0001 *= norm01.x;
252
+ g0101 *= norm01.y;
253
+ g1001 *= norm01.z;
254
+ g1101 *= norm01.w;
255
+
256
+ vec4 norm10 = taylorInvSqrt(
257
+ vec4(dot(g0010, g0010), dot(g0110, g0110), dot(g1010, g1010), dot(g1110, g1110))
258
+ );
259
+ g0010 *= norm10.x;
260
+ g0110 *= norm10.y;
261
+ g1010 *= norm10.z;
262
+ g1110 *= norm10.w;
263
+
264
+ vec4 norm11 = taylorInvSqrt(
265
+ vec4(dot(g0011, g0011), dot(g0111, g0111), dot(g1011, g1011), dot(g1111, g1111))
266
+ );
267
+ g0011 *= norm11.x;
268
+ g0111 *= norm11.y;
269
+ g1011 *= norm11.z;
270
+ g1111 *= norm11.w;
271
+
272
+ float n0000 = dot(g0000, Pf0);
273
+ float n1000 = dot(g1000, vec4(Pf1.x, Pf0.y, Pf0.z, Pf0.w));
274
+ float n0100 = dot(g0100, vec4(Pf0.x, Pf1.y, Pf0.z, Pf0.w));
275
+ float n1100 = dot(g1100, vec4(Pf1.x, Pf1.y, Pf0.z, Pf0.w));
276
+ float n0010 = dot(g0010, vec4(Pf0.x, Pf0.y, Pf1.z, Pf0.w));
277
+ float n1010 = dot(g1010, vec4(Pf1.x, Pf0.y, Pf1.z, Pf0.w));
278
+ float n0110 = dot(g0110, vec4(Pf0.x, Pf1.y, Pf1.z, Pf0.w));
279
+ float n1110 = dot(g1110, vec4(Pf1.x, Pf1.y, Pf1.z, Pf0.w));
280
+ float n0001 = dot(g0001, vec4(Pf0.x, Pf0.y, Pf0.z, Pf1.w));
281
+ float n1001 = dot(g1001, vec4(Pf1.x, Pf0.y, Pf0.z, Pf1.w));
282
+ float n0101 = dot(g0101, vec4(Pf0.x, Pf1.y, Pf0.z, Pf1.w));
283
+ float n1101 = dot(g1101, vec4(Pf1.x, Pf1.y, Pf0.z, Pf1.w));
284
+ float n0011 = dot(g0011, vec4(Pf0.x, Pf0.y, Pf1.z, Pf1.w));
285
+ float n1011 = dot(g1011, vec4(Pf1.x, Pf0.y, Pf1.z, Pf1.w));
286
+ float n0111 = dot(g0111, vec4(Pf0.x, Pf1.y, Pf1.z, Pf1.w));
287
+ float n1111 = dot(g1111, Pf1);
288
+
289
+ vec4 fade_xyzw = fade(Pf0);
290
+ vec4 n_0w = mix(vec4(n0000, n1000, n0100, n1100), vec4(n0001, n1001, n0101, n1101), fade_xyzw.w);
291
+ vec4 n_1w = mix(vec4(n0010, n1010, n0110, n1110), vec4(n0011, n1011, n0111, n1111), fade_xyzw.w);
292
+ vec4 n_zw = mix(n_0w, n_1w, fade_xyzw.z);
293
+ vec2 n_yzw = mix(n_zw.xy, n_zw.zw, fade_xyzw.y);
294
+ float n_xyzw = mix(n_yzw.x, n_yzw.y, fade_xyzw.x);
295
+ return 2.2 * n_xyzw;
296
+ }
297
+ `,g=`// Based on the following work with slight modifications.
298
+ // https://github.com/sebh/TileableVolumeNoise
299
+
300
+ /**
301
+ * The MIT License (MIT)
302
+ *
303
+ * Copyright(c) 2017 Sébastien Hillaire
304
+ *
305
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
306
+ * of this software and associated documentation files (the "Software"), to deal
307
+ * in the Software without restriction, including without limitation the rights
308
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
309
+ * copies of the Software, and to permit persons to whom the Software is
310
+ * furnished to do so, subject to the following conditions:
311
+ *
312
+ * The above copyright notice and this permission notice shall be included in
313
+ * all copies or substantial portions of the Software.
314
+ *
315
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
316
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
317
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
318
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
319
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
320
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
321
+ * SOFTWARE.
322
+ */
323
+
324
+ float hash(const float n) {
325
+ return fract(sin(n + 1.951) * 43758.5453);
326
+ }
327
+
328
+ float noise(const vec3 x) {
329
+ vec3 p = floor(x);
330
+ vec3 f = fract(x);
331
+
332
+ f = f * f * (3.0 - 2.0 * f);
333
+ float n = p.x + p.y * 57.0 + 113.0 * p.z;
334
+ return mix(
335
+ mix(mix(hash(n + 0.0), hash(n + 1.0), f.x), mix(hash(n + 57.0), hash(n + 58.0), f.x), f.y),
336
+ mix(
337
+ mix(hash(n + 113.0), hash(n + 114.0), f.x),
338
+ mix(hash(n + 170.0), hash(n + 171.0), f.x),
339
+ f.y
340
+ ),
341
+ f.z
342
+ );
343
+ }
344
+
345
+ float getWorleyNoise(const vec3 p, const float cellCount) {
346
+ vec3 cell = p * cellCount;
347
+ float d = 1.0e10;
348
+ for (int x = -1; x <= 1; ++x) {
349
+ for (int y = -1; y <= 1; ++y) {
350
+ for (int z = -1; z <= 1; ++z) {
351
+ vec3 tp = floor(cell) + vec3(x, y, z);
352
+ tp = cell - tp - noise(mod(tp, cellCount / 1.0));
353
+ d = min(d, dot(tp, tp));
354
+ }
355
+ }
356
+ }
357
+ return clamp(d, 0.0, 1.0);
358
+ }
359
+
360
+ float getPerlinNoise(const vec3 point, const vec3 frequency, const int octaveCount) {
361
+ // Noise frequency factor between octave, forced to 2.
362
+ const float octaveFrequencyFactor = 2.0;
363
+
364
+ // Compute the sum for each octave.
365
+ float sum = 0.0;
366
+ float roughness = 0.5;
367
+ float weightSum = 0.0;
368
+ float weight = 1.0;
369
+ vec3 nextFrequency = frequency;
370
+ for (int i = 0; i < octaveCount; ++i) {
371
+ vec4 p = vec4(point.x, point.y, point.z, 0.0) * vec4(nextFrequency, 1.0);
372
+ float value = perlin(p, vec4(nextFrequency, 1.0));
373
+ sum += value * weight;
374
+ weightSum += weight;
375
+ weight *= roughness;
376
+ nextFrequency *= octaveFrequencyFactor;
377
+ }
378
+
379
+ return sum / weightSum; // Intentionally skip clamping.
380
+ }
381
+
382
+ float getPerlinNoise(const vec3 point, const float frequency, const int octaveCount) {
383
+ return getPerlinNoise(point, vec3(frequency), octaveCount);
384
+ }
385
+ `;class v extends f{constructor(){super({size:o.CLOUD_SHAPE_TEXTURE_SIZE,fragmentShader:c.resolveIncludes(u,{core:{math:s.math},perlin:l,tileableNoise:g})})}}const d=`// Based on the following work with slight modifications.
386
+ // https://github.com/sebh/TileableVolumeNoise
387
+
388
+ /**
389
+ * The MIT License (MIT)
390
+ *
391
+ * Copyright(c) 2017 Sébastien Hillaire
392
+ *
393
+ * Permission is hereby granted, free of charge, to any person obtaining a copy
394
+ * of this software and associated documentation files (the "Software"), to deal
395
+ * in the Software without restriction, including without limitation the rights
396
+ * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
397
+ * copies of the Software, and to permit persons to whom the Software is
398
+ * furnished to do so, subject to the following conditions:
399
+ *
400
+ * The above copyright notice and this permission notice shall be included in
401
+ * all copies or substantial portions of the Software.
402
+ *
403
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
404
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
405
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
406
+ * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
407
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
408
+ * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
409
+ * SOFTWARE.
410
+ */
411
+
412
+ precision highp float;
413
+ precision highp int;
414
+
415
+ #include "core/math"
416
+ #include "perlin"
417
+ #include "tileableNoise"
418
+
419
+ uniform float layer;
420
+
421
+ in vec2 vUv;
422
+
423
+ layout(location = 0) out float outputColor;
424
+
425
+ void main() {
426
+ vec3 point = vec3(vUv.x, vUv.y, layer);
427
+ float cellCount = 2.0;
428
+ vec4 noise = vec4(
429
+ 1.0 - getWorleyNoise(point, cellCount * 1.0),
430
+ 1.0 - getWorleyNoise(point, cellCount * 2.0),
431
+ 1.0 - getWorleyNoise(point, cellCount * 4.0),
432
+ 1.0 - getWorleyNoise(point, cellCount * 8.0)
433
+ );
434
+ vec3 fbm = vec3(
435
+ dot(noise.xyz, vec3(0.625, 0.25, 0.125)),
436
+ dot(noise.yzw, vec3(0.625, 0.25, 0.125)),
437
+ dot(noise.zw, vec2(0.75, 0.25))
438
+ );
439
+ outputColor = dot(fbm, vec3(0.625, 0.25, 0.125));
440
+ }
441
+ `;class y extends f{constructor(){super({size:o.CLOUD_SHAPE_DETAIL_TEXTURE_SIZE,fragmentShader:c.resolveIncludes(d,{core:{math:s.math},perlin:l,tileableNoise:g})})}}class p{constructor({size:t,fragmentShader:r}){this.needsRender=!0,this.camera=new n.Camera,this.size=t,this.material=new n.RawShaderMaterial({glslVersion:n.GLSL3,vertexShader:`
442
+ in vec3 position;
443
+ out vec2 vUv;
444
+ void main() {
445
+ vUv = position.xy * 0.5 + 0.5;
446
+ gl_Position = vec4(position.xy, 0.0, 1.0);
447
+ }
448
+ `,fragmentShader:r,uniforms:{layer:new n.Uniform(0)}}),this.mesh=new n.Mesh(new n.PlaneGeometry(2,2),this.material),this.renderTarget=new n.WebGLRenderTarget(t,t,{depthBuffer:!1,stencilBuffer:!1,format:n.RGBAFormat});const e=this.renderTarget.texture;e.generateMipmaps=!0,e.minFilter=n.LinearMipMapLinearFilter,e.magFilter=n.LinearFilter,e.wrapS=n.RepeatWrapping,e.wrapT=n.RepeatWrapping,e.colorSpace=n.NoColorSpace,e.needsUpdate=!0}dispose(){this.renderTarget.dispose(),this.material.dispose()}render(t,r){if(!this.needsRender)return;this.needsRender=!1;const e=t.getRenderTarget();t.setRenderTarget(this.renderTarget),t.render(this.mesh,this.camera),t.setRenderTarget(e)}get texture(){return this.renderTarget.texture}}const T=`precision highp float;
449
+ precision highp int;
450
+
451
+ #include "core/math"
452
+ #include "perlin"
453
+ #include "tileableNoise"
454
+
455
+ in vec2 vUv;
456
+
457
+ layout(location = 0) out vec4 outputColor;
458
+
459
+ float getWorleyFbm(
460
+ const vec3 point,
461
+ float frequency,
462
+ float amplitude,
463
+ const float lacunarity,
464
+ const float gain,
465
+ const int octaveCount
466
+ ) {
467
+ float noise = 0.0;
468
+ for (int i = 0; i < octaveCount; ++i) {
469
+ noise += amplitude * (1.0 - getWorleyNoise(point, frequency));
470
+ frequency *= lacunarity;
471
+ amplitude *= gain;
472
+ }
473
+ return noise;
474
+ }
475
+
476
+ void main() {
477
+ vec3 point = vec3(vUv.x, vUv.y, 0.0);
478
+
479
+ // Mid clouds
480
+ {
481
+ float worley = getWorleyFbm(
482
+ point + vec3(0.5),
483
+ 8.0, // frequency
484
+ 0.4, // amplitude
485
+ 2.0, // lacunarity
486
+ 0.95, // gain
487
+ 4 // octaveCount
488
+ );
489
+ worley = smoothstep(1.0, 1.4, worley);
490
+ outputColor.g = worley;
491
+ }
492
+
493
+ // Low clouds
494
+ {
495
+ float worley = getWorleyFbm(
496
+ point,
497
+ 16.0, // frequency
498
+ 0.4, // amplitude
499
+ 2.0, // lacunarity
500
+ 0.95, // gain
501
+ 4 // octaveCount
502
+ );
503
+ worley = smoothstep(0.8, 1.4, worley);
504
+ outputColor.r = saturate(worley - outputColor.g);
505
+ }
506
+
507
+ // High clouds
508
+ {
509
+ float perlin = getPerlinNoise(
510
+ point,
511
+ vec3(6.0, 12.0, 1.0), // frequency
512
+ 8 // octaveCount
513
+ );
514
+ perlin = smoothstep(-0.5, 0.5, perlin);
515
+ outputColor.b = perlin;
516
+ }
517
+
518
+ // Extra
519
+ {
520
+ float perlin = getPerlinNoise(
521
+ point + vec3(-19.1, 33.4, 47.2),
522
+ 32.0, // frequency
523
+ 4 // octaveCount
524
+ );
525
+ perlin = smoothstep(-0.5, 0.5, perlin);
526
+ outputColor.a = perlin;
527
+ }
528
+
529
+ outputColor.a = 1.0;
530
+ }
531
+ `;class h extends p{constructor(){super({size:512,fragmentShader:c.resolveIncludes(T,{core:{math:s.math},perlin:l,tileableNoise:g})})}}const E=`precision highp float;
532
+ precision highp int;
533
+
534
+ #include "core/math"
535
+ #include "perlin"
536
+ #include "tileableNoise"
537
+
538
+ in vec2 vUv;
539
+
540
+ layout(location = 0) out vec4 outputColor;
541
+
542
+ const vec3 frequency = vec3(12.0);
543
+ const int octaveCount = 3;
544
+
545
+ float perlin(const vec3 point) {
546
+ return getPerlinNoise(point, frequency, octaveCount);
547
+ }
548
+
549
+ vec3 perlin3d(const vec3 point) {
550
+ float perlin1 = perlin(point);
551
+ float perlin2 = perlin(point.yzx + vec3(-19.1, 33.4, 47.2));
552
+ float perlin3 = perlin(point.zxy + vec3(74.2, -124.5, 99.4));
553
+ return vec3(perlin1, perlin2, perlin3);
554
+ }
555
+
556
+ vec3 curl(vec3 point) {
557
+ const float delta = 0.1;
558
+ vec3 dx = vec3(delta, 0.0, 0.0);
559
+ vec3 dy = vec3(0.0, delta, 0.0);
560
+ vec3 dz = vec3(0.0, 0.0, delta);
561
+
562
+ vec3 px0 = perlin3d(point - dx);
563
+ vec3 px1 = perlin3d(point + dx);
564
+ vec3 py0 = perlin3d(point - dy);
565
+ vec3 py1 = perlin3d(point + dy);
566
+ vec3 pz0 = perlin3d(point - dz);
567
+ vec3 pz1 = perlin3d(point + dz);
568
+
569
+ float x = py1.z - py0.z - pz1.y + pz0.y;
570
+ float y = pz1.x - pz0.x - px1.z + px0.z;
571
+ float z = px1.y - px0.y - py1.x + py0.x;
572
+
573
+ const float divisor = 1.0 / (2.0 * delta);
574
+ return normalize(vec3(x, y, z) * divisor);
575
+ }
576
+
577
+ void main() {
578
+ vec3 point = vec3(vUv.x, vUv.y, 0.0);
579
+ outputColor.rgb = 0.5 * curl(point) + 0.5;
580
+ outputColor.a = 1.0;
581
+ }
582
+ `;class R extends p{constructor(){super({size:128,fragmentShader:c.resolveIncludes(E,{core:{math:s.math},perlin:l,tileableNoise:g})})}}exports.CLOUD_SHAPE_DETAIL_TEXTURE_SIZE=o.CLOUD_SHAPE_DETAIL_TEXTURE_SIZE;exports.CLOUD_SHAPE_TEXTURE_SIZE=o.CLOUD_SHAPE_TEXTURE_SIZE;exports.CloudLayer=o.CloudLayer;exports.CloudLayers=o.CloudLayers;exports.CloudsEffect=o.CloudsEffect;exports.DEFAULT_LOCAL_WEATHER_URL=o.DEFAULT_LOCAL_WEATHER_URL;exports.DEFAULT_SHAPE_DETAIL_URL=o.DEFAULT_SHAPE_DETAIL_URL;exports.DEFAULT_SHAPE_URL=o.DEFAULT_SHAPE_URL;exports.DEFAULT_TURBULENCE_URL=o.DEFAULT_TURBULENCE_URL;exports.DensityProfile=o.DensityProfile;exports.cloudsPassOptionsDefaults=o.cloudsPassOptionsDefaults;exports.CloudShape=v;exports.CloudShapeDetail=y;exports.LocalWeather=h;exports.Procedural3DTextureBase=f;exports.ProceduralTextureBase=p;exports.Turbulence=R;
583
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.cjs","sources":["../src/Procedural3DTexture.ts","../src/shaders/cloudShape.frag?raw","../src/shaders/perlin.glsl?raw","../src/shaders/tileableNoise.glsl?raw","../src/CloudShape.ts","../src/shaders/cloudShapeDetail.frag?raw","../src/CloudShapeDetail.ts","../src/ProceduralTexture.ts","../src/shaders/localWeather.frag?raw","../src/LocalWeather.ts","../src/shaders/turbulence.frag?raw","../src/Turbulence.ts"],"sourcesContent":null,"names":["Procedural3DTextureBase","size","fragmentShader","Camera","RawShaderMaterial","GLSL3","Uniform","Mesh","PlaneGeometry","WebGL3DRenderTarget","RedFormat","texture","LinearFilter","RepeatWrapping","NoColorSpace","renderer","deltaTime","renderTarget","layer","fragmentShader$3","perlin","tileableNoise","CloudShape","CLOUD_SHAPE_TEXTURE_SIZE","resolveIncludes","math","fragmentShader$2","CloudShapeDetail","CLOUD_SHAPE_DETAIL_TEXTURE_SIZE","ProceduralTextureBase","WebGLRenderTarget","RGBAFormat","LinearMipMapLinearFilter","fragmentShader$1","LocalWeather","Turbulence"],"mappings":"uNAyBO,MAAMA,CAAuD,CASlE,YAAY,CAAE,KAAAC,EAAM,eAAAC,GAAqD,CAP3D,KAAA,YAAA,GAKG,KAAA,OAAS,IAAIC,SAG5B,KAAK,KAAOF,EACP,KAAA,SAAW,IAAIG,oBAAkB,CACpC,YAAaC,EAAA,MACb,aAAyB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,QAQzB,eAAAH,EACA,SAAU,CACR,MAAO,IAAII,EAAAA,QAAQ,CAAC,CAAA,CACtB,CACD,EACI,KAAA,KAAO,IAAIC,EAAAA,KAAK,IAAIC,EAAAA,cAAc,EAAG,CAAC,EAAG,KAAK,QAAQ,EAE3D,KAAK,aAAe,IAAIC,EAAAA,oBAAoBR,EAAMA,EAAMA,EAAM,CAC5D,YAAa,GACb,cAAe,GACf,OAAQS,EAAAA,SAAA,CACT,EACK,MAAAC,EAAU,KAAK,aAAa,QAClCA,EAAQ,UAAYC,EAAA,aACpBD,EAAQ,UAAYC,EAAA,aACpBD,EAAQ,MAAQE,EAAA,eAChBF,EAAQ,MAAQE,EAAA,eAChBF,EAAQ,MAAQE,EAAA,eAChBF,EAAQ,WAAaG,EAAA,aACrBH,EAAQ,YAAc,EAAA,CAGxB,SAAgB,CACd,KAAK,aAAa,QAAQ,EAC1B,KAAK,SAAS,QAAQ,CAAA,CAGxB,OAAOI,EAAyBC,EAA0B,CACpD,GAAA,CAAC,KAAK,YACR,OAEF,KAAK,YAAc,GAIb,MAAAC,EAAeF,EAAS,gBAAgB,EAC9C,QAASG,EAAQ,EAAGA,EAAQ,KAAK,KAAM,EAAEA,EACvC,KAAK,SAAS,SAAS,MAAM,MAAQA,EAAQ,K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