@woosh/meep-engine 3.61.0 → 3.61.2
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/package.json +1 -1
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.d.ts.map +1 -1
- package/src/engine/ecs/storage/populateEngineSerializationRegistry.js +4 -0
- package/src/engine/graphics/ecs/decal/v2/Decal.d.ts +46 -2
- package/src/engine/graphics/ecs/decal/v2/Decal.d.ts.map +1 -1
- package/src/engine/graphics/ecs/decal/v2/Decal.js +74 -5
- package/src/engine/graphics/ecs/decal/v2/DecalSerializationAdapter.d.ts.map +1 -1
- package/src/engine/graphics/ecs/decal/v2/DecalSerializationAdapter.js +13 -1
- package/src/engine/graphics/ecs/decal/v2/DecalSerializationUpgrader_1_2.d.ts +9 -0
- package/src/engine/graphics/ecs/decal/v2/DecalSerializationUpgrader_1_2.d.ts.map +1 -0
- package/src/engine/graphics/ecs/decal/v2/DecalSerializationUpgrader_1_2.js +37 -0
- package/src/engine/graphics3/DecalSystem.d.ts.map +1 -1
- package/src/engine/graphics3/DecalSystem.js +462 -447
- package/src/engine/graphics3/decal/DECAL_GPU_RECORD.d.ts +14 -0
- package/src/engine/graphics3/decal/DECAL_GPU_RECORD.d.ts.map +1 -1
- package/src/engine/graphics3/decal/DECAL_GPU_RECORD.js +53 -13
- package/src/engine/graphics3/decal/chunk_decal_record.d.ts +6 -1
- package/src/engine/graphics3/decal/chunk_decal_record.d.ts.map +1 -1
- package/src/engine/graphics3/decal/chunk_decal_record.js +28 -9
- package/src/engine/graphics3/decal/decal_gpu_records.d.ts +2 -1
- package/src/engine/graphics3/decal/decal_gpu_records.d.ts.map +1 -1
- package/src/engine/graphics3/decal/decal_gpu_records.js +26 -5
- package/src/engine/graphics3/decal/decal_material_samplers.d.ts +6 -0
- package/src/engine/graphics3/decal/decal_material_samplers.d.ts.map +1 -1
- package/src/engine/graphics3/decal/decal_material_samplers.js +13 -0
- package/src/engine/graphics3/decal/shader_cluster_assign_decals.js +1 -1
- package/src/engine/graphics3/decal/shader_cull_decals_frustum.js +1 -1
- package/src/engine/graphics3/decal/shader_decal_composite.d.ts +5 -0
- package/src/engine/graphics3/decal/shader_decal_composite.d.ts.map +1 -1
- package/src/engine/graphics3/decal/shader_decal_composite.js +69 -28
- package/src/engine/network/sim/SimActionExecutor.d.ts +4 -0
- package/src/engine/network/sim/SimActionExecutor.d.ts.map +1 -1
- package/src/engine/network/sim/SimActionExecutor.js +4 -0
- package/src/generation/foliage/material/foliage_atlas_cutout.d.ts.map +1 -1
- package/src/generation/foliage/material/foliage_atlas_cutout.js +21 -5
- package/src/generation/foliage/mesh/tree_cluster_representatives.d.ts +8 -0
- package/src/generation/foliage/mesh/tree_cluster_representatives.d.ts.map +1 -1
- package/src/generation/foliage/mesh/tree_cluster_representatives.js +178 -78
- package/src/generation/foliage/mesh/tree_mesh_build_bark.d.ts.map +1 -1
- package/src/generation/foliage/mesh/tree_mesh_build_bark.js +178 -97
- package/src/generation/foliage/skeleton/ShootLightField.d.ts +1 -0
- package/src/generation/foliage/skeleton/ShootLightField.d.ts.map +1 -1
- package/src/generation/foliage/skeleton/ShootLightField.js +88 -17
- package/src/generation/foliage/skeleton/ShootWoodHash.d.ts +8 -4
- package/src/generation/foliage/skeleton/ShootWoodHash.d.ts.map +1 -1
- package/src/generation/foliage/skeleton/ShootWoodHash.js +216 -27
- package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
- package/src/shade/playground/probe_clipmap/main.js +4 -0
- package/src/shade/playground/probe_clipmap_box/README.md +55 -0
- package/src/shade/playground/probe_clipmap_box/index.html +185 -0
- package/src/shade/playground/probe_clipmap_box/main.d.ts +8 -0
- package/src/shade/playground/probe_clipmap_box/main.d.ts.map +1 -0
- package/src/shade/playground/probe_clipmap_box/main.js +323 -0
- package/src/shade/playground/probe_clipmap_box/scene.d.ts +93 -0
- package/src/shade/playground/probe_clipmap_box/scene.d.ts.map +1 -0
- package/src/shade/playground/probe_clipmap_box/scene.js +256 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +6 -1
- package/src/shade/renderer/buffer/graph_read_buffer.d.ts +3 -1
- package/src/shade/renderer/buffer/graph_read_buffer.d.ts.map +1 -1
- package/src/shade/renderer/buffer/graph_read_buffer.js +9 -6
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_decode.d.ts +12 -0
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_decode.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_decode.js +49 -24
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_encode.d.ts +12 -0
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_encode.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_brick4_sh3_color_encode.js +50 -19
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_sh3_compress.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/encoding/v2/chunk_sh3_compress.js +6 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +5 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +7 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +6 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +10 -9
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts +12 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/PROBE_CLIPMAP.js +14 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts +17 -22
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap.js +53 -65
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts +2 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_pick.js +9 -20
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js +14 -19
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_accumulate.js +8 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_admit.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.js +13 -18
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.js +4 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_diffuse.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_diffuse.js +4 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js +4 -7
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts +4 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js +14 -13
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts +3 -4
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js +7 -15
- package/src/shade/renderer/light/environment/shader_downsample_environment_map.d.ts.map +1 -1
- package/src/shade/renderer/light/environment/shader_downsample_environment_map.js +5 -1
- package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
- package/src/shade/renderer/particles/GPUParticleSystem.js +1 -7
- package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.d.ts +26 -8
- package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.js +170 -142
- package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect_probe_clipmap.d.ts +1 -1
- package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect_probe_clipmap.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect_probe_clipmap.js +5 -8
- package/src/shade/renderer/restir/di/chunk_restir_resolve.d.ts.map +1 -1
- package/src/shade/renderer/restir/di/chunk_restir_resolve.js +91 -94
- package/src/shade/renderer/restir/reservoir/chunk_rtxdi_stream_sample.js +1 -1
- package/src/shade/renderer/shader/chunk/color/rgbe9995/chunk_rgbe9995_decode.d.ts +14 -0
- package/src/shade/renderer/shader/chunk/color/rgbe9995/chunk_rgbe9995_decode.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/rgbe9995/chunk_rgbe9995_decode.js +36 -21
- package/src/shade/renderer/shader/chunk/color/rgbe9995/chunk_rgbe9995_sample_gather.d.ts +22 -0
- package/src/shade/renderer/shader/chunk/color/rgbe9995/chunk_rgbe9995_sample_gather.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/color/rgbe9995/chunk_rgbe9995_sample_gather.js +64 -0
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts +15 -4
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +33 -7
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_vertex_normal.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_decode_vertex_normal.js +13 -18
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_encode_vertex_normal.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/normal/chunk_encode_vertex_normal.js +28 -30
- package/src/shade/renderer/shader/chunk/geometry/vec2/chunk_unit_u32_to_vec2.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/vec2/chunk_unit_u32_to_vec2.js +15 -16
- package/src/shade/renderer/shader/chunk/geometry/vec2/chunk_unit_vec2_to_u32.d.ts +0 -1
- package/src/shade/renderer/shader/chunk/geometry/vec2/chunk_unit_vec2_to_u32.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/vec2/chunk_unit_vec2_to_u32.js +15 -18
- package/src/shade/renderer/shader/chunk/noise/chunk_sobol_sample_vec2.d.ts +40 -0
- package/src/shade/renderer/shader/chunk/noise/chunk_sobol_sample_vec2.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/noise/chunk_sobol_sample_vec2.js +75 -0
- package/src/shade/renderer/shader/chunk/noise/chunk_vdc_radical_inverse.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/noise/chunk_vdc_radical_inverse.js +3 -1
- package/src/shade/renderer/shader/chunk/random/chunk_hash_lk.d.ts +28 -0
- package/src/shade/renderer/shader/chunk/random/chunk_hash_lk.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/random/chunk_hash_lk.js +41 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_color_add_scaled.d.ts +12 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_color_add_scaled.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/spherical_harmonics/chunk_sh3_color_add_scaled.js +24 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts +3 -2
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +4 -0
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts +2 -5
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.js +3 -20
- package/src/shade/renderer/water/chunk_water_gi.d.ts +1 -1
- package/src/shade/renderer/water/chunk_water_gi.d.ts.map +1 -1
- package/src/shade/renderer/water/chunk_water_gi.js +6 -8
- package/src/shade/wgsl/emulator/WGSLJavaScriptCompiler.js +8 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.d.ts.map +1 -1
- package/src/shade/wgsl/emulator/WGSLLanguageCore.js +79 -35
- package/src/core/math/hash/squirrel3.d.ts +0 -17
- package/src/core/math/hash/squirrel3.d.ts.map +0 -1
- package/src/core/math/hash/squirrel3.js +0 -30
- package/src/shade/renderer/global_illumination/brick4/cpu/brick4_sh3_color_encode.d.ts +0 -2
- package/src/shade/renderer/global_illumination/brick4/cpu/brick4_sh3_color_encode.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/brick4/cpu/brick4_sh3_color_encode.js +0 -6
- package/src/shade/renderer/shader/chunk/random/chunk_hash_squirrel3.d.ts +0 -12
- package/src/shade/renderer/shader/chunk/random/chunk_hash_squirrel3.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/random/chunk_hash_squirrel3.js +0 -30
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_bounce.js
CHANGED
|
@@ -5,23 +5,22 @@ import {
|
|
|
5
5
|
chunk_uv_octahedral_unit_decode
|
|
6
6
|
} from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
7
7
|
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
8
|
+
import { RECIPROCAL_PI_DECLARATION } from "../../../shader/chunk/math/RECIPROCAL_PI_DECLARATION.js";
|
|
8
9
|
import {
|
|
9
|
-
|
|
10
|
-
} from "../../../shader/chunk/spherical_harmonics/
|
|
10
|
+
chunk_sh3_color_get_irradiance_at
|
|
11
|
+
} from "../../../shader/chunk/spherical_harmonics/chunk_sh3_color_get_irradiance_at.js";
|
|
11
12
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
12
13
|
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
13
14
|
import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourceDescriptor.js";
|
|
14
15
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
15
16
|
import { vec2u } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
16
17
|
import { WebGPUArray } from "../../../shader/type/WebGPUArray.js";
|
|
17
|
-
import { STBN_VEC2_RESOURCE } from "../../../STATIC_GRAPHICS_ENGINE_ASSET_RESOURCES.js";
|
|
18
18
|
import { BRICK_TRACE_HIT } from "../brick/BRICK_CLIPMAP.js";
|
|
19
19
|
import {
|
|
20
20
|
chunk_probe_clipmap,
|
|
21
|
-
chunk_probe_clipmap_ray_jitter,
|
|
22
21
|
chunk_probe_clipmap_ray_layout,
|
|
22
|
+
chunk_probe_clipmap_ray_noise,
|
|
23
23
|
chunk_probe_clipmap_ray_origin,
|
|
24
|
-
chunk_probe_clipmap_ray_texel,
|
|
25
24
|
PROBE_ORIGINS_READ_RESOURCE,
|
|
26
25
|
PROBE_RAY_SUMS_READ_RESOURCE,
|
|
27
26
|
PROBE_RAYS_WRITE_RESOURCE,
|
|
@@ -48,7 +47,6 @@ resources.createGroup()
|
|
|
48
47
|
.add(PROBE_RAYS_WRITE_RESOURCE)
|
|
49
48
|
.add(PROBE_RAY_SUMS_READ_RESOURCE)
|
|
50
49
|
.add(PROBE_STATES_READ_RESOURCE)
|
|
51
|
-
.add(STBN_VEC2_RESOURCE)
|
|
52
50
|
.add(PROBE_DEPTH_SAMPLER_RESOURCE);
|
|
53
51
|
|
|
54
52
|
// the clipmap a hit takes its bounce from first: the frustum's probes
|
|
@@ -75,7 +73,8 @@ resources.createGroup()
|
|
|
75
73
|
* `PROBE_DISPATCH_RAYS`. It adds ρ_d·E_ind/π to the ray's light, ρ_d the albedo shade left in its `row`.
|
|
76
74
|
*
|
|
77
75
|
* - **The first clipmap**: the frustum's probes, picked at the hit along its normal, the view back along
|
|
78
|
-
* the ray, with the ray's own
|
|
76
|
+
* the ray, with the ray's own pick noise (`probe_clipmap_ray_noise`, `PROBE_RAY_NOISE_PICK`), drawn
|
|
77
|
+
* apart from the jitter that placed the hit (`probe_clipmap_pick_in`).
|
|
79
78
|
* - **Where it has probes**, their SH is the bounce, and the ray's `row` is cleared: a hit the first clipmap
|
|
80
79
|
* serves wants nothing of the fallback (`shader_probe_clipmap_want_hits`).
|
|
81
80
|
* - **Where it has none**, the fallback's, the world cache's: the same pick there, at its own spacing.
|
|
@@ -115,19 +114,15 @@ fn main(
|
|
|
115
114
|
|
|
116
115
|
// the probe's update's rays, and this one's place among them
|
|
117
116
|
let k = record.flags >> PROBE_RAY_PROBE_SHIFT;
|
|
118
|
-
let
|
|
119
|
-
let rays = span.y;
|
|
120
|
-
let i = ray - span.x;
|
|
117
|
+
let i = ray - probe_clipmap_probe_rays(k).x;
|
|
121
118
|
|
|
122
119
|
let slot = probe_trace.elements[k];
|
|
123
|
-
let n = settings.radiance_resolution;
|
|
124
120
|
let updates = probe_state_updates(probe_states[slot].x);
|
|
125
|
-
let texel = probe_clipmap_ray_texel(i, updates, rays, n * n);
|
|
126
121
|
|
|
127
122
|
let direction = uv_octahedral_unit_decode(unpack2x16unorm(record.direction));
|
|
128
123
|
let position = probe_clipmap_ray_origin(probe_origins[k], slot, record.direction) + record.t * direction;
|
|
129
124
|
let normal = uv_octahedral_unit_decode(unpack2x16unorm(record.normal));
|
|
130
|
-
let noise =
|
|
125
|
+
let noise = probe_clipmap_ray_noise(slot, updates, i, PROBE_RAY_NOISE_PICK);
|
|
131
126
|
|
|
132
127
|
var probes = probe_clipmap_sh_in(
|
|
133
128
|
&bounce_first_records,
|
|
@@ -148,8 +143,8 @@ fn main(
|
|
|
148
143
|
return;
|
|
149
144
|
}
|
|
150
145
|
|
|
151
|
-
// E
|
|
152
|
-
let e =
|
|
146
|
+
// E/π
|
|
147
|
+
let e = sh3_color_get_irradiance_at(normal, probes.sh) * RECIPROCAL_PI;
|
|
153
148
|
|
|
154
149
|
if (all(e == vec3<f32>(0.0))) {
|
|
155
150
|
return;
|
|
@@ -160,13 +155,13 @@ fn main(
|
|
|
160
155
|
`, [
|
|
161
156
|
chunk_probe_clipmap,
|
|
162
157
|
chunk_probe_clipmap_ray_layout,
|
|
163
|
-
|
|
164
|
-
chunk_probe_clipmap_ray_jitter,
|
|
158
|
+
chunk_probe_clipmap_ray_noise,
|
|
165
159
|
chunk_probe_clipmap_ray_origin,
|
|
166
160
|
chunk_folded_workgroup_index,
|
|
167
161
|
chunk_uv_octahedral_unit_decode,
|
|
168
162
|
chunk_probe_clipmap_pick_in,
|
|
169
|
-
|
|
163
|
+
chunk_sh3_color_get_irradiance_at,
|
|
164
|
+
RECIPROCAL_PI_DECLARATION,
|
|
170
165
|
chunk_rgbe9995_decode,
|
|
171
166
|
chunk_rgbe9995_encode,
|
|
172
167
|
]),
|
|
@@ -11,7 +11,7 @@ export const PROBE_CANDIDATE_SETTINGS: WebGPUStruct;
|
|
|
11
11
|
* - **The neighbours**: the 26 around B's lattice point in its cascade. One is a candidate if it is ALIVE, its
|
|
12
12
|
* record holds that point (the storage wraps), and it is listed this frame (`probe_clipmap_listed`), so that its
|
|
13
13
|
* rays are in `probe_rays`. A NEW one is not. M counts them.
|
|
14
|
-
* - **The importance**: the neighbour's radiance, its
|
|
14
|
+
* - **The importance**: the neighbour's radiance, the luminance of its mean radiance, times B's visibility of it: Chebyshev
|
|
15
15
|
* over B's depth moments toward it (`probe_visibility_chebyshev`), its distance in B's spacings held to the depth
|
|
16
16
|
* limit, as the moments are. A dark neighbour, or one behind a wall, weighs about nothing.
|
|
17
17
|
* - **The draw**: one by its importance, a reservoir of one through the 26 with a hash of the slot, the update count
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_candidate.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_candidate.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.js"],"names":[],"mappings":"AA8BA;;GAEG;AACH,uCAFU,YAAY,CAKO;AAqB7B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,6CAFU,aAAa,CAwFpB;6BA/J0B,sCAAsC;8BAHrC,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_candidate.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { chunk_rgb_to_luminance } from "../../../shader/chunk/color/chunk_rgb_to_luminance.js";
|
|
1
2
|
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
2
3
|
import { chunk_hash_to_float01 } from "../../../shader/chunk/random/chunk_hash_to_float01.js";
|
|
3
4
|
import { chunk_pcg3d } from "../../../shader/chunk/random/pcg/chunk_pcg3d.js";
|
|
@@ -63,7 +64,7 @@ resources.createGroup()
|
|
|
63
64
|
* - **The neighbours**: the 26 around B's lattice point in its cascade. One is a candidate if it is ALIVE, its
|
|
64
65
|
* record holds that point (the storage wraps), and it is listed this frame (`probe_clipmap_listed`), so that its
|
|
65
66
|
* rays are in `probe_rays`. A NEW one is not. M counts them.
|
|
66
|
-
* - **The importance**: the neighbour's radiance, its
|
|
67
|
+
* - **The importance**: the neighbour's radiance, the luminance of its mean radiance, times B's visibility of it: Chebyshev
|
|
67
68
|
* over B's depth moments toward it (`probe_visibility_chebyshev`), its distance in B's spacings held to the depth
|
|
68
69
|
* limit, as the moments are. A dark neighbour, or one behind a wall, weighs about nothing.
|
|
69
70
|
* - **The draw**: one by its importance, a reservoir of one through the 26 with a hash of the slot, the update count
|
|
@@ -135,7 +136,7 @@ fn main(
|
|
|
135
136
|
let distance = length(to_neighbour);
|
|
136
137
|
let toward = to_neighbour / max(distance, 1e-6);
|
|
137
138
|
let visibility = probe_visibility_chebyshev(probe_clipmap_depth_moments(slot, toward), min(distance / spacing, ${PROBE_DEPTH_LIMIT}));
|
|
138
|
-
let radiance =
|
|
139
|
+
let radiance = rgb_to_luminance(probe_record_mean_radiance(probe_records[neighbour].sh));
|
|
139
140
|
let importance = radiance * visibility;
|
|
140
141
|
|
|
141
142
|
if (importance <= 0.0) {
|
|
@@ -160,6 +161,7 @@ fn main(
|
|
|
160
161
|
chunk_probe_clipmap_pick,
|
|
161
162
|
chunk_probe_clipmap_resample,
|
|
162
163
|
chunk_folded_workgroup_index,
|
|
164
|
+
chunk_rgb_to_luminance,
|
|
163
165
|
chunk_hash_to_float01,
|
|
164
166
|
chunk_pcg3d,
|
|
165
167
|
]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_diffuse.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_diffuse.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_diffuse.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_diffuse.js"],"names":[],"mappings":"AA8EA;;;;;;;;GAQG;AACH,2CAFU,WAAW,CAalB;4BArFyB,gCAAgC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_diffuse.js
CHANGED
|
@@ -6,11 +6,10 @@ import { ENVIRONMENT_MAP_SAMPLER_RESOURCE } from "../../../light/environment/ENV
|
|
|
6
6
|
import { chunk_project_position_from_depth } from "../../../shader/chunk/camera/chunk_project_position_from_depth.js";
|
|
7
7
|
import { chunk_mat4_extract_position } from "../../../shader/chunk/geometry/mat4/chunk_mat4_extract_position.js";
|
|
8
8
|
import { chunk_decode_g_buffer_normal } from "../../../shader/chunk/geometry/normal/chunk_decode_g_buffer_normal.js";
|
|
9
|
-
import { PI_DECLARATION } from "../../../shader/chunk/math/PI_DECLARATION.js";
|
|
10
9
|
import { chunk_stbn_sample_vec2 } from "../../../shader/chunk/noise/chunk_stbn_sample_vec2.js";
|
|
11
10
|
import {
|
|
12
|
-
|
|
13
|
-
} from "../../../shader/chunk/spherical_harmonics/
|
|
11
|
+
chunk_sh3_color_get_irradiance_at
|
|
12
|
+
} from "../../../shader/chunk/spherical_harmonics/chunk_sh3_color_get_irradiance_at.js";
|
|
14
13
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
15
14
|
import { ImageShader } from "../../../shader/ImageShader.js";
|
|
16
15
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
@@ -59,7 +58,7 @@ fn main(
|
|
|
59
58
|
var irradiance = get_ibl_irradiance(bent_normal);
|
|
60
59
|
|
|
61
60
|
if (probes.found) {
|
|
62
|
-
irradiance =
|
|
61
|
+
irradiance = sh3_color_get_irradiance_at(bent_normal, probes.sh);
|
|
63
62
|
}
|
|
64
63
|
|
|
65
64
|
// AO baked in at the source, as the IBL pass does, so the resolve need not know which path ran
|
|
@@ -73,9 +72,8 @@ fn main(
|
|
|
73
72
|
chunk_decode_g_buffer_normal,
|
|
74
73
|
chunk_stbn_sample_vec2,
|
|
75
74
|
chunk_probe_clipmap_pick,
|
|
76
|
-
|
|
75
|
+
chunk_sh3_color_get_irradiance_at,
|
|
77
76
|
chunk_get_ibl_irradiance,
|
|
78
|
-
PI_DECLARATION,
|
|
79
77
|
]);
|
|
80
78
|
|
|
81
79
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_indirect_lighting.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_indirect_lighting.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js"],"names":[],"mappings":"AAuIA;;;;;;;;;;;GAWG;AACH,qDAFU,WAAW,CA0BlB;4BAtJyB,gCAAgC"}
|
|
@@ -14,11 +14,10 @@ import { chunk_compute_indirect_specular } from "../../../shader/chunk/material/
|
|
|
14
14
|
import { chunk_decode_g_buffer_metalness } from "../../../shader/chunk/material/chunk_decode_g_buffer_metalness.js";
|
|
15
15
|
import { chunk_decode_g_buffer_roughness } from "../../../shader/chunk/material/chunk_decode_g_buffer_roughness.js";
|
|
16
16
|
import { chunk_metalness_to_specular_color } from "../../../shader/chunk/material/chunk_metalness_to_specular_color.js";
|
|
17
|
-
import { PI_DECLARATION } from "../../../shader/chunk/math/PI_DECLARATION.js";
|
|
18
17
|
import { chunk_stbn_sample_vec2 } from "../../../shader/chunk/noise/chunk_stbn_sample_vec2.js";
|
|
19
18
|
import {
|
|
20
|
-
|
|
21
|
-
} from "../../../shader/chunk/spherical_harmonics/
|
|
19
|
+
chunk_sh3_color_get_irradiance_at
|
|
20
|
+
} from "../../../shader/chunk/spherical_harmonics/chunk_sh3_color_get_irradiance_at.js";
|
|
22
21
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
23
22
|
import { ImageShader } from "../../../shader/ImageShader.js";
|
|
24
23
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
@@ -88,8 +87,7 @@ fn main(
|
|
|
88
87
|
var radiance: vec3<f32>;
|
|
89
88
|
|
|
90
89
|
if (probes.found) {
|
|
91
|
-
|
|
92
|
-
irradiance = PI * resolve_irradiance_sh_to_diffuse(probes.sh.Y, probes.sh.CoCg, bent_normal);
|
|
90
|
+
irradiance = sh3_color_get_irradiance_at(bent_normal, probes.sh);
|
|
93
91
|
radiance = probe_clipmap_radiance_of(pick, position, normal, view_direction, surface_roughness).radiance;
|
|
94
92
|
} else {
|
|
95
93
|
// a pixel no probe weighs anything for takes the environment's, as the IBL passes give it
|
|
@@ -128,12 +126,11 @@ fn main(
|
|
|
128
126
|
chunk_stbn_sample_vec2,
|
|
129
127
|
chunk_probe_clipmap_pick,
|
|
130
128
|
chunk_probe_clipmap_sample_radiance,
|
|
131
|
-
|
|
129
|
+
chunk_sh3_color_get_irradiance_at,
|
|
132
130
|
chunk_get_ibl_irradiance,
|
|
133
131
|
chunk_get_ibl_radiance,
|
|
134
132
|
chunk_compute_indirect_specular,
|
|
135
133
|
chunk_compute_specular_occlusion_bn,
|
|
136
|
-
PI_DECLARATION,
|
|
137
134
|
]);
|
|
138
135
|
|
|
139
136
|
/**
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export const PROBE_PROJECT_SETTINGS: WebGPUStruct;
|
|
|
5
5
|
/**
|
|
6
6
|
* Projection, rows (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.8): a thread a row of each listed probe's
|
|
7
7
|
* radiance map, dispatched through `PROBE_DISPATCH_ROWS`. It sums the row's texels, new and kept, as
|
|
8
|
-
*
|
|
9
|
-
*
|
|
8
|
+
* RGB radiance SH3, `L·Y(ω)·dω` over each texel's solid angle, so that `sh3_color_get_irradiance_at` gives
|
|
9
|
+
* E; the row's rays this update, resolved and back faces; and how far the update's
|
|
10
10
|
* samples fell from their means, with that sum's variance. One row of the probe's projection each, which
|
|
11
11
|
* the probe's pass sums.
|
|
12
12
|
*
|
|
@@ -15,7 +15,8 @@ export const PROBE_PROJECT_SETTINGS: WebGPUStruct;
|
|
|
15
15
|
export const shader_probe_clipmap_project_rows: ComputeShader;
|
|
16
16
|
/**
|
|
17
17
|
* Projection, probes (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.4, §8.8): a thread a listed probe,
|
|
18
|
-
* dispatched through `PROBE_DISPATCH_TRACED`. It sums its rows into its record's SH,
|
|
18
|
+
* dispatched through `PROBE_DISPATCH_TRACED`. It sums its rows into its record's SH (`probe_record_sh_encode`),
|
|
19
|
+
* and classifies it
|
|
19
20
|
* by the update's resolved rays: dead when every one hit a back face, else alive, its update counted and
|
|
20
21
|
* its time the frame's. An update with no resolved ray keeps the probe's kind.
|
|
21
22
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_project.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_project.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js"],"names":[],"mappings":"AAmCA;;GAEG;AACH,qCAFU,YAAY,CAmBK;AAW3B;;;;;;;;;GASG;AACH,gDAFU,aAAa,CAsDpB;AAcH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AACH,2CAFU,aAAa,CA8FpB;6BA3P0B,sCAAsC;8BAHrC,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_project.js
CHANGED
|
@@ -5,9 +5,8 @@ import {
|
|
|
5
5
|
chunk_uv_octahedral_unit_decode
|
|
6
6
|
} from "../../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
7
7
|
import { chunk_folded_workgroup_index } from "../../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
8
|
-
import {
|
|
9
|
-
|
|
10
|
-
} from "../../../shader/chunk/spherical_harmonics/l1i/chunk_convert_to_irradiance_sh.js";
|
|
8
|
+
import { chunk_sh3_basis_at } from "../../../shader/chunk/spherical_harmonics/chunk_sh3_basis_at.js";
|
|
9
|
+
import { chunk_sh3_color_accumulate } from "../../../shader/chunk/spherical_harmonics/chunk_sh3_color_accumulate.js";
|
|
11
10
|
import { CodeChunk } from "../../../shader/compiler/CodeChunk.js";
|
|
12
11
|
import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
13
12
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
@@ -68,8 +67,8 @@ row_resources.createGroup()
|
|
|
68
67
|
/**
|
|
69
68
|
* Projection, rows (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.8): a thread a row of each listed probe's
|
|
70
69
|
* radiance map, dispatched through `PROBE_DISPATCH_ROWS`. It sums the row's texels, new and kept, as
|
|
71
|
-
*
|
|
72
|
-
*
|
|
70
|
+
* RGB radiance SH3, `L·Y(ω)·dω` over each texel's solid angle, so that `sh3_color_get_irradiance_at` gives
|
|
71
|
+
* E; the row's rays this update, resolved and back faces; and how far the update's
|
|
73
72
|
* samples fell from their means, with that sum's variance. One row of the probe's projection each, which
|
|
74
73
|
* the probe's pass sums.
|
|
75
74
|
*
|
|
@@ -105,13 +104,11 @@ fn main(
|
|
|
105
104
|
let i = row * n + x;
|
|
106
105
|
let light = vec3<f32>(unpack2x16float(probe_maps[maps + 2u * i]), unpack2x16float(probe_maps[maps + 2u * i + 1u]).x);
|
|
107
106
|
let uv = (vec2<f32>(f32(x), f32(row)) + 0.5) * inverse;
|
|
108
|
-
let
|
|
109
|
-
let sh = convert_to_irradiance_sh(light, uv_octahedral_unit_decode(uv));
|
|
107
|
+
let solid_angle = octahedral_solid_angle(uv, inverse);
|
|
110
108
|
let rays = probe_maps[maps + 2u * texels + i];
|
|
111
109
|
let change = unpack2x16float(probe_maps[maps + 3u * texels + settings.depth_resolution * settings.depth_resolution + i]);
|
|
112
110
|
|
|
113
|
-
row_sum.sh
|
|
114
|
-
row_sum.sh.Y += sh.Y * weight;
|
|
111
|
+
sh3_color_accumulate(&row_sum.sh, light * solid_angle, sh3_basis_at(uv_octahedral_unit_decode(uv)));
|
|
115
112
|
row_sum.resolved += rays & 0xFFFFu;
|
|
116
113
|
row_sum.back_faces += rays >> 16u;
|
|
117
114
|
row_sum.change += change.x;
|
|
@@ -125,7 +122,8 @@ fn main(
|
|
|
125
122
|
chunk_folded_workgroup_index,
|
|
126
123
|
chunk_octahedral_solid_angle,
|
|
127
124
|
chunk_uv_octahedral_unit_decode,
|
|
128
|
-
|
|
125
|
+
chunk_sh3_basis_at,
|
|
126
|
+
chunk_sh3_color_accumulate,
|
|
129
127
|
PROBE_PROJECTION_ROW_STRUCT.declaration_chunk,
|
|
130
128
|
]),
|
|
131
129
|
});
|
|
@@ -144,7 +142,8 @@ probe_resources.createGroup()
|
|
|
144
142
|
|
|
145
143
|
/**
|
|
146
144
|
* Projection, probes (PROBE_CLIPMAP_PROPOSAL_2026_10_27.md §8.4, §8.8): a thread a listed probe,
|
|
147
|
-
* dispatched through `PROBE_DISPATCH_TRACED`. It sums its rows into its record's SH,
|
|
145
|
+
* dispatched through `PROBE_DISPATCH_TRACED`. It sums its rows into its record's SH (`probe_record_sh_encode`),
|
|
146
|
+
* and classifies it
|
|
148
147
|
* by the update's resolved rays: dead when every one hit a back face, else alive, its update counted and
|
|
149
148
|
* its time the frame's. An update with no resolved ray keeps the probe's kind.
|
|
150
149
|
*
|
|
@@ -196,8 +195,10 @@ fn main(
|
|
|
196
195
|
for (var row = 0u; row < n; row++) {
|
|
197
196
|
let part = probe_projection[k * n + row];
|
|
198
197
|
|
|
199
|
-
|
|
200
|
-
|
|
198
|
+
for (var c = 0u; c < 9u; c++) {
|
|
199
|
+
sum.sh[c] += part.sh[c];
|
|
200
|
+
}
|
|
201
|
+
|
|
201
202
|
sum.resolved += part.resolved;
|
|
202
203
|
sum.back_faces += part.back_faces;
|
|
203
204
|
sum.change += part.change;
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts
CHANGED
|
@@ -12,10 +12,9 @@ export const PROBE_TRACE_SETTINGS: WebGPUStruct;
|
|
|
12
12
|
* or a spread subset below R = n_r². On a guided one, the walk position whose rays the ray is among
|
|
13
13
|
* in the probe's guide (`chunk_probe_clipmap_guide`), found by bisecting the first rays. A texel's rays
|
|
14
14
|
* then follow one another, in the walk's order.
|
|
15
|
-
* - **Direction**: the texel's octahedral square, jittered by
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
* (`probe_clipmap_guided_ray_jitter`).
|
|
15
|
+
* - **Direction**: the texel's octahedral square, jittered by white noise of the probe's slot, its update
|
|
16
|
+
* count and the ray's place in the update (`probe_clipmap_ray_noise`, `PROBE_RAY_NOISE_JITTER`), on
|
|
17
|
+
* uniform and guided updates alike. Nothing stratifies the jitter inside a texel.
|
|
19
18
|
* - **Origin**: a point of a small ball around the probe where relocation left it, `probe_origins`, one a
|
|
20
19
|
* ray (`probe_clipmap_ray_origin`); t_min one voxel of the brick cascade there.
|
|
21
20
|
* - **Direct light**: a hit off a front face takes E_dir = Σ colour·max(0, n·l)·visibility over the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_probe_clipmap_trace.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_probe_clipmap_trace.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js"],"names":[],"mappings":"AAmDA;;GAEG;AACH,mCAFU,YAAY,CAeG;AAuBzB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,yCAFU,aAAa,CAgJpB;6BAjP0B,sCAAsC;8BAHrC,kCAAkC"}
|
package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js
CHANGED
|
@@ -21,7 +21,6 @@ import { ComputeShader } from "../../../shader/ComputeShader.js";
|
|
|
21
21
|
import { ShaderResourceSetDescriptor } from "../../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
22
22
|
import { f32, u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
23
23
|
import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
|
|
24
|
-
import { STBN_VEC2_RESOURCE } from "../../../STATIC_GRAPHICS_ENGINE_ASSET_RESOURCES.js";
|
|
25
24
|
import {
|
|
26
25
|
BRICK_ATLAS_TEXTURE_RESOURCE,
|
|
27
26
|
BRICK_LEVELS_RESOURCE,
|
|
@@ -35,9 +34,8 @@ import {
|
|
|
35
34
|
import {
|
|
36
35
|
chunk_probe_clipmap,
|
|
37
36
|
chunk_probe_clipmap_guide,
|
|
38
|
-
chunk_probe_clipmap_guided_ray_jitter,
|
|
39
|
-
chunk_probe_clipmap_ray_jitter,
|
|
40
37
|
chunk_probe_clipmap_ray_layout,
|
|
38
|
+
chunk_probe_clipmap_ray_noise,
|
|
41
39
|
chunk_probe_clipmap_ray_origin,
|
|
42
40
|
chunk_probe_clipmap_ray_texel,
|
|
43
41
|
PROBE_GUIDE_READ_RESOURCE,
|
|
@@ -80,7 +78,6 @@ resources.createGroup()
|
|
|
80
78
|
.add(PROBE_RAYS_WRITE_RESOURCE)
|
|
81
79
|
.add(PROBE_RAY_SUMS_READ_RESOURCE)
|
|
82
80
|
.add(PROBE_GUIDE_READ_RESOURCE)
|
|
83
|
-
.add(STBN_VEC2_RESOURCE)
|
|
84
81
|
.add(LIGHT_DATA_RESOURCE);
|
|
85
82
|
|
|
86
83
|
resources.createGroup()
|
|
@@ -101,10 +98,9 @@ resources.createGroup()
|
|
|
101
98
|
* or a spread subset below R = n_r². On a guided one, the walk position whose rays the ray is among
|
|
102
99
|
* in the probe's guide (`chunk_probe_clipmap_guide`), found by bisecting the first rays. A texel's rays
|
|
103
100
|
* then follow one another, in the walk's order.
|
|
104
|
-
* - **Direction**: the texel's octahedral square, jittered by
|
|
105
|
-
*
|
|
106
|
-
*
|
|
107
|
-
* (`probe_clipmap_guided_ray_jitter`).
|
|
101
|
+
* - **Direction**: the texel's octahedral square, jittered by white noise of the probe's slot, its update
|
|
102
|
+
* count and the ray's place in the update (`probe_clipmap_ray_noise`, `PROBE_RAY_NOISE_JITTER`), on
|
|
103
|
+
* uniform and guided updates alike. Nothing stratifies the jitter inside a texel.
|
|
108
104
|
* - **Origin**: a point of a small ball around the probe where relocation left it, `probe_origins`, one a
|
|
109
105
|
* ray (`probe_clipmap_ray_origin`); t_min one voxel of the brick cascade there.
|
|
110
106
|
* - **Direct light**: a hit off a front face takes E_dir = Σ colour·max(0, n·l)·visibility over the
|
|
@@ -177,19 +173,16 @@ fn main(
|
|
|
177
173
|
let updates = probe_state_updates(state.x);
|
|
178
174
|
|
|
179
175
|
var texel: u32;
|
|
180
|
-
var jitter: vec2<f32>;
|
|
181
176
|
|
|
182
177
|
if (probe_clipmap_guided(state.x, settings.uniform_period, settings.rays_per_probe, texels)) {
|
|
183
178
|
let base = k * probe_clipmap_guide_words(n);
|
|
184
|
-
let position = probe_trace_guided_position(base, i, texels);
|
|
185
179
|
|
|
186
|
-
texel = probe_clipmap_guide_texel(
|
|
187
|
-
jitter = probe_clipmap_guided_ray_jitter(slot, texel, i - probe_guide[base + position], updates, rays, n);
|
|
180
|
+
texel = probe_clipmap_guide_texel(probe_trace_guided_position(base, i, texels), updates, n);
|
|
188
181
|
} else {
|
|
189
182
|
texel = probe_clipmap_ray_texel(i, updates, rays, texels);
|
|
190
|
-
jitter = probe_clipmap_ray_jitter(slot, texel, i, updates, rays, n);
|
|
191
183
|
}
|
|
192
184
|
|
|
185
|
+
let jitter = probe_clipmap_ray_noise(slot, updates, i, PROBE_RAY_NOISE_JITTER);
|
|
193
186
|
let direction = uv_octahedral_unit_decode((vec2<f32>(f32(texel % n), f32(texel / n)) + jitter) / f32(n));
|
|
194
187
|
let packed = pack2x16unorm(uv_octahedral_unit_encode(direction));
|
|
195
188
|
|
|
@@ -253,10 +246,9 @@ fn main(
|
|
|
253
246
|
chunk_probe_clipmap,
|
|
254
247
|
chunk_probe_clipmap_ray_layout,
|
|
255
248
|
chunk_probe_clipmap_ray_texel,
|
|
256
|
-
|
|
249
|
+
chunk_probe_clipmap_ray_noise,
|
|
257
250
|
chunk_probe_clipmap_ray_origin,
|
|
258
251
|
chunk_probe_clipmap_guide,
|
|
259
|
-
chunk_probe_clipmap_guided_ray_jitter,
|
|
260
252
|
chunk_folded_workgroup_index,
|
|
261
253
|
chunk_uv_octahedral_unit_decode,
|
|
262
254
|
chunk_uv_octahedral_unit_encode,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_downsample_environment_map.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/light/environment/shader_downsample_environment_map.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shader_downsample_environment_map.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/light/environment/shader_downsample_environment_map.js"],"names":[],"mappings":"AAuGA,8DAII;8BApG0B,+BAA+B"}
|
|
@@ -64,11 +64,15 @@ fn main(
|
|
|
64
64
|
let texel_y = first.y + f32(y);
|
|
65
65
|
let overlap_y = min(texel_y + 1.0, lo.y + span) - max(texel_y, lo.y);
|
|
66
66
|
|
|
67
|
+
if (overlap_y <= 0.0) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
|
|
67
71
|
for (var x = 0u; x < 4u; x++) {
|
|
68
72
|
let texel_x = first.x + f32(x);
|
|
69
73
|
let overlap_x = min(texel_x + 1.0, lo.x + span) - max(texel_x, lo.x);
|
|
70
74
|
|
|
71
|
-
if (overlap_x <= 0.0
|
|
75
|
+
if (overlap_x <= 0.0) {
|
|
72
76
|
continue;
|
|
73
77
|
}
|
|
74
78
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUParticleSystem.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/particles/GPUParticleSystem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GPUParticleSystem.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/particles/GPUParticleSystem.js"],"names":[],"mappings":"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"}
|
|
@@ -68,13 +68,7 @@ const STORAGE_GROWABLE = GPUBufferUsage.STORAGE | GPUBufferUsage.COPY_DST | GPUB
|
|
|
68
68
|
*/
|
|
69
69
|
const INDIRECT = GPUBufferUsage.STORAGE | GPUBufferUsage.INDIRECT | GPUBufferUsage.COPY_SRC;
|
|
70
70
|
|
|
71
|
-
|
|
72
|
-
* Particles a scene holds at once unless the constructor is told otherwise — and the renderer never
|
|
73
|
-
* tells it ({@link ../Renderer.js Renderer#particles}), so this is every scene's pool. 2^17: about
|
|
74
|
-
* 18 MB of pool, free list, alive list and coherence scratch at a 128-byte record, which a game with
|
|
75
|
-
* dense bursts (a body dissolving into thousands of motes) fills before 65,536 does.
|
|
76
|
-
*/
|
|
77
|
-
const DEFAULT_CAPACITY = 131072;
|
|
71
|
+
const DEFAULT_CAPACITY = 65536;
|
|
78
72
|
|
|
79
73
|
/**
|
|
80
74
|
* What {@link GPUParticleSystem#read_stats} decodes: the counts the GPU keeps between frames, named.
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
2
|
+
* The exposure: the factor the tonemapper multiplies the scene's linear radiance by ahead of its curve, metered from
|
|
3
|
+
* the frame and adapted to it ({@link update}), or set by {@link exposure_compensation} alone ({@link unadapted}).
|
|
4
|
+
*
|
|
5
|
+
* The factor lives in one buffer for the manager's life, {@link multiplier}, which a frame's {@link update} or
|
|
6
|
+
* {@link unadapted} writes over. A pass recorded ahead of that write in the frame reads the factor the last frame was
|
|
7
|
+
* shown with: the exposure of the image on screen, Unreal Engine's `View.PreExposure`.
|
|
6
8
|
*/
|
|
7
9
|
export class GPUCameraExposureManager {
|
|
8
10
|
/**
|
|
@@ -37,6 +39,14 @@ export class GPUCameraExposureManager {
|
|
|
37
39
|
*/
|
|
38
40
|
exposure_compensation: number;
|
|
39
41
|
destroy(): void;
|
|
42
|
+
/**
|
|
43
|
+
* The factor, {@link F32_CONTAINER_STRUCT}, as the last {@link update} or {@link unadapted} wrote it. A frame
|
|
44
|
+
* imports it into its graph once, and hands the handle both to the passes that read it ahead of the exposure,
|
|
45
|
+
* which take the last frame's factor, and to {@link update} or {@link unadapted}, which write this frame's.
|
|
46
|
+
*
|
|
47
|
+
* @returns {GPUBuffer} usable as a uniform or read-only storage
|
|
48
|
+
*/
|
|
49
|
+
get multiplier(): GPUBuffer;
|
|
40
50
|
/**
|
|
41
51
|
* Offer the pipelines {@link update} meters and adapts with — see {@link PipelineEnquiry}.
|
|
42
52
|
* {@link unadapted} dispatches none.
|
|
@@ -45,26 +55,34 @@ export class GPUCameraExposureManager {
|
|
|
45
55
|
*/
|
|
46
56
|
enquirePipelines(enquiry: PipelineEnquiry): void;
|
|
47
57
|
/**
|
|
58
|
+
* This frame's factor from {@link exposure_compensation} alone: 2^compensation.
|
|
48
59
|
*
|
|
49
60
|
* @param {Object} options
|
|
50
61
|
* @param {FrameGraph} options.graph
|
|
51
|
-
* @
|
|
62
|
+
* @param {number} options.multiplier the graph handle of {@link multiplier}, imported into `graph`
|
|
63
|
+
* @return {number} the handle of {@link multiplier} with this frame's factor written
|
|
52
64
|
*/
|
|
53
|
-
unadapted({ graph, }: {
|
|
65
|
+
unadapted({ graph, multiplier, }: {
|
|
54
66
|
graph: FrameGraph;
|
|
67
|
+
multiplier: number;
|
|
55
68
|
}): number;
|
|
56
69
|
/**
|
|
70
|
+
* This frame's factor metered from `input_color`: the luminance adapted toward the frame's, from the last
|
|
71
|
+
* frame's, by the adaptation speeds; its factor is middle grey over it, times 2^{@link exposure_compensation}.
|
|
57
72
|
*
|
|
58
73
|
* @param {Object} options
|
|
59
74
|
* @param {FrameGraph} options.graph
|
|
60
75
|
* @param {number} options.input_color
|
|
76
|
+
* @param {number} options.multiplier the graph handle of {@link multiplier}, imported into `graph`
|
|
61
77
|
* @param {number} [options.time_delta_seconds]
|
|
78
|
+
* @return {number} the handle of {@link multiplier} with this frame's factor written
|
|
62
79
|
*/
|
|
63
|
-
update({ input_color, graph, time_delta_seconds, }: {
|
|
80
|
+
update({ input_color, graph, multiplier, time_delta_seconds, }: {
|
|
64
81
|
graph: FrameGraph;
|
|
65
82
|
input_color: number;
|
|
83
|
+
multiplier: number;
|
|
66
84
|
time_delta_seconds?: number;
|
|
67
|
-
}):
|
|
85
|
+
}): number;
|
|
68
86
|
#private;
|
|
69
87
|
}
|
|
70
88
|
export type PipelineEnquiry = import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUCameraExposureManager.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/eye/GPUCameraExposureManager.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GPUCameraExposureManager.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/eye/GPUCameraExposureManager.js"],"names":[],"mappings":"AAwBA;;;;;;;GAOG;AACH;IA0DI;;;OAGG;IACH,+BAyBC;IAtED;;;;OAIG;IACH,qBAFU,MAAM,CAEU;IAE1B;;;;OAIG;IACH,uBAFU,MAAM,CAEY;IAE5B;;;;;OAKG;IACH,yBAFU,MAAM,CAEc;IAE9B;;;;;OAKG;IACH,uBAFU,MAAM,CAEY;IA4C5B,gBAMC;IAED;;;;;;OAMG;IACH,4BAEC;IAED;;;;;OAKG;IACH,0BAFW,eAAe,QAMzB;IAED;;;;;;;OAOG;IACH;QAJ+B,KAAK;QACT,UAAU,EAA1B,MAAM;QACL,MAAM,CAejB;IAoBD;;;;;;;;;;OAUG;IACH;QAN+B,KAAK;QACT,WAAW,EAA3B,MAAM;QACU,UAAU,EAA1B,MAAM;QACW,kBAAkB,GAAnC,MAAM;QACL,MAAM,CAmDjB;;CA2EJ;8BA7TY,OAAO,6CAA6C,EAAE,eAAe"}
|