@woosh/meep-engine 3.68.0 → 3.70.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +74 -0
- package/build/bundle-worker-terrain.js +1 -1
- package/editor/ecs/component/editors/ecs/Trail3DEditor.d.ts +2 -17
- package/editor/ecs/component/editors/ecs/Trail3DEditor.d.ts.map +1 -1
- package/editor/ecs/component/editors/ecs/Trail3DEditor.js +3 -18
- package/package.json +1 -1
- package/src/core/bvh8/build/BVH8Converter.d.ts +16 -0
- package/src/core/bvh8/build/BVH8Converter.d.ts.map +1 -1
- package/src/core/bvh8/build/BVH8Converter.js +64 -37
- package/src/core/bvh8/build/bvh8_assign_slots_greedy.d.ts +25 -0
- package/src/core/bvh8/build/bvh8_assign_slots_greedy.d.ts.map +1 -0
- package/src/core/bvh8/build/bvh8_assign_slots_greedy.js +68 -0
- package/src/core/bvh8/build/bvh8_from_proxy.d.ts.map +1 -1
- package/src/core/bvh8/build/bvh8_from_proxy.js +2 -33
- package/src/core/bvh8/build/bvh8_node_fit_slots.d.ts +22 -0
- package/src/core/bvh8/build/bvh8_node_fit_slots.d.ts.map +1 -0
- package/src/core/bvh8/build/bvh8_node_fit_slots.js +115 -0
- package/src/core/bvh8/bvh8_depth.d.ts +8 -0
- package/src/core/bvh8/bvh8_depth.d.ts.map +1 -0
- package/src/core/bvh8/bvh8_depth.js +39 -0
- package/src/core/math/complex/complex_fft_radix2.d.ts +19 -0
- package/src/core/math/complex/complex_fft_radix2.d.ts.map +1 -0
- package/src/core/math/complex/complex_fft_radix2.js +71 -0
- package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts +33 -65
- package/src/engine/graphics/ecs/trail3d/Trail3D.d.ts.map +1 -1
- package/src/engine/graphics/ecs/trail3d/Trail3D.js +37 -245
- package/src/engine/graphics/ecs/trail3d/Trail3DFlags.d.ts +0 -4
- package/src/engine/graphics/ecs/trail3d/Trail3DFlags.js +4 -10
- package/src/engine/graphics/ecs/trail3d/seed_trail_stroke.d.ts +13 -10
- package/src/engine/graphics/ecs/trail3d/seed_trail_stroke.d.ts.map +1 -1
- package/src/engine/graphics/ecs/trail3d/seed_trail_stroke.js +28 -37
- package/src/engine/graphics/ecs/trail3d/trail_knot_count.d.ts +10 -0
- package/src/engine/graphics/ecs/trail3d/trail_knot_count.d.ts.map +1 -0
- package/src/engine/graphics/ecs/trail3d/trail_knot_count.js +27 -0
- package/src/engine/graphics/trail/TrailKnots.d.ts +62 -0
- package/src/engine/graphics/trail/TrailKnots.d.ts.map +1 -0
- package/src/engine/graphics/trail/TrailKnots.js +137 -0
- package/src/engine/graphics/trail/tube/TubeXMaterialSpec.d.ts +1 -1
- package/src/engine/graphics/trail/tube/TubeXMaterialSpec.js +1 -1
- package/src/engine/graphics3/EntityRowHold.d.ts +48 -0
- package/src/engine/graphics3/EntityRowHold.d.ts.map +1 -0
- package/src/engine/graphics3/EntityRowHold.js +128 -0
- package/src/engine/graphics3/GPUFluidSystem.d.ts +17 -4
- package/src/engine/graphics3/GPUFluidSystem.d.ts.map +1 -1
- package/src/engine/graphics3/GPUFluidSystem.js +113 -16
- package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts +6 -2
- package/src/engine/graphics3/GPUParticleEmitterSystem.d.ts.map +1 -1
- package/src/engine/graphics3/GPUParticleEmitterSystem.js +11 -44
- package/src/engine/graphics3/Trail3DSystem.d.ts +69 -35
- package/src/engine/graphics3/Trail3DSystem.d.ts.map +1 -1
- package/src/engine/graphics3/Trail3DSystem.js +380 -81
- package/src/engine/physics/cloth/playground/wind_main.js +7 -6
- package/src/engine/physics/cloth/wind/AbstractClothWind.d.ts +2 -2
- package/src/engine/physics/cloth/wind/AbstractClothWind.js +2 -2
- package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts +3 -3
- package/src/engine/physics/cloth/wind/ClothFluidWind.d.ts.map +1 -1
- package/src/engine/physics/cloth/wind/ClothFluidWind.js +7 -9
- package/src/engine/physics/cloth/wind/ClothGPUFluidWind.d.ts +10 -10
- package/src/engine/physics/cloth/wind/ClothGPUFluidWind.d.ts.map +1 -1
- package/src/engine/physics/cloth/wind/ClothGPUFluidWind.js +14 -22
- package/src/engine/physics/fluid/FluidAtmosphere.d.ts +16 -2
- package/src/engine/physics/fluid/FluidAtmosphere.d.ts.map +1 -1
- package/src/engine/physics/fluid/FluidAtmosphere.js +17 -3
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponentSerializationAdapter.d.ts +1 -2
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponentSerializationAdapter.d.ts.map +1 -1
- package/src/engine/physics/fluid/ecs/FluidEffectorsComponentSerializationAdapter.js +1 -2
- package/src/engine/physics/fluid/ecs/FluidEffectorsSystem.d.ts +8 -5
- package/src/engine/physics/fluid/ecs/FluidEffectorsSystem.d.ts.map +1 -1
- package/src/engine/physics/fluid/ecs/FluidEffectorsSystem.js +60 -17
- package/src/engine/physics/fluid/ecs/FluidObstacle.d.ts +17 -0
- package/src/engine/physics/fluid/ecs/FluidObstacle.d.ts.map +1 -1
- package/src/engine/physics/fluid/ecs/FluidObstacle.js +22 -2
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +6 -5
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts.map +1 -1
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.js +14 -3
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.d.ts +1 -1
- package/src/engine/physics/fluid/effector/AbstractFluidEffector.js +1 -1
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts +33 -47
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/GlobalFluidEffector.js +38 -176
- package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationAdapter.d.ts +8 -11
- package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationAdapter.d.ts.map +1 -1
- package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationAdapter.js +13 -24
- package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationUpgrader_0_1.d.ts +16 -0
- package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationUpgrader_0_1.d.ts.map +1 -0
- package/src/engine/physics/fluid/effector/GlobalFluidEffectorSerializationUpgrader_0_1.js +35 -0
- package/src/engine/physics/fluid/fluid_apply_atmosphere.d.ts +1 -1
- package/src/engine/physics/fluid/fluid_apply_atmosphere.js +1 -1
- package/src/engine/physics/fluid/obstacle/FLUID_OBSTACLE_RECORD_STRUCT.d.ts +9 -1
- package/src/engine/physics/fluid/obstacle/FLUID_OBSTACLE_RECORD_STRUCT.d.ts.map +1 -1
- package/src/engine/physics/fluid/obstacle/FLUID_OBSTACLE_RECORD_STRUCT.js +11 -1
- package/src/engine/physics/fluid/obstacle/fluid_obstacle_record_create.d.ts +5 -0
- package/src/engine/physics/fluid/obstacle/fluid_obstacle_record_create.d.ts.map +1 -1
- package/src/engine/physics/fluid/obstacle/fluid_obstacle_record_create.js +2 -0
- package/src/engine/physics/fluid/obstacle/fluid_obstacle_write_gpu_record.d.ts +4 -3
- package/src/engine/physics/fluid/obstacle/fluid_obstacle_write_gpu_record.d.ts.map +1 -1
- package/src/engine/physics/fluid/obstacle/fluid_obstacle_write_gpu_record.js +11 -3
- package/src/engine/physics/fluid/turbulence/FLUID_TURBULENCE_TILE.d.ts +28 -0
- package/src/engine/physics/fluid/turbulence/FLUID_TURBULENCE_TILE.d.ts.map +1 -0
- package/src/engine/physics/fluid/turbulence/FLUID_TURBULENCE_TILE.js +29 -0
- package/src/engine/physics/fluid/turbulence/fluid_atmosphere_velocity_at.d.ts +16 -0
- package/src/engine/physics/fluid/turbulence/fluid_atmosphere_velocity_at.d.ts.map +1 -0
- package/src/engine/physics/fluid/turbulence/fluid_atmosphere_velocity_at.js +49 -0
- package/src/engine/physics/fluid/turbulence/fluid_turbulence_inverse_tile_size.d.ts +11 -0
- package/src/engine/physics/fluid/turbulence/fluid_turbulence_inverse_tile_size.d.ts.map +1 -0
- package/src/engine/physics/fluid/turbulence/fluid_turbulence_inverse_tile_size.js +18 -0
- package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_data.d.ts +25 -0
- package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_data.d.ts.map +1 -0
- package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_data.js +65 -0
- package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_generate.d.ts +56 -0
- package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_generate.d.ts.map +1 -0
- package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_generate.js +313 -0
- package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_sample.d.ts +16 -0
- package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_sample.d.ts.map +1 -0
- package/src/engine/physics/fluid/turbulence/fluid_turbulence_tile_sample.js +69 -0
- package/src/generation/foliage/mesh/branch_ring_triangulate.d.ts +1 -1
- package/src/generation/foliage/mesh/branch_ring_triangulate.js +1 -1
- package/src/shade/playground/bvh_repro/README.md +8 -6
- package/src/shade/playground/bvh_repro/index.html +125 -124
- package/src/shade/playground/bvh_repro/main.js +259 -254
- package/src/shade/playground/foliage_wind/foliage_world.d.ts.map +1 -1
- package/src/shade/playground/foliage_wind/foliage_world.js +7 -4
- package/src/shade/playground/grass_surfaces/main.js +3 -2
- package/src/shade/playground/particle_ecs/bonfire_wind.d.ts +23 -13
- package/src/shade/playground/particle_ecs/bonfire_wind.d.ts.map +1 -1
- package/src/shade/playground/particle_ecs/bonfire_wind.js +30 -33
- package/src/shade/playground/skinned_blas_refit/README.md +26 -14
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.d.ts +14 -9
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_leaf_triangles.js +126 -127
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_points.js +95 -95
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.d.ts +9 -1
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/shader_blas_audit_visibility.js +146 -135
- package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.d.ts +6 -6
- package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/verify_clone_leaves.js +148 -134
- package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.d.ts +11 -8
- package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/verify_leaf_triangles.js +342 -202
- package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.d.ts +12 -13
- package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/verify_skinned_blas_refit.js +136 -116
- package/src/shade/playground/skinned_blas_refit/verify_traversal_reachability.d.ts +4 -4
- package/src/shade/playground/skinned_blas_refit/verify_traversal_reachability.d.ts.map +1 -1
- package/src/shade/playground/skinned_blas_refit/verify_traversal_reachability.js +255 -249
- package/src/shade/playground/trails/index.html +50 -0
- package/src/shade/playground/trails/main.d.ts +2 -0
- package/src/shade/playground/trails/main.d.ts.map +1 -0
- package/src/shade/playground/trails/main.js +258 -0
- package/src/shade/playground/water_surface/main.js +6 -3
- package/src/shade/renderer/animation/GPUAnimationManager.js +2 -2
- package/src/shade/renderer/animation/animation_curve_write_keys.d.ts +18 -0
- package/src/shade/renderer/animation/animation_curve_write_keys.d.ts.map +1 -0
- package/src/shade/renderer/animation/animation_curve_write_keys.js +34 -0
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
- package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +7 -8
- package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts.map +1 -1
- package/src/shade/renderer/deferred/tonemap/ColorGrade.js +13 -36
- package/src/shade/renderer/dynamic/GPUDynamicMeshResidency.js +2 -2
- package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.d.ts +2 -13
- package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/chunk_dynamic_mesh_avboit_vertex.js +6 -21
- package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.d.ts +17 -6
- package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/graph_dynamic_mesh_avboit.js +38 -178
- package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.d.ts +7 -9
- package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_draw.js +17 -106
- package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.d.ts +7 -17
- package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.d.ts.map +1 -1
- package/src/shade/renderer/dynamic/shader_dynamic_mesh_avboit_splat.js +18 -118
- package/src/shade/renderer/fluid/FLUID_FAR_FIELD_STRUCT.d.ts +111 -0
- package/src/shade/renderer/fluid/FLUID_FAR_FIELD_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/fluid/FLUID_FAR_FIELD_STRUCT.js +162 -0
- package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +37 -8
- package/src/shade/renderer/fluid/GPUFluidCascade.d.ts.map +1 -1
- package/src/shade/renderer/fluid/GPUFluidCascade.js +149 -47
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +10 -3
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts.map +1 -1
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.js +69 -10
- package/src/shade/renderer/fluid/chunk_fluid_far_field.d.ts +19 -0
- package/src/shade/renderer/fluid/chunk_fluid_far_field.d.ts.map +1 -0
- package/src/shade/renderer/fluid/chunk_fluid_far_field.js +43 -0
- package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_PARENT_STRUCT.d.ts +10 -9
- package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_PARENT_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_PARENT_STRUCT.js +14 -12
- package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_RESTRICT_STRUCT.d.ts +3 -2
- package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_RESTRICT_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/fluid/coupling/FLUID_CASCADE_RESTRICT_STRUCT.js +7 -5
- package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_epilogue.d.ts +17 -9
- package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_epilogue.d.ts.map +1 -1
- package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_epilogue.js +58 -18
- package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.d.ts +23 -11
- package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.d.ts.map +1 -1
- package/src/shade/renderer/fluid/coupling/chunk_fluid_cascade_parent.js +371 -335
- package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_fill.d.ts.map +1 -1
- package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_fill.js +2 -1
- package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_ghosts.d.ts.map +1 -1
- package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_ghosts.js +109 -108
- package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_restrict.d.ts +5 -3
- package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_restrict.d.ts.map +1 -1
- package/src/shade/renderer/fluid/coupling/shader_fluid_cascade_restrict.js +24 -12
- package/src/shade/renderer/fluid/forcing/FLUID_FORCING.d.ts +14 -0
- package/src/shade/renderer/fluid/forcing/FLUID_FORCING.d.ts.map +1 -1
- package/src/shade/renderer/fluid/forcing/FLUID_FORCING.js +18 -0
- package/src/shade/renderer/fluid/forcing/FLUID_FORCING_APPLY_STRUCT.d.ts +3 -1
- package/src/shade/renderer/fluid/forcing/FLUID_FORCING_APPLY_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/fluid/forcing/FLUID_FORCING_APPLY_STRUCT.js +4 -1
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +9 -0
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts.map +1 -1
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.js +20 -4
- package/src/shade/renderer/fluid/forcing/chunk_fluid_forcing_cell.d.ts +11 -2
- package/src/shade/renderer/fluid/forcing/chunk_fluid_forcing_cell.d.ts.map +1 -1
- package/src/shade/renderer/fluid/forcing/chunk_fluid_forcing_cell.js +59 -2
- package/src/shade/renderer/fluid/forcing/shader_fluid_forcing_apply.d.ts +4 -1
- package/src/shade/renderer/fluid/forcing/shader_fluid_forcing_apply.d.ts.map +1 -1
- package/src/shade/renderer/fluid/forcing/shader_fluid_forcing_apply.js +367 -341
- package/src/shade/renderer/fluid/mac/FLUID_MAC_STEP_STRUCT.d.ts +6 -2
- package/src/shade/renderer/fluid/mac/FLUID_MAC_STEP_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/fluid/mac/FLUID_MAC_STEP_STRUCT.js +10 -5
- package/src/shade/renderer/fluid/mac/FluidMacPasses.d.ts +20 -21
- package/src/shade/renderer/fluid/mac/FluidMacPasses.d.ts.map +1 -1
- package/src/shade/renderer/fluid/mac/FluidMacPasses.js +453 -427
- package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.d.ts +6 -2
- package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.d.ts.map +1 -1
- package/src/shade/renderer/fluid/mac/shader_fluid_mac_advect_correct.js +340 -282
- package/src/shade/renderer/fluid/publish/FluidWindPublish.d.ts +13 -5
- package/src/shade/renderer/fluid/publish/FluidWindPublish.d.ts.map +1 -1
- package/src/shade/renderer/fluid/publish/FluidWindPublish.js +20 -10
- package/src/shade/renderer/fluid/publish/chunk_fluid_wind_publish_cell.d.ts +2 -2
- package/src/shade/renderer/fluid/publish/chunk_fluid_wind_publish_cell.js +2 -2
- package/src/shade/renderer/fluid/publish/shader_fluid_wind_publish.d.ts +5 -3
- package/src/shade/renderer/fluid/publish/shader_fluid_wind_publish.d.ts.map +1 -1
- package/src/shade/renderer/fluid/publish/shader_fluid_wind_publish.js +147 -142
- package/src/shade/renderer/fluid/query/GPUFluidQueries.js +2 -2
- package/src/shade/renderer/geometry/GPUGeometryManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/GPUGeometryManager.js +5 -7
- package/src/shade/renderer/geometry/MeshletGeometry.d.ts +4 -1
- package/src/shade/renderer/geometry/MeshletGeometry.d.ts.map +1 -1
- package/src/shade/renderer/geometry/MeshletGeometry.js +4 -1
- package/src/shade/renderer/geometry/MeshletGeometrySerializationAdapter.d.ts +20 -0
- package/src/shade/renderer/geometry/MeshletGeometrySerializationAdapter.d.ts.map +1 -1
- package/src/shade/renderer/geometry/MeshletGeometrySerializationAdapter.js +35 -3
- package/src/shade/renderer/geometry/blas_from_meshlets.d.ts +9 -3
- package/src/shade/renderer/geometry/blas_from_meshlets.d.ts.map +1 -1
- package/src/shade/renderer/geometry/blas_from_meshlets.js +16 -30
- package/src/shade/renderer/geometry/bvh/BLAS8_REFIT_TARGET_STRUCT.d.ts +14 -0
- package/src/shade/renderer/geometry/bvh/BLAS8_REFIT_TARGET_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/geometry/bvh/BLAS8_REFIT_TARGET_STRUCT.js +33 -0
- package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.d.ts +18 -21
- package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.d.ts.map +1 -1
- package/src/shade/renderer/geometry/bvh/GPUBLASRefitBatch.js +78 -158
- package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts +18 -39
- package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.d.ts.map +1 -1
- package/src/shade/renderer/geometry/bvh/GPUGeometryBVHManager.js +39 -398
- package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts +6 -7
- package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.d.ts.map +1 -1
- package/src/shade/renderer/geometry/bvh/GPUGeometryMeshletsBVH.js +5 -7
- package/src/shade/renderer/geometry/bvh/bvh8_build_for_meshlets.d.ts +36 -0
- package/src/shade/renderer/geometry/bvh/bvh8_build_for_meshlets.d.ts.map +1 -0
- package/src/shade/renderer/geometry/bvh/bvh8_build_for_meshlets.js +179 -0
- package/src/shade/renderer/geometry/bvh/meshlet_batch_to_clustered_bvh.d.ts +30 -0
- package/src/shade/renderer/geometry/bvh/meshlet_batch_to_clustered_bvh.d.ts.map +1 -0
- package/src/shade/renderer/geometry/bvh/meshlet_batch_to_clustered_bvh.js +207 -0
- package/src/shade/renderer/geometry/bvh/shader_blas8_refit_batch.d.ts +52 -0
- package/src/shade/renderer/geometry/bvh/shader_blas8_refit_batch.d.ts.map +1 -0
- package/src/shade/renderer/geometry/bvh/shader_blas8_refit_batch.js +464 -0
- package/src/shade/renderer/geometry/meshlet/MeshletBatch.d.ts +12 -0
- package/src/shade/renderer/geometry/meshlet/MeshletBatch.d.ts.map +1 -1
- package/src/shade/renderer/geometry/meshlet/MeshletBatch.js +37 -0
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.js +4 -4
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.js +2 -2
- package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.js +2 -2
- package/src/shade/renderer/geometry/sdf/shader_sdf_visualize.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/shader_sdf_visualize.js +4 -4
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/surface/shader_mesh_surface_trace.js +2 -2
- package/src/shade/renderer/geometry/sr_create_group_RTX.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sr_create_group_RTX.js +4 -4
- package/src/shade/renderer/global_illumination/brick4/gpu/bake/brick4_bake_basic.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/brick4/gpu/bake/brick4_bake_basic.js +1 -0
- package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.js +1 -0
- package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.js +372 -376
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts +9 -10
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MESH_BRICK.js +10 -11
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.d.ts +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_walk.js +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts +12 -8
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/shader_mesh_brick_gather.js +109 -60
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_sdf.js +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/debug/graph_probe_clipmap_debug_mesh_surfaces.js +2 -2
- package/src/shade/renderer/gpu_primitive/bvh/BVH_BUFFER_LAYOUT.d.ts +2 -2
- package/src/shade/renderer/gpu_primitive/bvh/BVH_BUFFER_LAYOUT.js +70 -70
- package/src/shade/renderer/gpu_primitive/bvh/BVH_BUILD_SETTINGS_STRUCT.d.ts +6 -7
- package/src/shade/renderer/gpu_primitive/bvh/BVH_BUILD_SETTINGS_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/gpu_primitive/bvh/BVH_BUILD_SETTINGS_STRUCT.js +6 -7
- package/src/shade/renderer/gpu_primitive/bvh/graph_bvh_build_lbvh.d.ts +3 -3
- package/src/shade/renderer/gpu_primitive/bvh/graph_bvh_build_lbvh.js +3 -3
- package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_build_single_workgroup.js +1 -1
- package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_emit_hierarchy.d.ts +2 -2
- package/src/shade/renderer/gpu_primitive/bvh/shader_bvh_emit_hierarchy.js +3 -3
- package/src/shade/renderer/gpu_primitive/bvh8/BVH8_TREE_BUFFER_LAYOUT.d.ts +69 -0
- package/src/shade/renderer/gpu_primitive/bvh8/BVH8_TREE_BUFFER_LAYOUT.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/BVH8_TREE_BUFFER_LAYOUT.js +89 -0
- package/src/shade/renderer/gpu_primitive/bvh8/bvh8_encode_from_bvh2.d.ts +41 -0
- package/src/shade/renderer/gpu_primitive/bvh8/bvh8_encode_from_bvh2.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/bvh8_encode_from_bvh2.js +348 -0
- package/src/shade/renderer/gpu_primitive/bvh8/check_bvh8_tree.d.ts +34 -0
- package/src/shade/renderer/gpu_primitive/bvh8/check_bvh8_tree.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/check_bvh8_tree.js +291 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_assign.d.ts +31 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_assign.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_assign.js +175 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_depth.d.ts +27 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_depth.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_depth.js +48 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_gather.d.ts +26 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_gather.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_gather.js +118 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_node.d.ts +22 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_node.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_node.js +143 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_sums.d.ts +36 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_sums.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/chunk_bvh8_encode_sums.js +97 -0
- package/src/shade/renderer/gpu_primitive/bvh8/graph_bvh8_encode_from_bvh2.d.ts +49 -0
- package/src/shade/renderer/gpu_primitive/bvh8/graph_bvh8_encode_from_bvh2.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/graph_bvh8_encode_from_bvh2.js +265 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_assign.d.ts +37 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_assign.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_assign.js +109 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count.d.ts +15 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count.js +85 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count_single_workgroup.d.ts +26 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count_single_workgroup.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_count_single_workgroup.js +200 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_parents.d.ts +19 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_parents.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_parents.js +81 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_write.d.ts +14 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_write.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/shader_bvh8_encode_write.js +101 -0
- package/src/shade/renderer/gpu_primitive/bvh8/verify_gpu_bvh8_encode.d.ts +19 -0
- package/src/shade/renderer/gpu_primitive/bvh8/verify_gpu_bvh8_encode.d.ts.map +1 -0
- package/src/shade/renderer/gpu_primitive/bvh8/verify_gpu_bvh8_encode.js +361 -0
- package/src/shade/renderer/grass/press/shader_grass_press_mark.d.ts +3 -2
- package/src/shade/renderer/grass/press/shader_grass_press_mark.d.ts.map +1 -1
- package/src/shade/renderer/grass/press/shader_grass_press_mark.js +5 -3
- package/src/shade/renderer/grass/surface/shader_grass_surface_bake.d.ts.map +1 -1
- package/src/shade/renderer/grass/surface/shader_grass_surface_bake.js +5 -6
- package/src/shade/renderer/lightmap/GPULightMap.d.ts.map +1 -1
- package/src/shade/renderer/lightmap/GPULightMap.js +1 -0
- package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.js +1 -0
- package/src/shade/renderer/path_tracer/graph_path_trace_scene.d.ts.map +1 -1
- package/src/shade/renderer/path_tracer/graph_path_trace_scene.js +1 -0
- package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.d.ts +49 -0
- package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.d.ts.map +1 -0
- package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.js +144 -0
- package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_splat.d.ts +71 -0
- package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_splat.d.ts.map +1 -0
- package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_splat.js +152 -0
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_unlit_varyings.d.ts +21 -0
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_unlit_varyings.d.ts.map +1 -0
- package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_unlit_varyings.js +30 -0
- package/src/shade/renderer/rasterize/native/avboit/graph_avboit_unlit.d.ts +101 -0
- package/src/shade/renderer/rasterize/native/avboit/graph_avboit_unlit.d.ts.map +1 -0
- package/src/shade/renderer/rasterize/native/avboit/graph_avboit_unlit.js +306 -0
- package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts +9 -0
- package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.js +11 -4
- package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.d.ts +8 -4
- package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.d.ts.map +1 -1
- package/src/shade/renderer/scene/GPUInstancesAccelerationStructure.js +60 -33
- package/src/shade/renderer/scene/verify_gpu_tlas_build.d.ts +6 -6
- package/src/shade/renderer/scene/verify_gpu_tlas_build.d.ts.map +1 -1
- package/src/shade/renderer/scene/verify_gpu_tlas_build.js +23 -53
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_INODE_STRUCT.d.ts +3 -1
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_INODE_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_INODE_STRUCT.js +5 -3
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_MAX_DEPTH.d.ts +28 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_MAX_DEPTH.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/BVH8_MAX_DEPTH.js +29 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_grid.d.ts +25 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_grid.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_grid.js +97 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_intersect.d.ts +8 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_intersect.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_intersect.js +23 -14
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_slot_distances.d.ts +36 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_slot_distances.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_node_slot_distances.js +222 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_direction_rcp.d.ts +20 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_direction_rcp.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_direction_rcp.js +30 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_tree_read.d.ts +30 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_tree_read.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_tree_read.js +91 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_waiting_slots.d.ts +23 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_waiting_slots.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_waiting_slots.js +40 -0
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_nearest.d.ts +22 -0
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_nearest.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_nearest.js +121 -70
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_occluded.d.ts +13 -1
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_occluded.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_blas_occluded.js +117 -61
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest.d.ts +21 -0
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest.js +111 -72
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.d.ts +1 -2
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_nearest_among.js +83 -54
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_occluded.d.ts +14 -0
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_occluded.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/geometry/ray/chunk_ray_query_occluded.js +92 -60
- package/src/shade/renderer/shader/chunk/sdf/chunk_point_query_blas_nearest.d.ts +22 -0
- package/src/shade/renderer/shader/chunk/sdf/chunk_point_query_blas_nearest.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/sdf/chunk_point_query_blas_nearest.js +153 -106
- package/src/shade/renderer/shader/chunk/sdf/chunk_scene_point_query_nearest.d.ts +21 -0
- package/src/shade/renderer/shader/chunk/sdf/chunk_scene_point_query_nearest.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/sdf/chunk_scene_point_query_nearest.js +115 -74
- package/src/shade/renderer/shader/chunk/sdf/chunk_scene_sdf_raymarch.d.ts +5 -2
- package/src/shade/renderer/shader/chunk/sdf/chunk_scene_sdf_raymarch.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/sdf/chunk_scene_sdf_raymarch.js +89 -63
- package/src/shade/renderer/shader/chunk/sdf/chunk_sdf_query_distance.d.ts +15 -0
- package/src/shade/renderer/shader/chunk/sdf/chunk_sdf_query_distance.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/sdf/chunk_sdf_query_distance.js +108 -63
- package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast.d.ts +14 -0
- package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast.d.ts.map +1 -1
- package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast.js +94 -60
- package/src/shade/renderer/shadow/sdf/graph_draw_sdf_shadows.d.ts.map +1 -1
- package/src/shade/renderer/shadow/sdf/graph_draw_sdf_shadows.js +4 -4
- package/src/shade/renderer/trails/GPUTrailAVBOITChannel.d.ts +69 -0
- package/src/shade/renderer/trails/GPUTrailAVBOITChannel.d.ts.map +1 -0
- package/src/shade/renderer/trails/GPUTrailAVBOITChannel.js +129 -0
- package/src/shade/renderer/trails/GPUTrailSystem.d.ts +164 -0
- package/src/shade/renderer/trails/GPUTrailSystem.d.ts.map +1 -0
- package/src/shade/renderer/trails/GPUTrailSystem.js +725 -0
- package/src/shade/renderer/trails/data/TRAIL_DATABASE_SPEC.d.ts +14 -0
- package/src/shade/renderer/trails/data/TRAIL_DATABASE_SPEC.d.ts.map +1 -0
- package/src/shade/renderer/trails/data/TRAIL_DATABASE_SPEC.js +38 -0
- package/src/shade/renderer/trails/data/TRAIL_KNOT.d.ts +66 -0
- package/src/shade/renderer/trails/data/TRAIL_KNOT.d.ts.map +1 -0
- package/src/shade/renderer/trails/data/TRAIL_KNOT.js +154 -0
- package/src/shade/renderer/trails/data/TRAIL_RECORD.d.ts +19 -0
- package/src/shade/renderer/trails/data/TRAIL_RECORD.d.ts.map +1 -0
- package/src/shade/renderer/trails/data/TRAIL_RECORD.js +68 -0
- package/src/shade/renderer/trails/data/TRAIL_STATE.d.ts +18 -0
- package/src/shade/renderer/trails/data/TRAIL_STATE.d.ts.map +1 -0
- package/src/shade/renderer/trails/data/TRAIL_STATE.js +43 -0
- package/src/shade/renderer/trails/graph_trails.d.ts +58 -0
- package/src/shade/renderer/trails/graph_trails.d.ts.map +1 -0
- package/src/shade/renderer/trails/graph_trails.js +155 -0
- package/src/shade/renderer/trails/graph_trails_avboit.d.ts +126 -0
- package/src/shade/renderer/trails/graph_trails_avboit.d.ts.map +1 -0
- package/src/shade/renderer/trails/graph_trails_avboit.js +300 -0
- package/src/shade/renderer/trails/runtime/TrailFadeCurves.d.ts +56 -0
- package/src/shade/renderer/trails/runtime/TrailFadeCurves.d.ts.map +1 -0
- package/src/shade/renderer/trails/runtime/TrailFadeCurves.js +220 -0
- package/src/shade/renderer/trails/runtime/TrailKnotPool.d.ts +49 -0
- package/src/shade/renderer/trails/runtime/TrailKnotPool.d.ts.map +1 -0
- package/src/shade/renderer/trails/runtime/TrailKnotPool.js +162 -0
- package/src/shade/renderer/trails/runtime/TrailParameters.d.ts +52 -0
- package/src/shade/renderer/trails/runtime/TrailParameters.d.ts.map +1 -0
- package/src/shade/renderer/trails/runtime/TrailParameters.js +126 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_frame_transport.d.ts +23 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_frame_transport.d.ts.map +1 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_frame_transport.js +57 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_knot_alpha.d.ts +14 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_knot_alpha.d.ts.map +1 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_knot_alpha.js +40 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_seed.d.ts +18 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_seed.d.ts.map +1 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_seed.js +64 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_segment.d.ts +14 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_segment.d.ts.map +1 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_segment.js +51 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_update.d.ts +48 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_update.d.ts.map +1 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_update.js +197 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_vertex.d.ts +34 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_vertex.d.ts.map +1 -0
- package/src/shade/renderer/trails/shaders/chunk_trail_vertex.js +111 -0
- package/src/shade/renderer/trails/shaders/shader_trail_avboit.d.ts +24 -0
- package/src/shade/renderer/trails/shaders/shader_trail_avboit.d.ts.map +1 -0
- package/src/shade/renderer/trails/shaders/shader_trail_avboit.js +78 -0
- package/src/shade/renderer/trails/shaders/shader_trail_avboit_segments.d.ts +23 -0
- package/src/shade/renderer/trails/shaders/shader_trail_avboit_segments.d.ts.map +1 -0
- package/src/shade/renderer/trails/shaders/shader_trail_avboit_segments.js +130 -0
- package/src/shade/renderer/trails/shaders/shader_trail_draw_args.d.ts +29 -0
- package/src/shade/renderer/trails/shaders/shader_trail_draw_args.d.ts.map +1 -0
- package/src/shade/renderer/trails/shaders/shader_trail_draw_args.js +78 -0
- package/src/shade/renderer/trails/shaders/shader_trail_seed.d.ts +18 -0
- package/src/shade/renderer/trails/shaders/shader_trail_seed.d.ts.map +1 -0
- package/src/shade/renderer/trails/shaders/shader_trail_seed.js +79 -0
- package/src/shade/renderer/trails/shaders/shader_trail_update.d.ts +20 -0
- package/src/shade/renderer/trails/shaders/shader_trail_update.d.ts.map +1 -0
- package/src/shade/renderer/trails/shaders/shader_trail_update.js +101 -0
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +2 -2
- package/src/shade/renderer/water/query/shader_water_surface_query.d.ts.map +1 -1
- package/src/shade/renderer/water/query/shader_water_surface_query.js +227 -227
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.d.ts.map +1 -1
- package/src/shade/renderer/water/surface/particles/chunk_water_particle_step.js +7 -4
- package/src/shade/renderer/water/surface/particles/shader_water_particles.js +2 -2
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +36 -4
- package/src/shade/renderer/wind/GPUSceneWind.d.ts.map +1 -1
- package/src/shade/renderer/wind/GPUSceneWind.js +150 -4
- package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts +9 -3
- package/src/shade/renderer/wind/WIND_FIELD_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/wind/WIND_FIELD_STRUCT.js +13 -3
- package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.d.ts +6 -6
- package/src/shade/renderer/wind/WIND_FIELD_UNIFORM.js +6 -6
- package/src/shade/renderer/wind/chunk_fluid_turbulence.d.ts +39 -0
- package/src/shade/renderer/wind/chunk_fluid_turbulence.d.ts.map +1 -0
- package/src/shade/renderer/wind/chunk_fluid_turbulence.js +63 -0
- package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts +10 -7
- package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.d.ts.map +1 -1
- package/src/shade/renderer/wind/chunk_wind_field_sample_cascades.js +34 -11
- package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.d.ts +2 -2
- package/src/shade/renderer/wind/chunk_wind_field_sample_uniform.js +2 -2
- package/src/shade/renderer/wind/wind_field_add_resources.d.ts +6 -4
- package/src/shade/renderer/wind/wind_field_add_resources.d.ts.map +1 -1
- package/src/shade/renderer/wind/wind_field_add_resources.js +9 -6
- package/src/engine/graphics/ecs/trail3d/advance_trail.d.ts +0 -18
- package/src/engine/graphics/ecs/trail3d/advance_trail.d.ts.map +0 -1
- package/src/engine/graphics/ecs/trail3d/advance_trail.js +0 -42
- package/src/engine/graphics/ecs/trail3d/seed_trail_tube.d.ts +0 -14
- package/src/engine/graphics/ecs/trail3d/seed_trail_tube.d.ts.map +0 -1
- package/src/engine/graphics/ecs/trail3d/seed_trail_tube.js +0 -75
- package/src/engine/graphics/ecs/trail3d/trail_head_position.d.ts +0 -17
- package/src/engine/graphics/ecs/trail3d/trail_head_position.d.ts.map +0 -1
- package/src/engine/graphics/ecs/trail3d/trail_head_position.js +0 -19
- package/src/engine/graphics/trail/tube/TubeX.d.ts +0 -186
- package/src/engine/graphics/trail/tube/TubeX.d.ts.map +0 -1
- package/src/engine/graphics/trail/tube/TubeX.js +0 -575
- package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.d.ts +0 -16
- package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.d.ts.map +0 -1
- package/src/engine/graphics/trail/tube/simulator/TubeXFixedPhysicsSimulator.js +0 -34
- package/src/engine/graphics/trail/tube/tube_attributes_spec.d.ts +0 -27
- package/src/engine/graphics/trail/tube/tube_attributes_spec.d.ts.map +0 -1
- package/src/engine/graphics/trail/tube/tube_attributes_spec.js +0 -70
- package/src/engine/graphics3/trail/trail_tube_write_geometry.d.ts +0 -38
- package/src/engine/graphics3/trail/trail_tube_write_geometry.d.ts.map +0 -1
- package/src/engine/graphics3/trail/trail_tube_write_geometry.js +0 -119
- package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.d.ts +0 -18
- package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.d.ts.map +0 -1
- package/src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.js +0 -50
- package/src/shade/renderer/geometry/bvh/bvh2_derive_topology.d.ts +0 -23
- package/src/shade/renderer/geometry/bvh/bvh2_derive_topology.d.ts.map +0 -1
- package/src/shade/renderer/geometry/bvh/bvh2_derive_topology.js +0 -87
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.d.ts +0 -42
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.d.ts.map +0 -1
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch.js +0 -141
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch_seed.d.ts +0 -21
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch_seed.d.ts.map +0 -1
- package/src/shade/renderer/geometry/bvh/shader_blas_refit_batch_seed.js +0 -75
- package/src/shade/renderer/geometry/meshlet_batch_to_bvh.d.ts +0 -17
- package/src/shade/renderer/geometry/meshlet_batch_to_bvh.d.ts.map +0 -1
- package/src/shade/renderer/geometry/meshlet_batch_to_bvh.js +0 -247
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_query_blas_occlusion.d.ts +0 -7
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_query_blas_occlusion.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/bvh/bvh8/webgpu/chunk_bvh8_ray_query_blas_occlusion.js +0 -226
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mask_visibility_via_rays.d.ts +0 -8
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mask_visibility_via_rays.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mask_visibility_via_rays.js +0 -45
- package/src/shade/renderer/shader/chunk/light/sample/chunk_ray_sample_light.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/sample/chunk_ray_sample_light.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/sample/chunk_ray_sample_light.js +0 -105
- package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_distance.d.ts +0 -6
- package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_distance.d.ts.map +0 -1
- package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_distance.js +0 -86
- package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast_traversal_count.d.ts +0 -2
- package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast_traversal_count.d.ts.map +0 -1
- package/src/shade/renderer/shadow/sdf/chunk_ray_query_sdf_raycast_traversal_count.js +0 -136
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { EndianType } from "../../../../core/binary/EndianType.js";
|
|
2
|
-
import { BinaryDataType } from "../../../../core/binary/type/BinaryDataType.js";
|
|
3
|
-
import { RowFirstTableSpec } from "../../../../core/collection/table/RowFirstTableSpec.js";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Per-vertex attribute layout for a {@link TubeX}.
|
|
7
|
-
*
|
|
8
|
-
* Unlike {@link RibbonX} (which extrudes in screen space and therefore stores
|
|
9
|
-
* the neighbouring positions to derive a 2D normal), the tube extrudes in WORLD
|
|
10
|
-
* space inside the vertex shader using a per-knot tangent frame. Every vertex of
|
|
11
|
-
* a knot's ring shares the same centre/frame/colour/etc and differs only by `off`
|
|
12
|
-
* (its angular position around the ring), so the heavy per-frame work is just
|
|
13
|
-
* writing the knot centre + frame to the ring's `radial+1` rows.
|
|
14
|
-
*
|
|
15
|
-
* Layout is floats-first then a float16 colour triple, padded to a 4-byte multiple
|
|
16
|
-
* so the interleaved Float32 view (stride = bytesPerRecord >> 2) stays aligned —
|
|
17
|
-
* the same trick {@link ribbon_attributes_spec} relies on. The colour is linear and
|
|
18
|
-
* not limited to 0..1, so a trail can be brighter than white.
|
|
19
|
-
*/
|
|
20
|
-
export const tube_attributes_spec = new RowFirstTableSpec([
|
|
21
|
-
// age (CPU-side bookkeeping for the simulator; NOT a GPU attribute)
|
|
22
|
-
BinaryDataType.Float32,
|
|
23
|
-
|
|
24
|
-
// position (ring centre, world space)
|
|
25
|
-
BinaryDataType.Float32,
|
|
26
|
-
BinaryDataType.Float32,
|
|
27
|
-
BinaryDataType.Float32,
|
|
28
|
-
|
|
29
|
-
// frame normal (ring basis axis 1, world space, unit)
|
|
30
|
-
BinaryDataType.Float32,
|
|
31
|
-
BinaryDataType.Float32,
|
|
32
|
-
BinaryDataType.Float32,
|
|
33
|
-
|
|
34
|
-
// frame binormal (ring basis axis 2, world space, unit)
|
|
35
|
-
BinaryDataType.Float32,
|
|
36
|
-
BinaryDataType.Float32,
|
|
37
|
-
BinaryDataType.Float32,
|
|
38
|
-
|
|
39
|
-
// off (angular position around the ring, 0..1; STATIC per radial index = uv.x)
|
|
40
|
-
BinaryDataType.Float32,
|
|
41
|
-
|
|
42
|
-
// uv_v (position along the tube; DYNAMIC = uv.y)
|
|
43
|
-
BinaryDataType.Float32,
|
|
44
|
-
|
|
45
|
-
// alpha
|
|
46
|
-
BinaryDataType.Float32,
|
|
47
|
-
|
|
48
|
-
// thickness (tube diameter; radius = thickness * 0.5)
|
|
49
|
-
BinaryDataType.Float32,
|
|
50
|
-
|
|
51
|
-
// color (linear, unbounded)
|
|
52
|
-
BinaryDataType.Float16,
|
|
53
|
-
BinaryDataType.Float16,
|
|
54
|
-
BinaryDataType.Float16,
|
|
55
|
-
|
|
56
|
-
// padding -> bytesPerRecord = 64 (divisible by 4, keeps the Float32 view aligned)
|
|
57
|
-
BinaryDataType.Uint16,
|
|
58
|
-
|
|
59
|
-
], EndianType.LittleEndian);
|
|
60
|
-
|
|
61
|
-
// Column indices into {@link tube_attributes_spec} for RowFirstTable read/write.
|
|
62
|
-
export const TUBE_ATTRIBUTE_ADDRESS_AGE = 0;
|
|
63
|
-
export const TUBE_ATTRIBUTE_ADDRESS_POSITION = 1;
|
|
64
|
-
export const TUBE_ATTRIBUTE_ADDRESS_NORMAL = 4;
|
|
65
|
-
export const TUBE_ATTRIBUTE_ADDRESS_BINORMAL = 7;
|
|
66
|
-
export const TUBE_ATTRIBUTE_ADDRESS_OFF = 10;
|
|
67
|
-
export const TUBE_ATTRIBUTE_ADDRESS_UV_V = 11;
|
|
68
|
-
export const TUBE_ATTRIBUTE_ADDRESS_ALPHA = 12;
|
|
69
|
-
export const TUBE_ATTRIBUTE_ADDRESS_THICKNESS = 13;
|
|
70
|
-
export const TUBE_ATTRIBUTE_ADDRESS_COLOR = 14;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Extrude a {@link TubeX}'s knots into the geometry a {@link DynamicMesh} is already holding.
|
|
3
|
-
*
|
|
4
|
-
* **The ring is built here rather than in a shader, and that is what the path costs.** The legacy
|
|
5
|
-
* renderer draws a tube through a material of its own, so its vertex stage can hold the knot's
|
|
6
|
-
* frame and expand a ring from it; the dynamic path has one pipeline and one vertex layout —
|
|
7
|
-
* position and colour (D11) — so the same expansion happens on the CPU, once per knot ring per
|
|
8
|
-
* frame the trail moves. Widening the layout to carry a frame would mean a second pipeline for
|
|
9
|
-
* every dynamic mesh in the engine, which is the trade D5/D11 already refused.
|
|
10
|
-
*
|
|
11
|
-
* The arithmetic is `TubeMaterialX`'s, exactly: a ring vertex sits at its knot's centre displaced
|
|
12
|
-
* by `cos(angle) * normal + sin(angle) * binormal`, half a thickness out, at `angle = off * 2π`.
|
|
13
|
-
*
|
|
14
|
-
* **Written into rather than replaced.** GPU residency on the dynamic path is keyed on the geometry
|
|
15
|
-
* and survives leaving the batch, so a trail that produced a fresh geometry each frame would strand
|
|
16
|
-
* a vertex buffer per frame.
|
|
17
|
-
*
|
|
18
|
-
* Colour rides the vertices because that is what fades a trail along its length: the knot's own
|
|
19
|
-
* half-float colour as is, unclamped so HDR survives, with its alpha — the simulator's age fade, already scaled by the trail's
|
|
20
|
-
* base opacity — as the fourth channel. A knot that has aged out is written transparent rather than
|
|
21
|
-
* dropped, which is what the index buffer expects, and blending takes it out of the picture.
|
|
22
|
-
*
|
|
23
|
-
* **A knot's alpha is the opacity of the tube as seen, not of one face of it.** The tube is a closed
|
|
24
|
-
* hull drawn from both sides, so a line of sight through it crosses two faces, and the transparency
|
|
25
|
-
* pipeline composes their transmittances: written as is, an alpha of 0.5 would cover 0.75, and a
|
|
26
|
-
* linear fade would hold near solid for most of the trail's life and collapse at its tail. Each face
|
|
27
|
-
* therefore takes half the optical depth, `1 - √(1 - α)`, and the two together cover exactly `α`.
|
|
28
|
-
* This is the one place that knows the hull is crossed twice, so it is the one place that splits it;
|
|
29
|
-
* a ray through a bend crosses the tube twice over, and that overlap is real and reads denser. The
|
|
30
|
-
* alpha is clamped to `0..1` first, the range an opacity has — an authored fade curve may overshoot
|
|
31
|
-
* it, and the square root has no answer above one.
|
|
32
|
-
*
|
|
33
|
-
* @param {Geometry} geometry
|
|
34
|
-
* @param {TubeX} tube
|
|
35
|
-
* @returns {void}
|
|
36
|
-
*/
|
|
37
|
-
export function trail_tube_write_geometry(geometry: Geometry, tube: TubeX): void;
|
|
38
|
-
//# sourceMappingURL=trail_tube_write_geometry.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"trail_tube_write_geometry.d.ts","sourceRoot":"","sources":["../../../../../src/engine/graphics3/trail/trail_tube_write_geometry.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAmCG;AACH,4EAFa,IAAI,CAiEhB"}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { assert } from "../../../core/assert.js";
|
|
2
|
-
import { clamp01 } from "../../../core/math/clamp01.js";
|
|
3
|
-
import {
|
|
4
|
-
geometry_obtain_attribute,
|
|
5
|
-
geometry_obtain_index
|
|
6
|
-
} from "../../../shade/renderer/geometry/geometry_obtain_attribute.js";
|
|
7
|
-
import { StandardAttributes } from "../../../shade/renderer/geometry/StandardAttributes.js";
|
|
8
|
-
import {
|
|
9
|
-
TUBE_ATTRIBUTE_ADDRESS_ALPHA,
|
|
10
|
-
TUBE_ATTRIBUTE_ADDRESS_BINORMAL,
|
|
11
|
-
TUBE_ATTRIBUTE_ADDRESS_COLOR,
|
|
12
|
-
TUBE_ATTRIBUTE_ADDRESS_NORMAL,
|
|
13
|
-
TUBE_ATTRIBUTE_ADDRESS_OFF,
|
|
14
|
-
TUBE_ATTRIBUTE_ADDRESS_POSITION,
|
|
15
|
-
TUBE_ATTRIBUTE_ADDRESS_THICKNESS
|
|
16
|
-
} from "../../graphics/trail/tube/tube_attributes_spec.js";
|
|
17
|
-
|
|
18
|
-
const TWO_PI = Math.PI * 2;
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* Extrude a {@link TubeX}'s knots into the geometry a {@link DynamicMesh} is already holding.
|
|
22
|
-
*
|
|
23
|
-
* **The ring is built here rather than in a shader, and that is what the path costs.** The legacy
|
|
24
|
-
* renderer draws a tube through a material of its own, so its vertex stage can hold the knot's
|
|
25
|
-
* frame and expand a ring from it; the dynamic path has one pipeline and one vertex layout —
|
|
26
|
-
* position and colour (D11) — so the same expansion happens on the CPU, once per knot ring per
|
|
27
|
-
* frame the trail moves. Widening the layout to carry a frame would mean a second pipeline for
|
|
28
|
-
* every dynamic mesh in the engine, which is the trade D5/D11 already refused.
|
|
29
|
-
*
|
|
30
|
-
* The arithmetic is `TubeMaterialX`'s, exactly: a ring vertex sits at its knot's centre displaced
|
|
31
|
-
* by `cos(angle) * normal + sin(angle) * binormal`, half a thickness out, at `angle = off * 2π`.
|
|
32
|
-
*
|
|
33
|
-
* **Written into rather than replaced.** GPU residency on the dynamic path is keyed on the geometry
|
|
34
|
-
* and survives leaving the batch, so a trail that produced a fresh geometry each frame would strand
|
|
35
|
-
* a vertex buffer per frame.
|
|
36
|
-
*
|
|
37
|
-
* Colour rides the vertices because that is what fades a trail along its length: the knot's own
|
|
38
|
-
* half-float colour as is, unclamped so HDR survives, with its alpha — the simulator's age fade, already scaled by the trail's
|
|
39
|
-
* base opacity — as the fourth channel. A knot that has aged out is written transparent rather than
|
|
40
|
-
* dropped, which is what the index buffer expects, and blending takes it out of the picture.
|
|
41
|
-
*
|
|
42
|
-
* **A knot's alpha is the opacity of the tube as seen, not of one face of it.** The tube is a closed
|
|
43
|
-
* hull drawn from both sides, so a line of sight through it crosses two faces, and the transparency
|
|
44
|
-
* pipeline composes their transmittances: written as is, an alpha of 0.5 would cover 0.75, and a
|
|
45
|
-
* linear fade would hold near solid for most of the trail's life and collapse at its tail. Each face
|
|
46
|
-
* therefore takes half the optical depth, `1 - √(1 - α)`, and the two together cover exactly `α`.
|
|
47
|
-
* This is the one place that knows the hull is crossed twice, so it is the one place that splits it;
|
|
48
|
-
* a ray through a bend crosses the tube twice over, and that overlap is real and reads denser. The
|
|
49
|
-
* alpha is clamped to `0..1` first, the range an opacity has — an authored fade curve may overshoot
|
|
50
|
-
* it, and the square root has no answer above one.
|
|
51
|
-
*
|
|
52
|
-
* @param {Geometry} geometry
|
|
53
|
-
* @param {TubeX} tube
|
|
54
|
-
* @returns {void}
|
|
55
|
-
*/
|
|
56
|
-
export function trail_tube_write_geometry(geometry, tube) {
|
|
57
|
-
assert.defined(geometry, 'geometry');
|
|
58
|
-
assert.defined(tube, 'tube');
|
|
59
|
-
|
|
60
|
-
const vertex_count = tube.vertex_count;
|
|
61
|
-
|
|
62
|
-
const positions = geometry_obtain_attribute(geometry, StandardAttributes.Position, 3, vertex_count);
|
|
63
|
-
const colors = geometry_obtain_attribute(geometry, StandardAttributes.Color, 4, vertex_count);
|
|
64
|
-
|
|
65
|
-
const table = tube.table;
|
|
66
|
-
|
|
67
|
-
// Views over the knot rows, not a copy of them. Every attribute up to the colour is a float, so
|
|
68
|
-
// a column index is also its offset in the float view; the colour is three half floats at the
|
|
69
|
-
// column that follows them.
|
|
70
|
-
const floats = new Float32Array(table.data);
|
|
71
|
-
const halves = new Float16Array(table.data);
|
|
72
|
-
|
|
73
|
-
const float_stride = tube.bytes_per_vertex >> 2;
|
|
74
|
-
const half_stride = tube.bytes_per_vertex >> 1;
|
|
75
|
-
|
|
76
|
-
const color_offset = TUBE_ATTRIBUTE_ADDRESS_COLOR * 2;
|
|
77
|
-
|
|
78
|
-
for (let i = 0; i < vertex_count; i++) {
|
|
79
|
-
const f = i * float_stride;
|
|
80
|
-
|
|
81
|
-
const angle = floats[f + TUBE_ATTRIBUTE_ADDRESS_OFF] * TWO_PI;
|
|
82
|
-
|
|
83
|
-
const c = Math.cos(angle);
|
|
84
|
-
const s = Math.sin(angle);
|
|
85
|
-
|
|
86
|
-
const radius = floats[f + TUBE_ATTRIBUTE_ADDRESS_THICKNESS] * 0.5;
|
|
87
|
-
|
|
88
|
-
const nx = floats[f + TUBE_ATTRIBUTE_ADDRESS_NORMAL];
|
|
89
|
-
const ny = floats[f + TUBE_ATTRIBUTE_ADDRESS_NORMAL + 1];
|
|
90
|
-
const nz = floats[f + TUBE_ATTRIBUTE_ADDRESS_NORMAL + 2];
|
|
91
|
-
|
|
92
|
-
const bx = floats[f + TUBE_ATTRIBUTE_ADDRESS_BINORMAL];
|
|
93
|
-
const by = floats[f + TUBE_ATTRIBUTE_ADDRESS_BINORMAL + 1];
|
|
94
|
-
const bz = floats[f + TUBE_ATTRIBUTE_ADDRESS_BINORMAL + 2];
|
|
95
|
-
|
|
96
|
-
const p = i * 3;
|
|
97
|
-
|
|
98
|
-
positions[p] = floats[f + TUBE_ATTRIBUTE_ADDRESS_POSITION] + (c * nx + s * bx) * radius;
|
|
99
|
-
positions[p + 1] = floats[f + TUBE_ATTRIBUTE_ADDRESS_POSITION + 1] + (c * ny + s * by) * radius;
|
|
100
|
-
positions[p + 2] = floats[f + TUBE_ATTRIBUTE_ADDRESS_POSITION + 2] + (c * nz + s * bz) * radius;
|
|
101
|
-
|
|
102
|
-
const h = i * half_stride + color_offset;
|
|
103
|
-
const o = i * 4;
|
|
104
|
-
|
|
105
|
-
colors[o] = halves[h];
|
|
106
|
-
colors[o + 1] = halves[h + 1];
|
|
107
|
-
colors[o + 2] = halves[h + 2];
|
|
108
|
-
// half the optical depth: the face behind this one carries the other half
|
|
109
|
-
colors[o + 3] = 1 - Math.sqrt(1 - clamp01(floats[f + TUBE_ATTRIBUTE_ADDRESS_ALPHA]));
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
const source_indices = tube.indices;
|
|
113
|
-
|
|
114
|
-
const indices = geometry_obtain_index(geometry, source_indices.length);
|
|
115
|
-
|
|
116
|
-
indices.set(source_indices);
|
|
117
|
-
|
|
118
|
-
geometry.needsUpdate = true;
|
|
119
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* One tree in a batched refit: where it lives, and where its arrival counters live.
|
|
3
|
-
*
|
|
4
|
-
* The first five fields are what {@link GPUGeometryBVHManager#get_refit_target} answers, copied
|
|
5
|
-
* out at the frame the batch's tables are built. The other two are the batch's own: a tree's
|
|
6
|
-
* counters sit at `counters_offset` in one buffer that holds the counters of every tree in the
|
|
7
|
-
* batch — a prefix sum of node counts — and `geometry_index` is the row whose meshlets the leaf
|
|
8
|
-
* payloads index, which for a skinned clone is the clone's own row, the one skinning deformed.
|
|
9
|
-
*
|
|
10
|
-
* Read by {@link shader_blas_refit_batch} and {@link shader_blas_refit_batch_seed} once per
|
|
11
|
-
* workgroup, through their workgroup lookups;
|
|
12
|
-
* written by {@link GPUBLASRefitBatch} when the set of trees or their residency changes.
|
|
13
|
-
*
|
|
14
|
-
* @type {WebGPUStruct}
|
|
15
|
-
*/
|
|
16
|
-
export const BLAS_REFIT_TARGET_STRUCT: WebGPUStruct;
|
|
17
|
-
import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
|
|
18
|
-
//# sourceMappingURL=BLAS_REFIT_TARGET_STRUCT.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"BLAS_REFIT_TARGET_STRUCT.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/geometry/bvh/BLAS_REFIT_TARGET_STRUCT.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;GAcG;AACH,uCAFU,YAAY,CAiCA;6BAhDO,mCAAmC"}
|
|
@@ -1,50 +0,0 @@
|
|
|
1
|
-
import { u32 } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
2
|
-
import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* One tree in a batched refit: where it lives, and where its arrival counters live.
|
|
6
|
-
*
|
|
7
|
-
* The first five fields are what {@link GPUGeometryBVHManager#get_refit_target} answers, copied
|
|
8
|
-
* out at the frame the batch's tables are built. The other two are the batch's own: a tree's
|
|
9
|
-
* counters sit at `counters_offset` in one buffer that holds the counters of every tree in the
|
|
10
|
-
* batch — a prefix sum of node counts — and `geometry_index` is the row whose meshlets the leaf
|
|
11
|
-
* payloads index, which for a skinned clone is the clone's own row, the one skinning deformed.
|
|
12
|
-
*
|
|
13
|
-
* Read by {@link shader_blas_refit_batch} and {@link shader_blas_refit_batch_seed} once per
|
|
14
|
-
* workgroup, through their workgroup lookups;
|
|
15
|
-
* written by {@link GPUBLASRefitBatch} when the set of trees or their residency changes.
|
|
16
|
-
*
|
|
17
|
-
* @type {WebGPUStruct}
|
|
18
|
-
*/
|
|
19
|
-
export const BLAS_REFIT_TARGET_STRUCT = WebGPUStruct.from({
|
|
20
|
-
/**
|
|
21
|
-
* u32 word this tree's node 0 starts at in the node arena.
|
|
22
|
-
*/
|
|
23
|
-
node_word_offset: u32,
|
|
24
|
-
/**
|
|
25
|
-
* Where this tree's parents start in the parents arena.
|
|
26
|
-
*/
|
|
27
|
-
parents_offset: u32,
|
|
28
|
-
/**
|
|
29
|
-
* Where this tree's leaf list starts in the leaf-node arena.
|
|
30
|
-
*/
|
|
31
|
-
leaf_nodes_offset: u32,
|
|
32
|
-
/**
|
|
33
|
-
* Leaves in this tree — one triangle each, so also its triangle count.
|
|
34
|
-
*/
|
|
35
|
-
leaf_count: u32,
|
|
36
|
-
/**
|
|
37
|
-
* Node slots the tree spans from `node_word_offset`, holes included — what the seeding pass
|
|
38
|
-
* covers before every refit.
|
|
39
|
-
*/
|
|
40
|
-
node_count: u32,
|
|
41
|
-
/**
|
|
42
|
-
* Where this tree's arrival counters start in the batch's counters buffer, one word per node
|
|
43
|
-
* slot of the tree.
|
|
44
|
-
*/
|
|
45
|
-
counters_offset: u32,
|
|
46
|
-
/**
|
|
47
|
-
* Row in the geometry table whose meshlets the leaf payloads index into.
|
|
48
|
-
*/
|
|
49
|
-
geometry_index: u32,
|
|
50
|
-
}, "BlasRefitTarget");
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The two things a refit needs to know about a tree it did not build: who each node's parent is, and
|
|
3
|
-
* which nodes are the leaves.
|
|
4
|
-
*
|
|
5
|
-
* Read straight off the compressed node bytes — the same bytes that go to the GPU — rather than off
|
|
6
|
-
* the `BVH` object they came from. That is deliberate: the arena holds `node_capacity` slots and a
|
|
7
|
-
* `BVH` allocates from a free list, so the buffer contains holes that were never part of any tree
|
|
8
|
-
* and whose child words are whatever the last occupant left. Walking from the root visits exactly
|
|
9
|
-
* the tree, so a hole is never mistaken for a leaf and never gets a parent.
|
|
10
|
-
*
|
|
11
|
-
* Topology, not geometry. Every per-instance copy of a geometry has the same answer, so this is
|
|
12
|
-
* derived once per source and shared — only bounds are per-instance.
|
|
13
|
-
*
|
|
14
|
-
* @param {ArrayBuffer} nodes compressed BVH2 nodes, 32 bytes each, root at node 0
|
|
15
|
-
* @returns {{parents: Uint32Array, leaf_nodes: Uint32Array}} `parents` is indexed by node and holds
|
|
16
|
-
* `BVH_NULL_NODE` for the root and for every slot the tree does not reach; `leaf_nodes` lists the
|
|
17
|
-
* leaves in pre-order, which is the ordinal the refit dispatches one thread per.
|
|
18
|
-
*/
|
|
19
|
-
export function bvh2_derive_topology(nodes: ArrayBuffer): {
|
|
20
|
-
parents: Uint32Array;
|
|
21
|
-
leaf_nodes: Uint32Array;
|
|
22
|
-
};
|
|
23
|
-
//# sourceMappingURL=bvh2_derive_topology.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bvh2_derive_topology.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/geometry/bvh/bvh2_derive_topology.js"],"names":[],"mappings":"AAYA;;;;;;;;;;;;;;;;;GAiBG;AACH,4CALW,WAAW,GACT;IAAC,OAAO,EAAE,WAAW,CAAC;IAAC,UAAU,EAAE,WAAW,CAAA;CAAC,CA4D3D"}
|
|
@@ -1,87 +0,0 @@
|
|
|
1
|
-
import { assert } from "../../../../core/assert.js";
|
|
2
|
-
import {
|
|
3
|
-
BVH_NODE_CHILD_1_WORD,
|
|
4
|
-
BVH_NODE_CHILD_2_WORD,
|
|
5
|
-
BVH_NODE_STRIDE_WORDS
|
|
6
|
-
} from "../../gpu_primitive/bvh/BVH_BUFFER_LAYOUT.js";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* @type {number}
|
|
10
|
-
*/
|
|
11
|
-
const BVH_NULL_NODE = 0xffffffff;
|
|
12
|
-
|
|
13
|
-
/**
|
|
14
|
-
* The two things a refit needs to know about a tree it did not build: who each node's parent is, and
|
|
15
|
-
* which nodes are the leaves.
|
|
16
|
-
*
|
|
17
|
-
* Read straight off the compressed node bytes — the same bytes that go to the GPU — rather than off
|
|
18
|
-
* the `BVH` object they came from. That is deliberate: the arena holds `node_capacity` slots and a
|
|
19
|
-
* `BVH` allocates from a free list, so the buffer contains holes that were never part of any tree
|
|
20
|
-
* and whose child words are whatever the last occupant left. Walking from the root visits exactly
|
|
21
|
-
* the tree, so a hole is never mistaken for a leaf and never gets a parent.
|
|
22
|
-
*
|
|
23
|
-
* Topology, not geometry. Every per-instance copy of a geometry has the same answer, so this is
|
|
24
|
-
* derived once per source and shared — only bounds are per-instance.
|
|
25
|
-
*
|
|
26
|
-
* @param {ArrayBuffer} nodes compressed BVH2 nodes, 32 bytes each, root at node 0
|
|
27
|
-
* @returns {{parents: Uint32Array, leaf_nodes: Uint32Array}} `parents` is indexed by node and holds
|
|
28
|
-
* `BVH_NULL_NODE` for the root and for every slot the tree does not reach; `leaf_nodes` lists the
|
|
29
|
-
* leaves in pre-order, which is the ordinal the refit dispatches one thread per.
|
|
30
|
-
*/
|
|
31
|
-
export function bvh2_derive_topology(nodes) {
|
|
32
|
-
assert.defined(nodes, 'nodes');
|
|
33
|
-
|
|
34
|
-
const words = new Uint32Array(nodes);
|
|
35
|
-
|
|
36
|
-
const node_count = Math.floor(words.length / BVH_NODE_STRIDE_WORDS);
|
|
37
|
-
|
|
38
|
-
assert.greaterThan(node_count, 0, 'node_count');
|
|
39
|
-
|
|
40
|
-
const parents = new Uint32Array(node_count).fill(BVH_NULL_NODE);
|
|
41
|
-
|
|
42
|
-
const leaf_nodes = [];
|
|
43
|
-
|
|
44
|
-
const stack = [0];
|
|
45
|
-
|
|
46
|
-
let visited = 0;
|
|
47
|
-
|
|
48
|
-
while (stack.length > 0) {
|
|
49
|
-
const node = stack.pop();
|
|
50
|
-
|
|
51
|
-
visited += 1;
|
|
52
|
-
|
|
53
|
-
assert.lessThanOrEqual(visited, node_count, 'walk visited more nodes than the buffer holds — the tree is not a tree');
|
|
54
|
-
|
|
55
|
-
const base = node * BVH_NODE_STRIDE_WORDS;
|
|
56
|
-
|
|
57
|
-
const child_1 = words[base + BVH_NODE_CHILD_1_WORD];
|
|
58
|
-
|
|
59
|
-
if (child_1 === BVH_NULL_NODE) {
|
|
60
|
-
leaf_nodes.push(node);
|
|
61
|
-
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const child_2 = words[base + BVH_NODE_CHILD_2_WORD];
|
|
66
|
-
|
|
67
|
-
assert.greaterThan(child_1, 0, 'child_1 must be a non-root node');
|
|
68
|
-
assert.greaterThan(child_2, 0, 'child_2 must be a non-root node');
|
|
69
|
-
assert.lessThan(child_1, node_count, 'child_1 out of range');
|
|
70
|
-
assert.lessThan(child_2, node_count, 'child_2 out of range');
|
|
71
|
-
assert.notEqual(child_1, child_2, 'internal node children must be distinct');
|
|
72
|
-
assert.equal(parents[child_1], BVH_NULL_NODE, 'child_1 already has a parent');
|
|
73
|
-
assert.equal(parents[child_2], BVH_NULL_NODE, 'child_2 already has a parent');
|
|
74
|
-
|
|
75
|
-
parents[child_1] = node;
|
|
76
|
-
parents[child_2] = node;
|
|
77
|
-
|
|
78
|
-
// child_1 first out, so the leaf order is a pre-order walk rather than an artefact of
|
|
79
|
-
// which way the stack happens to run
|
|
80
|
-
stack.push(child_2, child_1);
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
return {
|
|
84
|
-
parents,
|
|
85
|
-
leaf_nodes: Uint32Array.from(leaf_nodes),
|
|
86
|
-
};
|
|
87
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Leaves per workgroup. A workgroup serves one tree and one aligned run of this many of its leaves,
|
|
3
|
-
* which is what the lookup's `leaf_base` counts in.
|
|
4
|
-
*
|
|
5
|
-
* @type {number}
|
|
6
|
-
*/
|
|
7
|
-
export const BLAS_REFIT_BATCH_WORKGROUP_SIZE: number;
|
|
8
|
-
/**
|
|
9
|
-
* Refit every tree in a batch, from one dispatch.
|
|
10
|
-
*
|
|
11
|
-
* One lane per leaf, across every tree the batch lists: the lane finds its tree and its leaf through
|
|
12
|
-
* the workgroup lookup, rewrites that leaf's box from the triangle it names as the vertex buffer
|
|
13
|
-
* holds it *now*, and climbs — {@link chunk_bvh_refit_climb}, the same arrival-counter climb the
|
|
14
|
-
* LBVH build ends with, at this tree's positions in the shared arenas. Topology is untouched:
|
|
15
|
-
* nothing is sorted, nothing is emitted, no node's children change.
|
|
16
|
-
*
|
|
17
|
-
* Batched rather than per tree because a refit's cost is not the refit. A tree's climb is a chain
|
|
18
|
-
* of dependent atomics as long as the tree is deep, with half the live lanes exiting at every
|
|
19
|
-
* level; on its own it is a long tail of a nearly idle GPU, and a dispatch per tree serialises
|
|
20
|
-
* `N` such tails behind `2N` pass boundaries. In one dispatch a small tree's climb overlaps the
|
|
21
|
-
* next tree's, and the command count is the same for one skinned mesh as for three hundred.
|
|
22
|
-
*
|
|
23
|
-
* Fused rather than two passes: the leaf box is stored through the same atomic words the climb
|
|
24
|
-
* reads, before the lane's first arrival, so the second arrival at its parent reads it exactly as
|
|
25
|
-
* it reads an internal node's — including when it has not arrived yet. Arriving second does not
|
|
26
|
-
* order the sibling's stores (R1 in GPU_BVH_BUILD_PLAN.md), so every bound word is seeded with
|
|
27
|
-
* {@link BVH_UNFITTED} a dispatch earlier ({@link shader_blas_refit_batch_seed}), the climb defers
|
|
28
|
-
* the nodes it cannot see whole to the list in `refit_deferred`, and
|
|
29
|
-
* {@link shader_bvh_refit_repair} grows them a dispatch later — the build's own repair, over every
|
|
30
|
-
* tree in the batch at once.
|
|
31
|
-
*
|
|
32
|
-
* For a skinned mesh this runs against the per-instance clone, after the skinning pass has deformed
|
|
33
|
-
* its vertex region; `geometry_index` on the row is the clone's, and reading the source instead
|
|
34
|
-
* would produce the rest pose.
|
|
35
|
-
*
|
|
36
|
-
* Recorded by {@link GPUBLASRefitBatch}, which builds the tables and paginates the dispatch.
|
|
37
|
-
*
|
|
38
|
-
* @type {ComputeShader}
|
|
39
|
-
*/
|
|
40
|
-
export const shader_blas_refit_batch: ComputeShader;
|
|
41
|
-
import { ComputeShader } from "../../shader/ComputeShader.js";
|
|
42
|
-
//# sourceMappingURL=shader_blas_refit_batch.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shader_blas_refit_batch.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/geometry/bvh/shader_blas_refit_batch.js"],"names":[],"mappings":"AAeA;;;;;GAKG;AACH,8CAFU,MAAM,CAEkC;AAmFlD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,sCAFU,aAAa,CAMpB;8BAzI2B,+BAA+B"}
|
|
@@ -1,141 +0,0 @@
|
|
|
1
|
-
import { atomic_u32, u32 } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
2
|
-
import { WebGPUArray } from "../../shader/type/WebGPUArray.js";
|
|
3
|
-
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
4
|
-
import { ComputeShader } from "../../shader/ComputeShader.js";
|
|
5
|
-
import { ShaderResourceSetDescriptor } from "../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
6
|
-
import { BVH_NODE_LAYOUT_DEFINITION } from "../../gpu_primitive/bvh/BVH_NODE_LAYOUT_DEFINITION.js";
|
|
7
|
-
import { chunk_bvh_refit_climb } from "../../gpu_primitive/bvh/chunk_bvh_refit_climb.js";
|
|
8
|
-
import {
|
|
9
|
-
chunk_geometry_read_triangle_bounds
|
|
10
|
-
} from "../../shader/chunk/geometry/format/chunk_geometry_read_triangle_bounds.js";
|
|
11
|
-
import { GEOMETRY_ATTRIBUTE_DATA_TYPE } from "../GEOMETRY_ATTRIBUTE_DATA_TYPE.js";
|
|
12
|
-
import { GEOMETRY_METADATA_STRUCT } from "../GEOMETRY_METADATA_STRUCT.js";
|
|
13
|
-
import { MESHLET_METADATA_STRUCT } from "../meshlet/encoding/MESHLET_METADATA_STRUCT.js";
|
|
14
|
-
import { BLAS_REFIT_TARGET_STRUCT } from "./BLAS_REFIT_TARGET_STRUCT.js";
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Leaves per workgroup. A workgroup serves one tree and one aligned run of this many of its leaves,
|
|
18
|
-
* which is what the lookup's `leaf_base` counts in.
|
|
19
|
-
*
|
|
20
|
-
* @type {number}
|
|
21
|
-
*/
|
|
22
|
-
export const BLAS_REFIT_BATCH_WORKGROUP_SIZE = 64;
|
|
23
|
-
|
|
24
|
-
const resources = new ShaderResourceSetDescriptor();
|
|
25
|
-
|
|
26
|
-
// Workgroups already covered by earlier sub-dispatches of the same batch, for a batch larger than
|
|
27
|
-
// the device's per-dimension cap. Four bytes, per dispatch: immediate data.
|
|
28
|
-
resources.setImmediate("dispatch_offset", u32);
|
|
29
|
-
|
|
30
|
-
resources.createGroup()
|
|
31
|
-
// one row per tree in the batch — where it lives, and where its counters live
|
|
32
|
-
.addStorageBuffer("targets", WebGPUArray.from(BLAS_REFIT_TARGET_STRUCT), false)
|
|
33
|
-
// `(target_index, leaf_base)` per workgroup, flat
|
|
34
|
-
.addStorageBuffer("lookup", WebGPUArray.from(u32), false)
|
|
35
|
-
// node index of each leaf ordinal, per tree, at the tree's `leaf_nodes_offset`
|
|
36
|
-
.addStorageBuffer("leaf_nodes", WebGPUArray.from(u32), false)
|
|
37
|
-
// parent of every node, per tree, at the tree's `parents_offset`
|
|
38
|
-
.addStorageBuffer("parents", WebGPUArray.from(u32), false)
|
|
39
|
-
// one arrival counter per node slot of every tree, at each tree's `counters_offset`; zero at
|
|
40
|
-
// the start of every batch
|
|
41
|
-
.addStorageBuffer("counters", WebGPUArray.from(atomic_u32), true)
|
|
42
|
-
// The node arena, flat and atomic. Every word this kernel writes is communicated between
|
|
43
|
-
// invocations — a leaf box to the second arrival at its parent, a node box to the next — so
|
|
44
|
-
// every access to it is an atomic one. Its bound words arrive seeded by
|
|
45
|
-
// shader_blas_refit_batch_seed.
|
|
46
|
-
.addStorageBuffer("nodes", WebGPUArray.from(atomic_u32), true)
|
|
47
|
-
// the nodes whose children had not all reached their second arrival, every tree's, for the
|
|
48
|
-
// repair; header zero at the start of every batch
|
|
49
|
-
.addStorageBuffer("refit_deferred", WebGPUArray.from(atomic_u32), true)
|
|
50
|
-
.addStorageBuffer("geometries", WebGPUArray.from(GEOMETRY_METADATA_STRUCT), false)
|
|
51
|
-
.addStorageBuffer("meshlet_metadata", WebGPUArray.from(MESHLET_METADATA_STRUCT), false)
|
|
52
|
-
.addStorageBuffer("meshlet_data", GEOMETRY_ATTRIBUTE_DATA_TYPE, false);
|
|
53
|
-
|
|
54
|
-
const body = CodeChunk.from(
|
|
55
|
-
//language=WGSL
|
|
56
|
-
`
|
|
57
|
-
@compute @workgroup_size(${BLAS_REFIT_BATCH_WORKGROUP_SIZE}, 1, 1)
|
|
58
|
-
fn main(
|
|
59
|
-
@builtin(workgroup_id) wg: vec3<u32>,
|
|
60
|
-
@builtin(local_invocation_id) lid: vec3<u32>,
|
|
61
|
-
) {
|
|
62
|
-
// Which tree, and which run of its leaves: one lookup pair per workgroup, so the row read below
|
|
63
|
-
// is uniform across the workgroup and the leaf list read is one contiguous run.
|
|
64
|
-
let pair = (wg.x + dispatch_offset) * 2u;
|
|
65
|
-
|
|
66
|
-
// ("target" is a reserved word in WGSL)
|
|
67
|
-
let tree = targets[lookup[pair]];
|
|
68
|
-
|
|
69
|
-
let leaf = lookup[pair + 1u] + lid.x;
|
|
70
|
-
|
|
71
|
-
if (leaf >= tree.leaf_count) {
|
|
72
|
-
// the tail of a tree's last run; the next workgroup is another tree's
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
let leaf_node = leaf_nodes[tree.leaf_nodes_offset + leaf];
|
|
77
|
-
|
|
78
|
-
let leaf_word = tree.node_word_offset + leaf_node * BVH_NODE_STRIDE;
|
|
79
|
-
|
|
80
|
-
// The leaf already says which triangle it holds — its payload is what the ray query hands to
|
|
81
|
-
// the triangle test. Reading it back means no side table has to agree with the tree about
|
|
82
|
-
// which leaf is which.
|
|
83
|
-
let payload = atomicLoad(&nodes[leaf_word + BVH_NODE_CHILD_2]);
|
|
84
|
-
|
|
85
|
-
let box = geometry_read_triangle_bounds(geometries[tree.geometry_index], payload);
|
|
86
|
-
|
|
87
|
-
// This leaf's box, then the climb from it. The box is written before this lane's first arrival
|
|
88
|
-
// at the parent, through the same atomic words the climb reads every other box through, so the
|
|
89
|
-
// second arrival at the parent finds it exactly as it finds an internal node's.
|
|
90
|
-
bvh_node_store_bounds(leaf_word, box.min, box.max);
|
|
91
|
-
|
|
92
|
-
bvh_refit_climb(
|
|
93
|
-
tree.node_word_offset,
|
|
94
|
-
tree.parents_offset,
|
|
95
|
-
tree.counters_offset,
|
|
96
|
-
leaf_node
|
|
97
|
-
);
|
|
98
|
-
}
|
|
99
|
-
`, [
|
|
100
|
-
BVH_NODE_LAYOUT_DEFINITION,
|
|
101
|
-
chunk_bvh_refit_climb,
|
|
102
|
-
chunk_geometry_read_triangle_bounds,
|
|
103
|
-
]);
|
|
104
|
-
|
|
105
|
-
/**
|
|
106
|
-
* Refit every tree in a batch, from one dispatch.
|
|
107
|
-
*
|
|
108
|
-
* One lane per leaf, across every tree the batch lists: the lane finds its tree and its leaf through
|
|
109
|
-
* the workgroup lookup, rewrites that leaf's box from the triangle it names as the vertex buffer
|
|
110
|
-
* holds it *now*, and climbs — {@link chunk_bvh_refit_climb}, the same arrival-counter climb the
|
|
111
|
-
* LBVH build ends with, at this tree's positions in the shared arenas. Topology is untouched:
|
|
112
|
-
* nothing is sorted, nothing is emitted, no node's children change.
|
|
113
|
-
*
|
|
114
|
-
* Batched rather than per tree because a refit's cost is not the refit. A tree's climb is a chain
|
|
115
|
-
* of dependent atomics as long as the tree is deep, with half the live lanes exiting at every
|
|
116
|
-
* level; on its own it is a long tail of a nearly idle GPU, and a dispatch per tree serialises
|
|
117
|
-
* `N` such tails behind `2N` pass boundaries. In one dispatch a small tree's climb overlaps the
|
|
118
|
-
* next tree's, and the command count is the same for one skinned mesh as for three hundred.
|
|
119
|
-
*
|
|
120
|
-
* Fused rather than two passes: the leaf box is stored through the same atomic words the climb
|
|
121
|
-
* reads, before the lane's first arrival, so the second arrival at its parent reads it exactly as
|
|
122
|
-
* it reads an internal node's — including when it has not arrived yet. Arriving second does not
|
|
123
|
-
* order the sibling's stores (R1 in GPU_BVH_BUILD_PLAN.md), so every bound word is seeded with
|
|
124
|
-
* {@link BVH_UNFITTED} a dispatch earlier ({@link shader_blas_refit_batch_seed}), the climb defers
|
|
125
|
-
* the nodes it cannot see whole to the list in `refit_deferred`, and
|
|
126
|
-
* {@link shader_bvh_refit_repair} grows them a dispatch later — the build's own repair, over every
|
|
127
|
-
* tree in the batch at once.
|
|
128
|
-
*
|
|
129
|
-
* For a skinned mesh this runs against the per-instance clone, after the skinning pass has deformed
|
|
130
|
-
* its vertex region; `geometry_index` on the row is the clone's, and reading the source instead
|
|
131
|
-
* would produce the rest pose.
|
|
132
|
-
*
|
|
133
|
-
* Recorded by {@link GPUBLASRefitBatch}, which builds the tables and paginates the dispatch.
|
|
134
|
-
*
|
|
135
|
-
* @type {ComputeShader}
|
|
136
|
-
*/
|
|
137
|
-
export const shader_blas_refit_batch = ComputeShader.from({
|
|
138
|
-
label: "BLAS/RefitBatch",
|
|
139
|
-
resources,
|
|
140
|
-
body,
|
|
141
|
-
});
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Seed every bound word of every tree in a batch with {@link BVH_UNFITTED}, a dispatch ahead of
|
|
3
|
-
* {@link shader_blas_refit_batch}.
|
|
4
|
-
*
|
|
5
|
-
* The batch refit hands boxes between invocations through relaxed atomics — leaf boxes included,
|
|
6
|
-
* since it writes them in the same dispatch — and a store need not reach the reader before the
|
|
7
|
-
* dispatch ends. What this leaves behind is what such a read returns, so the climb can see a box
|
|
8
|
-
* that has not arrived instead of taking last frame's for it. For a skinned mesh last frame's box
|
|
9
|
-
* is close to this frame's, so taking it would go unnoticed.
|
|
10
|
-
*
|
|
11
|
-
* One lane per node slot, holes included: the arena's trees keep the slots their builder allocated,
|
|
12
|
-
* and seeding a hole costs six stores where telling it apart would cost a walk. The bounds words are
|
|
13
|
-
* all it touches; children and payloads are the tree's topology and stay as they are.
|
|
14
|
-
*
|
|
15
|
-
* Recorded by {@link GPUBLASRefitBatch}, paginated as the refit is.
|
|
16
|
-
*
|
|
17
|
-
* @type {ComputeShader}
|
|
18
|
-
*/
|
|
19
|
-
export const shader_blas_refit_batch_seed: ComputeShader;
|
|
20
|
-
import { ComputeShader } from "../../shader/ComputeShader.js";
|
|
21
|
-
//# sourceMappingURL=shader_blas_refit_batch_seed.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"shader_blas_refit_batch_seed.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/geometry/bvh/shader_blas_refit_batch_seed.js"],"names":[],"mappings":"AAoDA;;;;;;;;;;;;;;;;;GAiBG;AACH,2CAFU,aAAa,CAMpB;8BAvE2B,+BAA+B"}
|