@3driseai/3drise-viewer 0.1.9 → 0.1.11
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/dist/components/CloudsGenerator.d.ts.map +1 -1
- package/dist/components/CloudsGenerator.js +3 -1
- package/dist/components/EnvironmentManager.d.ts +30 -14
- package/dist/components/EnvironmentManager.d.ts.map +1 -1
- package/dist/components/EnvironmentManager.js +7 -2
- package/dist/components/effects/DataStreamEffect.d.ts.map +1 -1
- package/dist/components/effects/DataStreamEffect.js +14 -8
- package/dist/components/effects/NeuralNetworkEffect.d.ts.map +1 -1
- package/dist/components/effects/NeuralNetworkEffect.js +11 -9
- package/dist/components/volumetricClouds/Cirrus.d.ts +4 -0
- package/dist/components/volumetricClouds/Cirrus.d.ts.map +1 -1
- package/dist/components/volumetricClouds/Cirrus.js +4 -0
- package/dist/components/volumetricClouds/Cumulonimbus.js +2 -2
- package/dist/components/volumetricClouds/Cumulus.js +2 -2
- package/dist/components/volumetricClouds/Stratocumulus.js +2 -2
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts +4 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.d.ts.map +1 -1
- package/dist/components/volumetricClouds/VolumetricCloudsPass.js +45 -3
- package/dist/components/volumetricClouds/types.d.ts +3 -1
- package/dist/components/volumetricClouds/types.d.ts.map +1 -1
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +1 -0
- package/dist/hooks/useCloudLive.d.ts +1 -0
- package/dist/hooks/useCloudLive.d.ts.map +1 -1
- package/dist/hooks/useCloudLive.js +2 -1
- package/dist/hooks/useThunder.d.ts +37 -0
- package/dist/hooks/useThunder.d.ts.map +1 -0
- package/dist/hooks/useThunder.js +145 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/shaders/clouds/CloudShadowMaterial.d.ts +52 -0
- package/dist/shaders/clouds/CloudShadowMaterial.d.ts.map +1 -0
- package/dist/shaders/clouds/CloudShadowMaterial.js +110 -0
- package/dist/shaders/clouds/CloudVolumeMaterial.d.ts +10 -0
- package/dist/shaders/clouds/CloudVolumeMaterial.d.ts.map +1 -1
- package/dist/shaders/clouds/CloudVolumeMaterial.js +38 -2
- package/dist/shaders/glsl/cloudCore.glsl.d.ts +3 -3
- package/dist/shaders/glsl/cloudCore.glsl.d.ts.map +1 -1
- package/dist/shaders/glsl/cloudCore.glsl.js +81 -9
- package/dist/shaders/glsl/cloudShadow.glsl.d.ts +15 -0
- package/dist/shaders/glsl/cloudShadow.glsl.d.ts.map +1 -0
- package/dist/shaders/glsl/cloudShadow.glsl.js +35 -0
- package/dist/types/cloudConfigs.d.ts +53 -0
- package/dist/types/cloudConfigs.d.ts.map +1 -1
- package/dist/types/cloudConfigs.js +83 -51
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/utils/cloudShadowMap.d.ts +43 -0
- package/dist/utils/cloudShadowMap.d.ts.map +1 -0
- package/dist/utils/cloudShadowMap.js +60 -0
- package/dist/utils/cloudUniforms.d.ts +6 -1
- package/dist/utils/cloudUniforms.d.ts.map +1 -1
- package/dist/utils/cloudUniforms.js +18 -0
- package/dist/utils/gpuProfiler.d.ts +33 -0
- package/dist/utils/gpuProfiler.d.ts.map +1 -0
- package/dist/utils/gpuProfiler.js +115 -0
- package/package.json +2 -2
|
@@ -80,6 +80,12 @@ precision highp float;
|
|
|
80
80
|
precision highp sampler3D;
|
|
81
81
|
precision highp sampler2D;
|
|
82
82
|
|
|
83
|
+
/** Extinction. Declared with the density uniforms rather than the scattering ones
|
|
84
|
+
* because cloudField — the subset exported for surface materials that want cloud
|
|
85
|
+
* shadows — needs it to turn accumulated density into transmittance, and does not
|
|
86
|
+
* compile on its own without it. */
|
|
87
|
+
uniform float u_sigmaT;
|
|
88
|
+
|
|
83
89
|
uniform sampler3D u_base;
|
|
84
90
|
uniform sampler3D u_detail;
|
|
85
91
|
uniform sampler2D u_weather;
|
|
@@ -135,14 +141,28 @@ float heightGradient(float h, float ty){
|
|
|
135
141
|
}
|
|
136
142
|
|
|
137
143
|
/**
|
|
138
|
-
*
|
|
139
|
-
*
|
|
144
|
+
* The weather-derived terms, separated from the rest of the density evaluation.
|
|
145
|
+
*
|
|
146
|
+
* These are a function of horizontal position only, and the weather map's smallest
|
|
147
|
+
* feature is a ~7 km cell (weatherCellSize / 2.17). A sun ray inside the cloud travels
|
|
148
|
+
* a few hundred metres for a stratocumulus deck; over that distance these values do not
|
|
149
|
+
* meaningfully change. Sampling them once per shaded point and reusing them for the
|
|
150
|
+
* light march removes two texture fetches and a sin() from every one of its taps —
|
|
151
|
+
* which is most of the frame, since lighting is roughly 80% of the sample cost.
|
|
152
|
+
*
|
|
153
|
+
* This is the standard separation (Schneider does the same in Horizon): the light
|
|
154
|
+
* march's job is to find how much *shape* is between here and the sun, and the shape
|
|
155
|
+
* comes from the 3D noise, which is still evaluated per tap.
|
|
140
156
|
*/
|
|
141
|
-
|
|
142
|
-
|
|
157
|
+
struct CloudWeather {
|
|
158
|
+
float ty; // blended cloud type
|
|
159
|
+
float cov; // coverage BEFORE the height-dependent anvil term
|
|
160
|
+
};
|
|
143
161
|
|
|
162
|
+
CloudWeather cloudWeatherAt(vec3 p){
|
|
144
163
|
vec4 w = sampleWeather(p);
|
|
145
|
-
|
|
164
|
+
CloudWeather cw;
|
|
165
|
+
cw.ty = saturate(u_cloudType + (w.b - 0.5) * 0.30);
|
|
146
166
|
|
|
147
167
|
float cov = mix(w.r, w.g, 0.40);
|
|
148
168
|
// Slow formation and decay: the coverage threshold itself breathes.
|
|
@@ -151,7 +171,20 @@ float cloudDensity(vec3 p, float h, float detail){
|
|
|
151
171
|
// The window slides AND narrows with coverage. Remapping to a fixed upper bound of 1.0
|
|
152
172
|
// caps effective coverage near the weather map's median (~0.5), so overcast is
|
|
153
173
|
// unreachable no matter how high the slider goes.
|
|
154
|
-
cov = saturate(remap(cov, 1.0 - u_coverage, 1.0 - u_coverage * 0.35, 0.0, 1.0));
|
|
174
|
+
cw.cov = saturate(remap(cov, 1.0 - u_coverage, 1.0 - u_coverage * 0.35, 0.0, 1.0));
|
|
175
|
+
return cw;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* @param detail 0..1 — fades high-frequency erosion out with distance. Without it the
|
|
180
|
+
* finest worley octave beats against the step size and the far field speckles.
|
|
181
|
+
* @param cw weather at this column, from cloudWeatherAt().
|
|
182
|
+
*/
|
|
183
|
+
float cloudDensityW(vec3 p, float h, float detail, CloudWeather cw){
|
|
184
|
+
if (h <= 0.001 || h >= 0.999) return 0.0;
|
|
185
|
+
|
|
186
|
+
float ty = cw.ty;
|
|
187
|
+
float cov = cw.cov;
|
|
155
188
|
if (cov <= 0.0) return 0.0;
|
|
156
189
|
|
|
157
190
|
// Anvil: above the equilibrium level a storm spreads laterally. Gated on type so a
|
|
@@ -209,7 +242,19 @@ float cloudAlbedo(float h){
|
|
|
209
242
|
return mix(1.0, 0.22, u_precip * saturate(remap(h, 0.30, 0.02, 0.0, 1.0)));
|
|
210
243
|
}
|
|
211
244
|
|
|
245
|
+
/** Samples its own weather. Keeps the original signature for every existing caller,
|
|
246
|
+
* including the cloudField surface-shadow path. */
|
|
247
|
+
float cloudDensity(vec3 p, float h, float detail){
|
|
248
|
+
return cloudDensityW(p, h, detail, cloudWeatherAt(p));
|
|
249
|
+
}
|
|
250
|
+
|
|
212
251
|
float cloudDensityCheap(vec3 p, float h){ return cloudDensity(p, h, 0.0); }
|
|
252
|
+
|
|
253
|
+
/** Shape only, against weather already sampled at the shaded point. The light march
|
|
254
|
+
* and the empty-space skip both want this. */
|
|
255
|
+
float cloudDensityCheapW(vec3 p, float h, CloudWeather cw){
|
|
256
|
+
return cloudDensityW(p, h, 0.0, cw);
|
|
257
|
+
}
|
|
213
258
|
`;
|
|
214
259
|
/** Ray/layer and ray/sphere intersection. */
|
|
215
260
|
export const cloudGeometry = /* glsl */ `
|
|
@@ -278,7 +323,7 @@ bool sphereRange(vec3 ro, vec3 rd, vec3 c, float r, out float t0, out float t1){
|
|
|
278
323
|
}
|
|
279
324
|
`;
|
|
280
325
|
export const cloudLighting = /* glsl */ `
|
|
281
|
-
uniform float
|
|
326
|
+
uniform float u_g1, u_g2;
|
|
282
327
|
uniform float u_msExtinction, u_msEnergy, u_msPhase;
|
|
283
328
|
uniform float u_powder, u_silver, u_ambient;
|
|
284
329
|
uniform vec3 u_skyAmbient, u_groundAmbient;
|
|
@@ -306,7 +351,27 @@ const vec3 kCone[6] = vec3[6](
|
|
|
306
351
|
* The step is a FRACTION of cloud depth, not metres: the same absolute value is wrong
|
|
307
352
|
* for an 800 m deck and an 8 km tower.
|
|
308
353
|
*/
|
|
309
|
-
|
|
354
|
+
/**
|
|
355
|
+
* How far a light tap may travel, as a fraction of a weather cell, before it stops
|
|
356
|
+
* reusing the shaded point's weather and samples its own.
|
|
357
|
+
*
|
|
358
|
+
* The steps grow 1.62x, so the last two taps cover most of the distance and carry
|
|
359
|
+
* nearly all of the error — sharing weather across all six is fine for a 800 m
|
|
360
|
+
* stratocumulus deck and badly wrong for a 8.4 km cumulonimbus, where the cone reaches
|
|
361
|
+
* 5.5 km. Measured against the real baked weather map (p95 absolute coverage error):
|
|
362
|
+
*
|
|
363
|
+
* share all 6 strato 0.115 cumulus 0.173 Cb 0.408 <- too much on the big types
|
|
364
|
+
* 0.0012 (here) strato 0.074 cumulus 0.106 Cb 0.115
|
|
365
|
+
* 0.0008 strato 0.039 cumulus 0.057 Cb 0.053 <- if a storm looks wrong
|
|
366
|
+
*
|
|
367
|
+
* A distance rule rather than a fixed tap count because it self-tunes: thickness and
|
|
368
|
+
* weatherCellSize are both user-facing sliders, and their ratio is what decides how
|
|
369
|
+
* many taps are safe. It costs nothing in divergence either — the condition is built
|
|
370
|
+
* from uniforms alone, so every fragment in the draw takes the same branch.
|
|
371
|
+
*/
|
|
372
|
+
#define LIGHT_WEATHER_REUSE 0.0012
|
|
373
|
+
|
|
374
|
+
float lightMarch(vec3 p, float rayT, CloudWeather cw){
|
|
310
375
|
float thick = (u_host < 0.5) ? (2.0 * u_radius) : max(u_layerTop - u_layerBottom, 1.0);
|
|
311
376
|
float st = u_lightStep * thick;
|
|
312
377
|
float acc = 0.0;
|
|
@@ -314,10 +379,17 @@ float lightMarch(vec3 p, float rayT){
|
|
|
314
379
|
for (int i = 0; i < 6; i++){
|
|
315
380
|
if (i >= u_lightSteps) break;
|
|
316
381
|
vec3 sp = p + u_sunDir * (t + st * 0.5) + kCone[i] * (t * 0.38);
|
|
317
|
-
|
|
382
|
+
float sh = heightAt(sp, rayT);
|
|
383
|
+
// Near taps reuse the shaded point's weather; far ones sample their own. What every
|
|
384
|
+
// tap still fetches per-sample is the 3D shape, which is what forms the shadow.
|
|
385
|
+
acc += ((t * u_weatherScale < LIGHT_WEATHER_REUSE)
|
|
386
|
+
? cloudDensityCheapW(sp, sh, cw)
|
|
387
|
+
: cloudDensityCheap(sp, sh)) * st;
|
|
318
388
|
t += st;
|
|
319
389
|
st *= 1.62;
|
|
320
390
|
}
|
|
391
|
+
// The long probe always samples its own: at 2.6x the accumulated distance it can be
|
|
392
|
+
// 9 km out on a cumulonimbus, well outside the cell the shaded point sits in.
|
|
321
393
|
vec3 fp = p + u_sunDir * (t * 2.6);
|
|
322
394
|
acc += cloudDensityCheap(fp, heightAt(fp, rayT)) * st * 2.0;
|
|
323
395
|
return acc;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloud shadows for surface materials.
|
|
3
|
+
*
|
|
4
|
+
* One texture fetch. The expensive part — marching the density field toward the sun —
|
|
5
|
+
* happens once per frame into a low-res map, not per ground fragment. The earlier
|
|
6
|
+
* `cloudField` approach put a six-sample march in every surface shader, which is
|
|
7
|
+
* why nothing ever adopted it.
|
|
8
|
+
*
|
|
9
|
+
* Usage in a surface material:
|
|
10
|
+
* ${cloudShadowChunk} // in the fragment shader
|
|
11
|
+
* float cs = cloudShadow(worldPosition); // multiply into your shadow term
|
|
12
|
+
* and spread `cloudShadowUniforms` into the material's uniforms.
|
|
13
|
+
*/
|
|
14
|
+
export declare const cloudShadowChunk = "\nuniform sampler2D u_cloudShadowMap;\nuniform mat4 u_cloudShadowMatrix;\nuniform float u_cloudShadowStrength;\n\nfloat cloudShadow(vec3 worldPos){\n if (u_cloudShadowStrength <= 0.0) return 1.0;\n\n vec4 sp = u_cloudShadowMatrix * vec4(worldPos, 1.0);\n vec2 uv = (sp.xy / sp.w) * 0.5 + 0.5;\n\n // Outside the map is lit, not shadowed. Fading out over the last 8% of the extent\n // stops a hard rectangle appearing at the edge of the shadowed region, which is\n // the giveaway that this is a projected texture rather than a sky.\n vec2 d = min(uv, 1.0 - uv);\n float edge = smoothstep(0.0, 0.08, min(d.x, d.y));\n if (edge <= 0.0) return 1.0;\n\n float transmittance = texture2D(u_cloudShadowMap, uv).r;\n return mix(1.0, transmittance, u_cloudShadowStrength * edge);\n}\n";
|
|
15
|
+
//# sourceMappingURL=cloudShadow.glsl.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudShadow.glsl.d.ts","sourceRoot":"","sources":["../../../src/shaders/glsl/cloudShadow.glsl.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,gBAAgB,yxBAqB5B,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cloud shadows for surface materials.
|
|
3
|
+
*
|
|
4
|
+
* One texture fetch. The expensive part — marching the density field toward the sun —
|
|
5
|
+
* happens once per frame into a low-res map, not per ground fragment. The earlier
|
|
6
|
+
* `cloudField` approach put a six-sample march in every surface shader, which is
|
|
7
|
+
* why nothing ever adopted it.
|
|
8
|
+
*
|
|
9
|
+
* Usage in a surface material:
|
|
10
|
+
* ${cloudShadowChunk} // in the fragment shader
|
|
11
|
+
* float cs = cloudShadow(worldPosition); // multiply into your shadow term
|
|
12
|
+
* and spread `cloudShadowUniforms` into the material's uniforms.
|
|
13
|
+
*/
|
|
14
|
+
export const cloudShadowChunk = /* glsl */ `
|
|
15
|
+
uniform sampler2D u_cloudShadowMap;
|
|
16
|
+
uniform mat4 u_cloudShadowMatrix;
|
|
17
|
+
uniform float u_cloudShadowStrength;
|
|
18
|
+
|
|
19
|
+
float cloudShadow(vec3 worldPos){
|
|
20
|
+
if (u_cloudShadowStrength <= 0.0) return 1.0;
|
|
21
|
+
|
|
22
|
+
vec4 sp = u_cloudShadowMatrix * vec4(worldPos, 1.0);
|
|
23
|
+
vec2 uv = (sp.xy / sp.w) * 0.5 + 0.5;
|
|
24
|
+
|
|
25
|
+
// Outside the map is lit, not shadowed. Fading out over the last 8% of the extent
|
|
26
|
+
// stops a hard rectangle appearing at the edge of the shadowed region, which is
|
|
27
|
+
// the giveaway that this is a projected texture rather than a sky.
|
|
28
|
+
vec2 d = min(uv, 1.0 - uv);
|
|
29
|
+
float edge = smoothstep(0.0, 0.08, min(d.x, d.y));
|
|
30
|
+
if (edge <= 0.0) return 1.0;
|
|
31
|
+
|
|
32
|
+
float transmittance = texture2D(u_cloudShadowMap, uv).r;
|
|
33
|
+
return mix(1.0, transmittance, u_cloudShadowStrength * edge);
|
|
34
|
+
}
|
|
35
|
+
`;
|
|
@@ -133,6 +133,50 @@ export interface CirrusLayerConfig {
|
|
|
133
133
|
/** Name of the preset the numbers came from, or '' once any of them is edited. */
|
|
134
134
|
preset?: string;
|
|
135
135
|
}
|
|
136
|
+
/**
|
|
137
|
+
* Lightning.
|
|
138
|
+
*
|
|
139
|
+
* Modelled as light emitted *inside* the volume, not as a screen flash: a bolt is a
|
|
140
|
+
* point source buried in the deck, so the cloud around it lights from within and the
|
|
141
|
+
* glow falls off both with distance and with the cloud it has to push through. That
|
|
142
|
+
* is the whole difference between lightning and someone toggling the exposure.
|
|
143
|
+
*
|
|
144
|
+
* Cumulus and stratocumulus can carry it, but the defaults are tuned for a
|
|
145
|
+
* cumulonimbus and it ships disabled — a thunderstorm over a fair-weather cumulus
|
|
146
|
+
* field is wrong. Cirrus cannot: three samples through a thin ice slab is not a
|
|
147
|
+
* volume, and there is nothing for a flash to scatter through.
|
|
148
|
+
*/
|
|
149
|
+
export interface ThunderConfig {
|
|
150
|
+
enabled: boolean;
|
|
151
|
+
/** Mean flashes per minute. Actual spacing is exponential around this, because
|
|
152
|
+
* storms do not fire on a metronome. */
|
|
153
|
+
rate: number;
|
|
154
|
+
/** Peak radiance of the bolt. */
|
|
155
|
+
intensity: number;
|
|
156
|
+
/** Bolt colour. Real lightning is a blue-tinged white from ionised nitrogen. */
|
|
157
|
+
color: string;
|
|
158
|
+
/** Softening radius of the inverse-square falloff, in metres. Larger reads as a
|
|
159
|
+
* sheet lighting a whole cell; smaller as a single localised strike. */
|
|
160
|
+
radius: number;
|
|
161
|
+
/** Sub-strokes per event. A real flash flickers 2-5 times over ~200 ms, and that
|
|
162
|
+
* flicker is most of what separates lightning from a light bulb. */
|
|
163
|
+
strokes: number;
|
|
164
|
+
/** Length of one sub-stroke, seconds. */
|
|
165
|
+
strokeDuration: number;
|
|
166
|
+
/** Multiplies extinction between bolt and sample — how far the glow pushes through
|
|
167
|
+
* cloud. Low values light the whole cell, high values keep it local to the bolt. */
|
|
168
|
+
scatter: number;
|
|
169
|
+
/** How much the rest of the scene brightens, 0..1. Zero lights only the cloud,
|
|
170
|
+
* which looks broken: a real flash lights the ground too. */
|
|
171
|
+
sceneFlash: number;
|
|
172
|
+
/** Where in the deck the bolt sits, 0 at the base and 1 at the top. Real strikes
|
|
173
|
+
* originate low, in the charge separation region. */
|
|
174
|
+
originHeight: number;
|
|
175
|
+
/** How far away lightning can strike, in metres. Bolts are placed where a ray
|
|
176
|
+
* through a random on-screen point meets the deck, so this caps the distance
|
|
177
|
+
* rather than scattering blindly around the origin. */
|
|
178
|
+
spread: number;
|
|
179
|
+
}
|
|
136
180
|
/** Cost knobs. Shared by both layers, since they share the pipeline. */
|
|
137
181
|
export interface CloudsQualityConfig {
|
|
138
182
|
/** Fraction of full resolution the march runs at. 0.5 is the sweet spot. */
|
|
@@ -171,6 +215,7 @@ export declare const defaultCumulusConfig: CloudDeckConfig;
|
|
|
171
215
|
export declare const defaultStratocumulusConfig: CloudDeckConfig;
|
|
172
216
|
export declare const defaultCumulonimbusConfig: CloudDeckConfig;
|
|
173
217
|
export declare const defaultCirrusConfig: CirrusLayerConfig;
|
|
218
|
+
export declare const defaultThunderConfig: ThunderConfig;
|
|
174
219
|
export declare const defaultCloudsQuality: CloudsQualityConfig;
|
|
175
220
|
/** Per-type deck defaults, for the controller's type switcher. */
|
|
176
221
|
export declare const CLOUD_DECK_DEFAULTS: Record<CloudDeckType, CloudDeckConfig>;
|
|
@@ -184,6 +229,8 @@ export interface CloudPropertySchema {
|
|
|
184
229
|
key: string;
|
|
185
230
|
label: string;
|
|
186
231
|
group: CloudPropertyGroup;
|
|
232
|
+
/** Widget kind. Absent means a number, which almost everything is. */
|
|
233
|
+
valueType?: 'number' | 'color';
|
|
187
234
|
min?: number;
|
|
188
235
|
max?: number;
|
|
189
236
|
step?: number;
|
|
@@ -195,6 +242,7 @@ export interface CloudPropertySchema {
|
|
|
195
242
|
}
|
|
196
243
|
export declare const CLOUD_DECK_SCHEMA: CloudPropertySchema[];
|
|
197
244
|
export declare const CIRRUS_SCHEMA: CloudPropertySchema[];
|
|
245
|
+
export declare const THUNDER_SCHEMA: CloudPropertySchema[];
|
|
198
246
|
export declare const CLOUD_QUALITY_SCHEMA: CloudPropertySchema[];
|
|
199
247
|
import type { ObjectAnimations, MouseMoveInteractions } from '@3driseai/3drise-core';
|
|
200
248
|
/**
|
|
@@ -215,6 +263,7 @@ export interface VolumetricCloudsSettings {
|
|
|
215
263
|
config: CloudDeckConfig;
|
|
216
264
|
/** High ice layer. Independent — it sits above whatever the deck is doing. */
|
|
217
265
|
cirrus: CirrusLayerConfig;
|
|
266
|
+
thunder: ThunderConfig;
|
|
218
267
|
quality: CloudsQualityConfig;
|
|
219
268
|
/** Per-domain keyframe animations; the `clouds` domain drives deck properties. */
|
|
220
269
|
animations?: ObjectAnimations;
|
|
@@ -240,5 +289,9 @@ export declare function normalizeCloudDeck(raw: unknown): CloudDeckConfig | null
|
|
|
240
289
|
* it was never authored with. A block that exists but omits `enabled` is a
|
|
241
290
|
* deliberate one and takes the default. */
|
|
242
291
|
export declare function normalizeCirrus(raw: unknown): CirrusLayerConfig | null;
|
|
292
|
+
/** Thunder merged over defaults. Unlike cirrus this returns a config even when the
|
|
293
|
+
* block is absent, because the default is `enabled: false` — nothing appears, and a
|
|
294
|
+
* scene saved before thunder existed simply has it switched off. */
|
|
295
|
+
export declare function normalizeThunder(raw: unknown): ThunderConfig;
|
|
243
296
|
export declare function normalizeCloudQuality(raw: unknown): CloudsQualityConfig;
|
|
244
297
|
//# sourceMappingURL=cloudConfigs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cloudConfigs.d.ts","sourceRoot":"","sources":["../../src/types/cloudConfigs.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAEH,gFAAgF;AAChF,MAAM,MAAM,aAAa,GAAG,SAAS,GAAG,eAAe,GAAG,cAAc,CAAC;AAEzE,+DAA+D;AAC/D,MAAM,WAAW,sBAAsB;IACnC,OAAO,EAAE,OAAO,CAAC;IACjB;oFACgF;IAChF,QAAQ,EAAE,MAAM,CAAC;IACjB;uFACmF;IACnF,OAAO,EAAE,MAAM,CAAC;IAChB;;wEAEoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB,kCAAkC;IAClC,YAAY,EAAE,MAAM,CAAC;IACrB;mFAC+E;IAC/E,WAAW,EAAE,MAAM,CAAC;IACpB,6DAA6D;IAC7D,WAAW,EAAE,MAAM,CAAC;IACpB;sEACkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,6DAA6D;IAC7D,cAAc,EA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B,CAAC,CAAC,MAAM,CAAC,CAAC;AAuBnF;;+DAE+D;AAC/D,wBAAgB,kBAAkB,CAAC,GAAG,EAAE,OAAO,GAAG,eAAe,GAAG,IAAI,CAcvE;AAED;;;;4CAI4C;AAC5C,wBAAgB,eAAe,CAAC,GAAG,EAAE,OAAO,GAAG,iBAAiB,GAAG,IAAI,CAGtE;AAED;;qEAEqE;AACrE,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,OAAO,GAAG,aAAa,CAE5D;AAED,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,OAAO,GAAG,mBAAmB,CAEvE"}
|
|
@@ -123,6 +123,19 @@ export const defaultCirrusConfig = {
|
|
|
123
123
|
ambient: 1,
|
|
124
124
|
aerialPerspective: 0.000026,
|
|
125
125
|
};
|
|
126
|
+
export const defaultThunderConfig = {
|
|
127
|
+
enabled: false,
|
|
128
|
+
rate: 8,
|
|
129
|
+
intensity: 9,
|
|
130
|
+
color: '#cfe0ff',
|
|
131
|
+
radius: 900,
|
|
132
|
+
strokes: 3,
|
|
133
|
+
strokeDuration: 0.055,
|
|
134
|
+
scatter: 0.35,
|
|
135
|
+
sceneFlash: 0.55,
|
|
136
|
+
originHeight: 0.35,
|
|
137
|
+
spread: 40000,
|
|
138
|
+
};
|
|
126
139
|
export const defaultCloudsQuality = {
|
|
127
140
|
resolutionScale: 0.5,
|
|
128
141
|
temporalBlend: 0.9,
|
|
@@ -143,67 +156,80 @@ export const CLOUD_DECK_DEFAULTS = {
|
|
|
143
156
|
cumulonimbus: defaultCumulonimbusConfig,
|
|
144
157
|
};
|
|
145
158
|
export const CLOUD_DECK_SCHEMA = [
|
|
146
|
-
{ key: 'coverage', label: 'Coverage', group: 'shape', min: 0, max: 1, step: 0.005, description: '
|
|
147
|
-
{ key: 'profile', label: 'Vertical profile', group: 'shape', min: 0, max: 1, step: 0.005, description: '
|
|
148
|
-
{ key: 'density', label: 'Density', group: 'shape', min: 0, max: 9, step: 0.02, description: '
|
|
149
|
-
{ key: 'baseAltitude', label: 'Base altitude', group: 'shape', min: 200, max: 6000, step: 10, unit: 'm', description: '
|
|
150
|
-
{ key: 'topAltitude', label: 'Top altitude', group: 'shape', min: 600, max: 14000, step: 10, unit: 'm', description: '
|
|
151
|
-
{ key: 'featureSize', label: 'Feature size', group: 'shape', min: 600, max: 9000, step: 10, unit: 'm', description: '
|
|
152
|
-
{ key: 'detailSize', label: 'Detail size', group: 'shape', min: 150, max: 2000, step: 10, unit: 'm', description: '
|
|
153
|
-
{ key: 'detailStrength', label: 'Detail erosion', group: 'shape', min: 0, max: 1, step: 0.005, description: 'How
|
|
154
|
-
{ key: 'curlStrength', label: 'Curl warp', group: 'shape', min: 0, max: 2, step: 0.01, description: '
|
|
155
|
-
{ key: 'weatherCellSize', label: 'Weather cell size', group: 'shape', min: 4000, max: 90000, step: 250, unit: 'm', description: '
|
|
156
|
-
{ key: 'shear', label: 'Wind shear', group: 'shape', min: 0, max: 1.2, step: 0.005, description: '
|
|
157
|
-
{ key: 'anvil', label: 'Anvil spread', group: 'shape', min: 0, max: 1, step: 0.01, types: ['cumulonimbus'], description: '
|
|
158
|
-
{ key: 'precipitation', label: 'Precipitation', group: 'shape', min: 0, max: 1, step: 0.01, types: ['cumulonimbus'], description: '
|
|
159
|
-
{ key: 'windBearing', label: 'Wind bearing', group: 'animation', min: 0, max: 360, step: 1, unit: 'deg', description: '
|
|
160
|
-
{ key: 'windSpeed', label: 'Wind speed', group: 'animation', min: 0, max: 40, step: 0.1, unit: 'm/s', description: '
|
|
161
|
-
{ key: 'rise', label: 'Convective rise', group: 'animation', min: 0, max: 12, step: 0.05, unit: 'm/s', description: '
|
|
162
|
-
{ key: 'churn', label: 'Detail churn', group: 'animation', min: 0, max: 24, step: 0.1, unit: 'm/s', description: '
|
|
163
|
-
{ key: 'evolution', label: 'Formation / decay', group: 'animation', min: 0, max: 1, step: 0.01, description: '
|
|
164
|
-
{ key: 'extinction', label: 'Extinction', group: 'scattering', min: 0.002, max: 0.06, step: 0.0005, unit: '1/m', description: '
|
|
165
|
-
{ key: 'forwardLobe', label: 'Forward lobe', group: 'scattering', min: 0, max: 0.97, step: 0.005, description: '
|
|
166
|
-
{ key: 'backLobe', label: 'Back lobe', group: 'scattering', min: 0, max: 0.9, step: 0.005, description: '
|
|
167
|
-
{ key: 'msExtinction', label: 'MS extinction decay', group: 'scattering', min: 0.1, max: 0.95, step: 0.005, advanced: true, description: '
|
|
168
|
-
{ key: 'msEnergy', label: 'MS energy decay', group: 'scattering', min: 0.1, max: 0.95, step: 0.005, advanced: true, description: '
|
|
169
|
-
{ key: 'msPhase', label: 'MS phase decay', group: 'scattering', min: 0.1, max: 0.95, step: 0.005, advanced: true, description: '
|
|
170
|
-
{ key: 'powder', label: 'Powder', group: 'scattering', min: 0, max: 1.5, step: 0.01, description: '
|
|
171
|
-
{ key: 'silverLining', label: 'Silver lining', group: 'scattering', min: 0, max: 4, step: 0.01, description: '
|
|
172
|
-
{ key: 'ambient', label: 'Ambient', group: 'scattering', min: 0, max: 3, step: 0.01, description: '
|
|
173
|
-
{ key: 'aerialPerspective', label: 'Aerial perspective', group: 'lighting', min: 0, max: 0.00012, step: 0.000001, unit: '1/m', description: '
|
|
159
|
+
{ key: 'coverage', label: 'Coverage', group: 'shape', min: 0, max: 1, step: 0.005, description: 'How much of the sky is filled with cloud. Low leaves scattered puffs, high closes it into solid overcast.' },
|
|
160
|
+
{ key: 'profile', label: 'Vertical profile', group: 'shape', min: 0, max: 1, step: 0.005, description: 'The overall shape, from flat sheets through classic puffy clouds to towering storm clouds.' },
|
|
161
|
+
{ key: 'density', label: 'Density', group: 'shape', min: 0, max: 9, step: 0.02, description: 'How thick and solid the cloud looks. Too high and it turns into a grey mass.' },
|
|
162
|
+
{ key: 'baseAltitude', label: 'Base altitude', group: 'shape', min: 200, max: 6000, step: 10, unit: 'm', description: 'How high the bottom of the clouds sits.' },
|
|
163
|
+
{ key: 'topAltitude', label: 'Top altitude', group: 'shape', min: 600, max: 14000, step: 10, unit: 'm', description: 'How high the tops reach. The gap between this and the base is how tall the clouds are.' },
|
|
164
|
+
{ key: 'featureSize', label: 'Feature size', group: 'shape', min: 600, max: 9000, step: 10, unit: 'm', description: 'How big individual clouds are. Small makes a busy sky of many clouds, large makes a few huge ones.' },
|
|
165
|
+
{ key: 'detailSize', label: 'Detail size', group: 'shape', min: 150, max: 2000, step: 10, unit: 'm', description: 'The size of the fine bumps and wisps on the cloud surface.' },
|
|
166
|
+
{ key: 'detailStrength', label: 'Detail erosion', group: 'shape', min: 0, max: 1, step: 0.005, description: 'How much the edges are eaten away into wisps. Low gives smooth blobs, high gives ragged, torn edges.' },
|
|
167
|
+
{ key: 'curlStrength', label: 'Curl warp', group: 'shape', min: 0, max: 2, step: 0.01, description: 'Adds a swirling twist to the wisps, like cloud caught in a breeze.' },
|
|
168
|
+
{ key: 'weatherCellSize', label: 'Weather cell size', group: 'shape', min: 4000, max: 90000, step: 250, unit: 'm', description: 'How large an area shares the same weather. Big values give one huge system, small gives patchy skies.' },
|
|
169
|
+
{ key: 'shear', label: 'Wind shear', group: 'shape', min: 0, max: 1.2, step: 0.005, description: 'Leans the clouds over as they rise, like wind pushing the tops sideways.' },
|
|
170
|
+
{ key: 'anvil', label: 'Anvil spread', group: 'shape', min: 0, max: 1, step: 0.01, types: ['cumulonimbus'], description: 'Spreads the top of a storm cloud out flat, the classic anvil shape. Storm clouds only.' },
|
|
171
|
+
{ key: 'precipitation', label: 'Precipitation', group: 'shape', min: 0, max: 1, step: 0.01, types: ['cumulonimbus'], description: 'Darkens the underside to a heavy rain-bearing grey. Storm clouds only.' },
|
|
172
|
+
{ key: 'windBearing', label: 'Wind bearing', group: 'animation', min: 0, max: 360, step: 1, unit: 'deg', description: 'The compass direction the clouds drift towards.' },
|
|
173
|
+
{ key: 'windSpeed', label: 'Wind speed', group: 'animation', min: 0, max: 40, step: 0.1, unit: 'm/s', description: 'How fast the clouds drift across the sky.' },
|
|
174
|
+
{ key: 'rise', label: 'Convective rise', group: 'animation', min: 0, max: 12, step: 0.05, unit: 'm/s', description: 'How fast the clouds boil upwards, as warm air lifts through them.' },
|
|
175
|
+
{ key: 'churn', label: 'Detail churn', group: 'animation', min: 0, max: 24, step: 0.1, unit: 'm/s', description: 'How quickly the fine surface detail shifts and bubbles.' },
|
|
176
|
+
{ key: 'evolution', label: 'Formation / decay', group: 'animation', min: 0, max: 1, step: 0.01, description: 'How fast clouds form and fade away over time. Zero freezes the sky.' },
|
|
177
|
+
{ key: 'extinction', label: 'Extinction', group: 'scattering', min: 0.002, max: 0.06, step: 0.0005, unit: '1/m', description: 'How much light the cloud blocks. Higher makes it more opaque and its shadows deeper.' },
|
|
178
|
+
{ key: 'forwardLobe', label: 'Forward lobe', group: 'scattering', min: 0, max: 0.97, step: 0.005, description: 'The bright halo when you look towards the sun through cloud.' },
|
|
179
|
+
{ key: 'backLobe', label: 'Back lobe', group: 'scattering', min: 0, max: 0.9, step: 0.005, description: 'A soft glow when the sun is behind you.' },
|
|
180
|
+
{ key: 'msExtinction', label: 'MS extinction decay', group: 'scattering', min: 0.1, max: 0.95, step: 0.005, advanced: true, description: 'Fine tuning for how deep light reaches into the cloud. Lower brightens the interior.' },
|
|
181
|
+
{ key: 'msEnergy', label: 'MS energy decay', group: 'scattering', min: 0.1, max: 0.95, step: 0.005, advanced: true, description: 'Fine tuning for how much bounced light survives. Higher lifts the shadowed side.' },
|
|
182
|
+
{ key: 'msPhase', label: 'MS phase decay', group: 'scattering', min: 0.1, max: 0.95, step: 0.005, advanced: true, description: 'Fine tuning for how the glow spreads as light bounces around inside.' },
|
|
183
|
+
{ key: 'powder', label: 'Powder', group: 'scattering', min: 0, max: 1.5, step: 0.01, description: 'Darkens the edges facing away from the sun, which gives clouds their sense of bulk.' },
|
|
184
|
+
{ key: 'silverLining', label: 'Silver lining', group: 'scattering', min: 0, max: 4, step: 0.01, description: 'The bright rim on a cloud with the sun directly behind it.' },
|
|
185
|
+
{ key: 'ambient', label: 'Ambient', group: 'scattering', min: 0, max: 3, step: 0.01, description: 'How much light the cloud picks up from the sky and ground around it. Lifts the shadows.' },
|
|
186
|
+
{ key: 'aerialPerspective', label: 'Aerial perspective', group: 'lighting', min: 0, max: 0.00012, step: 0.000001, unit: '1/m', description: 'How quickly distant clouds fade into the haze.' },
|
|
174
187
|
];
|
|
175
188
|
export const CIRRUS_SCHEMA = [
|
|
176
|
-
{ key: 'altitude', label: 'Altitude', group: 'shape', min: 4000, max: 14000, step: 50, unit: 'm', description: '
|
|
177
|
-
{ key: 'thickness', label: 'Thickness', group: 'shape', min: 100, max: 2500, step: 25, unit: 'm', description: '
|
|
178
|
-
{ key: 'coverage', label: 'Coverage', group: 'shape', min: 0, max: 1, step: 0.005, description: '
|
|
179
|
-
{ key: 'opticalDepth', label: 'Optical depth', group: 'shape', min: 0, max: 2, step: 0.01, description: '
|
|
180
|
-
{ key: 'featureSize', label: 'Feature size', group: 'shape', min: 8000, max: 120000, step: 500, unit: 'm', description: '
|
|
181
|
-
{ key: 'anisotropy', label: 'Anisotropy', group: 'shape', min: 0.03, max: 1, step: 0.005, description: '
|
|
182
|
-
{ key: 'windBearing', label: 'Wind bearing', group: 'animation', min: 0, max: 360, step: 1, unit: 'deg', description: '
|
|
183
|
-
{ key: 'windSpeed', label: 'Drift speed', group: 'animation', min: 0, max: 60, step: 0.5, unit: 'm/s', description: '
|
|
184
|
-
{ key: 'halo', label: '22 degree halo', group: 'lighting', min: 0, max: 2, step: 0.01, description: '
|
|
185
|
-
{ key: 'forwardLobe', label: 'Forward lobe', group: 'scattering', min: 0, max: 0.97, step: 0.005, description: '
|
|
186
|
-
{ key: 'secondaryLobe', label: 'Secondary lobe', group: 'scattering', min: 0, max: 0.9, step: 0.005, description: '
|
|
187
|
-
{ key: 'ambient', label: 'Ambient', group: 'scattering', min: 0, max: 3, step: 0.01, description: '
|
|
188
|
-
{ key: 'aerialPerspective', label: 'Aerial perspective', group: 'lighting', min: 0, max: 0.00012, step: 0.000001, unit: '1/m', description: '
|
|
189
|
+
{ key: 'altitude', label: 'Altitude', group: 'shape', min: 4000, max: 14000, step: 50, unit: 'm', description: 'How high the ice sheet floats. Real cirrus sits far above ordinary cloud.' },
|
|
190
|
+
{ key: 'thickness', label: 'Thickness', group: 'shape', min: 100, max: 2500, step: 25, unit: 'm', description: 'How deep the ice layer is.' },
|
|
191
|
+
{ key: 'coverage', label: 'Coverage', group: 'shape', min: 0, max: 1, step: 0.005, description: 'How much of the sky is filled with cloud. Low leaves scattered puffs, high closes it into solid overcast.' },
|
|
192
|
+
{ key: 'opticalDepth', label: 'Optical depth', group: 'shape', min: 0, max: 2, step: 0.01, description: 'How solid the ice looks. Keep it low — you should be able to see the sun through cirrus.' },
|
|
193
|
+
{ key: 'featureSize', label: 'Feature size', group: 'shape', min: 8000, max: 120000, step: 500, unit: 'm', description: 'How big individual clouds are. Small makes a busy sky of many clouds, large makes a few huge ones.' },
|
|
194
|
+
{ key: 'anisotropy', label: 'Anisotropy', group: 'shape', min: 0.03, max: 1, step: 0.005, description: 'How stretched the streaks are. Low gives long drawn-out fibres, high gives rounder patches.' },
|
|
195
|
+
{ key: 'windBearing', label: 'Wind bearing', group: 'animation', min: 0, max: 360, step: 1, unit: 'deg', description: 'The compass direction the clouds drift towards.' },
|
|
196
|
+
{ key: 'windSpeed', label: 'Drift speed', group: 'animation', min: 0, max: 60, step: 0.5, unit: 'm/s', description: 'How fast the clouds drift across the sky.' },
|
|
197
|
+
{ key: 'halo', label: '22 degree halo', group: 'lighting', min: 0, max: 2, step: 0.01, description: 'The ring of light that appears around the sun when it shines through ice crystals.' },
|
|
198
|
+
{ key: 'forwardLobe', label: 'Forward lobe', group: 'scattering', min: 0, max: 0.97, step: 0.005, description: 'The bright halo when you look towards the sun through cloud.' },
|
|
199
|
+
{ key: 'secondaryLobe', label: 'Secondary lobe', group: 'scattering', min: 0, max: 0.9, step: 0.005, description: 'Widens the glow around the sun rather than adding brightness behind you.' },
|
|
200
|
+
{ key: 'ambient', label: 'Ambient', group: 'scattering', min: 0, max: 3, step: 0.01, description: 'How much light the cloud picks up from the sky and ground around it. Lifts the shadows.' },
|
|
201
|
+
{ key: 'aerialPerspective', label: 'Aerial perspective', group: 'lighting', min: 0, max: 0.00012, step: 0.000001, unit: '1/m', description: 'How quickly distant clouds fade into the haze.' },
|
|
202
|
+
];
|
|
203
|
+
export const THUNDER_SCHEMA = [
|
|
204
|
+
{ key: 'rate', label: 'Flash rate', group: 'animation', min: 0.5, max: 60, step: 0.5, unit: '/min', description: 'How often lightning strikes, in flashes per minute.' },
|
|
205
|
+
{ key: 'intensity', label: 'Intensity', group: 'lighting', min: 0, max: 40, step: 0.1, description: 'How bright each flash is.' },
|
|
206
|
+
{ key: 'color', label: 'Bolt colour', group: 'lighting', valueType: 'color', description: 'The colour of the lightning. Real bolts are a cold blue-white.' },
|
|
207
|
+
{ key: 'radius', label: 'Glow radius', group: 'lighting', min: 100, max: 6000, step: 25, unit: 'm', description: 'How wide the glow spreads from the bolt. Large lights up a whole cloud, small keeps it to one spot.' },
|
|
208
|
+
{ key: 'scatter', label: 'Scatter depth', group: 'scattering', min: 0, max: 2, step: 0.01, description: 'How deep the light pushes through the cloud. Low lights the whole cloud, high keeps a tight bright core.' },
|
|
209
|
+
{ key: 'strokes', label: 'Strokes', group: 'animation', min: 1, max: 6, step: 1, description: 'How many times each bolt flickers. Real lightning stutters two to five times rather than flashing once.' },
|
|
210
|
+
{ key: 'strokeDuration', label: 'Stroke length', group: 'animation', min: 0.01, max: 0.3, step: 0.005, unit: 's', description: 'How long each flicker lasts. Longer stops feeling electric.' },
|
|
211
|
+
{ key: 'sceneFlash', label: 'Scene flash', group: 'lighting', min: 0, max: 1, step: 0.01, description: 'How much the rest of the scene lights up. At zero only the cloud flashes, which looks wrong.' },
|
|
212
|
+
{ key: 'originHeight', label: 'Origin height', group: 'shape', min: 0, max: 1, step: 0.01, description: 'How high up in the cloud the bolt sits. Low is where real lightning starts.' },
|
|
213
|
+
{ key: 'spread', label: 'Spread', group: 'shape', min: 500, max: 40000, step: 100, unit: 'm', description: 'How far away lightning can strike. Bolts always appear somewhere you can see.' },
|
|
189
214
|
];
|
|
190
215
|
export const CLOUD_QUALITY_SCHEMA = [
|
|
191
|
-
{ key: 'resolutionScale', label: 'Render scale', group: 'quality', min: 0.25, max: 1, step: 0.05, description: '
|
|
192
|
-
{ key: 'temporalBlend', label: 'Temporal blend', group: 'quality', min: 0, max: 0.97, step: 0.005, description: '
|
|
193
|
-
{ key: 'steps', label: 'Step budget', group: 'quality', min: 24, max: 176, step: 1, description: '
|
|
194
|
-
{ key: 'lightSteps', label: 'Light steps', group: 'quality', min: 2, max: 6, step: 1, advanced: true, description: '
|
|
195
|
-
{ key: 'lightStep', label: 'Light step', group: 'quality', min: 0.004, max: 0.09, step: 0.001, advanced: true, description: '
|
|
196
|
-
{ key: 'stepGrowth', label: 'Distance step scale', group: 'quality', min: 0.0005, max: 0.03, step: 0.0005, advanced: true, description: '
|
|
197
|
-
{ key: 'maxSpan', label: 'Max march span', group: 'quality', min: 4000, max: 250000, step: 1000, unit: 'm', description: '
|
|
198
|
-
{ key: 'detailFadeDistance', label: 'Detail fade distance', group: 'quality', min: 2000, max: 80000, step: 500, unit: 'm', description: '
|
|
199
|
-
{ key: 'curvature', label: 'Planetary curvature', group: 'quality', min: 0, max: 0.0000005, step: 0.00000001, advanced: true, description: '
|
|
200
|
-
{ key: 'exposure', label: 'Exposure', group: 'quality', min: 0.2, max: 4, step: 0.01, description: '
|
|
216
|
+
{ key: 'resolutionScale', label: 'Render scale', group: 'quality', min: 0.25, max: 1, step: 0.05, description: 'How sharply the clouds are drawn. Lower is faster but softer. 0.5 is the sweet spot.' },
|
|
217
|
+
{ key: 'temporalBlend', label: 'Temporal blend', group: 'quality', min: 0, max: 0.97, step: 0.005, description: 'Smooths the clouds by blending with the previous frame. Higher is cleaner but can smear when you move.' },
|
|
218
|
+
{ key: 'steps', label: 'Step budget', group: 'quality', min: 24, max: 176, step: 1, description: 'How carefully the clouds are traced. Higher looks better and costs more.' },
|
|
219
|
+
{ key: 'lightSteps', label: 'Light steps', group: 'quality', min: 2, max: 6, step: 1, advanced: true, description: 'How carefully shadows inside the cloud are worked out. Lower flattens them.' },
|
|
220
|
+
{ key: 'lightStep', label: 'Light step', group: 'quality', min: 0.004, max: 0.09, step: 0.001, advanced: true, description: 'How far apart those shadow checks are spread through the cloud.' },
|
|
221
|
+
{ key: 'stepGrowth', label: 'Distance step scale', group: 'quality', min: 0.0005, max: 0.03, step: 0.0005, advanced: true, description: 'Lets distant clouds be traced more coarsely, since they cover fewer pixels anyway.' },
|
|
222
|
+
{ key: 'maxSpan', label: 'Max march span', group: 'quality', min: 4000, max: 250000, step: 1000, unit: 'm', description: 'How far into the distance clouds are still drawn.' },
|
|
223
|
+
{ key: 'detailFadeDistance', label: 'Detail fade distance', group: 'quality', min: 2000, max: 80000, step: 500, unit: 'm', description: 'How far away clouds keep their fine detail before smoothing out.' },
|
|
224
|
+
{ key: 'curvature', label: 'Planetary curvature', group: 'quality', min: 0, max: 0.0000005, step: 0.00000001, advanced: true, description: 'Bends the cloud layer with the curve of the earth so it meets a real horizon.' },
|
|
225
|
+
{ key: 'exposure', label: 'Exposure', group: 'quality', min: 0.2, max: 4, step: 0.01, description: 'Overall brightness of the clouds.' },
|
|
201
226
|
];
|
|
202
227
|
export const defaultVolumetricCloudsSettings = {
|
|
203
228
|
id: '3drise-clouds',
|
|
204
229
|
type: 'clouds',
|
|
205
230
|
config: { ...defaultCumulusConfig, enabled: false },
|
|
206
231
|
cirrus: { ...defaultCirrusConfig, enabled: false },
|
|
232
|
+
thunder: { ...defaultThunderConfig },
|
|
207
233
|
quality: { ...defaultCloudsQuality },
|
|
208
234
|
};
|
|
209
235
|
/**
|
|
@@ -277,6 +303,12 @@ export function normalizeCirrus(raw) {
|
|
|
277
303
|
return null;
|
|
278
304
|
return { ...defaultCirrusConfig, ...raw };
|
|
279
305
|
}
|
|
306
|
+
/** Thunder merged over defaults. Unlike cirrus this returns a config even when the
|
|
307
|
+
* block is absent, because the default is `enabled: false` — nothing appears, and a
|
|
308
|
+
* scene saved before thunder existed simply has it switched off. */
|
|
309
|
+
export function normalizeThunder(raw) {
|
|
310
|
+
return { ...defaultThunderConfig, ...(isRecord(raw) ? raw : {}) };
|
|
311
|
+
}
|
|
280
312
|
export function normalizeCloudQuality(raw) {
|
|
281
313
|
return { ...defaultCloudsQuality, ...(isRecord(raw) ? raw : {}) };
|
|
282
314
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
export type { ObjectReadyProps, ObjectReadySource, OnObjectDispose, OnObjectReady, } from './objectReady';
|
|
2
2
|
export type { AnyGridConfig, CircuitGridConfig, ContourGridConfig, FractalGridConfig, GridCellMode, GridLineMode, GridSurfaceConfig, HexGridConfig, MoireGridConfig, QuasiGridConfig, RadarGridConfig, VoronoiGridConfig, } from './gridConfigs';
|
|
3
|
-
export type { CirrusLayerConfig, CloudAnimatableProperty, CloudDeckConfig, CloudDeckSurfaceConfig, CloudDeckType, CloudPropertyGroup, CloudPropertySchema, CloudsQualityConfig, VolumetricCloudsSettings, } from './cloudConfigs';
|
|
3
|
+
export type { CirrusLayerConfig, CloudAnimatableProperty, CloudDeckConfig, CloudDeckSurfaceConfig, CloudDeckType, CloudPropertyGroup, CloudPropertySchema, CloudsQualityConfig, ThunderConfig, VolumetricCloudsSettings, } from './cloudConfigs';
|
|
4
4
|
export type { ProceduralTerrainSettings, TerrainConfig, TerrainPropertyGroup, TerrainPropertySchema, TerrainQualityConfig, TerrainSurfaceConfig, TerrainType, } from './terrainConfigs';
|
|
5
5
|
export { TERRAIN_DEFAULTS, TERRAIN_QUALITY_SCHEMA, TERRAIN_SCHEMA, defaultCanyonConfig, defaultDunesConfig, defaultHillsConfig, defaultMountainsConfig, defaultProceduralTerrainSettings, defaultTerrainQuality, normalizeTerrain, normalizeTerrainQuality, normalizeTerrainSettings, } from './terrainConfigs';
|
|
6
|
-
export { CIRRUS_SCHEMA, CLOUD_ANIMATABLE_PROPERTIES, CLOUD_DECK_DEFAULTS, CLOUD_DECK_SCHEMA, CLOUD_QUALITY_SCHEMA, defaultCirrusConfig, defaultCloudsQuality, defaultCumulonimbusConfig, defaultCumulusConfig, defaultStratocumulusConfig, defaultVolumetricCloudsSettings, normalizeCirrus, normalizeCloudDeck, normalizeCloudQuality, } from './cloudConfigs';
|
|
6
|
+
export { CIRRUS_SCHEMA, CLOUD_ANIMATABLE_PROPERTIES, CLOUD_DECK_DEFAULTS, CLOUD_DECK_SCHEMA, CLOUD_QUALITY_SCHEMA, defaultCirrusConfig, defaultCloudsQuality, defaultCumulonimbusConfig, defaultCumulusConfig, defaultStratocumulusConfig, defaultThunderConfig, defaultVolumetricCloudsSettings, normalizeCirrus, normalizeCloudDeck, normalizeCloudQuality, normalizeThunder, THUNDER_SCHEMA, } from './cloudConfigs';
|
|
7
7
|
export type { OceanConfig, OceanMeshSettings, OceanPropertyGroup, OceanPropertySchema, OceanQualityConfig, OceanSurfaceConfig, OceanWaterSettings, ReflectionMode, TerrainInteraction, WaterHost, WaterType, WaveModel, } from './oceanConfigs';
|
|
8
8
|
export { OCEAN_DEFAULTS, OCEAN_QUALITY_SCHEMA, OCEAN_SCHEMA, OBJECT_HOST_OVERRIDES, defaultLakeConfig, defaultOceanQuality, defaultOceanWaterSettings, defaultSeaConfig, defaultShoreConfig, defaultStormConfig, normalizeOcean, normalizeOceanQuality, normalizeOceanSettings, } from './oceanConfigs';
|
|
9
9
|
export type { AutoSplatConfig, HeightEncoding, LandscapeConfig, LandscapeHost, LandscapePropertyGroup, LandscapePropertySchema, LandscapeQualityConfig, LandscapeSettings, LandscapeSurface, SplatSource, } from './landscapeConfigs';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,eAAe,EACf,eAAe,EACf,iBAAiB,GAClB,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,iBAAiB,EACjB,uBAAuB,EACvB,eAAe,EACf,sBAAsB,EACtB,aAAa,EACb,kBAAkB,EAClB,mBAAmB,EACnB,mBAAmB,EACnB,wBAAwB,GACzB,MAAM,gBAAgB,CAAC;AAExB,YAAY,EACV,yBAAyB,EACzB,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,WAAW,GACZ,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,gBAAgB,EAChB,sBAAsB,EACtB,cAAc,EACd,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,sBAAsB,EACtB,gCAAgC,EAChC,qBAAqB,EACrB,gBAAgB,EAChB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,kBAAkB,CAAC;AAE1B,OAAO,EACL,aAAa,EACb,2BAA2B,EAC3B,mBAAmB,EACnB,iBAAiB,EACjB,oBAAoB,EACpB,mBAAmB,EACnB,oBAAoB,EACpB,yBAAyB,EACzB,oBAAoB,EACpB,0BAA0B,EAC1B,+BAA+B,EAC/B,eAAe,EACf,kBAAkB,EAClB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,gBAAgB,EAChB,iBAAiB,EACjB,eAAe,EACf,aAAa,GACd,MAAM,eAAe,CAAC;AAEvB,YAAY,EACV,aAAa,EACb,iBAAiB,EACjB,iBAAiB,EACjB,iBAAiB,EACjB,YAAY,EACZ,YAAY,EACZ,iBAAiB,EACjB,aAAa,EACb,eAAe,EACf,eAAe,EACf,eAAe,EAC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AAExB,YAAY,EACV,eAAe,EACf,cAAc,EACd,eAAe,EACf,aAAa,EACb,sBAAsB,EACtB,uBAAuB,EACvB,sBAAsB,EACtB,iBAAiB,EACjB,gBAAgB,EAChB,WAAW,GACZ,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EACL,0BAA0B,EAC1B,6BAA6B,EAC7B,0BAA0B,EAC1B,2BAA2B,EAC3B,2BAA2B,EAC3B,sBAAsB,EACtB,wBAAwB,EACxB,gBAAgB,EAChB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,sBAAsB,EACtB,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,kBAAkB,EAClB,yBAAyB,EACzB,0BAA0B,EAC1B,yBAAyB,GAC1B,MAAM,oBAAoB,CAAC"}
|
package/dist/types/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { TERRAIN_DEFAULTS, TERRAIN_QUALITY_SCHEMA, TERRAIN_SCHEMA, defaultCanyonConfig, defaultDunesConfig, defaultHillsConfig, defaultMountainsConfig, defaultProceduralTerrainSettings, defaultTerrainQuality, normalizeTerrain, normalizeTerrainQuality, normalizeTerrainSettings, } from './terrainConfigs.js';
|
|
2
|
-
export { CIRRUS_SCHEMA, CLOUD_ANIMATABLE_PROPERTIES, CLOUD_DECK_DEFAULTS, CLOUD_DECK_SCHEMA, CLOUD_QUALITY_SCHEMA, defaultCirrusConfig, defaultCloudsQuality, defaultCumulonimbusConfig, defaultCumulusConfig, defaultStratocumulusConfig, defaultVolumetricCloudsSettings, normalizeCirrus, normalizeCloudDeck, normalizeCloudQuality, } from './cloudConfigs.js';
|
|
2
|
+
export { CIRRUS_SCHEMA, CLOUD_ANIMATABLE_PROPERTIES, CLOUD_DECK_DEFAULTS, CLOUD_DECK_SCHEMA, CLOUD_QUALITY_SCHEMA, defaultCirrusConfig, defaultCloudsQuality, defaultCumulonimbusConfig, defaultCumulusConfig, defaultStratocumulusConfig, defaultThunderConfig, defaultVolumetricCloudsSettings, normalizeCirrus, normalizeCloudDeck, normalizeCloudQuality, normalizeThunder, THUNDER_SCHEMA, } from './cloudConfigs.js';
|
|
3
3
|
export { OCEAN_DEFAULTS, OCEAN_QUALITY_SCHEMA, OCEAN_SCHEMA, OBJECT_HOST_OVERRIDES, defaultLakeConfig, defaultOceanQuality, defaultOceanWaterSettings, defaultSeaConfig, defaultShoreConfig, defaultStormConfig, normalizeOcean, normalizeOceanQuality, normalizeOceanSettings, } from './oceanConfigs.js';
|
|
4
4
|
export { LANDSCAPE_AUTOSPLAT_SCHEMA, LANDSCAPE_LIVE_AUTOSPLAT_KEYS, LANDSCAPE_LIVE_CONFIG_KEYS, LANDSCAPE_LIVE_QUALITY_KEYS, LANDSCAPE_LIVE_SURFACE_KEYS, LANDSCAPE_REBUILD_KEYS, LANDSCAPE_QUALITY_SCHEMA, LANDSCAPE_SCHEMA, MAX_LANDSCAPE_SURFACES, MAX_OBJECT_SURFACES, defaultAutoSplat, defaultLandscapeConfig, defaultLandscapeQuality, defaultLandscapeSettings, defaultLandscapeSurface, normalizeLandscape, normalizeLandscapeQuality, normalizeLandscapeSettings, normalizeLandscapeSurface, } from './landscapeConfigs.js';
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import * as THREE from 'three';
|
|
2
|
+
/**
|
|
3
|
+
* The cloud shadow map, shared with every surface material that wants it.
|
|
4
|
+
*
|
|
5
|
+
* These are three.js *shared uniform objects*: a material that spreads
|
|
6
|
+
* `cloudShadowUniforms` into its own uniforms holds a reference to the same
|
|
7
|
+
* `{ value }` boxes, so the cloud pass updates them once per frame and terrain,
|
|
8
|
+
* ocean, landscape and anything else see the new texture without knowing about each
|
|
9
|
+
* other. Same idea as THREE.UniformsLib.
|
|
10
|
+
*
|
|
11
|
+
* The alternative — threading the texture down as props, or having each material
|
|
12
|
+
* poll a registry per frame — means every new surface material has to be taught
|
|
13
|
+
* about clouds. This way it costs one line at the material and nothing at the call
|
|
14
|
+
* site, which is the only version that will actually get adopted across a codebase
|
|
15
|
+
* with three custom surface shaders and an open-ended set of object materials.
|
|
16
|
+
*/
|
|
17
|
+
export declare const cloudShadowUniforms: {
|
|
18
|
+
/** R channel is transmittance along the sun ray: 1 lit, 0 fully shadowed. */
|
|
19
|
+
u_cloudShadowMap: {
|
|
20
|
+
value: THREE.Texture | null;
|
|
21
|
+
};
|
|
22
|
+
/** World -> shadow clip. The chunk does the 0.5 bias itself. */
|
|
23
|
+
u_cloudShadowMatrix: {
|
|
24
|
+
value: THREE.Matrix4;
|
|
25
|
+
};
|
|
26
|
+
/** 0 disables the lookup entirely, so an unused material pays one compare. */
|
|
27
|
+
u_cloudShadowStrength: {
|
|
28
|
+
value: number;
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
/** Called by the cloud pass each frame. Nothing else should write these. */
|
|
32
|
+
export declare function publishCloudShadowMap(texture: THREE.Texture | null, matrix: THREE.Matrix4 | null, strength: number): void;
|
|
33
|
+
/**
|
|
34
|
+
* Orthographic frame for the shadow camera, looking along the sun.
|
|
35
|
+
*
|
|
36
|
+
* Centred ahead of the viewer rather than on it: shadows behind the camera are
|
|
37
|
+
* never seen, so spending half the map on them halves the effective resolution for
|
|
38
|
+
* no reason. Snapped to texel increments — without that, the map slides
|
|
39
|
+
* continuously as the camera moves and the shadow edges crawl and shimmer, which
|
|
40
|
+
* is far more distracting than a slightly coarse edge.
|
|
41
|
+
*/
|
|
42
|
+
export declare function updateCloudShadowCamera(camera: THREE.OrthographicCamera, viewer: THREE.Vector3, viewDir: THREE.Vector3, sunDir: THREE.Vector3, extent: number, mapSize: number): void;
|
|
43
|
+
//# sourceMappingURL=cloudShadowMap.d.ts.map
|