@woosh/meep-engine 3.70.0 → 3.71.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (347) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/MIGRATION_2_TO_3.md +1 -1
  3. package/package.json +1 -1
  4. package/src/engine/graphics3/VolumetricLightMapSystem.d.ts +1 -1
  5. package/src/engine/graphics3/VolumetricLightMapSystem.js +261 -261
  6. package/src/engine/input/devices/PointerDevice.d.ts +12 -1
  7. package/src/engine/input/devices/PointerDevice.d.ts.map +1 -1
  8. package/src/engine/input/devices/PointerDevice.js +266 -24
  9. package/src/engine/input/devices/mouse/MouseButtons.d.ts +1 -2
  10. package/src/engine/input/devices/mouse/MouseButtons.d.ts.map +1 -1
  11. package/src/engine/input/devices/mouse/MouseButtons.js +1 -2
  12. package/src/engine/input/devices/mouse/mouseButtonToEventButtonsMask.d.ts +13 -0
  13. package/src/engine/input/devices/mouse/mouseButtonToEventButtonsMask.d.ts.map +1 -0
  14. package/src/engine/input/devices/mouse/mouseButtonToEventButtonsMask.js +24 -0
  15. package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
  16. package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +3 -1
  17. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  18. package/src/engine/sound/simulation/probe/probe_place_sdf_cover.d.ts +1 -2
  19. package/src/engine/sound/simulation/probe/probe_place_sdf_cover.d.ts.map +1 -1
  20. package/src/engine/sound/simulation/probe/probe_place_sdf_cover.js +1 -2
  21. package/src/shade/renderer/Renderer.d.ts +0 -12
  22. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  23. package/src/shade/renderer/Renderer.js +0 -101
  24. package/src/shade/renderer/ShadeIndirectLightingMode.d.ts +0 -1
  25. package/src/shade/renderer/ShadeIndirectLightingMode.js +0 -2
  26. package/src/shade/renderer/atmosphere/ATMOSPHERE_PARAMETERS_STRUCT.d.ts.map +1 -1
  27. package/src/shade/renderer/atmosphere/ATMOSPHERE_PARAMETERS_STRUCT.js +7 -0
  28. package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.d.ts.map +1 -1
  29. package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.js +1 -4
  30. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
  31. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
  32. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -7
  33. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  34. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  35. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +1 -1
  36. package/src/shade/renderer/light/GPULightCollection.d.ts +3 -2
  37. package/src/shade/renderer/light/GPULightCollection.d.ts.map +1 -1
  38. package/src/shade/renderer/light/GPULightCollection.js +28 -2
  39. package/src/shade/renderer/light/environment/shader_project_environment_sh.d.ts +2 -2
  40. package/src/shade/renderer/light/environment/shader_project_environment_sh.js +2 -2
  41. package/src/shade/renderer/light/make_sunlight.d.ts +14 -0
  42. package/src/shade/renderer/light/make_sunlight.d.ts.map +1 -1
  43. package/src/shade/renderer/light/make_sunlight.js +16 -2
  44. package/src/shade/renderer/light/model/DirectionalLight.d.ts +9 -0
  45. package/src/shade/renderer/light/model/DirectionalLight.d.ts.map +1 -1
  46. package/src/shade/renderer/light/model/DirectionalLight.js +10 -1
  47. package/src/shade/renderer/light/model/Light.d.ts +4 -2
  48. package/src/shade/renderer/light/model/Light.d.ts.map +1 -1
  49. package/src/shade/renderer/light/model/Light.js +4 -2
  50. package/src/shade/renderer/light/model/io/light_record_directional.d.ts.map +1 -1
  51. package/src/shade/renderer/light/model/io/light_record_directional.js +3 -0
  52. package/src/shade/renderer/light/shader_refresh_light_poses.d.ts +16 -1
  53. package/src/shade/renderer/light/shader_refresh_light_poses.d.ts.map +1 -1
  54. package/src/shade/renderer/light/shader_refresh_light_poses.js +211 -154
  55. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  56. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  57. package/src/shade/renderer/postprocess/ssr/SSR.d.ts +2 -5
  58. package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
  59. package/src/shade/renderer/postprocess/ssr/SSR.js +1 -13
  60. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.d.ts +2 -9
  61. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.d.ts.map +1 -1
  62. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.js +2 -38
  63. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts +0 -5
  64. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts.map +1 -1
  65. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.js +0 -16
  66. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.d.ts.map +1 -1
  67. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js +3 -10
  68. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect.d.ts +0 -2
  69. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect.d.ts.map +1 -1
  70. package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect.js +0 -3
  71. package/src/shade/renderer/scene/GPUSceneContext.d.ts +0 -6
  72. package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
  73. package/src/shade/renderer/scene/GPUSceneContext.js +0 -19
  74. package/src/shade/renderer/scene/Scene.d.ts +1 -7
  75. package/src/shade/renderer/scene/Scene.d.ts.map +1 -1
  76. package/src/shade/renderer/scene/Scene.js +1 -8
  77. package/src/shade/renderer/scene/bvh/sdf_build_from_scene.d.ts.map +1 -0
  78. package/src/shade/renderer/{global_illumination/lpv/placement/software → scene/bvh}/sdf_build_from_scene.js +6 -6
  79. package/src/shade/renderer/scene/bvh/sdf_find_local_maxima.d.ts.map +1 -0
  80. package/src/shade/renderer/{global_illumination/lpv/placement/software → scene/bvh}/sdf_find_local_maxima.js +1 -1
  81. package/src/shade/renderer/shader/chunk/light/DIRECTIONAL_LIGHT_STRUCT.d.ts.map +1 -1
  82. package/src/shade/renderer/shader/chunk/light/DIRECTIONAL_LIGHT_STRUCT.js +12 -2
  83. package/src/shade/renderer/shader/chunk/light/io/chunk_point_lights_iterate.d.ts +1 -1
  84. package/src/shade/renderer/shader/chunk/light/io/chunk_point_lights_iterate.js +1 -1
  85. package/src/shade/renderer/{global_illumination/probe/octahedral/sample → shader/chunk/light/probe}/chunk_parallax_correct_spherical_probe.d.ts +1 -1
  86. package/src/shade/renderer/shader/chunk/light/probe/chunk_parallax_correct_spherical_probe.d.ts.map +1 -0
  87. package/src/shade/renderer/{global_illumination/probe/octahedral/sample → shader/chunk/light/probe}/chunk_parallax_correct_spherical_probe.js +2 -2
  88. package/src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.d.ts +1 -1
  89. package/src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.js +1 -1
  90. package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh2_dering_optimize_positive.d.ts +1 -2
  91. package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh2_dering_optimize_positive.d.ts.map +1 -1
  92. package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh2_dering_optimize_positive.js +1 -2
  93. package/src/shade/renderer/trails/GPUTrailSystem.d.ts +4 -0
  94. package/src/shade/renderer/trails/GPUTrailSystem.d.ts.map +1 -1
  95. package/src/shade/renderer/trails/GPUTrailSystem.js +9 -3
  96. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts +1 -3
  97. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
  98. package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +0 -3
  99. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts +2 -2
  100. package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.js +2 -2
  101. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts +1 -3
  102. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
  103. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +0 -9
  104. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts +0 -5
  105. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts.map +1 -1
  106. package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.js +0 -29
  107. package/src/shade/renderer/volumetrics/irradiance_clipmap/shader_irradiance_clipmap_build.d.ts.map +1 -1
  108. package/src/shade/renderer/volumetrics/irradiance_clipmap/shader_irradiance_clipmap_build.js +0 -2
  109. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.d.ts.map +1 -1
  110. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +11 -6
  111. package/src/shade/renderer/volumetrics/shader_volumetrics_build_scattering_lut.d.ts.map +1 -1
  112. package/src/shade/renderer/volumetrics/shader_volumetrics_build_scattering_lut.js +10 -4
  113. package/src/shade/renderer/water/chunk_water_gi.d.ts +1 -1
  114. package/src/shade/renderer/water/chunk_water_gi.d.ts.map +1 -1
  115. package/src/shade/renderer/water/chunk_water_gi.js +1 -3
  116. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
  117. package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
  118. package/src/shade/renderer/deferred/indirect/chunk_gi_sample_lpv_cache.d.ts +0 -3
  119. package/src/shade/renderer/deferred/indirect/chunk_gi_sample_lpv_cache.d.ts.map +0 -1
  120. package/src/shade/renderer/deferred/indirect/chunk_gi_sample_lpv_cache.js +0 -41
  121. package/src/shade/renderer/deferred/indirect/chunk_lpv_2d_cache_sample_irradiance.d.ts +0 -6
  122. package/src/shade/renderer/deferred/indirect/chunk_lpv_2d_cache_sample_irradiance.d.ts.map +0 -1
  123. package/src/shade/renderer/deferred/indirect/chunk_lpv_2d_cache_sample_irradiance.js +0 -108
  124. package/src/shade/renderer/deferred/indirect/chunk_lpv_sample_light.d.ts +0 -6
  125. package/src/shade/renderer/deferred/indirect/chunk_lpv_sample_light.d.ts.map +0 -1
  126. package/src/shade/renderer/deferred/indirect/chunk_lpv_sample_light.js +0 -100
  127. package/src/shade/renderer/global_illumination/lpv/GPULightProbeVolume.d.ts +0 -51
  128. package/src/shade/renderer/global_illumination/lpv/GPULightProbeVolume.d.ts.map +0 -1
  129. package/src/shade/renderer/global_illumination/lpv/GPULightProbeVolume.js +0 -384
  130. package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_STRUCT.d.ts +0 -3
  131. package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_STRUCT.d.ts.map +0 -1
  132. package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_STRUCT.js +0 -20
  133. package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_VOLUME_METADATA_STRUCT.d.ts +0 -3
  134. package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_VOLUME_METADATA_STRUCT.d.ts.map +0 -1
  135. package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_VOLUME_METADATA_STRUCT.js +0 -10
  136. package/src/shade/renderer/global_illumination/lpv/LightProbeVolume.d.ts +0 -63
  137. package/src/shade/renderer/global_illumination/lpv/LightProbeVolume.d.ts.map +0 -1
  138. package/src/shade/renderer/global_illumination/lpv/LightProbeVolume.js +0 -177
  139. package/src/shade/renderer/global_illumination/lpv/TETRAHEDRAL_MESH_CELL_STRUCT.d.ts +0 -3
  140. package/src/shade/renderer/global_illumination/lpv/TETRAHEDRAL_MESH_CELL_STRUCT.d.ts.map +0 -1
  141. package/src/shade/renderer/global_illumination/lpv/TETRAHEDRAL_MESH_CELL_STRUCT.js +0 -7
  142. package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.d.ts +0 -68
  143. package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.d.ts.map +0 -1
  144. package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.js +0 -410
  145. package/src/shade/renderer/global_illumination/lpv/bake/PROBE_RAYS_PER_WORKGROUP.d.ts +0 -2
  146. package/src/shade/renderer/global_illumination/lpv/bake/PROBE_RAYS_PER_WORKGROUP.d.ts.map +0 -1
  147. package/src/shade/renderer/global_illumination/lpv/bake/PROBE_RAYS_PER_WORKGROUP.js +0 -1
  148. package/src/shade/renderer/global_illumination/lpv/debug/shader_visualize_probe_depth.d.ts +0 -3
  149. package/src/shade/renderer/global_illumination/lpv/debug/shader_visualize_probe_depth.d.ts.map +0 -1
  150. package/src/shade/renderer/global_illumination/lpv/debug/shader_visualize_probe_depth.js +0 -38
  151. package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_RESOLUTION.d.ts +0 -8
  152. package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_RESOLUTION.d.ts.map +0 -1
  153. package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_RESOLUTION.js +0 -7
  154. package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_STRUCT.d.ts +0 -3
  155. package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_STRUCT.d.ts.map +0 -1
  156. package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_STRUCT.js +0 -8
  157. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_get_visibility_mask.d.ts +0 -3
  158. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_get_visibility_mask.d.ts.map +0 -1
  159. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_get_visibility_mask.js +0 -48
  160. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_coordinate_to_address.d.ts +0 -3
  161. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_coordinate_to_address.d.ts.map +0 -1
  162. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_coordinate_to_address.js +0 -11
  163. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_get_pixel.d.ts +0 -3
  164. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_get_pixel.d.ts.map +0 -1
  165. package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_get_pixel.js +0 -20
  166. package/src/shade/renderer/global_illumination/lpv/deprecated/probe_trace_compute_shader_code.d.ts +0 -5
  167. package/src/shade/renderer/global_illumination/lpv/deprecated/probe_trace_compute_shader_code.d.ts.map +0 -1
  168. package/src/shade/renderer/global_illumination/lpv/deprecated/probe_trace_compute_shader_code.js +0 -206
  169. package/src/shade/renderer/global_illumination/lpv/edit/AddProbeAction.d.ts +0 -14
  170. package/src/shade/renderer/global_illumination/lpv/edit/AddProbeAction.d.ts.map +0 -1
  171. package/src/shade/renderer/global_illumination/lpv/edit/AddProbeAction.js +0 -39
  172. package/src/shade/renderer/global_illumination/lpv/graph_bake_irradiance_lookup_2d.d.ts +0 -16
  173. package/src/shade/renderer/global_illumination/lpv/graph_bake_irradiance_lookup_2d.d.ts.map +0 -1
  174. package/src/shade/renderer/global_illumination/lpv/graph_bake_irradiance_lookup_2d.js +0 -201
  175. package/src/shade/renderer/global_illumination/lpv/lpv_jitter_points.d.ts +0 -10
  176. package/src/shade/renderer/global_illumination/lpv/lpv_jitter_points.d.ts.map +0 -1
  177. package/src/shade/renderer/global_illumination/lpv/lpv_jitter_points.js +0 -27
  178. package/src/shade/renderer/global_illumination/lpv/lpv_visualise_probes.d.ts +0 -18
  179. package/src/shade/renderer/global_illumination/lpv/lpv_visualise_probes.d.ts.map +0 -1
  180. package/src/shade/renderer/global_illumination/lpv/lpv_visualise_probes.js +0 -265
  181. package/src/shade/renderer/global_illumination/lpv/placement/chunk_refine_probe_placement.d.ts +0 -7
  182. package/src/shade/renderer/global_illumination/lpv/placement/chunk_refine_probe_placement.d.ts.map +0 -1
  183. package/src/shade/renderer/global_illumination/lpv/placement/chunk_refine_probe_placement.js +0 -126
  184. package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.d.ts +0 -13
  185. package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.d.ts.map +0 -1
  186. package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.js +0 -373
  187. package/src/shade/renderer/global_illumination/lpv/placement/software/lpv_generate_probe_locations2.d.ts +0 -14
  188. package/src/shade/renderer/global_illumination/lpv/placement/software/lpv_generate_probe_locations2.d.ts.map +0 -1
  189. package/src/shade/renderer/global_illumination/lpv/placement/software/lpv_generate_probe_locations2.js +0 -225
  190. package/src/shade/renderer/global_illumination/lpv/placement/software/sdf_build_from_scene.d.ts.map +0 -1
  191. package/src/shade/renderer/global_illumination/lpv/placement/software/sdf_find_local_maxima.d.ts.map +0 -1
  192. package/src/shade/renderer/global_illumination/lpv/shader_diffuse_LPV.d.ts +0 -3
  193. package/src/shade/renderer/global_illumination/lpv/shader_diffuse_LPV.d.ts.map +0 -1
  194. package/src/shade/renderer/global_illumination/lpv/shader_diffuse_LPV.js +0 -91
  195. package/src/shade/renderer/global_illumination/probe/chunk_compute_probe_dering.d.ts +0 -5
  196. package/src/shade/renderer/global_illumination/probe/chunk_compute_probe_dering.d.ts.map +0 -1
  197. package/src/shade/renderer/global_illumination/probe/chunk_compute_probe_dering.js +0 -45
  198. package/src/shade/renderer/global_illumination/probe/compute_pipeline_probe_dering.d.ts +0 -3
  199. package/src/shade/renderer/global_illumination/probe/compute_pipeline_probe_dering.d.ts.map +0 -1
  200. package/src/shade/renderer/global_illumination/probe/compute_pipeline_probe_dering.js +0 -17
  201. package/src/shade/renderer/global_illumination/probe/lpv_dering_software.d.ts +0 -6
  202. package/src/shade/renderer/global_illumination/probe/lpv_dering_software.d.ts.map +0 -1
  203. package/src/shade/renderer/global_illumination/probe/lpv_dering_software.js +0 -21
  204. package/src/shade/renderer/global_illumination/probe/octahedral/GPUProbeAtlas.d.ts +0 -79
  205. package/src/shade/renderer/global_illumination/probe/octahedral/GPUProbeAtlas.d.ts.map +0 -1
  206. package/src/shade/renderer/global_illumination/probe/octahedral/GPUProbeAtlas.js +0 -437
  207. package/src/shade/renderer/global_illumination/probe/octahedral/LPV_ACCUMULATION_PUSH_CONSTANTS.d.ts +0 -3
  208. package/src/shade/renderer/global_illumination/probe/octahedral/LPV_ACCUMULATION_PUSH_CONSTANTS.d.ts.map +0 -1
  209. package/src/shade/renderer/global_illumination/probe/octahedral/LPV_ACCUMULATION_PUSH_CONSTANTS.js +0 -14
  210. package/src/shade/renderer/global_illumination/probe/octahedral/LPV_SHADER_RESOURCE_GROUP.d.ts +0 -42
  211. package/src/shade/renderer/global_illumination/probe/octahedral/LPV_SHADER_RESOURCE_GROUP.d.ts.map +0 -1
  212. package/src/shade/renderer/global_illumination/probe/octahedral/LPV_SHADER_RESOURCE_GROUP.js +0 -68
  213. package/src/shade/renderer/global_illumination/probe/octahedral/ProbeGBufferTypes.d.ts +0 -9
  214. package/src/shade/renderer/global_illumination/probe/octahedral/ProbeGBufferTypes.d.ts.map +0 -1
  215. package/src/shade/renderer/global_illumination/probe/octahedral/ProbeGBufferTypes.js +0 -20
  216. package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_map_index_to_border.d.ts +0 -3
  217. package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_map_index_to_border.d.ts.map +0 -1
  218. package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_map_index_to_border.js +0 -47
  219. package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_paint_borders_body.d.ts +0 -3
  220. package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_paint_borders_body.d.ts.map +0 -1
  221. package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_paint_borders_body.js +0 -55
  222. package/src/shade/renderer/global_illumination/probe/octahedral/border/graph_lpv_paint_border_depth.d.ts +0 -19
  223. package/src/shade/renderer/global_illumination/probe/octahedral/border/graph_lpv_paint_border_depth.d.ts.map +0 -1
  224. package/src/shade/renderer/global_illumination/probe/octahedral/border/graph_lpv_paint_border_depth.js +0 -85
  225. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_border_read.d.ts +0 -3
  226. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_border_read.d.ts.map +0 -1
  227. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_border_read.js +0 -78
  228. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_depth.d.ts +0 -7
  229. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_depth.d.ts.map +0 -1
  230. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_depth.js +0 -70
  231. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_radiance.d.ts +0 -7
  232. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_radiance.d.ts.map +0 -1
  233. package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_radiance.js +0 -20
  234. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/chunk_compute_coefficient_address.d.ts +0 -3
  235. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/chunk_compute_coefficient_address.d.ts.map +0 -1
  236. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/chunk_compute_coefficient_address.js +0 -20
  237. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lpv_store_sh.d.ts +0 -19
  238. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lpv_store_sh.d.ts.map +0 -1
  239. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lpv_store_sh.js +0 -128
  240. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lvp_atlas_to_sh.d.ts +0 -22
  241. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lvp_atlas_to_sh.d.ts.map +0 -1
  242. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lvp_atlas_to_sh.js +0 -200
  243. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.d.ts +0 -23
  244. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.d.ts.map +0 -1
  245. package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.js +0 -179
  246. package/src/shade/renderer/global_illumination/probe/octahedral/graph_lpv_shade.d.ts +0 -13
  247. package/src/shade/renderer/global_illumination/probe/octahedral/graph_lpv_shade.d.ts.map +0 -1
  248. package/src/shade/renderer/global_illumination/probe/octahedral/graph_lpv_shade.js +0 -416
  249. package/src/shade/renderer/global_illumination/probe/octahedral/graph_sample_light_probes.d.ts +0 -16
  250. package/src/shade/renderer/global_illumination/probe/octahedral/graph_sample_light_probes.d.ts.map +0 -1
  251. package/src/shade/renderer/global_illumination/probe/octahedral/graph_sample_light_probes.js +0 -268
  252. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_patch_texel_coord.d.ts +0 -17
  253. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_patch_texel_coord.d.ts.map +0 -1
  254. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_patch_texel_coord.js +0 -38
  255. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_read_patch_texel.d.ts +0 -3
  256. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_read_patch_texel.d.ts.map +0 -1
  257. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_read_patch_texel.js +0 -34
  258. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance.d.ts +0 -3
  259. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance.d.ts.map +0 -1
  260. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance.js +0 -62
  261. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance_nearest.d.ts +0 -3
  262. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance_nearest.d.ts.map +0 -1
  263. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance_nearest.js +0 -37
  264. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_mesh_interpolate_radiance_via_atlas.d.ts +0 -7
  265. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_mesh_interpolate_radiance_via_atlas.d.ts.map +0 -1
  266. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_mesh_interpolate_radiance_via_atlas.js +0 -62
  267. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_radiance_sample_reflection.d.ts +0 -7
  268. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_radiance_sample_reflection.d.ts.map +0 -1
  269. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_radiance_sample_reflection.js +0 -61
  270. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_parallax_correct_spherical_probe.d.ts.map +0 -1
  271. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_parallax_correct_spherical_probe_iterative.d.ts +0 -3
  272. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_parallax_correct_spherical_probe_iterative.d.ts.map +0 -1
  273. package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_parallax_correct_spherical_probe_iterative.js +0 -80
  274. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_accumulate_depth.d.ts +0 -3
  275. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_accumulate_depth.d.ts.map +0 -1
  276. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_accumulate_depth.js +0 -143
  277. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_atlas_write_depth.d.ts +0 -3
  278. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_atlas_write_depth.d.ts.map +0 -1
  279. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_atlas_write_depth.js +0 -59
  280. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.d.ts +0 -3
  281. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.d.ts.map +0 -1
  282. package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.js +0 -227
  283. package/src/shade/renderer/shader/chunk/light/lpv/INVALID_TET_DECLARATION.d.ts +0 -7
  284. package/src/shade/renderer/shader/chunk/light/lpv/INVALID_TET_DECLARATION.d.ts.map +0 -1
  285. package/src/shade/renderer/shader/chunk/light/lpv/INVALID_TET_DECLARATION.js +0 -12
  286. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_interpolate_probe_irradiance8.d.ts +0 -7
  287. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_interpolate_probe_irradiance8.d.ts.map +0 -1
  288. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_interpolate_probe_irradiance8.js +0 -37
  289. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_barycentric_coordinates.d.ts +0 -3
  290. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_barycentric_coordinates.d.ts.map +0 -1
  291. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_barycentric_coordinates.js +0 -29
  292. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_neighbours.d.ts +0 -3
  293. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_neighbours.d.ts.map +0 -1
  294. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_neighbours.js +0 -20
  295. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_vertices.d.ts +0 -3
  296. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_vertices.d.ts.map +0 -1
  297. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_vertices.js +0 -22
  298. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe.d.ts +0 -4
  299. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe.d.ts.map +0 -1
  300. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe.js +0 -53
  301. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance.d.ts +0 -7
  302. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance.d.ts.map +0 -1
  303. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance.js +0 -48
  304. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance_pre.d.ts +0 -7
  305. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance_pre.d.ts.map +0 -1
  306. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance_pre.js +0 -35
  307. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolation_probe_sh.d.ts +0 -3
  308. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolation_probe_sh.d.ts.map +0 -1
  309. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolation_probe_sh.js +0 -38
  310. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_lookup_nearest_cell.d.ts +0 -3
  311. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_lookup_nearest_cell.d.ts.map +0 -1
  312. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_lookup_nearest_cell.js +0 -67
  313. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_walk_to_tetrahedron.d.ts +0 -3
  314. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_walk_to_tetrahedron.d.ts.map +0 -1
  315. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_walk_to_tetrahedron.js +0 -52
  316. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_data.d.ts +0 -3
  317. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_data.d.ts.map +0 -1
  318. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_data.js +0 -22
  319. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_position.d.ts +0 -3
  320. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_position.d.ts.map +0 -1
  321. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_position.js +0 -17
  322. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance.d.ts +0 -3
  323. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance.d.ts.map +0 -1
  324. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance.js +0 -48
  325. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_8.d.ts +0 -9
  326. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_8.d.ts.map +0 -1
  327. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_8.js +0 -126
  328. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_no_depth.d.ts +0 -3
  329. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_no_depth.d.ts.map +0 -1
  330. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_no_depth.js +0 -45
  331. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_radiance.d.ts +0 -3
  332. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_radiance.d.ts.map +0 -1
  333. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_radiance.js +0 -61
  334. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_sh3_at.d.ts +0 -3
  335. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_sh3_at.d.ts.map +0 -1
  336. package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_sh3_at.js +0 -33
  337. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_mask_weights_by_visibility.d.ts +0 -4
  338. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_mask_weights_by_visibility.d.ts.map +0 -1
  339. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_mask_weights_by_visibility.js +0 -161
  340. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_probe_sample_depth_array.d.ts +0 -3
  341. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_probe_sample_depth_array.d.ts.map +0 -1
  342. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_probe_sample_depth_array.js +0 -59
  343. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_sample_depth_atlas.d.ts +0 -4
  344. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_sample_depth_atlas.d.ts.map +0 -1
  345. package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_sample_depth_atlas.js +0 -97
  346. /package/src/shade/renderer/{global_illumination/lpv/placement/software → scene/bvh}/sdf_build_from_scene.d.ts +0 -0
  347. /package/src/shade/renderer/{global_illumination/lpv/placement/software → scene/bvh}/sdf_find_local_maxima.d.ts +0 -0
@@ -1,437 +0,0 @@
1
- import { assert } from "../../../../../core/assert.js";
2
- import { UINT32_MAX } from "../../../../../core/binary/UINT32_MAX.js";
3
- import { randomIntegerBetween } from "../../../../../core/math/random/randomIntegerBetween.js";
4
- import { seededRandom } from "../../../../../core/math/random/seededRandom.js";
5
- import { graph_compute_pass } from "../../../shader/graph/compute/graph_compute_pass.js";
6
- import { graph_image_pass } from "../../../shader/graph/graph_image_pass.js";
7
- import { graph_import_buffer } from "../../../shader/graph/graph_import_buffer.js";
8
- import { graph_import_texture } from "../../../shader/graph/graph_import_texture.js";
9
- import { graph_import_typed_buffer } from "../../../shader/graph/graph_import_typed_buffer.js";
10
- import { GPUTileAtlas2D } from "../../../texture/atlas/GPUTileAtlas2D.js";
11
- import { graph_lpv_paint_border_depth } from "./border/graph_lpv_paint_border_depth.js";
12
- import { shader_lpv_atlas_paint_borders_radiance } from "./border/shader_lpv_atlas_paint_borders_radiance.js";
13
- import { graph_lpv_store_sh } from "./convolve/graph_lpv_store_sh.js";
14
- import { graph_lvp_atlas_to_sh } from "./convolve/graph_lvp_atlas_to_sh.js";
15
- import { graph_reduce_atlas_to_sh } from "./convolve/graph_reduce_atlas_to_sh.js";
16
- import { graph_lpv_shade } from "./graph_lpv_shade.js";
17
- import { graph_sample_light_probes } from "./graph_sample_light_probes.js";
18
- import { LPV_ACCUMULATION_PUSH_CONSTANTS } from "./LPV_ACCUMULATION_PUSH_CONSTANTS.js";
19
- import { shader_lpv_accumulate_depth } from "./shader_lpv_accumulate_depth.js";
20
- import { shader_lpv_atlas_write_depth } from "./shader_lpv_atlas_write_depth.js";
21
- import { shader_lpv_build_gbuffer } from "./shader_lpv_build_gbuffer.js";
22
-
23
- /**
24
- * @typedef {import("../../../GraphicsContext.js").GraphicsContext} GraphicsContext
25
- * @typedef {import("../../../scene/GPUSceneContext.js").GPUSceneContext} GPUSceneContext
26
- * @typedef {import("../../../texture/GPUTextureContext.js").GPUTextureContext} GPUTextureContext
27
- */
28
-
29
- /**
30
- * @typedef {import("../../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} FrameGraph
31
- */
32
-
33
- // TODO initialize new probes from environment map
34
-
35
- /**
36
- * Texels of a probe along each side, its 1-texel border apart. The reduction step needs a power of
37
- * two.
38
- * @type {number}
39
- */
40
- const PROBE_RESOLUTION = 64;
41
-
42
- export class GPUProbeAtlas {
43
-
44
- /**
45
- * The probes, a tile each with a 1-texel border for bilinear sampling: rgb9e5 radiance in
46
- * `r32uint`, and the first two moments of depth in `rg16float`.
47
- * @type {GPUTileAtlas2D}
48
- */
49
- #atlas;
50
-
51
- /**
52
- * Replaced when the atlas grows; take it each frame.
53
- * @returns {GPUTextureContext}
54
- */
55
- get texture_radiance() {
56
- return this.#atlas.texture_at(0);
57
- }
58
-
59
- /**
60
- * In probes, not texels
61
- * @returns {number[]}
62
- */
63
- get resolution() {
64
- return [this.#atlas.tiles_per_row, this.#atlas.rows];
65
- }
66
-
67
- /**
68
- * 2 channels, first 2 moments of depth. Replaced when the atlas grows; take it each frame.
69
- * @return {GPUTextureContext}
70
- */
71
- get texture_depth() {
72
- return this.#atlas.texture_at(1);
73
- }
74
-
75
- /**
76
- * Because of how reduction step works, must be a power of two
77
- * @returns {number}
78
- */
79
- get probe_resolution() {
80
- return PROBE_RESOLUTION;
81
- }
82
-
83
- /**
84
- *
85
- * @return {number}
86
- */
87
- get padded_probe_resolution() {
88
- // 1 pixel border for bilinear sampling
89
- return this.probe_resolution + 2;
90
- }
91
-
92
- /**
93
- * Used to initialize rays
94
- * @type {() => number}
95
- */
96
- random = seededRandom(1337);
97
-
98
- /**
99
- *
100
- * @param {GPUDevice} device
101
- */
102
- constructor(device) {
103
- const padded = this.padded_probe_resolution;
104
-
105
- this.#atlas = new GPUTileAtlas2D({
106
- device,
107
- // rgb9e5 radiance; the first 2 moments of depth for Chebyshev's
108
- formats: ["r32uint", "rg16float"],
109
- tile_size: [padded, padded],
110
- usage: GPUTextureUsage.RENDER_ATTACHMENT | GPUTextureUsage.TEXTURE_BINDING | GPUTextureUsage.STORAGE_BINDING,
111
- label: "GPUProbeAtlas",
112
- });
113
- }
114
-
115
- #update_cursor = 0;
116
-
117
- /**
118
- * Room for `probe_count` probes; the probes already there keep their texels. Past the device's
119
- * height the atlas stops there and says so, and the probes past it have no home.
120
- *
121
- * @param {number} probe_count
122
- */
123
- ensure_capacity(probe_count) {
124
- assert.isNonNegativeInteger(probe_count, 'probe_count');
125
-
126
- this.#atlas.ensure_capacity(probe_count);
127
- }
128
-
129
- /**
130
- * Copy external data into the atlas.
131
- * External data is expected not to have borders.
132
- * External data must match the probe resolution of the atlas.
133
- *
134
- * @param {Object} options
135
- * @param {GPUTextureContext} options.atlas_depth
136
- * @param {GPUTextureContext} options.atlas_radiance
137
- */
138
- upload_external({
139
- atlas_depth,
140
- atlas_radiance,
141
- }) {
142
-
143
- throw new Error("Not implemented");
144
-
145
- // TODO copy patch-by-patch
146
- // TODO paint border
147
-
148
- }
149
-
150
- /**
151
- *
152
- * @param {Object} options
153
- * @param {FrameGraph} options.graph
154
- * @param {GPUSceneContext} options.scene
155
- * @param {GraphicsContext} options.graphics
156
- * @param {number} [options.update_ray_count] how many rays to use, this lets us scale with the hardware
157
- */
158
- graph_update({
159
- graph,
160
- scene,
161
- graphics,
162
- update_ray_count = 4096,
163
- }) {
164
-
165
- assert.defined(graph, 'graph');
166
- assert.isNumber(update_ray_count, 'update_ray_count');
167
- assert.notNaN(update_ray_count, 'update_ray_count');
168
- assert.greaterThanOrEqual(update_ray_count, 0, 'update_ray_count');
169
-
170
- const lpv = scene.light_probe_volume.source;
171
- const total_probe_count = lpv.probe_count;
172
-
173
- // check atlas size against number of probes to see if we fit
174
- this.ensure_capacity(total_probe_count);
175
-
176
- const probe_resolution = this.probe_resolution;
177
- const texels_per_probe = probe_resolution * probe_resolution;
178
-
179
- const requested_budget_in_probes = Math.ceil(update_ray_count / texels_per_probe);
180
-
181
- const desired_update_count = Math.min(total_probe_count, requested_budget_in_probes);
182
-
183
- const texture_size_limit = graphics.device.limits.maxTextureDimension2D;
184
-
185
- const limit_resolution_in_probes = Math.floor(texture_size_limit / probe_resolution);
186
-
187
- const update_count = Math.min(desired_update_count, limit_resolution_in_probes * limit_resolution_in_probes);
188
-
189
- const resolution_height = Math.max(
190
- 1,
191
- Math.ceil(update_count / limit_resolution_in_probes)
192
- );
193
-
194
-
195
- const g_buffer_resolution = [
196
- limit_resolution_in_probes * probe_resolution,
197
- resolution_height * probe_resolution,
198
- ];
199
-
200
- const r_materials = graphics.materials_resident;
201
- r_materials.ensure_scene_materials(scene);
202
- r_materials.update();
203
-
204
- const random_seed = randomIntegerBetween(this.random, 0, UINT32_MAX);
205
- const start_index = this.#update_cursor;
206
-
207
- const geometries = scene.geometries;
208
-
209
- /**
210
- *
211
- * @type {GPUGeometryBVHManager}
212
- */
213
- const blas = geometries.blas;
214
-
215
- // We build a G-buffer from primary rays, this will be later lit and we will use this to generate light-sampling rays
216
- const [
217
- g_buffer_albedo,
218
- g_buffer_emissive,
219
- g_buffer_normals,
220
- g_buffer_pbr,
221
- g_buffer_position,
222
- ] = graph_image_pass({
223
- graph,
224
- shader: shader_lpv_build_gbuffer,
225
- inputs: {
226
- settings: {
227
- probe_index_offset: start_index,
228
- probe_update_count: update_count,
229
- probe_count: scene.light_probe_volume.source.probe_count,
230
- probe_resolution: this.probe_resolution,
231
- output_resolution_width: limit_resolution_in_probes,
232
- random_seed: random_seed
233
- },
234
- // probes
235
- lpv_probes: scene.light_probe_volume.buffer_probes,
236
- // RTX
237
- scene_database: scene.scene_database_buffer,
238
- tlas: scene.tlas.buffer,
239
- blas_lookup: blas.buffer_metadata,
240
- blas_data: blas.buffer_data,
241
- geometries: geometries.buffer_metadata,
242
- meshlet_metadata: geometries.meshlets.buffer_metadata,
243
- meshlet_data: geometries.meshlets.buffer_data,
244
- // Materials
245
- materials: r_materials.buffer_materials,
246
- textures: r_materials.textureView,
247
- //
248
-
249
- tEnvironment: scene.lights.environment,
250
- },
251
- output_resolution: g_buffer_resolution
252
- });
253
-
254
- const g_buffer_indirect = graph_sample_light_probes({
255
- graph,
256
- scene,
257
- atlas: this,
258
- probe_resolution: this.probe_resolution,
259
- g_buffer_resolution,
260
- //
261
- g_buffer_position,
262
- g_buffer_normals,
263
- g_buffer_albedo,
264
- g_buffer_pbr,
265
- probe_index_offset: start_index,
266
- probe_update_count: update_count,
267
- });
268
-
269
-
270
- /*
271
- Both atlases are threaded from here on: every helper that writes one hands back a renamed
272
- handle, and the next reader has to be given that one. Reading the version a previous pass
273
- has already superseded is the shape `validate()` exists to reject, and with assertions
274
- stripped it leaves the border and convolution passes with no recorded dependency on the
275
- passes that filled the atlas.
276
- */
277
- let t_radiance = graph_import_texture(graph, this.texture_radiance);
278
- let t_depth = graph_import_texture(graph, this.texture_depth);
279
- const b_probes = graph_import_buffer(graph, scene.light_probe_volume.buffer_probes);
280
-
281
- /*
282
- Plain assignment off the returned record, not a parenthesised destructuring assignment. The
283
- line above used to end without a semicolon, and ASI does not insert one before an open
284
- paren, so the two statements parsed as a single call expression: the handle
285
- `graph_import_buffer` returns was invoked as a function and `graph_update` threw a TypeError
286
- out of `Renderer.update_lpv` on its first frame, after `graph_lpv_shade` had already added
287
- its pass and before the depth accumulation, border painting, SH convolution and SH store
288
- were scheduled at all. This shape cannot recur.
289
- */
290
- t_radiance = graph_lpv_shade({
291
- graph,
292
- scene,
293
- atlas: this,
294
- resolution: g_buffer_resolution,
295
- probe_index_offset: start_index,
296
- probe_update_count: update_count,
297
- //
298
- atlas_radiance: t_radiance,
299
- // g-buffer
300
- g_buffer_albedo,
301
- g_buffer_emissive,
302
- g_buffer_normals,
303
- g_buffer_pbr,
304
- g_buffer_position,
305
- g_buffer_indirect,
306
- }).radiance;
307
-
308
- // avoid upsetting WebGPU validator with empty buffers
309
- if (update_count > 0) {
310
-
311
- const settings = {
312
- probe_resolution: probe_resolution,
313
- probe_update_count: update_count,
314
- probe_index_offset: start_index,
315
- probe_count: total_probe_count,
316
- atlas_patches_per_row: this.resolution[0],
317
- };
318
-
319
- const gr_settings = graph_import_typed_buffer({
320
- graph,
321
- type: LPV_ACCUMULATION_PUSH_CONSTANTS,
322
- value: settings,
323
- usage: GPUBufferUsage.UNIFORM,
324
- label: "settings",
325
- });
326
-
327
- // use g-buffer to update depths
328
- {
329
- // [2026/01/05]: We can't bind rg16float for 'read-write' access as a StorageTexture, so we have to use 2 passes to accumulate depth. First to resolve temporal depth, and the second to actually write it into the atlas
330
-
331
- const [accumulated_depth] = graph_image_pass({
332
- graph,
333
- shader: shader_lpv_accumulate_depth,
334
- inputs: {
335
- settings: gr_settings,
336
- gBuffer_position: g_buffer_position,
337
- gBuffer_PBR: g_buffer_pbr,
338
- tAtlas_depth: t_depth,
339
- // probes
340
- lpv_probes: b_probes,
341
- },
342
- output_resolution: g_buffer_resolution,
343
- });
344
-
345
- ({ tAtlas_depth: t_depth } = graph_compute_pass({
346
- graph,
347
- shader: shader_lpv_atlas_write_depth,
348
- bindings: {
349
- settings: gr_settings,
350
- tSource: accumulated_depth,
351
- tAtlas_depth: t_depth,
352
- },
353
- group_count: [
354
- Math.ceil(g_buffer_resolution[0] / 16),
355
- Math.ceil(g_buffer_resolution[1] / 16),
356
- 1
357
- ]
358
- }));
359
- }
360
-
361
- {
362
- const probe_border_texel_count = (probe_resolution + 1) * 4;
363
-
364
- const group_count = [
365
- Math.ceil(update_count * probe_border_texel_count / 256)
366
- ];
367
-
368
- // Depth
369
- t_depth = graph_lpv_paint_border_depth({
370
- graph,
371
- atlas: t_depth,
372
- settings: gr_settings,
373
- probe_resolution,
374
- update_count,
375
- });
376
-
377
- // Radiance
378
- ({ tAtlas: t_radiance } = graph_compute_pass({
379
- graph,
380
- shader: shader_lpv_atlas_paint_borders_radiance,
381
- group_count,
382
- bindings: {
383
- settings: gr_settings,
384
- tAtlas: t_radiance,
385
- }
386
- }));
387
- }
388
-
389
- // perform convolution to compute irradiance
390
- let sh_buffer = graph_lvp_atlas_to_sh({
391
- graph,
392
- atlas: this,
393
- scene,
394
- atlas_radiance: t_radiance,
395
- probe_index_offset: start_index,
396
- probe_update_count: update_count,
397
- g_buffer_resolution,
398
- });
399
-
400
- sh_buffer = graph_reduce_atlas_to_sh({
401
- graph,
402
- atlas: this,
403
- scene,
404
- probe_index_offset: start_index,
405
- probe_update_count: update_count,
406
- g_buffer_resolution,
407
- sh_buffer
408
- });
409
-
410
- graph_lpv_store_sh({
411
- graph,
412
- scene,
413
- atlas: this,
414
- probe_index_offset: start_index,
415
- probe_update_count: update_count,
416
- sh_buffer
417
- });
418
-
419
- }
420
-
421
- // advance cursor
422
- if (total_probe_count > 0) {
423
- // guard against 0 division
424
- this.#update_cursor = (this.#update_cursor + desired_update_count) % total_probe_count;
425
- }
426
-
427
- return t_radiance;
428
- }
429
-
430
- get gpu_memory_usage() {
431
- return this.#atlas.gpu_memory_usage;
432
- }
433
-
434
- destroy() {
435
- this.#atlas.destroy();
436
- }
437
- }
@@ -1,3 +0,0 @@
1
- export const LPV_ACCUMULATION_PUSH_CONSTANTS: WebGPUStruct;
2
- import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
3
- //# sourceMappingURL=LPV_ACCUMULATION_PUSH_CONSTANTS.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LPV_ACCUMULATION_PUSH_CONSTANTS.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe/octahedral/LPV_ACCUMULATION_PUSH_CONSTANTS.js"],"names":[],"mappings":"AAGA,2DAUE;6BAZ2B,sCAAsC"}
@@ -1,14 +0,0 @@
1
- import { u32 } from "../../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
2
- import { WebGPUStruct } from "../../../shader/type/WebGPUStruct.js";
3
-
4
- export const LPV_ACCUMULATION_PUSH_CONSTANTS = WebGPUStruct.from({
5
- probe_resolution: u32,
6
- probe_update_count: u32,
7
- probe_index_offset: u32,
8
-
9
- /**
10
- * Total number of probes being managed in the atlas
11
- */
12
- probe_count: u32,
13
- atlas_patches_per_row: u32,
14
- })
@@ -1,42 +0,0 @@
1
- /**
2
- * The light probe volume's BVH over its tetrahedral mesh.
3
- * @type {ShaderResourceDescriptor}
4
- */
5
- export const LPV_LOOKUP_RESOURCE: ShaderResourceDescriptor;
6
- /**
7
- * The light probe volume's metadata.
8
- * @type {ShaderResourceDescriptor}
9
- */
10
- export const LPV_METADATA_RESOURCE: ShaderResourceDescriptor;
11
- /**
12
- * The light probe volume's tetrahedral mesh.
13
- * @type {ShaderResourceDescriptor}
14
- */
15
- export const LPV_MESH_RESOURCE: ShaderResourceDescriptor;
16
- /**
17
- * The light probes.
18
- * @type {ShaderResourceDescriptor}
19
- */
20
- export const LPV_PROBES_RESOURCE: ShaderResourceDescriptor;
21
- /**
22
- * The probes' octahedral depth atlas.
23
- * @type {ShaderResourceDescriptor}
24
- */
25
- export const LPV_ATLAS_DEPTH_RESOURCE: ShaderResourceDescriptor;
26
- /**
27
- * The probes' octahedral radiance atlas, encoded.
28
- * @type {ShaderResourceDescriptor}
29
- */
30
- export const LPV_ATLAS_RADIANCE_RESOURCE: ShaderResourceDescriptor;
31
- export const LPV_SHADER_RESOURCE_GROUP: ShaderResourceGroupDescriptor;
32
- /**
33
- * The same bindings, each with a default, for a shader that reads the light probe volume under one
34
- * indirect lighting mode and is bound under all of them (SSR's resolve, froxel GI): a frame graph pass
35
- * given no volume binds transient buffers and a volume of no probes in its place.
36
- *
37
- * @type {ShaderResourceGroupDescriptor}
38
- */
39
- export const LPV_SHADER_RESOURCE_GROUP_WITH_DEFAULTS: ShaderResourceGroupDescriptor;
40
- import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourceDescriptor.js";
41
- import { ShaderResourceGroupDescriptor } from "../../../shader/resource/ShaderResourceGroupDescriptor.js";
42
- //# sourceMappingURL=LPV_SHADER_RESOURCE_GROUP.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"LPV_SHADER_RESOURCE_GROUP.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe/octahedral/LPV_SHADER_RESOURCE_GROUP.js"],"names":[],"mappings":"AAQA;;;GAGG;AACH,kCAFU,wBAAwB,CAEkE;AAEpG;;;GAGG;AACH,oCAFU,wBAAwB,CAEwF;AAE1H;;;GAGG;AACH,gCAFU,wBAAwB,CAEkG;AAEpI;;;GAGG;AACH,kCAFU,wBAAwB,CAE4F;AAE9H;;;GAGG;AACH,uCAFU,wBAAwB,CAEmE;AAErG;;;GAGG;AACH,0CAFU,wBAAwB,CAEwE;AAE1G,sEAA6E;AAS7E;;;;;;GAMG;AACH,sDAFU,6BAA6B,CAEoD;yCA1DlD,sDAAsD;8CACjD,2DAA2D"}
@@ -1,68 +0,0 @@
1
- import { WebGPUArray } from "../../../shader/type/WebGPUArray.js";
2
- import { BVH_STRUCT } from "../../../shader/chunk/bvh/BVH_STRUCT.js";
3
- import { ShaderResourceDescriptor } from "../../../shader/resource/ShaderResourceDescriptor.js";
4
- import { ShaderResourceGroupDescriptor } from "../../../shader/resource/ShaderResourceGroupDescriptor.js";
5
- import { LIGHT_PROBE_STRUCT } from "../../lpv/LIGHT_PROBE_STRUCT.js";
6
- import { LIGHT_PROBE_VOLUME_METADATA_STRUCT } from "../../lpv/LIGHT_PROBE_VOLUME_METADATA_STRUCT.js";
7
- import { TETRAHEDRAL_MESH_CELL_STRUCT } from "../../lpv/TETRAHEDRAL_MESH_CELL_STRUCT.js";
8
-
9
- /**
10
- * The light probe volume's BVH over its tetrahedral mesh.
11
- * @type {ShaderResourceDescriptor}
12
- */
13
- export const LPV_LOOKUP_RESOURCE = ShaderResourceDescriptor.storageBuffer("lpv_lookup", BVH_STRUCT);
14
-
15
- /**
16
- * The light probe volume's metadata.
17
- * @type {ShaderResourceDescriptor}
18
- */
19
- export const LPV_METADATA_RESOURCE = ShaderResourceDescriptor.uniform("lpv_metadata", LIGHT_PROBE_VOLUME_METADATA_STRUCT);
20
-
21
- /**
22
- * The light probe volume's tetrahedral mesh.
23
- * @type {ShaderResourceDescriptor}
24
- */
25
- export const LPV_MESH_RESOURCE = ShaderResourceDescriptor.storageBuffer("lpv_mesh", WebGPUArray.from(TETRAHEDRAL_MESH_CELL_STRUCT));
26
-
27
- /**
28
- * The light probes.
29
- * @type {ShaderResourceDescriptor}
30
- */
31
- export const LPV_PROBES_RESOURCE = ShaderResourceDescriptor.storageBuffer("lpv_probes", WebGPUArray.from(LIGHT_PROBE_STRUCT));
32
-
33
- /**
34
- * The probes' octahedral depth atlas.
35
- * @type {ShaderResourceDescriptor}
36
- */
37
- export const LPV_ATLAS_DEPTH_RESOURCE = ShaderResourceDescriptor.texture("lpv_atlas_depth", "float");
38
-
39
- /**
40
- * The probes' octahedral radiance atlas, encoded.
41
- * @type {ShaderResourceDescriptor}
42
- */
43
- export const LPV_ATLAS_RADIANCE_RESOURCE = ShaderResourceDescriptor.texture("lpv_atlas_radiance", "uint");
44
-
45
- export const LPV_SHADER_RESOURCE_GROUP = new ShaderResourceGroupDescriptor();
46
-
47
- LPV_SHADER_RESOURCE_GROUP
48
- .add(LPV_LOOKUP_RESOURCE)
49
- .add(LPV_METADATA_RESOURCE)
50
- .add(LPV_MESH_RESOURCE)
51
- .add(LPV_PROBES_RESOURCE)
52
- ;
53
-
54
- /**
55
- * The same bindings, each with a default, for a shader that reads the light probe volume under one
56
- * indirect lighting mode and is bound under all of them (SSR's resolve, froxel GI): a frame graph pass
57
- * given no volume binds transient buffers and a volume of no probes in its place.
58
- *
59
- * @type {ShaderResourceGroupDescriptor}
60
- */
61
- export const LPV_SHADER_RESOURCE_GROUP_WITH_DEFAULTS = new ShaderResourceGroupDescriptor();
62
-
63
- LPV_SHADER_RESOURCE_GROUP_WITH_DEFAULTS
64
- .addStorageBuffer("lpv_lookup", BVH_STRUCT, false, true)
65
- .addUniform("lpv_metadata", LIGHT_PROBE_VOLUME_METADATA_STRUCT, { probe_count: 0, probe_resolution: 0 })
66
- .addStorageBuffer("lpv_mesh", WebGPUArray.from(TETRAHEDRAL_MESH_CELL_STRUCT), false, true)
67
- .addStorageBuffer("lpv_probes", WebGPUArray.from(LIGHT_PROBE_STRUCT), false, true)
68
- ;
@@ -1,9 +0,0 @@
1
- export type ProbeGBufferTypes = GPUTextureFormat;
2
- export namespace ProbeGBufferTypes {
3
- let Albedo: string;
4
- let Emissive: string;
5
- let Normals: string;
6
- let PBR: string;
7
- let Position: string;
8
- }
9
- //# sourceMappingURL=ProbeGBufferTypes.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"ProbeGBufferTypes.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe/octahedral/ProbeGBufferTypes.js"],"names":[],"mappings":""}
@@ -1,20 +0,0 @@
1
- /**
2
- *
3
- * @enum {GPUTextureFormat}
4
- */
5
- export const ProbeGBufferTypes = {
6
- Albedo: "rgba8unorm",
7
- Emissive: "r32uint",
8
- /**
9
- * Normals using low resolution as precision is less important for GI traces
10
- * And we want to keep bandwidth low
11
- *
12
- * RG - shading normal
13
- */
14
- Normals: "rg8unorm",
15
- PBR: "rgba8unorm",
16
- /**
17
- * NOTE: we can pack geometric normal into A channel
18
- */
19
- Position: "rgba16float",
20
- }
@@ -1,3 +0,0 @@
1
- export const chunk_lpv_map_index_to_border: CodeChunk;
2
- import { CodeChunk } from "../../../../shader/compiler/CodeChunk.js";
3
- //# sourceMappingURL=chunk_lpv_map_index_to_border.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunk_lpv_map_index_to_border.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_map_index_to_border.js"],"names":[],"mappings":"AAEA,sDA4CC;0BA9CyB,0CAA0C"}
@@ -1,47 +0,0 @@
1
- import { CodeChunk } from "../../../../shader/compiler/CodeChunk.js";
2
-
3
- export const chunk_lpv_map_index_to_border = CodeChunk.from(
4
- //language=WGSL
5
- `
6
- fn lpv_map_index_to_border(index: u32, probe_resolution: u32) -> vec2<i32>{
7
-
8
- let segment_length = probe_resolution + 1;
9
-
10
- // relative to probe space
11
- var local_texel:vec2<i32>;
12
-
13
- // We wind Counter-Clockwise starting from Top-Left (-1, -1)
14
-
15
- if (index < segment_length) {
16
- // --- TOP EDGE (Includes TL Corner) ---
17
- // Range: x=[-1..R-1], y=-1
18
- local_texel.x = i32(index) - 1;
19
- local_texel.y = -1;
20
- }
21
- else if (index < segment_length * 2) {
22
- // --- RIGHT EDGE (Includes TR Corner) ---
23
- // Range: x=R, y=[-1..R-1]
24
- let offset = index - segment_length;
25
- local_texel.x = i32(probe_resolution);
26
- local_texel.y = i32(offset) - 1;
27
- }
28
- else if (index < segment_length * 3) {
29
- // --- BOTTOM EDGE (Includes BR Corner) ---
30
- // Range: x=[R..0], y=R
31
- // Note: We iterate backwards to maintain winding order
32
- let offset = index - (segment_length * 2);
33
- local_texel.x = i32(probe_resolution - offset);
34
- local_texel.y = i32(probe_resolution);
35
- }
36
- else {
37
- // --- LEFT EDGE (Includes BL Corner) ---
38
- // Range: x=-1, y=[R..0]
39
- let offset = index - (segment_length * 3);
40
- local_texel.x = -1;
41
- local_texel.y = i32(probe_resolution - offset);
42
- }
43
-
44
- return local_texel;
45
- }
46
- `
47
- )
@@ -1,3 +0,0 @@
1
- export const chunk_lpv_paint_borders_body: CodeChunk;
2
- import { CodeChunk } from "../../../../shader/compiler/CodeChunk.js";
3
- //# sourceMappingURL=chunk_lpv_paint_borders_body.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"chunk_lpv_paint_borders_body.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_paint_borders_body.js"],"names":[],"mappings":"AAOA,qDA+CC;0BAlDyB,0CAA0C"}