@woosh/meep-engine 3.75.0 → 3.77.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 (369) hide show
  1. package/editor/particles/effect/ParticleReferenceSimulation.d.ts +11 -0
  2. package/editor/particles/effect/ParticleReferenceSimulation.d.ts.map +1 -1
  3. package/editor/particles/effect/ParticleReferenceSimulation.js +14 -0
  4. package/editor/view/particles/effect/ParticleGraphEditorView.js +1 -1
  5. package/package.json +1 -1
  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 +113 -0
  11. package/src/engine/graphics/ecs/hair/Hair.d.ts +54 -0
  12. package/src/engine/graphics/ecs/hair/Hair.d.ts.map +1 -0
  13. package/src/engine/graphics/ecs/hair/Hair.js +70 -0
  14. package/src/engine/graphics/ecs/hair/HairDynamics.d.ts +63 -0
  15. package/src/engine/graphics/ecs/hair/HairDynamics.d.ts.map +1 -0
  16. package/src/engine/graphics/ecs/hair/HairDynamics.js +82 -0
  17. package/src/engine/graphics/hair/Groom.d.ts +175 -0
  18. package/src/engine/graphics/hair/Groom.d.ts.map +1 -0
  19. package/src/engine/graphics/hair/Groom.js +249 -0
  20. package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts +50 -0
  21. package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts.map +1 -0
  22. package/src/engine/graphics/hair/GroomSerializationAdapter.js +150 -0
  23. package/src/engine/graphics/hair/GroomSerializationUpgrader_0_1.d.ts +8 -0
  24. package/src/engine/graphics/hair/GroomSerializationUpgrader_0_1.d.ts.map +1 -0
  25. package/src/engine/graphics/hair/GroomSerializationUpgrader_0_1.js +31 -0
  26. package/src/engine/graphics/hair/groom_bind_to_mesh.d.ts +85 -0
  27. package/src/engine/graphics/hair/groom_bind_to_mesh.d.ts.map +1 -0
  28. package/src/engine/graphics/hair/groom_bind_to_mesh.js +216 -0
  29. package/src/engine/graphics/hair/groom_build_group.d.ts +90 -0
  30. package/src/engine/graphics/hair/groom_build_group.d.ts.map +1 -0
  31. package/src/engine/graphics/hair/groom_build_group.js +496 -0
  32. package/src/engine/graphics/hair/groom_build_guides.d.ts +43 -0
  33. package/src/engine/graphics/hair/groom_build_guides.d.ts.map +1 -0
  34. package/src/engine/graphics/hair/groom_build_guides.js +267 -0
  35. package/src/engine/graphics/hair/groom_generate_scalp.d.ts +29 -0
  36. package/src/engine/graphics/hair/groom_generate_scalp.d.ts.map +1 -0
  37. package/src/engine/graphics/hair/groom_generate_scalp.js +184 -0
  38. package/src/engine/graphics/hair/groom_rank_order.d.ts +15 -0
  39. package/src/engine/graphics/hair/groom_rank_order.d.ts.map +1 -0
  40. package/src/engine/graphics/hair/groom_rank_order.js +53 -0
  41. package/src/engine/graphics/hair/groom_root_spacing.d.ts +14 -0
  42. package/src/engine/graphics/hair/groom_root_spacing.d.ts.map +1 -0
  43. package/src/engine/graphics/hair/groom_root_spacing.js +253 -0
  44. package/src/engine/graphics3/HairColliderSystem.d.ts +59 -0
  45. package/src/engine/graphics3/HairColliderSystem.d.ts.map +1 -0
  46. package/src/engine/graphics3/HairColliderSystem.js +270 -0
  47. package/src/engine/graphics3/HairSystem.d.ts +119 -0
  48. package/src/engine/graphics3/HairSystem.d.ts.map +1 -0
  49. package/src/engine/graphics3/HairSystem.js +722 -0
  50. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  51. package/src/shade/assets/textures/hair_scattering.bin +0 -0
  52. package/src/shade/device/pipeline/PipelineEnquiry.d.ts +11 -0
  53. package/src/shade/device/pipeline/PipelineEnquiry.d.ts.map +1 -1
  54. package/src/shade/device/pipeline/PipelineEnquiry.js +13 -0
  55. package/src/shade/playground/hair/index.html +50 -0
  56. package/src/shade/playground/hair/main.d.ts +2 -0
  57. package/src/shade/playground/hair/main.d.ts.map +1 -0
  58. package/src/shade/playground/hair/main.js +297 -0
  59. package/src/shade/playground/hair_skinned/index.html +192 -0
  60. package/src/shade/playground/hair_skinned/main.d.ts +7 -0
  61. package/src/shade/playground/hair_skinned/main.d.ts.map +1 -0
  62. package/src/shade/playground/hair_skinned/main.js +481 -0
  63. package/src/shade/playground/hair_skinned/skinned_hair.d.ts +49 -0
  64. package/src/shade/playground/hair_skinned/skinned_hair.d.ts.map +1 -0
  65. package/src/shade/playground/hair_skinned/skinned_hair.js +362 -0
  66. package/src/shade/playground/screen_probes/README.md +54 -0
  67. package/src/shade/playground/screen_probes/index.html +271 -0
  68. package/src/shade/playground/screen_probes/main.d.ts +8 -0
  69. package/src/shade/playground/screen_probes/main.d.ts.map +1 -0
  70. package/src/shade/playground/screen_probes/main.js +527 -0
  71. package/src/shade/playground/sparks/README.md +36 -0
  72. package/src/shade/playground/sparks/index.html +145 -0
  73. package/src/shade/playground/sparks/main.d.ts +7 -0
  74. package/src/shade/playground/sparks/main.d.ts.map +1 -0
  75. package/src/shade/playground/sparks/main.js +312 -0
  76. package/src/shade/playground/sparks/sparks_effect.d.ts +72 -0
  77. package/src/shade/playground/sparks/sparks_effect.d.ts.map +1 -0
  78. package/src/shade/playground/sparks/sparks_effect.js +180 -0
  79. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  80. package/src/shade/renderer/Renderer.js +72 -11
  81. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.d.ts +6 -0
  82. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.d.ts.map +1 -1
  83. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.js +10 -0
  84. package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
  85. package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts +1 -1
  86. package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
  87. package/src/shade/renderer/animation/GPUAnimationManager.d.ts +3 -2
  88. package/src/shade/renderer/animation/GPUAnimationManager.d.ts.map +1 -1
  89. package/src/shade/renderer/animation/GPUAnimationManager.js +74 -3
  90. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts +13 -3
  91. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.d.ts.map +1 -1
  92. package/src/shade/renderer/animation/skinning/GPUMeshSkinningContext.js +16 -5
  93. package/src/shade/renderer/animation/skinning/shader_meshlet_apply_skinning.js +8 -8
  94. package/src/shade/renderer/deferred/chunk_read_gBuffer_material.d.ts.map +1 -1
  95. package/src/shade/renderer/deferred/chunk_read_gBuffer_material.js +3 -1
  96. package/src/shade/renderer/deferred/chunk_shade_direct_lights.d.ts +23 -0
  97. package/src/shade/renderer/deferred/chunk_shade_direct_lights.d.ts.map +1 -0
  98. package/src/shade/renderer/deferred/chunk_shade_direct_lights.js +111 -0
  99. package/src/shade/renderer/deferred/chunk_shade_directional_lights.d.ts +19 -6
  100. package/src/shade/renderer/deferred/chunk_shade_directional_lights.d.ts.map +1 -1
  101. package/src/shade/renderer/deferred/chunk_shade_directional_lights.js +30 -21
  102. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts +12 -22
  103. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts.map +1 -1
  104. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.js +20 -100
  105. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.d.ts.map +1 -1
  106. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.js +6 -4
  107. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.d.ts +15 -0
  108. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.d.ts.map +1 -0
  109. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.js +47 -0
  110. package/src/shade/renderer/extension/ShadowAtlas.d.ts +75 -0
  111. package/src/shade/renderer/extension/ShadowAtlas.d.ts.map +1 -0
  112. package/src/shade/renderer/extension/ShadowAtlas.js +133 -0
  113. package/src/shade/renderer/extension/ViewLighting.d.ts +101 -0
  114. package/src/shade/renderer/extension/ViewLighting.d.ts.map +1 -0
  115. package/src/shade/renderer/extension/ViewLighting.js +168 -0
  116. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
  117. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
  118. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -7
  119. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  120. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  121. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.d.ts.map +1 -1
  122. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.js +3 -1
  123. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts +37 -7
  124. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts.map +1 -1
  125. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.js +132 -8
  126. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +3 -1
  127. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts.map +1 -1
  128. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +6 -2
  129. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts.map +1 -1
  130. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js +3 -1
  131. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +15 -7
  132. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts.map +1 -1
  133. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +40 -9
  134. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts +23 -0
  135. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts.map +1 -1
  136. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js +26 -0
  137. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.d.ts +1 -0
  138. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.js +6 -0
  139. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +13 -1
  140. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
  141. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +23 -1
  142. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.d.ts.map +1 -1
  143. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js +2 -0
  144. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts +29 -0
  145. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts.map +1 -0
  146. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.js +102 -0
  147. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts +8 -1
  148. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts.map +1 -1
  149. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.js +27 -1
  150. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts +4 -1
  151. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts.map +1 -1
  152. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js +4 -1
  153. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts +11 -5
  154. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts.map +1 -1
  155. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.js +28 -10
  156. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts +36 -2
  157. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts.map +1 -1
  158. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.js +149 -4
  159. package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.d.ts.map +1 -1
  160. package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.js +3 -1
  161. package/src/shade/renderer/global_illumination/sharc/sharc_constants.d.ts +0 -18
  162. package/src/shade/renderer/global_illumination/sharc/sharc_constants.d.ts.map +1 -1
  163. package/src/shade/renderer/global_illumination/sharc/sharc_constants.js +1 -21
  164. package/src/shade/renderer/hair/GPUHairSystem.d.ts +278 -0
  165. package/src/shade/renderer/hair/GPUHairSystem.d.ts.map +1 -0
  166. package/src/shade/renderer/hair/GPUHairSystem.js +2263 -0
  167. package/src/shade/renderer/hair/HAIR.d.ts +121 -0
  168. package/src/shade/renderer/hair/HAIR.d.ts.map +1 -0
  169. package/src/shade/renderer/hair/HAIR.js +136 -0
  170. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.d.ts +17 -0
  171. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.d.ts.map +1 -0
  172. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.js +104 -0
  173. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.d.ts +15 -0
  174. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.d.ts.map +1 -0
  175. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.js +70 -0
  176. package/src/shade/renderer/hair/HAIR_SIMULATION.d.ts +139 -0
  177. package/src/shade/renderer/hair/HAIR_SIMULATION.d.ts.map +1 -0
  178. package/src/shade/renderer/hair/HAIR_SIMULATION.js +160 -0
  179. package/src/shade/renderer/hair/HairFrame.d.ts +41 -0
  180. package/src/shade/renderer/hair/HairFrame.d.ts.map +1 -0
  181. package/src/shade/renderer/hair/HairFrame.js +76 -0
  182. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts +42 -0
  183. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts.map +1 -0
  184. package/src/shade/renderer/hair/chunk_hair_bsdf.js +170 -0
  185. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts +37 -0
  186. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts.map +1 -0
  187. package/src/shade/renderer/hair/chunk_hair_dual_scattering.js +158 -0
  188. package/src/shade/renderer/hair/chunk_hair_guide.d.ts +59 -0
  189. package/src/shade/renderer/hair/chunk_hair_guide.d.ts.map +1 -0
  190. package/src/shade/renderer/hair/chunk_hair_guide.js +179 -0
  191. package/src/shade/renderer/hair/chunk_hair_pixel.d.ts +32 -0
  192. package/src/shade/renderer/hair/chunk_hair_pixel.d.ts.map +1 -0
  193. package/src/shade/renderer/hair/chunk_hair_pixel.js +116 -0
  194. package/src/shade/renderer/hair/chunk_hair_strand.d.ts +40 -0
  195. package/src/shade/renderer/hair/chunk_hair_strand.d.ts.map +1 -0
  196. package/src/shade/renderer/hair/chunk_hair_strand.js +85 -0
  197. package/src/shade/renderer/hair/chunk_hair_volume.d.ts +32 -0
  198. package/src/shade/renderer/hair/chunk_hair_volume.d.ts.map +1 -0
  199. package/src/shade/renderer/hair/chunk_hair_volume.js +115 -0
  200. package/src/shade/renderer/hair/hair_id_draw.d.ts +24 -0
  201. package/src/shade/renderer/hair/hair_id_draw.d.ts.map +1 -0
  202. package/src/shade/renderer/hair/hair_id_draw.js +135 -0
  203. package/src/shade/renderer/hair/hair_lighting.d.ts +53 -0
  204. package/src/shade/renderer/hair/hair_lighting.d.ts.map +1 -0
  205. package/src/shade/renderer/hair/hair_lighting.js +279 -0
  206. package/src/shade/renderer/hair/hair_scattering_lut.d.ts +75 -0
  207. package/src/shade/renderer/hair/hair_scattering_lut.d.ts.map +1 -0
  208. package/src/shade/renderer/hair/hair_scattering_lut.js +271 -0
  209. package/src/shade/renderer/hair/hair_shadow_draw.d.ts +32 -0
  210. package/src/shade/renderer/hair/hair_shadow_draw.d.ts.map +1 -0
  211. package/src/shade/renderer/hair/hair_shadow_draw.js +123 -0
  212. package/src/shade/renderer/hair/hair_stamp.d.ts +33 -0
  213. package/src/shade/renderer/hair/hair_stamp.d.ts.map +1 -0
  214. package/src/shade/renderer/hair/hair_stamp.js +175 -0
  215. package/src/shade/renderer/hair/shader_hair_classes.d.ts +22 -0
  216. package/src/shade/renderer/hair/shader_hair_classes.d.ts.map +1 -0
  217. package/src/shade/renderer/hair/shader_hair_classes.js +90 -0
  218. package/src/shade/renderer/hair/shader_hair_cull.d.ts +37 -0
  219. package/src/shade/renderer/hair/shader_hair_cull.d.ts.map +1 -0
  220. package/src/shade/renderer/hair/shader_hair_cull.js +251 -0
  221. package/src/shade/renderer/hair/shader_hair_lod.d.ts +39 -0
  222. package/src/shade/renderer/hair/shader_hair_lod.d.ts.map +1 -0
  223. package/src/shade/renderer/hair/shader_hair_lod.js +362 -0
  224. package/src/shade/renderer/hair/shader_hair_roots.d.ts +36 -0
  225. package/src/shade/renderer/hair/shader_hair_roots.d.ts.map +1 -0
  226. package/src/shade/renderer/hair/shader_hair_roots.js +261 -0
  227. package/src/shade/renderer/hair/shader_hair_shadow_list.d.ts +44 -0
  228. package/src/shade/renderer/hair/shader_hair_shadow_list.d.ts.map +1 -0
  229. package/src/shade/renderer/hair/shader_hair_shadow_list.js +240 -0
  230. package/src/shade/renderer/hair/shader_hair_simulate.d.ts +55 -0
  231. package/src/shade/renderer/hair/shader_hair_simulate.d.ts.map +1 -0
  232. package/src/shade/renderer/hair/shader_hair_simulate.js +563 -0
  233. package/src/shade/renderer/hair/shader_hair_volume.d.ts +28 -0
  234. package/src/shade/renderer/hair/shader_hair_volume.d.ts.map +1 -0
  235. package/src/shade/renderer/hair/shader_hair_volume.js +154 -0
  236. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  237. package/src/shade/renderer/loader/usd/usd_build_scene.d.ts +31 -0
  238. package/src/shade/renderer/loader/usd/usd_build_scene.d.ts.map +1 -1
  239. package/src/shade/renderer/loader/usd/usd_build_scene.js +36 -21
  240. package/src/shade/renderer/loader/usd/usd_groom_extension.d.ts +65 -0
  241. package/src/shade/renderer/loader/usd/usd_groom_extension.d.ts.map +1 -0
  242. package/src/shade/renderer/loader/usd/usd_groom_extension.js +470 -0
  243. package/src/shade/renderer/particles/GPUParticleSystem.d.ts +8 -0
  244. package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
  245. package/src/shade/renderer/particles/GPUParticleSystem.js +28 -0
  246. package/src/shade/renderer/particles/graph/ParticleNodeRegistry.d.ts.map +1 -1
  247. package/src/shade/renderer/particles/graph/ParticleNodeRegistry.js +22 -0
  248. package/src/shade/renderer/particles/graph/groups/particle_builtin_groups.d.ts.map +1 -1
  249. package/src/shade/renderer/particles/graph/groups/particle_builtin_groups.js +4 -0
  250. package/src/shade/renderer/particles/graph/groups/particle_groups_scene.d.ts +32 -0
  251. package/src/shade/renderer/particles/graph/groups/particle_groups_scene.d.ts.map +1 -0
  252. package/src/shade/renderer/particles/graph/groups/particle_groups_scene.js +80 -0
  253. package/src/shade/renderer/particles/graph/particle_node_parameters.d.ts.map +1 -1
  254. package/src/shade/renderer/particles/graph/particle_node_parameters.js +1 -0
  255. package/src/shade/renderer/particles/graph/particle_node_presentation.d.ts.map +1 -1
  256. package/src/shade/renderer/particles/graph/particle_node_presentation.js +12 -0
  257. package/src/shade/renderer/particles/graph_particles.d.ts +5 -1
  258. package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
  259. package/src/shade/renderer/particles/graph_particles.js +18 -3
  260. package/src/shade/renderer/particles/isa/InstructionStream.d.ts +25 -0
  261. package/src/shade/renderer/particles/isa/InstructionStream.d.ts.map +1 -1
  262. package/src/shade/renderer/particles/isa/InstructionStream.js +25 -0
  263. package/src/shade/renderer/particles/isa/ParticleVMISA.d.ts +9 -0
  264. package/src/shade/renderer/particles/isa/ParticleVMISA.d.ts.map +1 -1
  265. package/src/shade/renderer/particles/isa/ParticleVMISA.js +20 -0
  266. package/src/shade/renderer/particles/isa/particle_program_reads_scene_sdf.d.ts +9 -0
  267. package/src/shade/renderer/particles/isa/particle_program_reads_scene_sdf.d.ts.map +1 -0
  268. package/src/shade/renderer/particles/isa/particle_program_reads_scene_sdf.js +29 -0
  269. package/src/shade/renderer/particles/optimizer/particle_program_equivalence.d.ts +2 -1
  270. package/src/shade/renderer/particles/optimizer/particle_program_equivalence.d.ts.map +1 -1
  271. package/src/shade/renderer/particles/optimizer/particle_program_equivalence.js +27 -5
  272. package/src/shade/renderer/particles/optimizer/particle_program_fuzz.js +1 -1
  273. package/src/shade/renderer/particles/optimizer/particle_vm_semantics.d.ts.map +1 -1
  274. package/src/shade/renderer/particles/optimizer/particle_vm_semantics.js +5 -0
  275. package/src/shade/renderer/particles/runtime/EmitterRegistry.d.ts +7 -0
  276. package/src/shade/renderer/particles/runtime/EmitterRegistry.d.ts.map +1 -1
  277. package/src/shade/renderer/particles/runtime/EmitterRegistry.js +10 -0
  278. package/src/shade/renderer/particles/runtime/ParticleEmitter.d.ts +5 -0
  279. package/src/shade/renderer/particles/runtime/ParticleEmitter.d.ts.map +1 -1
  280. package/src/shade/renderer/particles/runtime/ParticleEmitter.js +5 -0
  281. package/src/shade/renderer/particles/runtime/ProgramHeap.d.ts +8 -0
  282. package/src/shade/renderer/particles/runtime/ProgramHeap.d.ts.map +1 -1
  283. package/src/shade/renderer/particles/runtime/ProgramHeap.js +25 -0
  284. package/src/shade/renderer/particles/shaders/shader_particle_emit.d.ts +1 -1
  285. package/src/shade/renderer/particles/shaders/shader_particle_emit.d.ts.map +1 -1
  286. package/src/shade/renderer/particles/shaders/shader_particle_emit.js +9 -3
  287. package/src/shade/renderer/particles/shaders/shader_particle_emit_wide.d.ts.map +1 -1
  288. package/src/shade/renderer/particles/shaders/shader_particle_emit_wide.js +4 -2
  289. package/src/shade/renderer/particles/shaders/shader_particle_simulate.d.ts +2 -2
  290. package/src/shade/renderer/particles/shaders/shader_particle_simulate.d.ts.map +1 -1
  291. package/src/shade/renderer/particles/shaders/shader_particle_simulate.js +10 -4
  292. package/src/shade/renderer/particles/shaders/shader_particle_simulate_wide.d.ts.map +1 -1
  293. package/src/shade/renderer/particles/shaders/shader_particle_simulate_wide.js +4 -2
  294. package/src/shade/renderer/particles/vm/ParticleVMReference.d.ts +14 -1
  295. package/src/shade/renderer/particles/vm/ParticleVMReference.d.ts.map +1 -1
  296. package/src/shade/renderer/particles/vm/ParticleVMReference.js +34 -1
  297. package/src/shade/renderer/particles/vm/chunk_particle_vm.d.ts.map +1 -1
  298. package/src/shade/renderer/particles/vm/chunk_particle_vm.js +10 -0
  299. package/src/shade/renderer/particles/vm/chunk_particle_vm_scene_sdf.d.ts +39 -0
  300. package/src/shade/renderer/particles/vm/chunk_particle_vm_scene_sdf.d.ts.map +1 -0
  301. package/src/shade/renderer/particles/vm/chunk_particle_vm_scene_sdf.js +90 -0
  302. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts +4 -1
  303. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
  304. package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +14 -2
  305. package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance.d.ts +1 -1
  306. package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance.d.ts.map +1 -1
  307. package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance.js +9 -3
  308. package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance_wide.d.ts.map +1 -1
  309. package/src/shade/renderer/particles/warmup/shader_particle_warmup_advance_wide.js +4 -2
  310. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts.map +1 -1
  311. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.js +4 -1
  312. package/src/shade/renderer/path_tracer/shader/chunk_shading_closure_from_material_data.d.ts.map +1 -1
  313. package/src/shade/renderer/path_tracer/shader/chunk_shading_closure_from_material_data.js +3 -1
  314. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  315. package/src/shade/renderer/postprocess/ssr/SSR.d.ts +4 -1
  316. package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
  317. package/src/shade/renderer/postprocess/ssr/SSR.js +9 -0
  318. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts +16 -1
  319. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts.map +1 -1
  320. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.js +47 -3
  321. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.d.ts.map +1 -1
  322. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js +5 -3
  323. package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.d.ts.map +1 -1
  324. package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.js +6 -5
  325. package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.d.ts +7 -4
  326. package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.d.ts.map +1 -1
  327. package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.js +26 -16
  328. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.d.ts.map +1 -1
  329. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.js +5 -2
  330. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.d.ts.map +1 -1
  331. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js +5 -0
  332. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts.map +1 -1
  333. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.js +4 -1
  334. package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.d.ts.map +1 -1
  335. package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.js +5 -1
  336. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.d.ts.map +1 -1
  337. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.js +7 -4
  338. package/src/shade/renderer/scene/GPUSceneContext.d.ts +7 -0
  339. package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
  340. package/src/shade/renderer/scene/GPUSceneContext.js +18 -0
  341. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts +13 -8
  342. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts.map +1 -1
  343. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.js +18 -14
  344. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts +3 -2
  345. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts.map +1 -1
  346. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.js +12 -4
  347. package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.d.ts.map +1 -1
  348. package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js +1 -0
  349. package/src/shade/renderer/shader/chunk/material/chunk_compute_indirect_specular.js +1 -1
  350. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.d.ts +16 -0
  351. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.d.ts.map +1 -0
  352. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.js +25 -0
  353. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.js +2 -2
  354. package/src/shade/renderer/shader/chunk/sdf/chunk_shape_record_signed_distance_gradient.d.ts +20 -0
  355. package/src/shade/renderer/shader/chunk/sdf/chunk_shape_record_signed_distance_gradient.d.ts.map +1 -0
  356. package/src/shade/renderer/shader/chunk/sdf/chunk_shape_record_signed_distance_gradient.js +134 -0
  357. package/src/shade/renderer/shader/compiler/ShaderSwitch.d.ts +1 -1
  358. package/src/shade/renderer/shader/compiler/ShaderSwitchSet.d.ts +1 -1
  359. package/src/shade/renderer/shader/resource/ShaderResourceDescriptor.d.ts +1 -1
  360. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts +15 -0
  361. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts.map +1 -1
  362. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +69 -0
  363. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_directional_atlas_casters.d.ts +10 -0
  364. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_directional_atlas_casters.d.ts.map +1 -0
  365. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_directional_atlas_casters.js +22 -0
  366. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_point2.d.ts +2 -2
  367. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_point2.js +2 -2
  368. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
  369. package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
@@ -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
@@ -1,9 +1,15 @@
1
1
  /**
2
- * The screen probes' deferred indirect light in one pass, for SSR off: the diffuse is the screen probes' (the temporal
3
- * filter's output, E at the bent normal), and the specular the world-space probes', picked and resolved as the probe
4
- * clipmap's fused pass takes it (`probe_clipmap_radiance_of`), the environment's where no probe weighs anything. The
5
- * two are resolved as `shader_resolve_indirect_lighting` resolves the IBL pair: AO multiplies the diffuse, the
6
- * specular is occluded along its lobe, and the result is added to the scene's colour.
2
+ * The screen probes' deferred indirect light in one pass, for SSR off:
3
+ * - **The diffuse** is the screen probes' (the temporal filter's output, E at the bent normal).
4
+ * - **The specular** is the screen probes' rough specular (`GPUScreenProbeGI#specular_handle`) and the world-space
5
+ * probes' radiance, each by its share, the world probes' the alpha: theirs picked and resolved as the probe
6
+ * clipmap's fused pass takes it (`probe_clipmap_radiance_of`), the environment's where no probe weighs anything,
7
+ * and not picked where their share is none.
8
+ * - The two are resolved as `shader_resolve_indirect_lighting` resolves the IBL pair: AO multiplies the diffuse, the
9
+ * specular is occluded along its lobe, and the result is added to the scene's colour.
10
+ * - `PROBE_CLIPMAP_INDIRECT_LOBE` decides what is added: both lobes by default; for the mode's indirect specular
11
+ * debug view (`ScreenProbeDebugView.IndirectSpecular`), the specular's light alone, before the surface's material and
12
+ * occlusion, as this pass takes it with SSR off.
7
13
  *
8
14
  * @type {ImageShader}
9
15
  */
@@ -1 +1 @@
1
- {"version":3,"file":"shader_screen_probe_indirect_lighting.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.js"],"names":[],"mappings":"AAmDA;;;;;;;;GAQG;AACH,oDAFU,WAAW,CA8FlB;AAQH;;;;;GAKG;AACH,0CAFU,WAAW,CAyBlB;AAQH;;;;;GAKG;AACH,gDAFU,aAAa,CAiBpB;4BAxMyB,6BAA6B;8BAD3B,+BAA+B"}
1
+ {"version":3,"file":"shader_screen_probe_indirect_lighting.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.js"],"names":[],"mappings":"AAsDA;;;;;;;;;;;;;;GAcG;AACH,oDAFU,WAAW,CAuGlB;AAQH;;;;;GAKG;AACH,0CAFU,WAAW,CAyBlB;AAQH;;;;;GAKG;AACH,gDAFU,aAAa,CAiBpB;4BAzNyB,6BAA6B;8BAD3B,+BAA+B"}
@@ -13,6 +13,7 @@ import { chunk_compute_indirect_specular } from "../../shader/chunk/material/chu
13
13
  import { chunk_decode_g_buffer_metalness } from "../../shader/chunk/material/chunk_decode_g_buffer_metalness.js";
14
14
  import { chunk_decode_g_buffer_roughness } from "../../shader/chunk/material/chunk_decode_g_buffer_roughness.js";
15
15
  import { chunk_metalness_to_specular_color } from "../../shader/chunk/material/chunk_metalness_to_specular_color.js";
16
+ import { chunk_metalness_to_specular_F90 } from "../../shader/chunk/material/chunk_metalness_to_specular_F90.js";
16
17
  import { chunk_stbn_sample_vec2 } from "../../shader/chunk/noise/chunk_stbn_sample_vec2.js";
17
18
  import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
18
19
  import { ComputeShader } from "../../shader/ComputeShader.js";
@@ -22,6 +23,7 @@ import { ShaderDescriptor } from "../../shader/ShaderDescriptor.js";
22
23
  import { STBN_VEC2_RESOURCE } from "../../STATIC_GRAPHICS_ENGINE_ASSET_RESOURCES.js";
23
24
  import { SAMPLER_LINEAR_UPSCALE } from "../../texture/SAMPLER_LINEAR_UPSCALE.js";
24
25
  import { VIEW_UNIFORM_STRUCT } from "../../view/VIEW_UNIFORM_STRUCT.js";
26
+ import { chunk_probe_clipmap_indirect_lobe } from "../probe_clipmap/probe/chunk_probe_clipmap_indirect_lobe.js";
25
27
  import {
26
28
  chunk_probe_clipmap_pick,
27
29
  PROBE_CLIPMAP_SAMPLING_GROUP
@@ -39,6 +41,7 @@ fused_resources.createGroup()
39
41
  .addTexture("tGBufferAlbedo")
40
42
  .addTexture("tGBufferPBR")
41
43
  .addTexture("tScreenProbeDiffuse")
44
+ .addTexture("tScreenProbeSpecular")
42
45
  .add(STBN_VEC2_RESOURCE)
43
46
  .addUniform("view", VIEW_UNIFORM_STRUCT)
44
47
  .addUniform("camera", CAMERA_UNIFORM_STRUCT)
@@ -50,11 +53,17 @@ fused_resources.createGroup()
50
53
  fused_resources.addGroup(PROBE_CLIPMAP_SAMPLING_GROUP);
51
54
 
52
55
  /**
53
- * The screen probes' deferred indirect light in one pass, for SSR off: the diffuse is the screen probes' (the temporal
54
- * filter's output, E at the bent normal), and the specular the world-space probes', picked and resolved as the probe
55
- * clipmap's fused pass takes it (`probe_clipmap_radiance_of`), the environment's where no probe weighs anything. The
56
- * two are resolved as `shader_resolve_indirect_lighting` resolves the IBL pair: AO multiplies the diffuse, the
57
- * specular is occluded along its lobe, and the result is added to the scene's colour.
56
+ * The screen probes' deferred indirect light in one pass, for SSR off:
57
+ * - **The diffuse** is the screen probes' (the temporal filter's output, E at the bent normal).
58
+ * - **The specular** is the screen probes' rough specular (`GPUScreenProbeGI#specular_handle`) and the world-space
59
+ * probes' radiance, each by its share, the world probes' the alpha: theirs picked and resolved as the probe
60
+ * clipmap's fused pass takes it (`probe_clipmap_radiance_of`), the environment's where no probe weighs anything,
61
+ * and not picked where their share is none.
62
+ * - The two are resolved as `shader_resolve_indirect_lighting` resolves the IBL pair: AO multiplies the diffuse, the
63
+ * specular is occluded along its lobe, and the result is added to the scene's colour.
64
+ * - `PROBE_CLIPMAP_INDIRECT_LOBE` decides what is added: both lobes by default; for the mode's indirect specular
65
+ * debug view (`ScreenProbeDebugView.IndirectSpecular`), the specular's light alone, before the surface's material and
66
+ * occlusion, as this pass takes it with SSR off.
58
67
  *
59
68
  * @type {ImageShader}
60
69
  */
@@ -93,10 +102,17 @@ fn main(
93
102
  let bent_normal = decode_g_buffer_normal(textureLoad(tBentNormals, i_coord, 0).x);
94
103
 
95
104
  let irradiance = textureLoad(tScreenProbeDiffuse, i_coord, 0).rgb;
105
+ let rough = textureLoad(tScreenProbeSpecular, i_coord, 0);
96
106
 
97
- let pick = probe_clipmap_pick(position, normal, view_direction, stbn_sample_vec2(vec3<u32>(i_coord, view.frame_index)));
98
- let found = probe_clipmap_radiance_of(pick, position, normal, view_direction, surface_roughness);
99
- let radiance = select(get_ibl_radiance(view_direction, normal, surface_roughness), found.radiance, found.found);
107
+ var radiance = rough.rgb * (1.0 - rough.a);
108
+
109
+ // the world probes' share, picked only where they keep one
110
+ if (rough.a > 0.0) {
111
+ let pick = probe_clipmap_pick(position, normal, view_direction, stbn_sample_vec2(vec3<u32>(i_coord, view.frame_index)));
112
+ let found = probe_clipmap_radiance_of(pick, position, normal, view_direction, surface_roughness);
113
+
114
+ radiance += rough.a * select(get_ibl_radiance(view_direction, normal, surface_roughness), found.radiance, found.found);
115
+ }
100
116
 
101
117
  let indirect = compute_indirect_specular(
102
118
  radiance,
@@ -107,14 +123,14 @@ fn main(
107
123
  metalness_to_specular_color(f_metalness, albedo),
108
124
  vec3(MIN_DIELECTRICS_F0),
109
125
  albedo,
110
- 1.0,
126
+ metalness_to_specular_F90(f_metalness, albedo),
111
127
  roughness,
112
128
  );
113
129
 
114
130
  let spec_direction = normalize(mix(reflect(-view_direction, normal), normal, alpha));
115
131
  let specular_occlusion = compute_specular_occlusion_bn(spec_direction, bent_normal, occlusion, roughness);
116
132
 
117
- return vec4(indirect[0] * specular_occlusion + indirect[1], 1.0);
133
+ return vec4(probe_clipmap_indirect_lobe(indirect[0] * specular_occlusion, indirect[1], radiance, irradiance), 1.0);
118
134
  }
119
135
  `, [
120
136
  chunk_project_position_from_depth,
@@ -123,6 +139,7 @@ fn main(
123
139
  chunk_decode_g_buffer_metalness,
124
140
  chunk_decode_g_buffer_roughness,
125
141
  chunk_metalness_to_specular_color,
142
+ chunk_metalness_to_specular_F90,
126
143
  chunk_MIN_DIELECTRICS_F0,
127
144
  chunk_stbn_sample_vec2,
128
145
  chunk_probe_clipmap_pick,
@@ -130,6 +147,7 @@ fn main(
130
147
  chunk_get_ibl_radiance,
131
148
  chunk_compute_indirect_specular,
132
149
  chunk_compute_specular_occlusion_bn,
150
+ chunk_probe_clipmap_indirect_lobe,
133
151
  ]),
134
152
  }),
135
153
  targets: [