@woosh/meep-engine 3.78.0 → 3.78.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/CHANGELOG.md +21 -0
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/engine/graphics3/GraphicsEngine.d.ts +19 -1
- package/src/engine/graphics3/GraphicsEngine.d.ts.map +1 -1
- package/src/engine/graphics3/GraphicsEngine.js +24 -2
- package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/cloth_step.js +4 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts +36 -2
- package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +60 -3
- package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts +119 -0
- package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts.map +1 -0
- package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.js +563 -0
- package/src/generation/wfc/GRID_WFC_PIECE_SOCKET_PREFIX.d.ts +11 -0
- package/src/generation/wfc/GRID_WFC_PIECE_SOCKET_PREFIX.d.ts.map +1 -0
- package/src/generation/wfc/GRID_WFC_PIECE_SOCKET_PREFIX.js +10 -0
- package/src/generation/wfc/GridWFCCompiledTileSet.d.ts +123 -0
- package/src/generation/wfc/GridWFCCompiledTileSet.d.ts.map +1 -0
- package/src/generation/wfc/GridWFCCompiledTileSet.js +355 -0
- package/src/generation/wfc/GridWFCEdge.d.ts +13 -0
- package/src/generation/wfc/GridWFCEdge.d.ts.map +1 -0
- package/src/generation/wfc/GridWFCEdge.js +14 -0
- package/src/generation/wfc/GridWFCTileSet.d.ts +120 -0
- package/src/generation/wfc/GridWFCTileSet.d.ts.map +1 -0
- package/src/generation/wfc/GridWFCTileSet.js +275 -0
- package/src/shade/device/pipeline/ComputePipelineManager.d.ts +8 -0
- package/src/shade/device/pipeline/ComputePipelineManager.d.ts.map +1 -1
- package/src/shade/device/pipeline/ComputePipelineManager.js +18 -0
- package/src/shade/device/pipeline/RenderPipelineManager.d.ts +8 -0
- package/src/shade/device/pipeline/RenderPipelineManager.d.ts.map +1 -1
- package/src/shade/device/pipeline/RenderPipelineManager.js +17 -0
- package/src/shade/playground/avboit_footprint/index.html +20 -0
- package/src/shade/playground/avboit_footprint/main.d.ts +2 -0
- package/src/shade/playground/avboit_footprint/main.d.ts.map +1 -0
- package/src/shade/playground/avboit_footprint/main.js +428 -0
- package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
- package/src/shade/playground/probe_clipmap/main.js +7 -3
- package/src/shade/playground/screen_probes/main.d.ts.map +1 -1
- package/src/shade/playground/screen_probes/main.js +7 -3
- package/src/shade/renderer/Renderer.d.ts +18 -8
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +201 -16
- package/src/shade/renderer/RendererConfiguration.d.ts +95 -0
- package/src/shade/renderer/RendererConfiguration.d.ts.map +1 -0
- package/src/shade/renderer/RendererConfiguration.js +119 -0
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +8 -0
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +34 -0
- package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts +7 -0
- package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.js +15 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +10 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +37 -3
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +6 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +31 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +7 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +20 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts +8 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.js +14 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts +7 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.js +13 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts +6 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.js +9 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +11 -0
- 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 +71 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts +6 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.js +9 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts +6 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.js +9 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts +6 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.js +13 -0
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +9 -0
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +47 -0
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +6 -0
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +17 -0
- package/src/shade/renderer/hair/GPUHairSystem.d.ts.map +1 -1
- package/src/shade/renderer/hair/GPUHairSystem.js +28 -9
- package/src/shade/renderer/hair/HAIR_SIMULATION.d.ts +50 -9
- package/src/shade/renderer/hair/HAIR_SIMULATION.d.ts.map +1 -1
- package/src/shade/renderer/hair/HAIR_SIMULATION.js +71 -11
- package/src/shade/renderer/hair/shader_hair_simulate.d.ts +22 -16
- package/src/shade/renderer/hair/shader_hair_simulate.d.ts.map +1 -1
- package/src/shade/renderer/hair/shader_hair_simulate.js +151 -78
- package/src/shade/renderer/particles/GPUParticleSystem.d.ts +8 -0
- package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
- package/src/shade/renderer/particles/GPUParticleSystem.js +20 -1
- package/src/shade/renderer/particles/bounds/graph_particle_bounds.d.ts +6 -0
- package/src/shade/renderer/particles/bounds/graph_particle_bounds.d.ts.map +1 -1
- package/src/shade/renderer/particles/bounds/graph_particle_bounds.js +11 -1
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +6 -0
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
- package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +15 -0
- package/src/shade/renderer/particles/graph_particles.d.ts +8 -0
- package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph_particles.js +28 -3
- package/src/shade/renderer/particles/graph_particles_avboit.d.ts +7 -0
- package/src/shade/renderer/particles/graph_particles_avboit.d.ts.map +1 -1
- package/src/shade/renderer/particles/graph_particles_avboit.js +14 -0
- package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.d.ts.map +1 -1
- package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.js +5 -7
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts +7 -0
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
- package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +15 -0
- package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts +6 -0
- package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.js +16 -2
- package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.d.ts +6 -0
- package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.js +9 -0
- package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.d.ts +11 -0
- package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.js +10 -0
- package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts +6 -0
- package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.js +10 -1
- package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts +7 -0
- package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.js +21 -0
- package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.d.ts +7 -0
- package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.js +11 -1
- package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.d.ts +9 -0
- package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.js +29 -0
- package/src/shade/renderer/postprocess/motion_blur/MotionBlur.d.ts +6 -0
- package/src/shade/renderer/postprocess/motion_blur/MotionBlur.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/motion_blur/MotionBlur.js +13 -1
- package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.d.ts +6 -0
- package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.js +11 -0
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +9 -0
- package/src/shade/renderer/postprocess/nss/NSS.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/nss/NSS.js +33 -18
- package/src/shade/renderer/postprocess/ssr/SSR.d.ts +8 -0
- package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/SSR.js +42 -2
- package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.d.ts +6 -0
- package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.js +10 -0
- package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.d.ts +6 -0
- package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.js +11 -0
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts +8 -0
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +27 -3
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.d.ts +6 -0
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.js +10 -0
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +5 -4
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +5 -4
- package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.d.ts +3 -3
- package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.js +3 -3
- package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js +5 -7
- package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.js +5 -7
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.d.ts +34 -0
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.d.ts.map +1 -0
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.js +42 -0
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.d.ts +5 -4
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.js +8 -7
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.d.ts +2 -2
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.js +4 -5
- package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts +9 -0
- package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +18 -0
- package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts +9 -0
- package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.js +15 -0
- package/src/shade/renderer/restir/di/ReSTIRDI.d.ts +6 -0
- package/src/shade/renderer/restir/di/ReSTIRDI.d.ts.map +1 -1
- package/src/shade/renderer/restir/di/ReSTIRDI.js +10 -1
- package/src/shade/renderer/restir/di/graph_restir_di.d.ts +9 -0
- package/src/shade/renderer/restir/di/graph_restir_di.d.ts.map +1 -1
- package/src/shade/renderer/restir/di/graph_restir_di.js +19 -1
- package/src/shade/renderer/restir/di/graph_restir_di_denoise.d.ts +6 -0
- package/src/shade/renderer/restir/di/graph_restir_di_denoise.d.ts.map +1 -1
- package/src/shade/renderer/restir/di/graph_restir_di_denoise.js +9 -0
- package/src/shade/renderer/scene/movers/graph_scene_movers.d.ts +7 -0
- package/src/shade/renderer/scene/movers/graph_scene_movers.d.ts.map +1 -1
- package/src/shade/renderer/scene/movers/graph_scene_movers.js +11 -0
- package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts +10 -0
- package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts.map +1 -1
- package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +25 -1
- package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.d.ts +7 -0
- package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.d.ts.map +1 -1
- package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.js +14 -0
- package/src/shade/renderer/text/shaders/shader_text_avboit.d.ts.map +1 -1
- package/src/shade/renderer/text/shaders/shader_text_avboit.js +5 -7
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts +9 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +16 -1
- package/src/shade/renderer/water/shader_water_avboit.d.ts.map +1 -1
- package/src/shade/renderer/water/shader_water_avboit.js +16 -13
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.d.ts +0 -33
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.d.ts.map +0 -1
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.js +0 -45
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUScreenProbeGI.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js"],"names":[],"mappings":"AAqEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;
|
|
1
|
+
{"version":3,"file":"GPUScreenProbeGI.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js"],"names":[],"mappings":"AAqEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;IA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
|
97
97
|
|
|
98
|
+
/**
|
|
99
|
+
* Offer the pipelines a frame of the screen probes dispatches under `settings` — see {@link PipelineEnquiry}:
|
|
100
|
+
* their placement, rays, gather and resolve. The world they trace is the probe clipmap's to offer, the pass that
|
|
101
|
+
* lights the frame from them the renderer's, and the debug views are left to the frame that first shows one.
|
|
102
|
+
*
|
|
103
|
+
* @param {import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
|
|
104
|
+
* @param {ScreenProbeSettings} settings the renderer's, as {@link graph_update} will be given them
|
|
105
|
+
*/
|
|
106
|
+
enquirePipelines(enquiry, settings) {
|
|
107
|
+
assert.defined(settings, 'settings');
|
|
108
|
+
|
|
109
|
+
const compute = enquiry.compute;
|
|
110
|
+
|
|
111
|
+
compute.push(shader_screen_probe_place_uniform.pipeline);
|
|
112
|
+
|
|
113
|
+
if (screen_probe_adaptive_levels(settings.downsample_factor, settings.adaptive_min_downsample_factor) > 0) {
|
|
114
|
+
compute.push(shader_screen_probe_place_adaptive.pipeline);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
compute.push(shader_screen_probe_command.pipeline);
|
|
118
|
+
compute.push(shader_screen_probe_pick.pipeline);
|
|
119
|
+
compute.push(shader_screen_probe_brdf_pdf.pipeline);
|
|
120
|
+
|
|
121
|
+
if (settings.importance_sampling) {
|
|
122
|
+
compute.push(shader_screen_probe_lighting_pdf.pipeline);
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
compute.push(shader_screen_probe_generate_rays.pipeline);
|
|
126
|
+
compute.push(shader_screen_probe_trace_screen.pipeline);
|
|
127
|
+
compute.push(shader_screen_probe_brick_command.pipeline);
|
|
128
|
+
compute.push(shader_screen_probe_brick_trace.pipeline);
|
|
129
|
+
compute.push(shader_screen_probe_brick_shade.pipeline);
|
|
130
|
+
compute.push(shader_screen_probe_brick_light.pipeline);
|
|
131
|
+
compute.push(shader_screen_probe_brick_bounce.pipeline);
|
|
132
|
+
compute.push(shader_screen_probe_brick_want.pipeline);
|
|
133
|
+
compute.push(shader_screen_probe_composite.pipeline);
|
|
134
|
+
|
|
135
|
+
if (settings.spatial_filter_passes > 0) {
|
|
136
|
+
compute.push(shader_screen_probe_filter.pipeline);
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
compute.push(shader_screen_probe_irradiance.pipeline);
|
|
140
|
+
compute.push(shader_screen_probe_integrate.pipeline);
|
|
141
|
+
compute.push(shader_screen_probe_temporal.pipeline);
|
|
142
|
+
compute.push(shader_screen_probe_color_capture.pipeline);
|
|
143
|
+
}
|
|
144
|
+
|
|
98
145
|
#destroyed = false;
|
|
99
146
|
|
|
100
147
|
/** The structure the resources were made for. */
|
|
@@ -117,6 +117,12 @@ export class ScreenProbeSettings {
|
|
|
117
117
|
* @returns {ScreenProbeDebugView}
|
|
118
118
|
*/
|
|
119
119
|
get debug_view(): number;
|
|
120
|
+
/**
|
|
121
|
+
* Take every field's value from `other`, which is left as it was. The two share nothing afterwards.
|
|
122
|
+
*
|
|
123
|
+
* @param {ScreenProbeSettings} other
|
|
124
|
+
*/
|
|
125
|
+
copy(other: ScreenProbeSettings): void;
|
|
120
126
|
#private;
|
|
121
127
|
}
|
|
122
128
|
//# sourceMappingURL=ScreenProbeSettings.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ScreenProbeSettings.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AACH;IAgBI;;OAEG;IACH,iCAKC;IApBD;;;;;;;OAOG;IACH,gCAEC;IAyBD;;;OAGG;IACH,qCAKC;IApBD;;;;;;OAMG;IACH,oCAEC;IA0BD;;OAEG;IACH,8CAKC;IAnBD;;;;;;OAMG;IACH,6CAEC;IAyBD;;OAEG;IACH,oCAIC;IAlBD;;;;;;OAMG;IACH,mCAEC;IAuBD;;OAEG;IACH,8BAIC;IAjBD;;;;;OAKG;IACH,6BAEC;IAwBD;;OAEG;IACH,+BAIC;IAlBD;;;;;;OAMG;IACH,8BAEC;IAuBD;;OAEG;IACH,qCAIC;IAjBD;;;;;OAKG;IACH,oCAEC;IAuBD;;OAEG;IACH,+BAKC;IAlBD;;;;;OAKG;IACH,8BAEC;IAuBD;;OAEG;IACH,0BAIC;IAhBD;;;;OAIG;IACH,yBAEC;;
|
|
1
|
+
{"version":3,"file":"ScreenProbeSettings.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AACH;IAgBI;;OAEG;IACH,iCAKC;IApBD;;;;;;;OAOG;IACH,gCAEC;IAyBD;;;OAGG;IACH,qCAKC;IApBD;;;;;;OAMG;IACH,oCAEC;IA0BD;;OAEG;IACH,8CAKC;IAnBD;;;;;;OAMG;IACH,6CAEC;IAyBD;;OAEG;IACH,oCAIC;IAlBD;;;;;;OAMG;IACH,mCAEC;IAuBD;;OAEG;IACH,8BAIC;IAjBD;;;;;OAKG;IACH,6BAEC;IAwBD;;OAEG;IACH,+BAIC;IAlBD;;;;;;OAMG;IACH,8BAEC;IAuBD;;OAEG;IACH,qCAIC;IAjBD;;;;;OAKG;IACH,oCAEC;IAuBD;;OAEG;IACH,+BAKC;IAlBD;;;;;OAKG;IACH,8BAEC;IAuBD;;OAEG;IACH,0BAIC;IAhBD;;;;OAIG;IACH,yBAEC;IAWD;;;;OAIG;IACH,YAFW,mBAAmB,QAY7B;;CACJ"}
|
|
@@ -216,4 +216,21 @@ export class ScreenProbeSettings {
|
|
|
216
216
|
|
|
217
217
|
this.#debug_view = v;
|
|
218
218
|
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Take every field's value from `other`, which is left as it was. The two share nothing afterwards.
|
|
222
|
+
*
|
|
223
|
+
* @param {ScreenProbeSettings} other
|
|
224
|
+
*/
|
|
225
|
+
copy(other) {
|
|
226
|
+
this.#downsample_factor = other.downsample_factor;
|
|
227
|
+
this.#octahedron_resolution = other.octahedron_resolution;
|
|
228
|
+
this.#adaptive_min_downsample_factor = other.adaptive_min_downsample_factor;
|
|
229
|
+
this.#importance_sampling = other.importance_sampling;
|
|
230
|
+
this.#screen_traces = other.screen_traces;
|
|
231
|
+
this.#rough_specular = other.rough_specular;
|
|
232
|
+
this.#spatial_filter_passes = other.spatial_filter_passes;
|
|
233
|
+
this.#temporal_frames = other.temporal_frames;
|
|
234
|
+
this.#debug_view = other.debug_view;
|
|
235
|
+
}
|
|
219
236
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUHairSystem.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/GPUHairSystem.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GPUHairSystem.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/GPUHairSystem.js"],"names":[],"mappings":"AAuIA;;;;GAIG;AACH,+BAFU,MAAM,CAEkB;AAElC;;;GAGG;AACH,wCAFU,MAAM,CAE6B;AAc7C;;GAEG;AACH;IACI,6CAA6C;IAC7C,SADW,MAAM,CACH;IAEd,kEAAkE;IAClE,SADW,MAAM,CACL;IAEZ,mDAAmD;IACnD,KADW,YAAY,CACW;IAElC,oDAAoD;IACpD,WADW,MAAM,CACD;IAEhB;;OAEG;IACH,YAFW,YAAY,QAOtB;IAED;;;OAGG;IACH,cAHW,YAAY,GACV,OAAO,CASnB;CACJ;AAED;;;GAGG;AACH;IACI,gCAAgC;IAChC,SADW,MAAM,CACL;IAEZ,gCAAgC;IAChC,mBADW,MAAM,CACM;IAEvB,+CAA+C;IAC/C,oBADW,MAAM,CACQ;IAEzB,gCAAgC;IAChC,kBADW,MAAM,CACK;IAEtB,qBAAqB;IACrB,UADW,MAAM,CACF;IAEf,4BAA4B;IAC5B,WADW,MAAM,CACH;IAEd;;OAEG;IACH,YAFW,oBAAoB,QAS9B;IAED;;;OAGG;IACH,cAHW,oB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_FRAME_STEPS_BLEND,
|
|
61
|
+
HAIR_FRAME_STEPS_COUNT,
|
|
62
|
+
HAIR_FRAME_STEPS_FIRST,
|
|
63
|
+
HAIR_FRAME_STEPS_OWED,
|
|
64
|
+
HAIR_FRAME_STEPS_STRIDE,
|
|
60
65
|
HAIR_ROOT_FRAME_VECTORS,
|
|
61
66
|
HAIR_GUIDE_BOUNDS_WORDS,
|
|
62
67
|
HAIR_GUIDE_RECORD_WORDS,
|
|
63
68
|
HAIR_STATE_HEADER,
|
|
64
69
|
HAIR_STATE_NONE,
|
|
65
70
|
HAIR_STATE_PLANES,
|
|
66
|
-
|
|
71
|
+
HAIR_STEP
|
|
67
72
|
} from "./HAIR_SIMULATION.js";
|
|
68
73
|
import { HAIR_EPOCH_MASK } from "./chunk_hair_guide.js";
|
|
69
74
|
import {
|
|
@@ -464,9 +469,15 @@ export class GPUHairSystem {
|
|
|
464
469
|
/** @type {number} entities whose hair is simulated */
|
|
465
470
|
#simulated = 0;
|
|
466
471
|
|
|
467
|
-
/** @type {number} seconds the scene's clock moved
|
|
472
|
+
/** @type {number} seconds the scene's clock moved since the guides' frame was last recorded */
|
|
468
473
|
#pending_time = 0;
|
|
469
474
|
|
|
475
|
+
/** @type {number} seconds the frames recorded have run past the guides' last step, less than a step */
|
|
476
|
+
#owed_time = 0;
|
|
477
|
+
|
|
478
|
+
/** @type {Float64Array} how the frame's time is cut into steps (`hair_frame_steps`) */
|
|
479
|
+
#frame_steps = new Float64Array(5);
|
|
480
|
+
|
|
470
481
|
/** @type {number} the scene context's frame the guides were last stepped in, -1 for none */
|
|
471
482
|
#simulated_frame = -1;
|
|
472
483
|
|
|
@@ -1923,8 +1934,9 @@ export class GPUHairSystem {
|
|
|
1923
1934
|
/**
|
|
1924
1935
|
* Step the guides of every simulated instance through the time the scene's clock moved, once a frame: the first
|
|
1925
1936
|
* view to draw hair records it, the begin pass, the colliders' poses and the solver (`shader_hair_simulate.js`).
|
|
1926
|
-
*
|
|
1927
|
-
* `
|
|
1937
|
+
* The time is stepped through in whole steps of `HAIR_STEP`, what is left of it owed to the next frame
|
|
1938
|
+
* (`hair_frame_steps`); a frame that takes no step still lays new states at rest, follows the anchors and draws
|
|
1939
|
+
* the guides between their last two steps.
|
|
1928
1940
|
*
|
|
1929
1941
|
* @param {import("../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} graph
|
|
1930
1942
|
* @param {Object} scene the view's scene context
|
|
@@ -1958,9 +1970,12 @@ export class GPUHairSystem {
|
|
|
1958
1970
|
return { state, bounds };
|
|
1959
1971
|
}
|
|
1960
1972
|
|
|
1961
|
-
const seconds =
|
|
1962
|
-
const
|
|
1973
|
+
const seconds = this.#pending_time;
|
|
1974
|
+
const steps = this.#frame_steps;
|
|
1975
|
+
|
|
1976
|
+
hair_frame_steps(steps, this.#owed_time, seconds);
|
|
1963
1977
|
|
|
1978
|
+
this.#owed_time = steps[HAIR_FRAME_STEPS_OWED];
|
|
1964
1979
|
this.#pending_time = 0;
|
|
1965
1980
|
this.#simulated_frame = scene.frame;
|
|
1966
1981
|
|
|
@@ -2043,8 +2058,12 @@ export class GPUHairSystem {
|
|
|
2043
2058
|
hair_guide_bounds: current.bounds,
|
|
2044
2059
|
settings: {
|
|
2045
2060
|
gravity: this.gravity,
|
|
2046
|
-
step:
|
|
2047
|
-
|
|
2061
|
+
step: HAIR_STEP,
|
|
2062
|
+
steps: steps[HAIR_FRAME_STEPS_COUNT],
|
|
2063
|
+
first: steps[HAIR_FRAME_STEPS_FIRST],
|
|
2064
|
+
stride: steps[HAIR_FRAME_STEPS_STRIDE],
|
|
2065
|
+
blend: steps[HAIR_FRAME_STEPS_BLEND],
|
|
2066
|
+
seconds,
|
|
2048
2067
|
},
|
|
2049
2068
|
};
|
|
2050
2069
|
|
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* How a frame's time is cut into the solver's steps. The time not yet stepped through, `owed` from the frames
|
|
3
|
+
* before and this frame's `seconds` (at most {@link HAIR_FRAME_STEP_MAX} of them), is stepped through in whole
|
|
4
|
+
* steps of {@link HAIR_STEP}; what is left is owed to the next frame. A step falls at a time within the frame, and
|
|
5
|
+
* reads the world there: the share of the frame's motion, from a frame ago at 0 to now at 1, is `first` for the
|
|
6
|
+
* frame's first step and `stride` more for each after it. The drawn state is `blend` of the way from the step
|
|
7
|
+
* before the last to the last: a step behind the scene's clock, always.
|
|
8
|
+
*
|
|
9
|
+
* @param {Float64Array|number[]} result written: the `HAIR_FRAME_STEPS_*` words
|
|
10
|
+
* @param {number} owed seconds the frames before ran past their last step, in `[0, HAIR_STEP)`
|
|
11
|
+
* @param {number} seconds the scene's clock moved this frame
|
|
12
|
+
*/
|
|
13
|
+
export function hair_frame_steps(result: Float64Array | number[], owed: number, seconds: number): void;
|
|
1
14
|
/**
|
|
2
15
|
* The rate a node's velocity relaxes toward the air's by drag, per second: the drag of the wisp its guide stands for,
|
|
3
16
|
* a cylinder of diameter `diameter` across the flow at relative speed `speed`, over the wisp's mass a unit length,
|
|
@@ -24,19 +37,31 @@ export function hair_drag_rate(speed: number, diameter: number, mass_per_length:
|
|
|
24
37
|
* for `P` nodes a guide and `G` guides, so the threads of neighbouring guides read neighbouring vectors.
|
|
25
38
|
*
|
|
26
39
|
* Positions are metres from the instance's **anchor**, its entity's translation this frame, along the world's axes:
|
|
27
|
-
* near zero wherever the entity is, so a
|
|
40
|
+
* near zero wherever the entity is, so a step's small moves keep their precision far from the world's origin.
|
|
41
|
+
*
|
|
42
|
+
* The guides are solved in steps of {@link HAIR_STEP}, whatever the frames' lengths ({@link hair_frame_steps}), and
|
|
43
|
+
* drawn between the last two steps: what the strands read is the **drawn** state, the solver's own is the **solved**
|
|
44
|
+
* one. The drawn state is blended in the frame of the guide's root (the entity's, or its strand's root frame on a bound
|
|
45
|
+
* mesh), from the step before the last to the last by the share of a step the frames have run past the last, and
|
|
46
|
+
* carried by the root's frame now: a guide's drawn root is its root this frame, and a root that turns or moves between
|
|
47
|
+
* steps carries its guide rigidly.
|
|
28
48
|
*
|
|
29
49
|
* ```
|
|
30
50
|
* header 0 the anchor, world metres; w: the epoch the state was made for, u32 bits
|
|
31
|
-
* 1 the anchor's move since the
|
|
51
|
+
* 1 the anchor's move since the frame before; w: 1 when the state is to be laid at rest
|
|
32
52
|
* 2..4 the entity's world matrix now, its columns' x, y and z, translation dropped
|
|
33
53
|
* 5..7 the same a frame ago
|
|
34
54
|
* 8 where the entity's origin was a frame ago, from the anchor
|
|
35
|
-
* plane 0 a node's position
|
|
36
|
-
* 1 its velocity, metres a second
|
|
37
|
-
* 2 its frame: the rotation, a unit quaternion, from its rest frame carried by the entity to where it is
|
|
38
|
-
* 3 its position a frame ago, from this frame's anchor
|
|
39
|
-
* 4 its frame a frame ago
|
|
55
|
+
* plane 0 a node's drawn position
|
|
56
|
+
* 1 its solved velocity, metres a second, at the last step
|
|
57
|
+
* 2 its drawn frame: the rotation, a unit quaternion, from its rest frame carried by the entity to where it is
|
|
58
|
+
* 3 its drawn position a frame ago, from this frame's anchor
|
|
59
|
+
* 4 its drawn frame a frame ago
|
|
60
|
+
* 5 its solved position at the last step
|
|
61
|
+
* 6 its solved rotation at the last step, a unit quaternion: from the groom's rest space to the world, scale
|
|
62
|
+
* left out. The root node's is its root frame's.
|
|
63
|
+
* 7 its solved position a step before the last: from its guide's root, along the root frame's axes
|
|
64
|
+
* 8 its solved rotation a step before the last, in the root frame's axes
|
|
40
65
|
* ```
|
|
41
66
|
*/
|
|
42
67
|
/**
|
|
@@ -70,6 +95,10 @@ export const HAIR_STATE_VELOCITY: 1;
|
|
|
70
95
|
export const HAIR_STATE_FRAME: 2;
|
|
71
96
|
export const HAIR_STATE_LAST_POSITION: 3;
|
|
72
97
|
export const HAIR_STATE_LAST_FRAME: 4;
|
|
98
|
+
export const HAIR_STATE_SOLVED_POSITION: 5;
|
|
99
|
+
export const HAIR_STATE_SOLVED_ROTATION: 6;
|
|
100
|
+
export const HAIR_STATE_PREVIOUS_POSITION: 7;
|
|
101
|
+
export const HAIR_STATE_PREVIOUS_ROTATION: 8;
|
|
73
102
|
/**
|
|
74
103
|
* Words of a guide's record in the groom pool: its strand's rank, its wisp's strand count, its wisp's diameter and
|
|
75
104
|
* its length (f32 bits each, groom metres).
|
|
@@ -77,10 +106,21 @@ export const HAIR_STATE_LAST_FRAME: 4;
|
|
|
77
106
|
*/
|
|
78
107
|
export const HAIR_GUIDE_RECORD_WORDS: number;
|
|
79
108
|
/**
|
|
80
|
-
* The
|
|
109
|
+
* The solver's step, seconds: every step is this long, whatever the frames' lengths, so the hair's pose and its
|
|
110
|
+
* stability do not follow the frame rate.
|
|
81
111
|
* @type {number}
|
|
82
112
|
*/
|
|
83
|
-
export const
|
|
113
|
+
export const HAIR_STEP: number;
|
|
114
|
+
/** Steps the solver takes this frame, in {@link hair_frame_steps}' result. */
|
|
115
|
+
export const HAIR_FRAME_STEPS_COUNT: 0;
|
|
116
|
+
/** Seconds the frames have run past the last step, less than {@link HAIR_STEP}, in {@link hair_frame_steps}' result. */
|
|
117
|
+
export const HAIR_FRAME_STEPS_OWED: 1;
|
|
118
|
+
/** The share of the frame's motion the first step falls at, in {@link hair_frame_steps}' result. */
|
|
119
|
+
export const HAIR_FRAME_STEPS_FIRST: 2;
|
|
120
|
+
/** The share of the frame's motion from a step to the next, in {@link hair_frame_steps}' result. */
|
|
121
|
+
export const HAIR_FRAME_STEPS_STRIDE: 3;
|
|
122
|
+
/** How far the drawn state is from the step before the last, 0, to the last, 1, in {@link hair_frame_steps}' result. */
|
|
123
|
+
export const HAIR_FRAME_STEPS_BLEND: 4;
|
|
84
124
|
/**
|
|
85
125
|
* The longest frame the simulation steps, seconds, as the animation clamps its own: a stall slows the hair rather
|
|
86
126
|
* than throwing it.
|
|
@@ -124,6 +164,7 @@ export const HAIR_COLLIDER_LIMIT: number;
|
|
|
124
164
|
* 8 .. 11 from the world to its own frame, as the pose pass writes it: the rotation, a unit quaternion
|
|
125
165
|
* 12 .. 14 the translation after it
|
|
126
166
|
* 15 the scale after that: distances in its frame are the world's times it
|
|
167
|
+
* 16 .. 23 the same a frame ago
|
|
127
168
|
* ```
|
|
128
169
|
*
|
|
129
170
|
* @type {number}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HAIR_SIMULATION.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/HAIR_SIMULATION.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HAIR_SIMULATION.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/HAIR_SIMULATION.js"],"names":[],"mappings":"AA+GA;;;;;;;;;;;GAWG;AACH,yCAJW,YAAY,GAAC,MAAM,EAAE,QACrB,MAAM,WACN,MAAM,QAehB;AAkED;;;;;;;;;;;GAWG;AACH,sCALW,MAAM,YACN,MAAM,mBACN,MAAM,GACJ,MAAM,CAOlB;AA3ND;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AAEH;;;GAGG;AACH,8BAFU,MAAM,CAE0B;AAE1C;;;GAGG;AACH,gCAFU,MAAM,CAE4B;AAE5C;;;;GAIG;AACH,sCAFU,MAAM,CAEyB;AAEzC;;;GAGG;AACH,gCAFU,MAAM,CAEmB;AAEnC;;;GAGG;AACH,gCAFU,MAAM,CAEmB;AAEnC,oCAAqC;AACrC,oCAAqC;AACrC,iCAAkC;AAClC,yCAA0C;AAC1C,sCAAuC;AACvC,2CAA4C;AAC5C,2CAA4C;AAC5C,6CAA8C;AAC9C,6CAA8C;AAE9C;;;;GAIG;AACH,sCAFU,MAAM,CAEyB;AAEzC;;;;GAIG;AACH,wBAFU,MAAM,CAEgB;AAEhC,8EAA8E;AAC9E,uCAAwC;AAExC,wHAAwH;AACxH,sCAAuC;AAEvC,oGAAoG;AACpG,uCAAwC;AAExC,oGAAoG;AACpG,wCAAyC;AAEzC,wHAAwH;AACxH,uCAAwC;AA6BxC;;;;GAIG;AACH,kCAFU,MAAM,CAE0B;AAE1C;;;GAGG;AACH,+BAFU,MAAM,CAEsB;AAEtC;;;GAGG;AACH,iCAFU,MAAM,CAE0B;AAE1C;;;GAGG;AACH,iCAFU,MAAM,CAEuB;AAEvC;;;;GAIG;AACH,6CAFU,MAAM,CAEkC;AAElD;;;GAGG;AACH,kCAFU,MAAM,CAEsB;AAEtC;;;;;;;;;;;;;;;GAeG;AACH,kCAFU,MAAM,CAEsB;AAEtC;;;;;GAKG;AACH,sCAFU,MAAM,CAEyB"}
|
|
@@ -11,19 +11,31 @@
|
|
|
11
11
|
* for `P` nodes a guide and `G` guides, so the threads of neighbouring guides read neighbouring vectors.
|
|
12
12
|
*
|
|
13
13
|
* Positions are metres from the instance's **anchor**, its entity's translation this frame, along the world's axes:
|
|
14
|
-
* near zero wherever the entity is, so a
|
|
14
|
+
* near zero wherever the entity is, so a step's small moves keep their precision far from the world's origin.
|
|
15
|
+
*
|
|
16
|
+
* The guides are solved in steps of {@link HAIR_STEP}, whatever the frames' lengths ({@link hair_frame_steps}), and
|
|
17
|
+
* drawn between the last two steps: what the strands read is the **drawn** state, the solver's own is the **solved**
|
|
18
|
+
* one. The drawn state is blended in the frame of the guide's root (the entity's, or its strand's root frame on a bound
|
|
19
|
+
* mesh), from the step before the last to the last by the share of a step the frames have run past the last, and
|
|
20
|
+
* carried by the root's frame now: a guide's drawn root is its root this frame, and a root that turns or moves between
|
|
21
|
+
* steps carries its guide rigidly.
|
|
15
22
|
*
|
|
16
23
|
* ```
|
|
17
24
|
* header 0 the anchor, world metres; w: the epoch the state was made for, u32 bits
|
|
18
|
-
* 1 the anchor's move since the
|
|
25
|
+
* 1 the anchor's move since the frame before; w: 1 when the state is to be laid at rest
|
|
19
26
|
* 2..4 the entity's world matrix now, its columns' x, y and z, translation dropped
|
|
20
27
|
* 5..7 the same a frame ago
|
|
21
28
|
* 8 where the entity's origin was a frame ago, from the anchor
|
|
22
|
-
* plane 0 a node's position
|
|
23
|
-
* 1 its velocity, metres a second
|
|
24
|
-
* 2 its frame: the rotation, a unit quaternion, from its rest frame carried by the entity to where it is
|
|
25
|
-
* 3 its position a frame ago, from this frame's anchor
|
|
26
|
-
* 4 its frame a frame ago
|
|
29
|
+
* plane 0 a node's drawn position
|
|
30
|
+
* 1 its solved velocity, metres a second, at the last step
|
|
31
|
+
* 2 its drawn frame: the rotation, a unit quaternion, from its rest frame carried by the entity to where it is
|
|
32
|
+
* 3 its drawn position a frame ago, from this frame's anchor
|
|
33
|
+
* 4 its drawn frame a frame ago
|
|
34
|
+
* 5 its solved position at the last step
|
|
35
|
+
* 6 its solved rotation at the last step, a unit quaternion: from the groom's rest space to the world, scale
|
|
36
|
+
* left out. The root node's is its root frame's.
|
|
37
|
+
* 7 its solved position a step before the last: from its guide's root, along the root frame's axes
|
|
38
|
+
* 8 its solved rotation a step before the last, in the root frame's axes
|
|
27
39
|
* ```
|
|
28
40
|
*/
|
|
29
41
|
|
|
@@ -56,13 +68,17 @@ export const HAIR_STATE_HEADER = 9;
|
|
|
56
68
|
* Planes of a guide state, a vector a node each.
|
|
57
69
|
* @type {number}
|
|
58
70
|
*/
|
|
59
|
-
export const HAIR_STATE_PLANES =
|
|
71
|
+
export const HAIR_STATE_PLANES = 9;
|
|
60
72
|
|
|
61
73
|
export const HAIR_STATE_POSITION = 0;
|
|
62
74
|
export const HAIR_STATE_VELOCITY = 1;
|
|
63
75
|
export const HAIR_STATE_FRAME = 2;
|
|
64
76
|
export const HAIR_STATE_LAST_POSITION = 3;
|
|
65
77
|
export const HAIR_STATE_LAST_FRAME = 4;
|
|
78
|
+
export const HAIR_STATE_SOLVED_POSITION = 5;
|
|
79
|
+
export const HAIR_STATE_SOLVED_ROTATION = 6;
|
|
80
|
+
export const HAIR_STATE_PREVIOUS_POSITION = 7;
|
|
81
|
+
export const HAIR_STATE_PREVIOUS_ROTATION = 8;
|
|
66
82
|
|
|
67
83
|
/**
|
|
68
84
|
* Words of a guide's record in the groom pool: its strand's rank, its wisp's strand count, its wisp's diameter and
|
|
@@ -72,10 +88,53 @@ export const HAIR_STATE_LAST_FRAME = 4;
|
|
|
72
88
|
export const HAIR_GUIDE_RECORD_WORDS = 4;
|
|
73
89
|
|
|
74
90
|
/**
|
|
75
|
-
* The
|
|
91
|
+
* The solver's step, seconds: every step is this long, whatever the frames' lengths, so the hair's pose and its
|
|
92
|
+
* stability do not follow the frame rate.
|
|
76
93
|
* @type {number}
|
|
77
94
|
*/
|
|
78
|
-
export const
|
|
95
|
+
export const HAIR_STEP = 1 / 60;
|
|
96
|
+
|
|
97
|
+
/** Steps the solver takes this frame, in {@link hair_frame_steps}' result. */
|
|
98
|
+
export const HAIR_FRAME_STEPS_COUNT = 0;
|
|
99
|
+
|
|
100
|
+
/** Seconds the frames have run past the last step, less than {@link HAIR_STEP}, in {@link hair_frame_steps}' result. */
|
|
101
|
+
export const HAIR_FRAME_STEPS_OWED = 1;
|
|
102
|
+
|
|
103
|
+
/** The share of the frame's motion the first step falls at, in {@link hair_frame_steps}' result. */
|
|
104
|
+
export const HAIR_FRAME_STEPS_FIRST = 2;
|
|
105
|
+
|
|
106
|
+
/** The share of the frame's motion from a step to the next, in {@link hair_frame_steps}' result. */
|
|
107
|
+
export const HAIR_FRAME_STEPS_STRIDE = 3;
|
|
108
|
+
|
|
109
|
+
/** How far the drawn state is from the step before the last, 0, to the last, 1, in {@link hair_frame_steps}' result. */
|
|
110
|
+
export const HAIR_FRAME_STEPS_BLEND = 4;
|
|
111
|
+
|
|
112
|
+
/**
|
|
113
|
+
* How a frame's time is cut into the solver's steps. The time not yet stepped through, `owed` from the frames
|
|
114
|
+
* before and this frame's `seconds` (at most {@link HAIR_FRAME_STEP_MAX} of them), is stepped through in whole
|
|
115
|
+
* steps of {@link HAIR_STEP}; what is left is owed to the next frame. A step falls at a time within the frame, and
|
|
116
|
+
* reads the world there: the share of the frame's motion, from a frame ago at 0 to now at 1, is `first` for the
|
|
117
|
+
* frame's first step and `stride` more for each after it. The drawn state is `blend` of the way from the step
|
|
118
|
+
* before the last to the last: a step behind the scene's clock, always.
|
|
119
|
+
*
|
|
120
|
+
* @param {Float64Array|number[]} result written: the `HAIR_FRAME_STEPS_*` words
|
|
121
|
+
* @param {number} owed seconds the frames before ran past their last step, in `[0, HAIR_STEP)`
|
|
122
|
+
* @param {number} seconds the scene's clock moved this frame
|
|
123
|
+
*/
|
|
124
|
+
export function hair_frame_steps(result, owed, seconds) {
|
|
125
|
+
const frame = Math.min(seconds, HAIR_FRAME_STEP_MAX);
|
|
126
|
+
const time = owed + frame;
|
|
127
|
+
const count = Math.floor(time / HAIR_STEP);
|
|
128
|
+
|
|
129
|
+
// never negative, and never a whole step: the count is what the division's rounding made it
|
|
130
|
+
const left = Math.min(Math.max(time - count * HAIR_STEP, 0), HAIR_STEP * (1 - Number.EPSILON));
|
|
131
|
+
|
|
132
|
+
result[HAIR_FRAME_STEPS_COUNT] = count;
|
|
133
|
+
result[HAIR_FRAME_STEPS_OWED] = left;
|
|
134
|
+
result[HAIR_FRAME_STEPS_FIRST] = count > 0 ? Math.min((HAIR_STEP - owed) / frame, 1) : 0;
|
|
135
|
+
result[HAIR_FRAME_STEPS_STRIDE] = count > 0 ? HAIR_STEP / frame : 0;
|
|
136
|
+
result[HAIR_FRAME_STEPS_BLEND] = left / HAIR_STEP;
|
|
137
|
+
}
|
|
79
138
|
|
|
80
139
|
/**
|
|
81
140
|
* The longest frame the simulation steps, seconds, as the animation clamps its own: a stall slows the hair rather
|
|
@@ -126,11 +185,12 @@ export const HAIR_COLLIDER_LIMIT = 32;
|
|
|
126
185
|
* 8 .. 11 from the world to its own frame, as the pose pass writes it: the rotation, a unit quaternion
|
|
127
186
|
* 12 .. 14 the translation after it
|
|
128
187
|
* 15 the scale after that: distances in its frame are the world's times it
|
|
188
|
+
* 16 .. 23 the same a frame ago
|
|
129
189
|
* ```
|
|
130
190
|
*
|
|
131
191
|
* @type {number}
|
|
132
192
|
*/
|
|
133
|
-
export const HAIR_COLLIDER_WORDS =
|
|
193
|
+
export const HAIR_COLLIDER_WORDS = 24;
|
|
134
194
|
|
|
135
195
|
/**
|
|
136
196
|
* Words of an instance's guide bounds a row: the largest of each coordinate over its nodes, then the smallest, as
|
|
@@ -11,23 +11,25 @@ export { HAIR_EPOCH_MASK } from "./chunk_hair_guide.js";
|
|
|
11
11
|
export const shader_hair_simulate_begin: ComputeShader;
|
|
12
12
|
export const HAIR_COLLIDER_POSE_SETTINGS: WebGPUStruct;
|
|
13
13
|
/**
|
|
14
|
-
* Writes each collider of the frame's list the way from the world into its own frame (`HAIR_COLLIDER_WORDS`),
|
|
15
|
-
* thread a collider, from its entity's world
|
|
16
|
-
* largest axis is taken.
|
|
14
|
+
* Writes each collider of the frame's list the way from the world into its own frame (`HAIR_COLLIDER_WORDS`), now
|
|
15
|
+
* and a frame ago, a thread a collider, from its entity's world matrices as the scene holds them: a rigid motion and
|
|
16
|
+
* a uniform scale, whose largest axis is taken.
|
|
17
17
|
*
|
|
18
18
|
* @type {ComputeShader}
|
|
19
19
|
*/
|
|
20
20
|
export const shader_hair_collider_poses: ComputeShader;
|
|
21
21
|
export const HAIR_SIMULATE_SETTINGS: WebGPUStruct;
|
|
22
22
|
/**
|
|
23
|
-
* Steps every simulated instance's guides through the frame
|
|
24
|
-
* of a row found from the inclusive sums of the rows' guide counts.
|
|
23
|
+
* Steps every simulated instance's guides through the frame's steps and writes what is drawn of them, a thread a
|
|
24
|
+
* guide (`HAIR_SIMULATION.js`), the threads of a row found from the inclusive sums of the rows' guide counts.
|
|
25
25
|
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
26
|
+
* Every step is `settings.step` long; a frame takes `settings.steps` of them, none when its time has not reached the
|
|
27
|
+
* next (`hair_frame_steps`). A step reads the world at its own time within the frame: a guide's root rides the
|
|
28
|
+
* entity, or its strand's root frame where the instance is bound to a mesh, the frame taken linearly from a frame
|
|
29
|
+
* ago to now at the step's share of the frame's motion, and the colliders are where they were at that share. The
|
|
30
|
+
* first segment's rest direction is held, as every other's, by the local shape from the entity's frame. A frame of
|
|
31
|
+
* no time carries the solved state rigidly from the entity's frame a frame ago to now, as its own geometry is
|
|
32
|
+
* carried. Each step, from the node after the root to the tip, a node:
|
|
31
33
|
*
|
|
32
34
|
* - **predicts**: its velocity loses `1 − e^(−damping·h)`, gains gravity, and relaxes toward the air's
|
|
33
35
|
* (`wind_field_sample` at the node) as `v ← u + (v − u) e^(−k h)`, `k` the wisp's drag rate
|
|
@@ -35,17 +37,21 @@ export const HAIR_SIMULATE_SETTINGS: WebGPUStruct;
|
|
|
35
37
|
* - is pulled toward its rest place in the entity's frame (**global shape**) at a rate that falls from
|
|
36
38
|
* `global_shape_rate` at the root to nothing at `global_shape_range` of the length, and toward its rest
|
|
37
39
|
* direction turned by its parent's frame (**local shape**) at `local_shape_rate`, each a share
|
|
38
|
-
* `1 − e^(−rate·h)
|
|
40
|
+
* `1 − e^(−rate·h)` a step;
|
|
39
41
|
* - is pushed out of each of its instance's colliders by its wisp's radius plus the instance's thickness and the
|
|
40
42
|
* collider's inflation, and loses `friction` of its sliding along it per push out as deep as the sliding;
|
|
41
43
|
* - is put back onto the sphere of its rest segment's length about its parent (**follow the leader**), and never
|
|
42
|
-
* farther from the root than its length along the guide; its velocity is its move over the
|
|
43
|
-
* parent's loses `HAIR_FOLLOW_THE_LEADER_DAMPING` of this node's correction over the
|
|
44
|
+
* farther from the root than its length along the guide; its velocity is its move over the step, and its
|
|
45
|
+
* parent's loses `HAIR_FOLLOW_THE_LEADER_DAMPING` of this node's correction over the step (Müller's DFTL).
|
|
44
46
|
*
|
|
45
47
|
* A segment's frame is its parent's, turned the least that takes the rest direction it predicts to the direction
|
|
46
|
-
* the segment has; a node's frame
|
|
47
|
-
*
|
|
48
|
-
*
|
|
48
|
+
* the segment has; a node's frame blends the two segments either side of it. A state to be laid at rest is the rest
|
|
49
|
+
* pose, still. Colliders and the wind are read in the world: the anchor plus a node's position.
|
|
50
|
+
*
|
|
51
|
+
* **What is drawn**, every frame, stepped or not: each node between where the last two steps solved it, in the frame
|
|
52
|
+
* of its guide's root at each, `settings.blend` of the way from the step before the last to the last, carried by the
|
|
53
|
+
* root's frame now. The drawn root is the root now; what was drawn the frame before is kept as a frame ago. The drawn
|
|
54
|
+
* nodes' bounds, from the anchor, are gathered into the row's guide bounds.
|
|
49
55
|
*
|
|
50
56
|
* @type {ComputeShader}
|
|
51
57
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_hair_simulate.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/shader_hair_simulate.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"shader_hair_simulate.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/hair/shader_hair_simulate.js"],"names":[],"mappings":";AAuDA;;;;;;;;GAQG;AACH,yCAFU,aAAa,CAkEpB;AAEH,uDAK+B;AAU/B;;;;;;GAMG;AACH,yCAFU,aAAa,CAqCpB;AAEH,kDAe2B;AAuY3B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,mCAFU,aAAa,CAMpB;8BA/mB2B,4BAA4B;6BAK7B,gCAAgC"}
|