@woosh/meep-engine 3.74.0 → 3.76.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.
Files changed (363) hide show
  1. package/CHANGELOG.md +20 -19
  2. package/package.json +1 -1
  3. package/src/core/geom/2d/hilbert/v2_hilbert_encode.d.ts +11 -0
  4. package/src/core/geom/2d/hilbert/v2_hilbert_encode.d.ts.map +1 -0
  5. package/src/core/geom/2d/hilbert/v2_hilbert_encode.js +46 -0
  6. package/src/engine/asset/GameAssetType.d.ts +1 -0
  7. package/src/engine/asset/GameAssetType.js +5 -1
  8. package/src/engine/asset/loaders/GroomAssetLoader.d.ts +33 -0
  9. package/src/engine/asset/loaders/GroomAssetLoader.d.ts.map +1 -0
  10. package/src/engine/asset/loaders/GroomAssetLoader.js +99 -0
  11. package/src/engine/graphics/ecs/hair/Hair.d.ts +47 -0
  12. package/src/engine/graphics/ecs/hair/Hair.d.ts.map +1 -0
  13. package/src/engine/graphics/ecs/hair/Hair.js +61 -0
  14. package/src/engine/graphics/hair/Groom.d.ts +130 -0
  15. package/src/engine/graphics/hair/Groom.d.ts.map +1 -0
  16. package/src/engine/graphics/hair/Groom.js +193 -0
  17. package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts +24 -0
  18. package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts.map +1 -0
  19. package/src/engine/graphics/hair/GroomSerializationAdapter.js +77 -0
  20. package/src/engine/graphics/hair/groom_build_group.d.ts +85 -0
  21. package/src/engine/graphics/hair/groom_build_group.d.ts.map +1 -0
  22. package/src/engine/graphics/hair/groom_build_group.js +487 -0
  23. package/src/engine/graphics/hair/groom_generate_scalp.d.ts +29 -0
  24. package/src/engine/graphics/hair/groom_generate_scalp.d.ts.map +1 -0
  25. package/src/engine/graphics/hair/groom_generate_scalp.js +184 -0
  26. package/src/engine/graphics/hair/groom_rank_order.d.ts +15 -0
  27. package/src/engine/graphics/hair/groom_rank_order.d.ts.map +1 -0
  28. package/src/engine/graphics/hair/groom_rank_order.js +53 -0
  29. package/src/engine/graphics/hair/groom_root_spacing.d.ts +12 -0
  30. package/src/engine/graphics/hair/groom_root_spacing.d.ts.map +1 -0
  31. package/src/engine/graphics/hair/groom_root_spacing.js +120 -0
  32. package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts +6 -0
  33. package/src/engine/graphics/render/frame_graph/FrameGraph.d.ts.map +1 -1
  34. package/src/engine/graphics/render/frame_graph/FrameGraph.js +9 -0
  35. package/src/engine/graphics3/GPUAcousticSystem.d.ts +29 -32
  36. package/src/engine/graphics3/GPUAcousticSystem.d.ts.map +1 -1
  37. package/src/engine/graphics3/GPUAcousticSystem.js +87 -162
  38. package/src/engine/graphics3/HairSystem.d.ts +102 -0
  39. package/src/engine/graphics3/HairSystem.d.ts.map +1 -0
  40. package/src/engine/graphics3/HairSystem.js +456 -0
  41. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  42. package/src/engine/sound/ecs/audio/AudioEmitterSystem.d.ts.map +1 -1
  43. package/src/engine/sound/ecs/audio/AudioEmitterSystem.js +35 -17
  44. package/src/engine/sound/ecs/audio/LiveEmitterSet.d.ts.map +1 -1
  45. package/src/engine/sound/ecs/audio/LiveEmitterSet.js +2 -3
  46. package/src/engine/sound/simulation/AcousticSimulator.d.ts +7 -0
  47. package/src/engine/sound/simulation/AcousticSimulator.d.ts.map +1 -1
  48. package/src/engine/sound/simulation/AcousticSimulator.js +27 -0
  49. package/src/engine/sound/simulation/README.md +121 -107
  50. package/src/engine/sound/sopra/README.md +8 -3
  51. package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.d.ts +2 -2
  52. package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.d.ts.map +1 -1
  53. package/src/engine/sound/sopra/definition/effect/AcousticReverbEffect.js +4 -3
  54. package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.d.ts +118 -0
  55. package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.d.ts.map +1 -0
  56. package/src/engine/sound/sopra/runtime/AcousticReverbConvolution.js +472 -0
  57. package/src/engine/sound/sopra/runtime/AcousticReverbLines.d.ts +166 -0
  58. package/src/engine/sound/sopra/runtime/AcousticReverbLines.d.ts.map +1 -0
  59. package/src/engine/sound/sopra/runtime/AcousticReverbLines.js +447 -0
  60. package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.d.ts +69 -113
  61. package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.d.ts.map +1 -1
  62. package/src/engine/sound/sopra/runtime/AcousticReverbNetwork.js +143 -491
  63. package/src/engine/sound/sopra/runtime/AcousticSpeakers.d.ts +102 -0
  64. package/src/engine/sound/sopra/runtime/AcousticSpeakers.d.ts.map +1 -0
  65. package/src/engine/sound/sopra/runtime/AcousticSpeakers.js +232 -0
  66. package/src/engine/sound/sopra/runtime/BusGraph.d.ts +17 -3
  67. package/src/engine/sound/sopra/runtime/BusGraph.d.ts.map +1 -1
  68. package/src/engine/sound/sopra/runtime/BusGraph.js +55 -5
  69. package/src/engine/sound/sopra/runtime/EventInstance.d.ts +8 -6
  70. package/src/engine/sound/sopra/runtime/EventInstance.d.ts.map +1 -1
  71. package/src/engine/sound/sopra/runtime/EventInstance.js +113 -105
  72. package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.d.ts +13 -0
  73. package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.d.ts.map +1 -0
  74. package/src/engine/sound/sopra/runtime/acoustic_reverb_decay.js +15 -0
  75. package/src/generation/grid/generation/discrete/GridTaskConnectRooms.d.ts.map +1 -1
  76. package/src/generation/grid/generation/discrete/GridTaskConnectRooms.js +4 -6
  77. package/src/shade/assets/textures/hair_scattering.bin +0 -0
  78. package/src/shade/device/pipeline/PipelineEnquiry.d.ts +11 -0
  79. package/src/shade/device/pipeline/PipelineEnquiry.d.ts.map +1 -1
  80. package/src/shade/device/pipeline/PipelineEnquiry.js +13 -0
  81. package/src/shade/playground/hair/index.html +50 -0
  82. package/src/shade/playground/hair/main.d.ts +2 -0
  83. package/src/shade/playground/hair/main.d.ts.map +1 -0
  84. package/src/shade/playground/hair/main.js +274 -0
  85. package/src/shade/playground/screen_probes/README.md +54 -0
  86. package/src/shade/playground/screen_probes/index.html +271 -0
  87. package/src/shade/playground/screen_probes/main.d.ts +8 -0
  88. package/src/shade/playground/screen_probes/main.d.ts.map +1 -0
  89. package/src/shade/playground/screen_probes/main.js +527 -0
  90. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.d.ts.map +1 -1
  91. package/src/shade/playground/skinned_blas_refit/diff_traced_against_rasterized.js +4 -5
  92. package/src/shade/playground/skinned_blas_refit/main.d.ts.map +1 -1
  93. package/src/shade/playground/skinned_blas_refit/main.js +6 -12
  94. package/src/shade/playground/skinned_mesh_soup/main.d.ts.map +1 -1
  95. package/src/shade/playground/skinned_mesh_soup/main.js +1 -2
  96. package/src/shade/playground/vgeo_scene/README.md +12 -2
  97. package/src/shade/playground/vgeo_scene/main.js +1 -1
  98. package/src/shade/playground/volumetrics_froxel/README.md +191 -191
  99. package/src/shade/playground/volumetrics_froxel/measure.d.ts +3 -3
  100. package/src/shade/playground/volumetrics_froxel/measure.d.ts.map +1 -1
  101. package/src/shade/playground/volumetrics_froxel/measure.js +11 -13
  102. package/src/shade/playground/vsm/main.d.ts.map +1 -1
  103. package/src/shade/playground/vsm/main.js +5 -6
  104. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  105. package/src/shade/renderer/Renderer.js +85 -16
  106. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.d.ts +6 -0
  107. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.d.ts.map +1 -1
  108. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.js +10 -0
  109. package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.d.ts +28 -0
  110. package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.d.ts.map +1 -0
  111. package/src/shade/renderer/acoustics/ACOUSTIC_LISTENER_RESOURCES.js +42 -0
  112. package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.d.ts +58 -0
  113. package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.d.ts.map +1 -0
  114. package/src/shade/renderer/acoustics/ACOUSTIC_PROBE_DATABASE_SPEC.js +108 -0
  115. package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
  116. package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts +161 -0
  117. package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts.map +1 -0
  118. package/src/shade/renderer/acoustics/GPUAcousticProbes.js +760 -0
  119. package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
  120. package/src/shade/renderer/acoustics/acoustic_listener_order.d.ts +12 -0
  121. package/src/shade/renderer/acoustics/acoustic_listener_order.d.ts.map +1 -0
  122. package/src/shade/renderer/acoustics/acoustic_listener_order.js +56 -0
  123. package/src/shade/renderer/acoustics/chunk_acoustic_direct.d.ts.map +1 -1
  124. package/src/shade/renderer/acoustics/chunk_acoustic_direct.js +5 -0
  125. package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.d.ts +57 -0
  126. package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.d.ts.map +1 -0
  127. package/src/shade/renderer/acoustics/chunk_acoustic_direct_cone.js +314 -0
  128. package/src/shade/renderer/acoustics/chunk_acoustic_finite.d.ts +15 -0
  129. package/src/shade/renderer/acoustics/chunk_acoustic_finite.d.ts.map +1 -0
  130. package/src/shade/renderer/acoustics/chunk_acoustic_finite.js +21 -0
  131. package/src/shade/renderer/acoustics/chunk_acoustic_gather.js +1 -1
  132. package/src/shade/renderer/acoustics/chunk_acoustic_lean.d.ts +27 -0
  133. package/src/shade/renderer/acoustics/chunk_acoustic_lean.d.ts.map +1 -0
  134. package/src/shade/renderer/acoustics/chunk_acoustic_lean.js +42 -0
  135. package/src/shade/renderer/acoustics/chunk_acoustic_listener.d.ts +80 -0
  136. package/src/shade/renderer/acoustics/chunk_acoustic_listener.d.ts.map +1 -0
  137. package/src/shade/renderer/acoustics/chunk_acoustic_listener.js +274 -0
  138. package/src/shade/renderer/acoustics/chunk_acoustic_partials.d.ts +2 -2
  139. package/src/shade/renderer/acoustics/chunk_acoustic_partials.js +2 -2
  140. package/src/shade/renderer/acoustics/chunk_acoustic_phonon.d.ts +7 -0
  141. package/src/shade/renderer/acoustics/chunk_acoustic_phonon.d.ts.map +1 -1
  142. package/src/shade/renderer/acoustics/chunk_acoustic_phonon.js +24 -1
  143. package/src/shade/renderer/acoustics/chunk_acoustic_resample.js +1 -1
  144. package/src/shade/renderer/acoustics/chunk_acoustic_reservoir.js +1 -1
  145. package/src/shade/renderer/acoustics/chunk_acoustic_through.d.ts +43 -0
  146. package/src/shade/renderer/acoustics/chunk_acoustic_through.d.ts.map +1 -0
  147. package/src/shade/renderer/acoustics/chunk_acoustic_through.js +153 -0
  148. package/src/shade/renderer/acoustics/chunk_acoustic_trace.d.ts +3 -1
  149. package/src/shade/renderer/acoustics/chunk_acoustic_trace.d.ts.map +1 -1
  150. package/src/shade/renderer/acoustics/chunk_acoustic_trace.js +10 -1
  151. package/src/shade/renderer/acoustics/shader_acoustic_combine.d.ts +7 -3
  152. package/src/shade/renderer/acoustics/shader_acoustic_combine.d.ts.map +1 -1
  153. package/src/shade/renderer/acoustics/shader_acoustic_combine.js +22 -6
  154. package/src/shade/renderer/acoustics/shader_acoustic_coupling.d.ts +14 -0
  155. package/src/shade/renderer/acoustics/shader_acoustic_coupling.d.ts.map +1 -0
  156. package/src/shade/renderer/acoustics/shader_acoustic_coupling.js +102 -0
  157. package/src/shade/renderer/acoustics/shader_acoustic_listener.d.ts +12 -0
  158. package/src/shade/renderer/acoustics/shader_acoustic_listener.d.ts.map +1 -0
  159. package/src/shade/renderer/acoustics/shader_acoustic_listener.js +80 -0
  160. package/src/shade/renderer/acoustics/shader_acoustic_receive.d.ts.map +1 -1
  161. package/src/shade/renderer/acoustics/shader_acoustic_receive.js +27 -6
  162. package/src/shade/renderer/acoustics/shader_acoustic_room.d.ts +11 -0
  163. package/src/shade/renderer/acoustics/shader_acoustic_room.d.ts.map +1 -0
  164. package/src/shade/renderer/acoustics/shader_acoustic_room.js +111 -0
  165. package/src/shade/renderer/acoustics/shader_acoustic_source.d.ts +18 -0
  166. package/src/shade/renderer/acoustics/shader_acoustic_source.d.ts.map +1 -0
  167. package/src/shade/renderer/acoustics/shader_acoustic_source.js +130 -0
  168. package/src/shade/renderer/deferred/chunk_read_gBuffer_material.d.ts.map +1 -1
  169. package/src/shade/renderer/deferred/chunk_read_gBuffer_material.js +3 -1
  170. package/src/shade/renderer/deferred/chunk_shade_direct_lights.d.ts +23 -0
  171. package/src/shade/renderer/deferred/chunk_shade_direct_lights.d.ts.map +1 -0
  172. package/src/shade/renderer/deferred/chunk_shade_direct_lights.js +111 -0
  173. package/src/shade/renderer/deferred/chunk_shade_directional_lights.d.ts +17 -6
  174. package/src/shade/renderer/deferred/chunk_shade_directional_lights.d.ts.map +1 -1
  175. package/src/shade/renderer/deferred/chunk_shade_directional_lights.js +26 -21
  176. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts +12 -22
  177. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts.map +1 -1
  178. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.js +20 -100
  179. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.d.ts.map +1 -1
  180. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.js +6 -4
  181. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.d.ts +15 -0
  182. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.d.ts.map +1 -0
  183. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.js +47 -0
  184. package/src/shade/renderer/extension/ViewLighting.d.ts +101 -0
  185. package/src/shade/renderer/extension/ViewLighting.d.ts.map +1 -0
  186. package/src/shade/renderer/extension/ViewLighting.js +168 -0
  187. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
  188. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
  189. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -7
  190. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  191. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  192. package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.d.ts +2 -2
  193. package/src/shade/renderer/geometry/virtual/build/level/VGeoFrontier.js +2 -2
  194. package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.d.ts +5 -2
  195. package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.d.ts.map +1 -1
  196. package/src/shade/renderer/geometry/virtual/build/level/VGeoLevelOptions.js +5 -2
  197. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts +9 -2
  198. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.d.ts.map +1 -1
  199. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_group_step.js +48 -12
  200. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts +0 -22
  201. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.d.ts.map +1 -1
  202. package/src/shade/renderer/geometry/virtual/format/read/VGeoContainerReader.js +0 -42
  203. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts +2 -18
  204. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.d.ts.map +1 -1
  205. package/src/shade/renderer/geometry/virtual/format/read/VGeoReadOptions.js +2 -19
  206. package/src/shade/renderer/geometry/virtual/format/read/vgeo_page_worker_serve.d.ts.map +1 -1
  207. package/src/shade/renderer/geometry/virtual/format/read/vgeo_page_worker_serve.js +0 -1
  208. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts +5 -4
  209. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.d.ts.map +1 -1
  210. package/src/shade/renderer/geometry/virtual/runtime/GPUVirtualGeometryRuntime.js +3 -1
  211. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.d.ts.map +1 -1
  212. package/src/shade/renderer/geometry/virtual/runtime/VGeoFeedbackLoop.js +3 -1
  213. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.d.ts.map +1 -1
  214. package/src/shade/renderer/geometry/virtual/runtime/VGeoPageFetcher.js +0 -1
  215. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts +60 -14
  216. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.d.ts.map +1 -1
  217. package/src/shade/renderer/geometry/virtual/runtime/VGeoViewCut.js +75 -39
  218. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.d.ts.map +1 -1
  219. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.js +3 -1
  220. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +1 -1
  221. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts +0 -9
  222. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts.map +1 -1
  223. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.js +45 -17
  224. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +7 -3
  225. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
  226. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +43 -7
  227. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts.map +1 -1
  228. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js +3 -1
  229. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +15 -7
  230. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts.map +1 -1
  231. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +40 -9
  232. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts +23 -0
  233. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts.map +1 -1
  234. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js +26 -0
  235. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.d.ts +1 -0
  236. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.js +6 -0
  237. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +13 -1
  238. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
  239. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +23 -1
  240. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.d.ts.map +1 -1
  241. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js +2 -0
  242. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts +29 -0
  243. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts.map +1 -0
  244. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.js +102 -0
  245. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts +8 -1
  246. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts.map +1 -1
  247. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.js +27 -1
  248. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts +4 -1
  249. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts.map +1 -1
  250. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js +4 -1
  251. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts +11 -5
  252. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts.map +1 -1
  253. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.js +28 -10
  254. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts +36 -2
  255. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts.map +1 -1
  256. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.js +149 -4
  257. package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.d.ts.map +1 -1
  258. package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.js +3 -1
  259. package/src/shade/renderer/hair/GPUHairSystem.d.ts +159 -0
  260. package/src/shade/renderer/hair/GPUHairSystem.d.ts.map +1 -0
  261. package/src/shade/renderer/hair/GPUHairSystem.js +1132 -0
  262. package/src/shade/renderer/hair/HAIR.d.ts +102 -0
  263. package/src/shade/renderer/hair/HAIR.d.ts.map +1 -0
  264. package/src/shade/renderer/hair/HAIR.js +115 -0
  265. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.d.ts +17 -0
  266. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.d.ts.map +1 -0
  267. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.js +71 -0
  268. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.d.ts +11 -0
  269. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.d.ts.map +1 -0
  270. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.js +48 -0
  271. package/src/shade/renderer/hair/HairFrame.d.ts +41 -0
  272. package/src/shade/renderer/hair/HairFrame.d.ts.map +1 -0
  273. package/src/shade/renderer/hair/HairFrame.js +76 -0
  274. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts +42 -0
  275. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts.map +1 -0
  276. package/src/shade/renderer/hair/chunk_hair_bsdf.js +170 -0
  277. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts +30 -0
  278. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts.map +1 -0
  279. package/src/shade/renderer/hair/chunk_hair_dual_scattering.js +131 -0
  280. package/src/shade/renderer/hair/chunk_hair_pixel.d.ts +32 -0
  281. package/src/shade/renderer/hair/chunk_hair_pixel.d.ts.map +1 -0
  282. package/src/shade/renderer/hair/chunk_hair_pixel.js +116 -0
  283. package/src/shade/renderer/hair/chunk_hair_strand.d.ts +40 -0
  284. package/src/shade/renderer/hair/chunk_hair_strand.d.ts.map +1 -0
  285. package/src/shade/renderer/hair/chunk_hair_strand.js +85 -0
  286. package/src/shade/renderer/hair/chunk_hair_volume.d.ts +31 -0
  287. package/src/shade/renderer/hair/chunk_hair_volume.d.ts.map +1 -0
  288. package/src/shade/renderer/hair/chunk_hair_volume.js +106 -0
  289. package/src/shade/renderer/hair/hair_id_draw.d.ts +24 -0
  290. package/src/shade/renderer/hair/hair_id_draw.d.ts.map +1 -0
  291. package/src/shade/renderer/hair/hair_id_draw.js +135 -0
  292. package/src/shade/renderer/hair/hair_lighting.d.ts +53 -0
  293. package/src/shade/renderer/hair/hair_lighting.d.ts.map +1 -0
  294. package/src/shade/renderer/hair/hair_lighting.js +270 -0
  295. package/src/shade/renderer/hair/hair_scattering_lut.d.ts +75 -0
  296. package/src/shade/renderer/hair/hair_scattering_lut.d.ts.map +1 -0
  297. package/src/shade/renderer/hair/hair_scattering_lut.js +271 -0
  298. package/src/shade/renderer/hair/hair_stamp.d.ts +33 -0
  299. package/src/shade/renderer/hair/hair_stamp.d.ts.map +1 -0
  300. package/src/shade/renderer/hair/hair_stamp.js +175 -0
  301. package/src/shade/renderer/hair/shader_hair_classes.d.ts +21 -0
  302. package/src/shade/renderer/hair/shader_hair_classes.d.ts.map +1 -0
  303. package/src/shade/renderer/hair/shader_hair_classes.js +86 -0
  304. package/src/shade/renderer/hair/shader_hair_cull.d.ts +31 -0
  305. package/src/shade/renderer/hair/shader_hair_cull.d.ts.map +1 -0
  306. package/src/shade/renderer/hair/shader_hair_cull.js +194 -0
  307. package/src/shade/renderer/hair/shader_hair_lod.d.ts +33 -0
  308. package/src/shade/renderer/hair/shader_hair_lod.d.ts.map +1 -0
  309. package/src/shade/renderer/hair/shader_hair_lod.js +268 -0
  310. package/src/shade/renderer/hair/shader_hair_volume.d.ts +28 -0
  311. package/src/shade/renderer/hair/shader_hair_volume.d.ts.map +1 -0
  312. package/src/shade/renderer/hair/shader_hair_volume.js +167 -0
  313. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  314. package/src/shade/renderer/loader/usd/usd_build_scene.d.ts +31 -0
  315. package/src/shade/renderer/loader/usd/usd_build_scene.d.ts.map +1 -1
  316. package/src/shade/renderer/loader/usd/usd_build_scene.js +36 -21
  317. package/src/shade/renderer/loader/usd/usd_groom_extension.d.ts +60 -0
  318. package/src/shade/renderer/loader/usd/usd_groom_extension.d.ts.map +1 -0
  319. package/src/shade/renderer/loader/usd/usd_groom_extension.js +417 -0
  320. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts.map +1 -1
  321. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.js +4 -1
  322. package/src/shade/renderer/path_tracer/shader/chunk_shading_closure_from_material_data.d.ts.map +1 -1
  323. package/src/shade/renderer/path_tracer/shader/chunk_shading_closure_from_material_data.js +3 -1
  324. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  325. package/src/shade/renderer/postprocess/ssr/SSR.d.ts +4 -1
  326. package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
  327. package/src/shade/renderer/postprocess/ssr/SSR.js +9 -0
  328. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts +16 -1
  329. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts.map +1 -1
  330. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.js +47 -3
  331. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.d.ts.map +1 -1
  332. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js +5 -3
  333. package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.d.ts.map +1 -1
  334. package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.js +6 -5
  335. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.d.ts.map +1 -1
  336. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.js +5 -2
  337. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.d.ts.map +1 -1
  338. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js +5 -0
  339. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts.map +1 -1
  340. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.js +4 -1
  341. package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.d.ts.map +1 -1
  342. package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.js +5 -1
  343. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.d.ts.map +1 -1
  344. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.js +7 -4
  345. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts +13 -8
  346. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts.map +1 -1
  347. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.js +18 -14
  348. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts +3 -2
  349. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts.map +1 -1
  350. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.js +12 -4
  351. package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.d.ts.map +1 -1
  352. package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js +1 -0
  353. package/src/shade/renderer/shader/chunk/material/chunk_compute_indirect_specular.js +1 -1
  354. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.d.ts +16 -0
  355. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.d.ts.map +1 -0
  356. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.js +25 -0
  357. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.js +2 -2
  358. package/src/shade/renderer/shader/compiler/ShaderSwitch.d.ts +1 -1
  359. package/src/shade/renderer/shader/compiler/ShaderSwitchSet.d.ts +1 -1
  360. package/src/shade/renderer/shader/resource/ShaderResourceDescriptor.d.ts +1 -1
  361. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_point2.d.ts +2 -2
  362. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_point2.js +2 -2
  363. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
@@ -81,12 +81,12 @@ const frame_word = name => SCREEN_PROBE_FRAME_STRUCT.get(name).offset >>> 2;
81
81
  * it wants); its BRDF and lighting densities and its rays, reassigned to where its light is; the screen trace; the
82
82
  * bricks' trace, shade, local light and bounce of what the screen left; the hits' wants; the composite into each
83
83
  * probe's radiance, the spatial filter's passes, and the probes' SH3.
84
- * 3. **Resolve** ({@link graph_resolve}), once the bent normals exist: each pixel's irradiance from its probes, then
85
- * the temporal filter into the frame's diffuse, which the deferred passes read.
84
+ * 3. **Resolve** ({@link graph_resolve}), once the bent normals exist: each pixel's irradiance and rough specular from
85
+ * its probes, then the temporal filter into the frame's diffuse and specular, which the deferred passes read.
86
86
  * 4. **Capture** ({@link graph_capture}): the lit colour of the opaque surfaces, for the next frame's screen hits.
87
87
  *
88
- * **Its history**: last frame's probes (their records and filtered radiance, for the lighting density), its diffuse
89
- * and frames (for the temporal filter) and its colour (for the screen hits) are kept while the structure and the view
88
+ * **Its history**: last frame's probes (their records and filtered radiance, for the lighting density), its diffuse,
89
+ * specular and frames (for the temporal filter) and its colour (for the screen hits) are kept while the structure and the view
90
90
  * stay, until {@link reset_history}; any change starts it again. Nothing is allocated on a frame that changes neither: the adaptive probes' slots
91
91
  * are made with the rest, as many as the uniform probes (`screen_probe_adaptive_capacity`), and a frame that would
92
92
  * place more places no more.
@@ -159,9 +159,13 @@ export class GPUScreenProbeGI {
159
159
  #radiance_final = 0;
160
160
  /** @type {GPUTextureContext|null} */
161
161
  #integrated = null;
162
- /** This frame's and last frame's diffuse and frames; {@link #temporal_parity} names this frame's. @type {GPUTextureContext[]} */
162
+ /** @type {GPUTextureContext|null} */
163
+ #integrated_specular = null;
164
+ /** This frame's and last frame's diffuse, specular and frames; {@link #temporal_parity} names this frame's. @type {GPUTextureContext[]} */
163
165
  #diffuse = [];
164
166
  /** @type {GPUTextureContext[]} */
167
+ #specular = [];
168
+ /** @type {GPUTextureContext[]} */
165
169
  #frames = [];
166
170
  #temporal_parity = 0;
167
171
  /** @type {GPUTextureContext|null} */
@@ -209,6 +213,9 @@ export class GPUScreenProbeGI {
209
213
  /** The graph handle of the frame's diffuse, as {@link graph_resolve} wrote it. */
210
214
  #diffuse_handle = -1;
211
215
 
216
+ /** The graph handle of the frame's rough specular, as {@link graph_resolve} wrote it. */
217
+ #specular_handle = -1;
218
+
212
219
  /**
213
220
  * @param {GPUDevice} device
214
221
  */
@@ -367,13 +374,14 @@ export class GPUScreenProbeGI {
367
374
  }
368
375
 
369
376
  /**
370
- * Take the frame's resolve, once the bent normals exist: each pixel's irradiance from its probes, then the temporal
371
- * filter into the frame's diffuse.
377
+ * Take the frame's resolve, once the bent normals exist: each pixel's irradiance and rough specular from its
378
+ * probes, then the temporal filter into the frame's diffuse and specular ({@link specular_handle}).
372
379
  *
373
380
  * @param {Object} options
374
381
  * @param {FrameGraph} options.graph
375
382
  * @param {number} options.depth graph handle of the view's reverse-Z depth
376
383
  * @param {number} options.depth_previous graph handle of last frame's
384
+ * @param {number} options.normal graph handle of the G-buffer's shading normals, which the specular lobe stands on
377
385
  * @param {number} options.pbr graph handle of the G-buffer's PBR target
378
386
  * @param {number} options.velocity graph handle of the frame's motion
379
387
  * @param {number} options.bent_normals graph handle of the bent normals (the shading normals where GTAO is off)
@@ -381,27 +389,40 @@ export class GPUScreenProbeGI {
381
389
  * was shown, the one {@link graph_update} took: what the probes' radiance is pre-exposed by
382
390
  * @returns {number} graph handle of the frame's diffuse, `rgba16float`: E at the bent normal, before AO
383
391
  */
384
- graph_resolve({ graph, depth, depth_previous, pbr, velocity, bent_normals, exposure }) {
392
+ graph_resolve({ graph, depth, depth_previous, normal, pbr, velocity, bent_normals, exposure }) {
385
393
  assert.ok(this.#built, 'graph_update() first');
394
+ assert.isNonNegativeInteger(normal, 'normal');
386
395
 
387
396
  const data = this.#resolve_data;
388
397
  const pass = graph.add("Screen Probe Resolve", data, this.#execute_resolve);
389
398
 
390
399
  data.depth = pass.read(depth);
391
400
  data.depth_previous = pass.read(depth_previous);
401
+ data.normal = pass.read(normal);
392
402
  data.pbr = pass.read(pbr);
393
403
  data.velocity = pass.read(velocity);
394
404
  data.bent_normals = pass.read(bent_normals);
395
405
  data.exposure = pass.read(exposure);
396
406
  data.diffuse = pass.write(graph_import_texture(graph, this.#diffuse[this.#temporal_parity], 'screen probe diffuse'));
407
+ data.specular = pass.write(graph_import_texture(graph, this.#specular[this.#temporal_parity], 'screen probe specular'));
397
408
 
398
409
  pass.make_side_effect();
399
410
 
400
411
  this.#diffuse_handle = data.diffuse;
412
+ this.#specular_handle = data.specular;
401
413
 
402
414
  return data.diffuse;
403
415
  }
404
416
 
417
+ /**
418
+ * @returns {number} graph handle of the rough specular this frame's {@link graph_resolve} wrote, `rgba16float`: the
419
+ * screen probes' radiance along each pixel's specular lobe, and in alpha the share of the pixel's specular the
420
+ * world-space probes keep, so a pixel's specular light is `rgb · (1 − a) + world · a`
421
+ */
422
+ get specular_handle() {
423
+ return this.#specular_handle;
424
+ }
425
+
405
426
  /**
406
427
  * @returns {number} graph handle of the diffuse this frame's {@link graph_resolve} wrote
407
428
  */
@@ -482,6 +503,7 @@ export class GPUScreenProbeGI {
482
503
  f[frame_word('brick_t_max')] = Math.sqrt(3) * bricks.resolution * bricks.cell_size(coarsest);
483
504
  u[frame_word('importance_sampling')] = settings.importance_sampling && this.#octahedron_resolution <= SCREEN_PROBE_OCTAHEDRON_LIMIT ? 1 : 0;
484
505
  u[frame_word('screen_traces')] = settings.screen_traces ? 1 : 0;
506
+ u[frame_word('rough_specular')] = settings.rough_specular ? 1 : 0;
485
507
  u[frame_word('brick_cascade_count')] = bricks.cascade_count;
486
508
  u[frame_word('brick_atlas_shift')] = bricks.atlas_shift;
487
509
  f[frame_word('temporal_frames')] = settings.temporal_frames;
@@ -572,7 +594,9 @@ export class GPUScreenProbeGI {
572
594
  const view_texture = (name, format) => this.#texture(`screen probe ${name}`, [width, height], format);
573
595
 
574
596
  this.#integrated = view_texture('integrated', 'rgba16float');
597
+ this.#integrated_specular = view_texture('integrated specular', 'rgba16float');
575
598
  this.#diffuse = [view_texture('diffuse 0', 'rgba16float'), view_texture('diffuse 1', 'rgba16float')];
599
+ this.#specular = [view_texture('specular 0', 'rgba16float'), view_texture('specular 1', 'rgba16float')];
576
600
  this.#frames = [view_texture('frames 0', 'r32uint'), view_texture('frames 1', 'r32uint')];
577
601
  this.#color_history = view_texture('color history', 'rgba16float');
578
602
 
@@ -831,11 +855,14 @@ export class GPUScreenProbeGI {
831
855
  b.tSTBN_vec2 = this.#stbn;
832
856
  b.tDepth = resources.get(data.depth);
833
857
  b.tDepthPrevious = resources.get(data.depth_previous);
858
+ b.tNormal = resources.get(data.normal);
834
859
  b.tPBR = resources.get(data.pbr);
835
860
  b.tVelocity = resources.get(data.velocity);
836
861
  b.tBentNormals = resources.get(data.bent_normals);
837
862
  b.screen_probe_exposure = resources.get(data.exposure);
838
863
  b.screen_probe_integrated = this.#integrated.obtainView();
864
+ b.screen_probe_integrated_specular = this.#integrated_specular.obtainView();
865
+ b.screen_probe_radiance = this.#radiance[this.#radiance_final].obtainView();
839
866
 
840
867
  const x = Math.ceil(this.#view_width / groups);
841
868
  const y = Math.ceil(this.#view_height / groups);
@@ -847,6 +874,8 @@ export class GPUScreenProbeGI {
847
874
  b.screen_probe_diffuse_history = this.#diffuse[1 - now].obtainView();
848
875
  b.screen_probe_frames_history = this.#frames[1 - now].obtainView();
849
876
  b.screen_probe_diffuse = resources.get(data.diffuse);
877
+ b.screen_probe_specular_history = this.#specular[1 - now].obtainView();
878
+ b.screen_probe_specular = resources.get(data.specular);
850
879
  b.screen_probe_frames = this.#frames[now].obtainView();
851
880
 
852
881
  shader_screen_probe_temporal.dispatch({ encoder, bindings: b, group_count_x: x, group_count_y: y });
@@ -904,7 +933,7 @@ export class GPUScreenProbeGI {
904
933
  buffer?.destroy();
905
934
  }
906
935
 
907
- for (const texture of [this.#integrated, ...this.#diffuse, ...this.#frames, this.#color_history]) {
936
+ for (const texture of [this.#integrated, this.#integrated_specular, ...this.#diffuse, ...this.#specular, ...this.#frames, this.#color_history]) {
908
937
  texture?.destroy();
909
938
  }
910
939
 
@@ -915,7 +944,9 @@ export class GPUScreenProbeGI {
915
944
  this.#counters = null;
916
945
  this.#exposure_history = [];
917
946
  this.#integrated = null;
947
+ this.#integrated_specular = null;
918
948
  this.#diffuse = [];
949
+ this.#specular = [];
919
950
  this.#frames = [];
920
951
  this.#color_history = null;
921
952
 
@@ -146,6 +146,29 @@ export const SCREEN_PROBE_TEMPORAL_DISTANCE: number;
146
146
  */
147
147
  export const SCREEN_PROBE_FAST_UPDATE_MOVING: number;
148
148
  export const SCREEN_PROBE_FAST_UPDATE_LIMIT: 0.9;
149
+ /**
150
+ * Where the screen probes' rough specular takes a surface's specular over from the world-space probes, by its
151
+ * perceptual roughness: the world probes' whole below `ROUGHNESS − FADE`, the screen probes' whole from `ROUGHNESS`,
152
+ * linear between. Lumen's `LumenMaxRoughnessToTraceReflections` (0.4) and `r.Lumen.Reflections.RoughnessFadeLength`
153
+ * (0.1), its traced reflections being the world probes here.
154
+ * @type {number}
155
+ */
156
+ export const SCREEN_PROBE_ROUGH_SPECULAR_ROUGHNESS: number;
157
+ export const SCREEN_PROBE_ROUGH_SPECULAR_FADE: 0.1;
158
+ /**
159
+ * Where the rough specular stops sampling the probes' radiance along the GGX lobe and takes their irradiance at the
160
+ * bent normal over π instead, by perceptual roughness: sampled whole below `ROUGHNESS − FADE`, the irradiance whole
161
+ * from `ROUGHNESS`, linear between. Lumen's `r.Lumen.ScreenProbeGather.MaxRoughnessToEvaluateRoughSpecular` (0.8) and
162
+ * `GetDiffuseLerp`'s fade (0.2).
163
+ * @type {number}
164
+ */
165
+ export const SCREEN_PROBE_ROUGH_SPECULAR_SAMPLED_ROUGHNESS: number;
166
+ export const SCREEN_PROBE_ROUGH_SPECULAR_SAMPLED_FADE: 0.2;
167
+ /**
168
+ * Directions a pixel's rough specular draws from the GGX lobe a frame, Lumen's `NumSpecularSamples`.
169
+ * @type {number}
170
+ */
171
+ export const SCREEN_PROBE_ROUGH_SPECULAR_SAMPLES: number;
149
172
  /**
150
173
  * How a probe's ray ended, the low bits of its hit word.
151
174
  * - PENDING: the screen could not answer; the bricks will.
@@ -1 +1 @@
1
- {"version":3,"file":"SCREEN_PROBE.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js"],"names":[],"mappings":"AAsMA;;;;;GAKG;AACH,gEALW,MAAM,kCACN,MAAM,GACJ,MAAM,CAWlB;AAED;;;;GAIG;AACH,4DAJW,MAAM,GACJ,MAAM,CAKlB;AAED;;;;;;GAMG;AACH,8DANW,MAAM,UACN,MAAM,GACJ,MAAM,CAMlB;AArOD;;;;GAIG;AACH,iDAFU,MAAM,CAE2D;AAE3E;;;GAGG;AACH,+CAFU,MAAM,CAEkC;AAElD;;;;GAIG;AACH,yCAFU,MAAM,CAE4B;AAE5C;;;;;;GAMG;AACH,4CAFU,MAAM,CAEgC;AAEhD;;;GAGG;AACH,8CAFU,MAAM,CAEiC;AAEjD;;;;GAIG;AACH,8CAFU,MAAM,CAEqC;AAErD;;;;GAIG;AACH,0CAFU,MAAM,CAEgC;AAEhD;;;;GAIG;AACH,qDAFU,MAAM,CAE8C;AAE9D;;;;GAIG;AACH,6CAFU,MAAM,CAEkC;AAElD;;;;;;GAMG;AACH,mCAFU,MAAM,CAEwB;AAExC;;;;GAIG;AACH,yCAFU,MAAM,CAE4B;AAE5C;;;;;GAKG;AACH,6CAFU,MAAM,CAEiC;AAEjD;;;;GAIG;AACH,8CAFU,MAAM,CAEkC;AAElD;;;;GAIG;AACH,4CAFU,MAAM,CAEkC;AAElD;;;;GAIG;AACH,uCAFU,MAAM,CAE4B;AAE5C;;;;;;GAMG;AACH,0CAFU,MAAM,CAE6C;AAE7D;;;;GAIG;AACH,wCAFU,MAAM,CAE2B;AAE3C;;;;GAIG;AACH,wCAFU,MAAM,CAE+B;AAE/C;;;;;GAKG;AACH,6CAFU,MAAM,CAEoC;AAEpD;;;;GAIG;AACH,8CAFU,MAAM,CAEmC;AACnD,iDAAkD;AAElD;;;;;;;;;;GAUG;AACH,2CAA4C;AAC5C,0CAA2C;AAC3C,uCAAwC;AACxC,wCAAyC;AACzC,uCAAwC;AACxC,uCAAwC;AACxC,8CAA+C;AAC/C,wCAAyC;AACzC,6CAA8C;AAE9C;;;GAGG;AACH,wCAFU,MAAM,CAE2B;AAE3C;;;;GAIG;AACH,6CAA8C;AAC9C,8CAA+C;AAC/C,2CAA4C;AAC5C,iDAAkD;AAClD,mDAAoD;AACpD,uDAAwD;AACxD,6CAA8C;AAE9C;;;GAGG;AACH,8CAA+C;AAC/C,gDAAiD;AACjD,2CAA4C"}
1
+ {"version":3,"file":"SCREEN_PROBE.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js"],"names":[],"mappings":"AAgOA;;;;;GAKG;AACH,gEALW,MAAM,kCACN,MAAM,GACJ,MAAM,CAWlB;AAED;;;;GAIG;AACH,4DAJW,MAAM,GACJ,MAAM,CAKlB;AAED;;;;;;GAMG;AACH,8DANW,MAAM,UACN,MAAM,GACJ,MAAM,CAMlB;AA/PD;;;;GAIG;AACH,iDAFU,MAAM,CAE2D;AAE3E;;;GAGG;AACH,+CAFU,MAAM,CAEkC;AAElD;;;;GAIG;AACH,yCAFU,MAAM,CAE4B;AAE5C;;;;;;GAMG;AACH,4CAFU,MAAM,CAEgC;AAEhD;;;GAGG;AACH,8CAFU,MAAM,CAEiC;AAEjD;;;;GAIG;AACH,8CAFU,MAAM,CAEqC;AAErD;;;;GAIG;AACH,0CAFU,MAAM,CAEgC;AAEhD;;;;GAIG;AACH,qDAFU,MAAM,CAE8C;AAE9D;;;;GAIG;AACH,6CAFU,MAAM,CAEkC;AAElD;;;;;;GAMG;AACH,mCAFU,MAAM,CAEwB;AAExC;;;;GAIG;AACH,yCAFU,MAAM,CAE4B;AAE5C;;;;;GAKG;AACH,6CAFU,MAAM,CAEiC;AAEjD;;;;GAIG;AACH,8CAFU,MAAM,CAEkC;AAElD;;;;GAIG;AACH,4CAFU,MAAM,CAEkC;AAElD;;;;GAIG;AACH,uCAFU,MAAM,CAE4B;AAE5C;;;;;;GAMG;AACH,0CAFU,MAAM,CAE6C;AAE7D;;;;GAIG;AACH,wCAFU,MAAM,CAE2B;AAE3C;;;;GAIG;AACH,wCAFU,MAAM,CAE+B;AAE/C;;;;;GAKG;AACH,6CAFU,MAAM,CAEoC;AAEpD;;;;GAIG;AACH,8CAFU,MAAM,CAEmC;AACnD,iDAAkD;AAElD;;;;;;GAMG;AACH,oDAFU,MAAM,CAEyC;AACzD,mDAAoD;AAEpD;;;;;;GAMG;AACH,4DAFU,MAAM,CAEiD;AACjE,2DAA4D;AAE5D;;;GAGG;AACH,kDAFU,MAAM,CAEqC;AAErD;;;;;;;;;;GAUG;AACH,2CAA4C;AAC5C,0CAA2C;AAC3C,uCAAwC;AACxC,wCAAyC;AACzC,uCAAwC;AACxC,uCAAwC;AACxC,8CAA+C;AAC/C,wCAAyC;AACzC,6CAA8C;AAE9C;;;GAGG;AACH,wCAFU,MAAM,CAE2B;AAE3C;;;;GAIG;AACH,6CAA8C;AAC9C,8CAA+C;AAC/C,2CAA4C;AAC5C,iDAAkD;AAClD,mDAAoD;AACpD,uDAAwD;AACxD,6CAA8C;AAE9C;;;GAGG;AACH,8CAA+C;AAC/C,gDAAiD;AACjD,2CAA4C"}
@@ -148,6 +148,32 @@ export const SCREEN_PROBE_TEMPORAL_DISTANCE = 0.005;
148
148
  export const SCREEN_PROBE_FAST_UPDATE_MOVING = 0.1;
149
149
  export const SCREEN_PROBE_FAST_UPDATE_LIMIT = 0.9;
150
150
 
151
+ /**
152
+ * Where the screen probes' rough specular takes a surface's specular over from the world-space probes, by its
153
+ * perceptual roughness: the world probes' whole below `ROUGHNESS − FADE`, the screen probes' whole from `ROUGHNESS`,
154
+ * linear between. Lumen's `LumenMaxRoughnessToTraceReflections` (0.4) and `r.Lumen.Reflections.RoughnessFadeLength`
155
+ * (0.1), its traced reflections being the world probes here.
156
+ * @type {number}
157
+ */
158
+ export const SCREEN_PROBE_ROUGH_SPECULAR_ROUGHNESS = 0.4;
159
+ export const SCREEN_PROBE_ROUGH_SPECULAR_FADE = 0.1;
160
+
161
+ /**
162
+ * Where the rough specular stops sampling the probes' radiance along the GGX lobe and takes their irradiance at the
163
+ * bent normal over π instead, by perceptual roughness: sampled whole below `ROUGHNESS − FADE`, the irradiance whole
164
+ * from `ROUGHNESS`, linear between. Lumen's `r.Lumen.ScreenProbeGather.MaxRoughnessToEvaluateRoughSpecular` (0.8) and
165
+ * `GetDiffuseLerp`'s fade (0.2).
166
+ * @type {number}
167
+ */
168
+ export const SCREEN_PROBE_ROUGH_SPECULAR_SAMPLED_ROUGHNESS = 0.8;
169
+ export const SCREEN_PROBE_ROUGH_SPECULAR_SAMPLED_FADE = 0.2;
170
+
171
+ /**
172
+ * Directions a pixel's rough specular draws from the GGX lobe a frame, Lumen's `NumSpecularSamples`.
173
+ * @type {number}
174
+ */
175
+ export const SCREEN_PROBE_ROUGH_SPECULAR_SAMPLES = 4;
176
+
151
177
  /**
152
178
  * How a probe's ray ended, the low bits of its hit word.
153
179
  * - PENDING: the screen could not answer; the bricks will.
@@ -7,5 +7,6 @@ export namespace ScreenProbeDebugView {
7
7
  let IndirectDiffuse: number;
8
8
  let ProbePlacement: number;
9
9
  let TraceKinds: number;
10
+ let IndirectSpecular: number;
10
11
  }
11
12
  //# sourceMappingURL=ScreenProbeDebugView.d.ts.map
@@ -22,4 +22,10 @@ export const ScreenProbeDebugView = {
22
22
  * green, by the world-space probes past the trace blue
23
23
  */
24
24
  TraceKinds: 3,
25
+ /**
26
+ * the light the mode's indirect specular is made of with SSR off: the screen probes' rough specular and the
27
+ * world-space probes' radiance, each by its share (all of a smooth surface's the world probes'), before the
28
+ * surface's split-sum reflectance and occlusion; with SSR on, what SSR's trace falls back to where it finds nothing
29
+ */
30
+ IndirectSpecular: 4,
25
31
  };
@@ -73,6 +73,18 @@ export class ScreenProbeSettings {
73
73
  * @returns {boolean}
74
74
  */
75
75
  get screen_traces(): boolean;
76
+ /**
77
+ * @param {boolean} v
78
+ */
79
+ set rough_specular(v: boolean);
80
+ /**
81
+ * Whether the probes light the specular of rough surfaces, as Lumen's screen probe gather does: each pixel's
82
+ * radiance along its GGX lobe from the probes' radiance, the probes' irradiance over π for the roughest, taking the
83
+ * specular over from the world-space probes by roughness (`SCREEN_PROBE_ROUGH_SPECULAR_ROUGHNESS`). Off, the
84
+ * world-space probes light every surface's specular. Takes effect the next frame.
85
+ * @returns {boolean}
86
+ */
87
+ get rough_specular(): boolean;
76
88
  /**
77
89
  * @param {number} v a non-negative integer
78
90
  */
@@ -89,7 +101,7 @@ export class ScreenProbeSettings {
89
101
  */
90
102
  set temporal_frames(v: number);
91
103
  /**
92
- * The most frames the temporal filter averages a pixel's diffuse over, Lumen's `Temporal.MaxFramesAccumulated`:
104
+ * The most frames the temporal filter averages a pixel's diffuse and rough specular over, Lumen's `Temporal.MaxFramesAccumulated`:
93
105
  * a pixel whose history holds blends its new light by 1 / (1 + frames). Where the probes' rays saw something
94
106
  * move, it takes fewer. Takes effect the next frame.
95
107
  * @returns {number}
@@ -1 +1 @@
1
- {"version":3,"file":"ScreenProbeSettings.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AACH;IAgBI;;OAEG;IACH,iCAKC;IApBD;;;;;;;OAOG;IACH,gCAEC;IAyBD;;;OAGG;IACH,qCAKC;IApBD;;;;;;OAMG;IACH,oCAEC;IA0BD;;OAEG;IACH,8CAKC;IAnBD;;;;;;OAMG;IACH,6CAEC;IAyBD;;OAEG;IACH,oCAIC;IAlBD;;;;;;OAMG;IACH,mCAEC;IAuBD;;OAEG;IACH,8BAIC;IAjBD;;;;;OAKG;IACH,6BAEC;IAuBD;;OAEG;IACH,qCAIC;IAjBD;;;;;OAKG;IACH,oCAEC;IAuBD;;OAEG;IACH,+BAKC;IAlBD;;;;;OAKG;IACH,8BAEC;IAuBD;;OAEG;IACH,0BAIC;IAhBD;;;;OAIG;IACH,yBAEC;;CAUJ"}
1
+ {"version":3,"file":"ScreenProbeSettings.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;GAYG;AACH;IAgBI;;OAEG;IACH,iCAKC;IApBD;;;;;;;OAOG;IACH,gCAEC;IAyBD;;;OAGG;IACH,qCAKC;IApBD;;;;;;OAMG;IACH,oCAEC;IA0BD;;OAEG;IACH,8CAKC;IAnBD;;;;;;OAMG;IACH,6CAEC;IAyBD;;OAEG;IACH,oCAIC;IAlBD;;;;;;OAMG;IACH,mCAEC;IAuBD;;OAEG;IACH,8BAIC;IAjBD;;;;;OAKG;IACH,6BAEC;IAwBD;;OAEG;IACH,+BAIC;IAlBD;;;;;;OAMG;IACH,8BAEC;IAuBD;;OAEG;IACH,qCAIC;IAjBD;;;;;OAKG;IACH,oCAEC;IAuBD;;OAEG;IACH,+BAKC;IAlBD;;;;;OAKG;IACH,8BAEC;IAuBD;;OAEG;IACH,0BAIC;IAhBD;;;;OAIG;IACH,yBAEC;;CAUJ"}
@@ -132,6 +132,28 @@ export class ScreenProbeSettings {
132
132
  this.#screen_traces = v;
133
133
  }
134
134
 
135
+ #rough_specular = true;
136
+
137
+ /**
138
+ * Whether the probes light the specular of rough surfaces, as Lumen's screen probe gather does: each pixel's
139
+ * radiance along its GGX lobe from the probes' radiance, the probes' irradiance over π for the roughest, taking the
140
+ * specular over from the world-space probes by roughness (`SCREEN_PROBE_ROUGH_SPECULAR_ROUGHNESS`). Off, the
141
+ * world-space probes light every surface's specular. Takes effect the next frame.
142
+ * @returns {boolean}
143
+ */
144
+ get rough_specular() {
145
+ return this.#rough_specular;
146
+ }
147
+
148
+ /**
149
+ * @param {boolean} v
150
+ */
151
+ set rough_specular(v) {
152
+ assert.isBoolean(v, 'rough_specular');
153
+
154
+ this.#rough_specular = v;
155
+ }
156
+
135
157
  #spatial_filter_passes = 3;
136
158
 
137
159
  /**
@@ -156,7 +178,7 @@ export class ScreenProbeSettings {
156
178
  #temporal_frames = 10;
157
179
 
158
180
  /**
159
- * The most frames the temporal filter averages a pixel's diffuse over, Lumen's `Temporal.MaxFramesAccumulated`:
181
+ * The most frames the temporal filter averages a pixel's diffuse and rough specular over, Lumen's `Temporal.MaxFramesAccumulated`:
160
182
  * a pixel whose history holds blends its new light by 1 / (1 + frames). Where the probes' rays saw something
161
183
  * move, it takes fewer. Takes effect the next frame.
162
184
  * @returns {number}
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_screen_probe.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js"],"names":[],"mappings":"AA2BA;;;GAGG;AACH,wCAFU,YAAY,CA2CC;AAEvB;;;GAGG;AACH,kCAFU,YAAY,CAaJ;AAElB;;;;GAIG;AACH,uCAFU,YAAY,CAgBA;AAEtB;;;GAGG;AACH,sCAFU,YAAY,CAiBD;AAErB,uCAAuC;AACvC,0CADW,wBAAwB,CAC0F;AAE7H;;;;GAIG;AACH,6CAFU,wBAAwB,CAE4F;AAE9H,sGAAsG;AACtG,sDAD0E,wBAAwB,CAC8C;AAEhJ,kFAAkF;AAClF,0CADsD,wBAAwB,CAC4D;AAC1I,uCAAuC;AACvC,2CADW,wBAAwB,CAC8G;AAEjJ,8GAA8G;AAC9G,8CADkF,wBAAwB,CAC6C;AAEvJ,uCAAuC;AACvC,+CADW,wBAAwB,CACsH;AACzJ,uCAAuC;AACvC,gDADW,wBAAwB,CAC6H;AAEhK,iKAAiK;AACjK,kDADqI,wBAAwB,CACzB;AACpI,uCAAuC;AACvC,mDADW,wBAAwB,CACwG;AAE3I,+FAA+F;AAC/F,6CADmE,wBAAwB,CACuD;AAClJ,uCAAuC;AACvC,kDADW,wBAAwB,CACiG;AAEpI,6EAA6E;AAC7E,qDADiD,wBAAwB,CACiE;AAC1I,uCAAuC;AACvC,sDADW,wBAAwB,CAC2H;AAE9J,6IAA6I;AAC7I,qDADiH,wBAAwB,CACC;AAC1I,uCAAuC;AACvC,sDADW,wBAAwB,CAC8G;AAEjJ,+EAA+E;AAC/E,8CADmD,wBAAwB,CAC2E;AACtJ,uCAAuC;AACvC,+CADW,wBAAwB,CAC0H;AAE7J,iKAAiK;AACjK,gDADqI,wBAAwB,CACvB;AACtI,uCAAuC;AACvC,iDADW,wBAAwB,CAC0G;AAE7I,yOAAyO;AACzO,kDAD6M,wBAAwB,CAClG;AACnI,uCAAuC;AACvC,mDADW,wBAAwB,CACyH;AAE5J,qJAAqJ;AACrJ,4CADyH,wBAAwB,CACzB;AACxH,uCAAuC;AACvC,6CADW,wBAAwB,CAC4F;AAE/H,kHAAkH;AAClH,kDADsF,wBAAwB,CACO;AACrH,uCAAuC;AACvC,mDADW,wBAAwB,CACiH;AAEpJ,iHAAiH;AACjH,wDADqF,wBAAwB,CACkC;AAC/I,uCAAuC;AACvC,yDADW,wBAAwB,CACiI;AAEpK,uGAAuG;AACvG,mDAD2E,wBAAwB,CACoB;AACvH,uCAAuC;AACvC,oDADW,wBAAwB,CACmH;AAEtJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,iCAFU,SAAS,CAwGZ;AAIP;;;;;;;;;;;;;;;GAeG;AACH,4CAFU,SAAS,CAeZ;AAIP;;;;;;;;;GASG;AACH,wCAFU,SAAS,CAYhB;6BA7Y0B,mCAAmC;yCAJvB,mDAAmD;0BADlE,oCAAoC"}
1
+ {"version":3,"file":"chunk_screen_probe.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js"],"names":[],"mappings":"AA2BA;;;GAGG;AACH,wCAFU,YAAY,CA6CC;AAEvB;;;GAGG;AACH,kCAFU,YAAY,CAaJ;AAElB;;;;GAIG;AACH,uCAFU,YAAY,CAgBA;AAEtB;;;GAGG;AACH,sCAFU,YAAY,CAiBD;AAErB,uCAAuC;AACvC,0CADW,wBAAwB,CAC0F;AAE7H;;;;GAIG;AACH,6CAFU,wBAAwB,CAE4F;AAE9H,sGAAsG;AACtG,sDAD0E,wBAAwB,CAC8C;AAEhJ,kFAAkF;AAClF,0CADsD,wBAAwB,CAC4D;AAC1I,uCAAuC;AACvC,2CADW,wBAAwB,CAC8G;AAEjJ,8GAA8G;AAC9G,8CADkF,wBAAwB,CAC6C;AAEvJ,uCAAuC;AACvC,+CADW,wBAAwB,CACsH;AACzJ,uCAAuC;AACvC,gDADW,wBAAwB,CAC6H;AAEhK,iKAAiK;AACjK,kDADqI,wBAAwB,CACzB;AACpI,uCAAuC;AACvC,mDADW,wBAAwB,CACwG;AAE3I,+FAA+F;AAC/F,6CADmE,wBAAwB,CACuD;AAClJ,uCAAuC;AACvC,kDADW,wBAAwB,CACiG;AAEpI,6EAA6E;AAC7E,qDADiD,wBAAwB,CACiE;AAC1I,uCAAuC;AACvC,sDADW,wBAAwB,CAC2H;AAE9J,6IAA6I;AAC7I,qDADiH,wBAAwB,CACC;AAC1I,uCAAuC;AACvC,sDADW,wBAAwB,CAC8G;AAEjJ,+EAA+E;AAC/E,8CADmD,wBAAwB,CAC2E;AACtJ,uCAAuC;AACvC,+CADW,wBAAwB,CAC0H;AAE7J,iKAAiK;AACjK,gDADqI,wBAAwB,CACvB;AACtI,uCAAuC;AACvC,iDADW,wBAAwB,CAC0G;AAE7I,yOAAyO;AACzO,kDAD6M,wBAAwB,CAClG;AACnI,uCAAuC;AACvC,mDADW,wBAAwB,CACyH;AAE5J,qJAAqJ;AACrJ,4CADyH,wBAAwB,CACzB;AACxH,uCAAuC;AACvC,6CADW,wBAAwB,CAC4F;AAE/H,kHAAkH;AAClH,kDADsF,wBAAwB,CACO;AACrH,uCAAuC;AACvC,mDADW,wBAAwB,CACiH;AAEpJ,iHAAiH;AACjH,wDADqF,wBAAwB,CACkC;AAC/I,uCAAuC;AACvC,yDADW,wBAAwB,CACiI;AAEpK,uGAAuG;AACvG,mDAD2E,wBAAwB,CACoB;AACvH,uCAAuC;AACvC,oDADW,wBAAwB,CACmH;AAEtJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,iCAFU,SAAS,CAwGZ;AAIP;;;;;;;;;;;;;;;GAeG;AACH,4CAFU,SAAS,CAeZ;AAIP;;;;;;;;;GASG;AACH,wCAFU,SAAS,CAYhB;6BA/Y0B,mCAAmC;yCAJvB,mDAAmD;0BADlE,oCAAoC"}
@@ -70,6 +70,8 @@ export const SCREEN_PROBE_FRAME_STRUCT = WebGPUStruct.from({
70
70
  importance_sampling: u32,
71
71
  /** 1 where rays are traced through the screen before the bricks (`ScreenProbeSettings#screen_traces`), else 0 */
72
72
  screen_traces: u32,
73
+ /** 1 where the probes light the rough surfaces' specular (`ScreenProbeSettings#rough_specular`), else 0 */
74
+ rough_specular: u32,
73
75
  }, "ScreenProbeFrame");
74
76
 
75
77
  /**
@@ -0,0 +1,29 @@
1
+ /**
2
+ * A pixel's rough specular from the screen probes (Lumen's `RoughSpecularIndirect`):
3
+ *
4
+ * ```wgsl
5
+ * fn screen_probe_rough_specular_world_share(roughness: f32) -> f32
6
+ * fn screen_probe_rough_specular_sampled_share(roughness: f32) -> f32
7
+ * fn screen_probe_radiance_at(probe: u32, direction: vec3<f32>) -> vec3<f32>
8
+ * fn screen_probe_lobe_radiance(probe: u32, normal: vec3<f32>, view_direction: vec3<f32>, alpha: f32, pixel: vec2<u32>, frame_index: u32) -> vec3<f32>
9
+ * ```
10
+ *
11
+ * - **World share**: what of a surface's specular the world-space probes keep, by its perceptual roughness: 1 below
12
+ * `SCREEN_PROBE_ROUGH_SPECULAR_ROUGHNESS − SCREEN_PROBE_ROUGH_SPECULAR_FADE`, 0 from `…_ROUGHNESS`, linear between.
13
+ * - **Sampled share**: what of the screen probes' share is their radiance along the GGX lobe rather than their
14
+ * irradiance over π: 1 below `…_SAMPLED_ROUGHNESS − …_SAMPLED_FADE`, 0 from `…_SAMPLED_ROUGHNESS`.
15
+ * - **Radiance at a direction**: the probe's filtered radiance (`screen_probe_radiance`, pre-exposed), bilinear over its
16
+ * octahedron's texels: the equal-area map folds as the octahedral one does, so a tap past an edge reads the texel
17
+ * that edge joins (`texture_octahedral_wrap_texel_coordinates`) and the read has no seam. Lumen reads a bordered
18
+ * atlas, bilinear, at a mip; there are no mips here.
19
+ * - **Lobe radiance**: `SCREEN_PROBE_ROUGH_SPECULAR_SAMPLES` reflections drawn from the GGX distribution of visible
20
+ * normals at `alpha` around the shading normal (`sample_reflection_vector`), each by the frame's blue noise at the
21
+ * pixel in its own slice (8, 24, 40 and 56 past the frame), weighed by Smith's G1 of its direction, the BRDF over
22
+ * that density with the Fresnel term left to the split sum; their weighted mean, the light the split sum's
23
+ * reflectance multiplies. A direction below the surface weighs nothing; with all of them below, zero.
24
+ *
25
+ * @type {CodeChunk}
26
+ */
27
+ export const chunk_screen_probe_rough_specular: CodeChunk;
28
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
29
+ //# sourceMappingURL=chunk_screen_probe_rough_specular.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"chunk_screen_probe_rough_specular.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.js"],"names":[],"mappings":"AAgBA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,gDAFU,SAAS,CA2DZ;0BA7FmB,oCAAoC"}
@@ -0,0 +1,102 @@
1
+ import { chunk_uv_equal_area_sphere } from "../../shader/chunk/geometry/octahedron/chunk_uv_equal_area_sphere.js";
2
+ import { chunk_stbn_sample_vec2 } from "../../shader/chunk/noise/chunk_stbn_sample_vec2.js";
3
+ import { chunk_sample_reflection_vector } from "../../shader/chunk/screen_space/chunk_sample_reflection_vector.js";
4
+ import {
5
+ chunk_texture_octahedral_wrap_texel_coordinates
6
+ } from "../../shader/chunk/texture/octahedral/chunk_texture_octahedral_wrap_texel_coordinates.js";
7
+ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
8
+ import { chunk_screen_probe, SCREEN_PROBE_RADIANCE_READ_RESOURCE } from "./chunk_screen_probe.js";
9
+ import {
10
+ SCREEN_PROBE_ROUGH_SPECULAR_FADE,
11
+ SCREEN_PROBE_ROUGH_SPECULAR_ROUGHNESS,
12
+ SCREEN_PROBE_ROUGH_SPECULAR_SAMPLED_FADE,
13
+ SCREEN_PROBE_ROUGH_SPECULAR_SAMPLED_ROUGHNESS,
14
+ SCREEN_PROBE_ROUGH_SPECULAR_SAMPLES
15
+ } from "./SCREEN_PROBE.js";
16
+
17
+ /**
18
+ * A pixel's rough specular from the screen probes (Lumen's `RoughSpecularIndirect`):
19
+ *
20
+ * ```wgsl
21
+ * fn screen_probe_rough_specular_world_share(roughness: f32) -> f32
22
+ * fn screen_probe_rough_specular_sampled_share(roughness: f32) -> f32
23
+ * fn screen_probe_radiance_at(probe: u32, direction: vec3<f32>) -> vec3<f32>
24
+ * fn screen_probe_lobe_radiance(probe: u32, normal: vec3<f32>, view_direction: vec3<f32>, alpha: f32, pixel: vec2<u32>, frame_index: u32) -> vec3<f32>
25
+ * ```
26
+ *
27
+ * - **World share**: what of a surface's specular the world-space probes keep, by its perceptual roughness: 1 below
28
+ * `SCREEN_PROBE_ROUGH_SPECULAR_ROUGHNESS − SCREEN_PROBE_ROUGH_SPECULAR_FADE`, 0 from `…_ROUGHNESS`, linear between.
29
+ * - **Sampled share**: what of the screen probes' share is their radiance along the GGX lobe rather than their
30
+ * irradiance over π: 1 below `…_SAMPLED_ROUGHNESS − …_SAMPLED_FADE`, 0 from `…_SAMPLED_ROUGHNESS`.
31
+ * - **Radiance at a direction**: the probe's filtered radiance (`screen_probe_radiance`, pre-exposed), bilinear over its
32
+ * octahedron's texels: the equal-area map folds as the octahedral one does, so a tap past an edge reads the texel
33
+ * that edge joins (`texture_octahedral_wrap_texel_coordinates`) and the read has no seam. Lumen reads a bordered
34
+ * atlas, bilinear, at a mip; there are no mips here.
35
+ * - **Lobe radiance**: `SCREEN_PROBE_ROUGH_SPECULAR_SAMPLES` reflections drawn from the GGX distribution of visible
36
+ * normals at `alpha` around the shading normal (`sample_reflection_vector`), each by the frame's blue noise at the
37
+ * pixel in its own slice (8, 24, 40 and 56 past the frame), weighed by Smith's G1 of its direction, the BRDF over
38
+ * that density with the Fresnel term left to the split sum; their weighted mean, the light the split sum's
39
+ * reflectance multiplies. A direction below the surface weighs nothing; with all of them below, zero.
40
+ *
41
+ * @type {CodeChunk}
42
+ */
43
+ export const chunk_screen_probe_rough_specular = CodeChunk.from(
44
+ //language=WGSL
45
+ `
46
+ fn screen_probe_rough_specular_world_share(roughness: f32) -> f32 {
47
+ return saturate((${SCREEN_PROBE_ROUGH_SPECULAR_ROUGHNESS} - roughness) / ${SCREEN_PROBE_ROUGH_SPECULAR_FADE});
48
+ }
49
+
50
+ fn screen_probe_rough_specular_sampled_share(roughness: f32) -> f32 {
51
+ return saturate((${SCREEN_PROBE_ROUGH_SPECULAR_SAMPLED_ROUGHNESS} - roughness) / ${SCREEN_PROBE_ROUGH_SPECULAR_SAMPLED_FADE});
52
+ }
53
+
54
+ fn screen_probe_radiance_at(probe: u32, direction: vec3<f32>) -> vec3<f32> {
55
+ let n = screen_probe_frame.octahedron_resolution;
56
+ let base = screen_probe_atlas(probe) * n;
57
+ let grid = uv_equal_area_sphere_encode(direction) * f32(n) - 0.5;
58
+ let corner = floor(grid);
59
+ let f = grid - corner;
60
+ let texel = vec2<i32>(corner);
61
+ let size = i32(n);
62
+
63
+ let t00 = textureLoad(screen_probe_radiance, base + texture_octahedral_wrap_texel_coordinates(texel, size), 0).rgb;
64
+ let t10 = textureLoad(screen_probe_radiance, base + texture_octahedral_wrap_texel_coordinates(texel + vec2<i32>(1, 0), size), 0).rgb;
65
+ let t01 = textureLoad(screen_probe_radiance, base + texture_octahedral_wrap_texel_coordinates(texel + vec2<i32>(0, 1), size), 0).rgb;
66
+ let t11 = textureLoad(screen_probe_radiance, base + texture_octahedral_wrap_texel_coordinates(texel + vec2<i32>(1, 1), size), 0).rgb;
67
+
68
+ return mix(mix(t00, t10, f.x), mix(t01, t11, f.x), f.y);
69
+ }
70
+
71
+ fn screen_probe_lobe_radiance(probe: u32, normal: vec3<f32>, view_direction: vec3<f32>, alpha: f32, pixel: vec2<u32>, frame_index: u32) -> vec3<f32> {
72
+ let a2 = alpha * alpha;
73
+
74
+ var sum = vec3<f32>(0.0);
75
+ var weight = 0.0;
76
+
77
+ for (var k = 0u; k < ${SCREEN_PROBE_ROUGH_SPECULAR_SAMPLES}u; k++) {
78
+ let u = stbn_sample_vec2(vec3<u32>(pixel, frame_index + 8u + 16u * k));
79
+ let direction = normalize(sample_reflection_vector(view_direction, normal, alpha, u));
80
+ let n_dot_l = dot(normal, direction);
81
+
82
+ if (n_dot_l <= 0.0) {
83
+ continue;
84
+ }
85
+
86
+ let g1 = 2.0 * n_dot_l / (n_dot_l + sqrt(a2 + (1.0 - a2) * n_dot_l * n_dot_l));
87
+
88
+ sum += g1 * screen_probe_radiance_at(probe, direction);
89
+ weight += g1;
90
+ }
91
+
92
+ return select(vec3<f32>(0.0), sum / weight, weight > 0.0);
93
+ }
94
+ `, [
95
+ chunk_screen_probe,
96
+ chunk_uv_equal_area_sphere,
97
+ chunk_texture_octahedral_wrap_texel_coordinates,
98
+ chunk_stbn_sample_vec2,
99
+ chunk_sample_reflection_vector,
100
+ ]);
101
+
102
+ chunk_screen_probe_rough_specular.requireResource(SCREEN_PROBE_RADIANCE_READ_RESOURCE);
@@ -2,20 +2,27 @@
2
2
  * Record a screen probe debug view in place of the frame's colour (`ScreenProbeDebugView`), after this frame's
3
3
  * `GPUScreenProbeGI#graph_resolve`.
4
4
  *
5
+ * The indirect specular view draws the mode's fused indirect pass (`shader_screen_probe_indirect_lighting`) with the
6
+ * specular's light alone (`PROBE_CLIPMAP_INDIRECT_LOBE`), from `indirect`, over opaque black, so the background, which
7
+ * the pass does not draw, stays black. The others are `shader_screen_probe_debug`'s.
8
+ *
5
9
  * @param {Object} options
6
10
  * @param {import("../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} options.graph
7
11
  * @param {import("./GPUScreenProbeGI.js").GPUScreenProbeGI} options.gi
8
12
  * @param {ScreenProbeDebugView} options.view_mode
9
13
  * @param {number} options.depth graph handle of the view's depth
10
14
  * @param {number[]} options.resolution the view's pixels
15
+ * @param {Object} [options.indirect] for `ScreenProbeDebugView.IndirectSpecular`, which alone reads it: the fused indirect
16
+ * pass's inputs this frame, the world probes' sampling bindings and the screen probes' diffuse and specular among them
11
17
  * @returns {number} graph handle of the image, `rgba16float`
12
18
  */
13
- export function graph_screen_probe_debug_view({ graph, gi, view_mode, depth, resolution }: {
19
+ export function graph_screen_probe_debug_view({ graph, gi, view_mode, depth, resolution, indirect }: {
14
20
  graph: import("../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph;
15
21
  gi: import("./GPUScreenProbeGI.js").GPUScreenProbeGI;
16
22
  view_mode: ScreenProbeDebugView;
17
23
  depth: number;
18
24
  resolution: number[];
25
+ indirect?: any;
19
26
  }): number;
20
27
  import { ScreenProbeDebugView } from "./ScreenProbeDebugView.js";
21
28
  //# sourceMappingURL=graph_screen_probe_debug_view.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"graph_screen_probe_debug_view.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.js"],"names":[],"mappings":"AASA;;;;;;;;;;;GAWG;AACH;IAPsG,KAAK,EAAhG,OAAO,8DAA8D,EAAE,UAAU;IACvB,EAAE,EAA5D,OAAO,uBAAuB,EAAE,gBAAgB;IAClB,SAAS,EAAvC,oBAAoB;IACJ,KAAK,EAArB,MAAM;IACY,UAAU,EAA5B,MAAM,EAAE;IACN,MAAM,CAkClB;qCAnDoC,2BAA2B"}
1
+ {"version":3,"file":"graph_screen_probe_debug_view.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.js"],"names":[],"mappings":"AAcA;;;;;;;;;;;;;;;;;GAiBG;AACH;IATsG,KAAK,EAAhG,OAAO,8DAA8D,EAAE,UAAU;IACvB,EAAE,EAA5D,OAAO,uBAAuB,EAAE,gBAAgB;IAClB,SAAS,EAAvC,oBAAoB;IACJ,KAAK,EAArB,MAAM;IACY,UAAU,EAA5B,MAAM,EAAE;IACS,QAAQ;IAEvB,MAAM,CAiDlB;qCAzEoC,2BAA2B"}
@@ -1,8 +1,13 @@
1
1
  import { assert } from "../../../../core/assert.js";
2
2
  import { TextureResourceDescriptor } from "../../../device/graph/TextureResourceDescriptor.js";
3
+ import { ShaderSwitchSet } from "../../shader/compiler/ShaderSwitchSet.js";
4
+ import { graph_image_pass } from "../../shader/graph/graph_image_pass.js";
5
+ import { PROBE_CLIPMAP_INDIRECT_LOBE } from "../probe_clipmap/probe/PROBE_CLIPMAP_INDIRECT_LOBE.js";
6
+ import { ProbeClipmapIndirectLobe } from "../probe_clipmap/probe/ProbeClipmapIndirectLobe.js";
3
7
  import { ScreenProbeDebugView } from "./ScreenProbeDebugView.js";
4
8
  import { SCREEN_PROBE_TILE_WORKGROUP_SIZE } from "./SCREEN_PROBE.js";
5
9
  import { shader_screen_probe_debug } from "./shader_screen_probe_debug.js";
10
+ import { shader_screen_probe_indirect_lighting } from "./shader_screen_probe_indirect_lighting.js";
6
11
 
7
12
  const settings = { view: 0 };
8
13
  const bindings = {};
@@ -11,18 +16,39 @@ const bindings = {};
11
16
  * Record a screen probe debug view in place of the frame's colour (`ScreenProbeDebugView`), after this frame's
12
17
  * `GPUScreenProbeGI#graph_resolve`.
13
18
  *
19
+ * The indirect specular view draws the mode's fused indirect pass (`shader_screen_probe_indirect_lighting`) with the
20
+ * specular's light alone (`PROBE_CLIPMAP_INDIRECT_LOBE`), from `indirect`, over opaque black, so the background, which
21
+ * the pass does not draw, stays black. The others are `shader_screen_probe_debug`'s.
22
+ *
14
23
  * @param {Object} options
15
24
  * @param {import("../../../../engine/graphics/render/frame_graph/FrameGraph.js").FrameGraph} options.graph
16
25
  * @param {import("./GPUScreenProbeGI.js").GPUScreenProbeGI} options.gi
17
26
  * @param {ScreenProbeDebugView} options.view_mode
18
27
  * @param {number} options.depth graph handle of the view's depth
19
28
  * @param {number[]} options.resolution the view's pixels
29
+ * @param {Object} [options.indirect] for `ScreenProbeDebugView.IndirectSpecular`, which alone reads it: the fused indirect
30
+ * pass's inputs this frame, the world probes' sampling bindings and the screen probes' diffuse and specular among them
20
31
  * @returns {number} graph handle of the image, `rgba16float`
21
32
  */
22
- export function graph_screen_probe_debug_view({ graph, gi, view_mode, depth, resolution }) {
33
+ export function graph_screen_probe_debug_view({ graph, gi, view_mode, depth, resolution, indirect }) {
23
34
  assert.enum(view_mode, ScreenProbeDebugView, 'view_mode');
24
35
  assert.notEqual(view_mode, ScreenProbeDebugView.None, 'view_mode');
25
36
 
37
+ if (view_mode === ScreenProbeDebugView.IndirectSpecular) {
38
+ assert.defined(indirect, 'indirect');
39
+
40
+ const [image] = graph_image_pass({
41
+ graph,
42
+ shader: shader_screen_probe_indirect_lighting.variant(ShaderSwitchSet.EMPTY.with(PROBE_CLIPMAP_INDIRECT_LOBE, ProbeClipmapIndirectLobe.Specular)),
43
+ inputs: indirect,
44
+ input_depth: depth,
45
+ output_resolution: resolution,
46
+ clear_value: [0, 0, 0, 1],
47
+ });
48
+
49
+ return image;
50
+ }
51
+
26
52
  const data = {};
27
53
  const pass = graph.add("Screen Probe Debug", data, (data, resources, context) => {
28
54
  settings.view = view_mode;
@@ -11,7 +11,10 @@
11
11
  * below or above along each axis as the probe's dither, one blue-noise draw at the probe's tile half the noise's
12
12
  * period from the jitter's, falls under or over the place's fraction: each ray lands in one of the four texels about
13
13
  * it in proportion to its bilinear weights, which hides the grid of directions. A step past the octahedron's edge
14
- * lands on its fold (`screen_probe_texel_wrap`).
14
+ * lands on its fold (`screen_probe_texel_wrap`). Known defect: the landing carries a ray up to a texel across the
15
+ * probe's surface's horizon, so light a ray met below the surface's plane (that surface itself, further along) is
16
+ * held in a texel above it, where every resolve takes it as light from above; it adds to the integration's own
17
+ * (`shader_screen_probe_integrate`).
15
18
  * - **Accumulated** in workgroup memory, fixed point with the scale that keeps n² of the largest radiance in a word;
16
19
  * each texel keeps the nearest hit among the rays that landed, and whether any did.
17
20
  * - **The texels**: the sum, not normalised, as Lumen's: a texel takes about one ray's weight on average; the nearest
@@ -1 +1 @@
1
- {"version":3,"file":"shader_screen_probe_gather.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js"],"names":[],"mappings":"AAmDA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,4CAFU,aAAa,CAqIpB;AAaH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,yCAFU,aAAa,CAgIpB;AAWH;;;;;;;;GAQG;AACH,6CAFU,aAAa,CA0FpB;8BArd2B,+BAA+B"}
1
+ {"version":3,"file":"shader_screen_probe_gather.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js"],"names":[],"mappings":"AAmDA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AACH,4CAFU,aAAa,CAqIpB;AAaH;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,yCAFU,aAAa,CAgIpB;AAWH;;;;;;;;GAQG;AACH,6CAFU,aAAa,CA0FpB;8BAxd2B,+BAA+B"}
@@ -62,7 +62,10 @@ composite_resources.createGroup()
62
62
  * below or above along each axis as the probe's dither, one blue-noise draw at the probe's tile half the noise's
63
63
  * period from the jitter's, falls under or over the place's fraction: each ray lands in one of the four texels about
64
64
  * it in proportion to its bilinear weights, which hides the grid of directions. A step past the octahedron's edge
65
- * lands on its fold (`screen_probe_texel_wrap`).
65
+ * lands on its fold (`screen_probe_texel_wrap`). Known defect: the landing carries a ray up to a texel across the
66
+ * probe's surface's horizon, so light a ray met below the surface's plane (that surface itself, further along) is
67
+ * held in a texel above it, where every resolve takes it as light from above; it adds to the integration's own
68
+ * (`shader_screen_probe_integrate`).
66
69
  * - **Accumulated** in workgroup memory, fixed point with the scale that keeps n² of the largest radiance in a word;
67
70
  * each texel keeps the nearest hit among the rays that landed, and whether any did.
68
71
  * - **The texels**: the sum, not normalised, as Lumen's: a texel takes about one ray's weight on average; the nearest