@woosh/meep-engine 3.75.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 (216) hide show
  1. package/package.json +1 -1
  2. package/src/engine/asset/GameAssetType.d.ts +1 -0
  3. package/src/engine/asset/GameAssetType.js +5 -1
  4. package/src/engine/asset/loaders/GroomAssetLoader.d.ts +33 -0
  5. package/src/engine/asset/loaders/GroomAssetLoader.d.ts.map +1 -0
  6. package/src/engine/asset/loaders/GroomAssetLoader.js +99 -0
  7. package/src/engine/graphics/ecs/hair/Hair.d.ts +47 -0
  8. package/src/engine/graphics/ecs/hair/Hair.d.ts.map +1 -0
  9. package/src/engine/graphics/ecs/hair/Hair.js +61 -0
  10. package/src/engine/graphics/hair/Groom.d.ts +130 -0
  11. package/src/engine/graphics/hair/Groom.d.ts.map +1 -0
  12. package/src/engine/graphics/hair/Groom.js +193 -0
  13. package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts +24 -0
  14. package/src/engine/graphics/hair/GroomSerializationAdapter.d.ts.map +1 -0
  15. package/src/engine/graphics/hair/GroomSerializationAdapter.js +77 -0
  16. package/src/engine/graphics/hair/groom_build_group.d.ts +85 -0
  17. package/src/engine/graphics/hair/groom_build_group.d.ts.map +1 -0
  18. package/src/engine/graphics/hair/groom_build_group.js +487 -0
  19. package/src/engine/graphics/hair/groom_generate_scalp.d.ts +29 -0
  20. package/src/engine/graphics/hair/groom_generate_scalp.d.ts.map +1 -0
  21. package/src/engine/graphics/hair/groom_generate_scalp.js +184 -0
  22. package/src/engine/graphics/hair/groom_rank_order.d.ts +15 -0
  23. package/src/engine/graphics/hair/groom_rank_order.d.ts.map +1 -0
  24. package/src/engine/graphics/hair/groom_rank_order.js +53 -0
  25. package/src/engine/graphics/hair/groom_root_spacing.d.ts +12 -0
  26. package/src/engine/graphics/hair/groom_root_spacing.d.ts.map +1 -0
  27. package/src/engine/graphics/hair/groom_root_spacing.js +120 -0
  28. package/src/engine/graphics3/HairSystem.d.ts +102 -0
  29. package/src/engine/graphics3/HairSystem.d.ts.map +1 -0
  30. package/src/engine/graphics3/HairSystem.js +456 -0
  31. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  32. package/src/shade/assets/textures/hair_scattering.bin +0 -0
  33. package/src/shade/device/pipeline/PipelineEnquiry.d.ts +11 -0
  34. package/src/shade/device/pipeline/PipelineEnquiry.d.ts.map +1 -1
  35. package/src/shade/device/pipeline/PipelineEnquiry.js +13 -0
  36. package/src/shade/playground/hair/index.html +50 -0
  37. package/src/shade/playground/hair/main.d.ts +2 -0
  38. package/src/shade/playground/hair/main.d.ts.map +1 -0
  39. package/src/shade/playground/hair/main.js +274 -0
  40. package/src/shade/playground/screen_probes/README.md +54 -0
  41. package/src/shade/playground/screen_probes/index.html +271 -0
  42. package/src/shade/playground/screen_probes/main.d.ts +8 -0
  43. package/src/shade/playground/screen_probes/main.d.ts.map +1 -0
  44. package/src/shade/playground/screen_probes/main.js +527 -0
  45. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  46. package/src/shade/renderer/Renderer.js +54 -8
  47. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.d.ts +6 -0
  48. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.d.ts.map +1 -1
  49. package/src/shade/renderer/STATIC_GRAPHICS_ENGINE_ASSETS.js +10 -0
  50. package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
  51. package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts +1 -1
  52. package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
  53. package/src/shade/renderer/deferred/chunk_read_gBuffer_material.d.ts.map +1 -1
  54. package/src/shade/renderer/deferred/chunk_read_gBuffer_material.js +3 -1
  55. package/src/shade/renderer/deferred/chunk_shade_direct_lights.d.ts +23 -0
  56. package/src/shade/renderer/deferred/chunk_shade_direct_lights.d.ts.map +1 -0
  57. package/src/shade/renderer/deferred/chunk_shade_direct_lights.js +111 -0
  58. package/src/shade/renderer/deferred/chunk_shade_directional_lights.d.ts +17 -6
  59. package/src/shade/renderer/deferred/chunk_shade_directional_lights.d.ts.map +1 -1
  60. package/src/shade/renderer/deferred/chunk_shade_directional_lights.js +26 -21
  61. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts +12 -22
  62. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.d.ts.map +1 -1
  63. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct.js +20 -100
  64. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.d.ts.map +1 -1
  65. package/src/shade/renderer/deferred/chunk_shade_standard_material_direct_restir.js +6 -4
  66. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.d.ts +15 -0
  67. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.d.ts.map +1 -0
  68. package/src/shade/renderer/deferred/chunk_standard_material_direct_light_lobe.js +47 -0
  69. package/src/shade/renderer/extension/ViewLighting.d.ts +101 -0
  70. package/src/shade/renderer/extension/ViewLighting.d.ts.map +1 -0
  71. package/src/shade/renderer/extension/ViewLighting.js +168 -0
  72. package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
  73. package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
  74. package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -7
  75. package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
  76. package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
  77. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.d.ts.map +1 -1
  78. package/src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.js +3 -1
  79. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +1 -1
  80. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.d.ts.map +1 -1
  81. package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js +3 -1
  82. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +15 -7
  83. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts.map +1 -1
  84. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +40 -9
  85. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts +23 -0
  86. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts.map +1 -1
  87. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js +26 -0
  88. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.d.ts +1 -0
  89. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.js +6 -0
  90. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +13 -1
  91. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
  92. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +23 -1
  93. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.d.ts.map +1 -1
  94. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js +2 -0
  95. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts +29 -0
  96. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts.map +1 -0
  97. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.js +102 -0
  98. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts +8 -1
  99. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts.map +1 -1
  100. package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.js +27 -1
  101. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts +4 -1
  102. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts.map +1 -1
  103. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js +4 -1
  104. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts +11 -5
  105. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts.map +1 -1
  106. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.js +28 -10
  107. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts +36 -2
  108. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts.map +1 -1
  109. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.js +149 -4
  110. package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.d.ts.map +1 -1
  111. package/src/shade/renderer/global_illumination/shader_resolve_indirect_lighting.js +3 -1
  112. package/src/shade/renderer/hair/GPUHairSystem.d.ts +159 -0
  113. package/src/shade/renderer/hair/GPUHairSystem.d.ts.map +1 -0
  114. package/src/shade/renderer/hair/GPUHairSystem.js +1132 -0
  115. package/src/shade/renderer/hair/HAIR.d.ts +102 -0
  116. package/src/shade/renderer/hair/HAIR.d.ts.map +1 -0
  117. package/src/shade/renderer/hair/HAIR.js +115 -0
  118. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.d.ts +17 -0
  119. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.d.ts.map +1 -0
  120. package/src/shade/renderer/hair/HAIR_DATABASE_SPEC.js +71 -0
  121. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.d.ts +11 -0
  122. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.d.ts.map +1 -0
  123. package/src/shade/renderer/hair/HAIR_FRAME_STRUCTS.js +48 -0
  124. package/src/shade/renderer/hair/HairFrame.d.ts +41 -0
  125. package/src/shade/renderer/hair/HairFrame.d.ts.map +1 -0
  126. package/src/shade/renderer/hair/HairFrame.js +76 -0
  127. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts +42 -0
  128. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts.map +1 -0
  129. package/src/shade/renderer/hair/chunk_hair_bsdf.js +170 -0
  130. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts +30 -0
  131. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts.map +1 -0
  132. package/src/shade/renderer/hair/chunk_hair_dual_scattering.js +131 -0
  133. package/src/shade/renderer/hair/chunk_hair_pixel.d.ts +32 -0
  134. package/src/shade/renderer/hair/chunk_hair_pixel.d.ts.map +1 -0
  135. package/src/shade/renderer/hair/chunk_hair_pixel.js +116 -0
  136. package/src/shade/renderer/hair/chunk_hair_strand.d.ts +40 -0
  137. package/src/shade/renderer/hair/chunk_hair_strand.d.ts.map +1 -0
  138. package/src/shade/renderer/hair/chunk_hair_strand.js +85 -0
  139. package/src/shade/renderer/hair/chunk_hair_volume.d.ts +31 -0
  140. package/src/shade/renderer/hair/chunk_hair_volume.d.ts.map +1 -0
  141. package/src/shade/renderer/hair/chunk_hair_volume.js +106 -0
  142. package/src/shade/renderer/hair/hair_id_draw.d.ts +24 -0
  143. package/src/shade/renderer/hair/hair_id_draw.d.ts.map +1 -0
  144. package/src/shade/renderer/hair/hair_id_draw.js +135 -0
  145. package/src/shade/renderer/hair/hair_lighting.d.ts +53 -0
  146. package/src/shade/renderer/hair/hair_lighting.d.ts.map +1 -0
  147. package/src/shade/renderer/hair/hair_lighting.js +270 -0
  148. package/src/shade/renderer/hair/hair_scattering_lut.d.ts +75 -0
  149. package/src/shade/renderer/hair/hair_scattering_lut.d.ts.map +1 -0
  150. package/src/shade/renderer/hair/hair_scattering_lut.js +271 -0
  151. package/src/shade/renderer/hair/hair_stamp.d.ts +33 -0
  152. package/src/shade/renderer/hair/hair_stamp.d.ts.map +1 -0
  153. package/src/shade/renderer/hair/hair_stamp.js +175 -0
  154. package/src/shade/renderer/hair/shader_hair_classes.d.ts +21 -0
  155. package/src/shade/renderer/hair/shader_hair_classes.d.ts.map +1 -0
  156. package/src/shade/renderer/hair/shader_hair_classes.js +86 -0
  157. package/src/shade/renderer/hair/shader_hair_cull.d.ts +31 -0
  158. package/src/shade/renderer/hair/shader_hair_cull.d.ts.map +1 -0
  159. package/src/shade/renderer/hair/shader_hair_cull.js +194 -0
  160. package/src/shade/renderer/hair/shader_hair_lod.d.ts +33 -0
  161. package/src/shade/renderer/hair/shader_hair_lod.d.ts.map +1 -0
  162. package/src/shade/renderer/hair/shader_hair_lod.js +268 -0
  163. package/src/shade/renderer/hair/shader_hair_volume.d.ts +28 -0
  164. package/src/shade/renderer/hair/shader_hair_volume.d.ts.map +1 -0
  165. package/src/shade/renderer/hair/shader_hair_volume.js +167 -0
  166. package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
  167. package/src/shade/renderer/loader/usd/usd_build_scene.d.ts +31 -0
  168. package/src/shade/renderer/loader/usd/usd_build_scene.d.ts.map +1 -1
  169. package/src/shade/renderer/loader/usd/usd_build_scene.js +36 -21
  170. package/src/shade/renderer/loader/usd/usd_groom_extension.d.ts +60 -0
  171. package/src/shade/renderer/loader/usd/usd_groom_extension.d.ts.map +1 -0
  172. package/src/shade/renderer/loader/usd/usd_groom_extension.js +417 -0
  173. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.d.ts.map +1 -1
  174. package/src/shade/renderer/path_tracer/shader/chunk_sample_material_data.js +4 -1
  175. package/src/shade/renderer/path_tracer/shader/chunk_shading_closure_from_material_data.d.ts.map +1 -1
  176. package/src/shade/renderer/path_tracer/shader/chunk_shading_closure_from_material_data.js +3 -1
  177. package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
  178. package/src/shade/renderer/postprocess/ssr/SSR.d.ts +4 -1
  179. package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
  180. package/src/shade/renderer/postprocess/ssr/SSR.js +9 -0
  181. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts +16 -1
  182. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts.map +1 -1
  183. package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.js +47 -3
  184. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.d.ts.map +1 -1
  185. package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js +5 -3
  186. package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.d.ts.map +1 -1
  187. package/src/shade/renderer/postprocess/ssr/ssr_combine_shader.js +6 -5
  188. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.d.ts.map +1 -1
  189. package/src/shade/renderer/rasterize/forward/chunk_forward_shade_standard_fragment.js +5 -2
  190. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.d.ts.map +1 -1
  191. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js +5 -0
  192. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.d.ts.map +1 -1
  193. package/src/shade/renderer/rasterize/native/avboit/shader_avboit_splat.js +4 -1
  194. package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.d.ts.map +1 -1
  195. package/src/shade/renderer/rasterize/native/oit/oit_resolve_fragment_body.js +5 -1
  196. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.d.ts.map +1 -1
  197. package/src/shade/renderer/rasterize/native/oit/shader_oit_generate_moments.js +7 -4
  198. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts +13 -8
  199. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts.map +1 -1
  200. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.js +18 -14
  201. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts +3 -2
  202. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.d.ts.map +1 -1
  203. package/src/shade/renderer/shader/chunk/light/chunk_compute_multiscattering_specular.js +12 -4
  204. package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.d.ts.map +1 -1
  205. package/src/shade/renderer/shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js +1 -0
  206. package/src/shade/renderer/shader/chunk/material/chunk_compute_indirect_specular.js +1 -1
  207. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.d.ts +16 -0
  208. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.d.ts.map +1 -0
  209. package/src/shade/renderer/shader/chunk/material/chunk_metalness_to_specular_F90.js +25 -0
  210. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.js +2 -2
  211. package/src/shade/renderer/shader/compiler/ShaderSwitch.d.ts +1 -1
  212. package/src/shade/renderer/shader/compiler/ShaderSwitchSet.d.ts +1 -1
  213. package/src/shade/renderer/shader/resource/ShaderResourceDescriptor.d.ts +1 -1
  214. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_point2.d.ts +2 -2
  215. package/src/shade/renderer/shadow/map/shader/chunk_shadowmap_sample_point2.js +2 -2
  216. package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
@@ -0,0 +1,47 @@
1
+ import { INCIDENT_LIGHT_STRUCT } from "../shader/chunk/light/INCIDENT_LIGHT_STRUCT.js";
2
+ import { REFLECTED_LIGHT_STRUCT } from "../shader/chunk/light/REFLECTED_LIGHT_STRUCT.js";
3
+ import { chunk_re_direct_physical } from "../shader/chunk/material/chunk_re_direct_physical.js";
4
+ import { GEOMETRIC_SHADING_INFO_STRUCT } from "../shader/chunk/material/GEOMETRIC_SHADING_INFO_STRUCT.js";
5
+ import { MATERIAL_SHADING_INFO_STRUCT } from "../shader/chunk/material/MATERIAL_SHADING_INFO_STRUCT.js";
6
+ import { CodeChunk } from "../shader/compiler/CodeChunk.js";
7
+ import { UNRESTRICTED_POINTER_PARAMETERS_EXTENSION } from "../shader/resource/BUFFER_VIEW.js";
8
+
9
+ /**
10
+ * The standard material's lobe for the direct-light loops ({@link chunk_shade_direct_lights},
11
+ * `chunk_shade_directional_lights`): its context carries the material and the geometry at the shaded point and
12
+ * accumulates the reflected light, and each light goes through `re_direct_physical`. Shadows are taken along the
13
+ * shading normal.
14
+ *
15
+ * ```wgsl
16
+ * struct DirectLightContext { material: MaterialShadingInfo, geometry: GeometricShadingInfo, reflected: ReflectedLight }
17
+ * ```
18
+ *
19
+ * @type {CodeChunk}
20
+ */
21
+ export const chunk_standard_material_direct_light_lobe = CodeChunk.from(
22
+ //language=WGSL
23
+ `
24
+ struct DirectLightContext {
25
+ material: ${MATERIAL_SHADING_INFO_STRUCT.wgsl_ref},
26
+ geometry: ${GEOMETRIC_SHADING_INFO_STRUCT.wgsl_ref},
27
+ reflected: ${REFLECTED_LIGHT_STRUCT.wgsl_ref},
28
+ }
29
+
30
+ fn direct_light_lobe(context: ptr<function, DirectLightContext>, light: ${INCIDENT_LIGHT_STRUCT.wgsl_ref}) {
31
+ re_direct_physical(light, (*context).geometry, (*context).material, &(*context).reflected);
32
+ }
33
+
34
+ fn direct_light_visibility_normal(context: ptr<function, DirectLightContext>, light: ${INCIDENT_LIGHT_STRUCT.wgsl_ref}) -> vec3<f32> {
35
+ return (*context).geometry.shading_normal;
36
+ }
37
+ `, [
38
+ INCIDENT_LIGHT_STRUCT.declaration_chunk,
39
+ REFLECTED_LIGHT_STRUCT.declaration_chunk,
40
+ GEOMETRIC_SHADING_INFO_STRUCT.declaration_chunk,
41
+ MATERIAL_SHADING_INFO_STRUCT.declaration_chunk,
42
+ chunk_re_direct_physical,
43
+ ]
44
+ );
45
+
46
+ // the reflected light accumulates through a pointer to a member of the context
47
+ chunk_standard_material_direct_light_lobe.addLanguageExtension(UNRESTRICTED_POINTER_PARAMETERS_EXTENSION);
@@ -0,0 +1,101 @@
1
+ /**
2
+ * @typedef {import("../shader/compiler/ShaderSwitchSet.js").ShaderSwitchSet} ShaderSwitchSet
3
+ * @typedef {import("../global_illumination/probe_clipmap/GPUProbeClipmapGI.js").GPUProbeClipmapGI} GPUProbeClipmapGI
4
+ */
5
+ /**
6
+ * What the frame lights a surface with, for an extension that shades samples of its own: this frame's light
7
+ * clusters, the shadow atlas, the volumetrics' look-up table and its metadata (the fog a surface is seen through),
8
+ * the renderer's shader switches (the shadow technique and the indirect lighting mode among them) and the probe
9
+ * clipmap GI, whose probes a pass that can read indirect light binds in every mode. The transparent surfaces are lit
10
+ * by exactly these.
11
+ *
12
+ * The light records, the environment and the shadow tables are the scene's and are reached through the view
13
+ * (`frame.view.scene.lights`, `frame.view.scene.shadow_context`); this record carries what only the frame has.
14
+ *
15
+ * Carried at {@link FramePhase.AfterLighting} and {@link FramePhase.AfterTransparency}, and **frozen at both**: the
16
+ * renderer states it once, and nothing an extension publishes into it would reach a pass that lights anything.
17
+ */
18
+ export class ViewLighting extends FrameRecord {
19
+ static is_present_at(phase: any): boolean;
20
+ static is_writable_at(phase: any): boolean;
21
+ /**
22
+ * The light clusters' depth curve: a graph handle of a uniform buffer, `LIGHT_CLUSTER_PARAMETERS_RESOURCE`.
23
+ *
24
+ * @returns {number}
25
+ */
26
+ get light_cluster_parameters(): number;
27
+ /**
28
+ * The light clusters' per-cell counts and offsets: a graph handle of a storage buffer,
29
+ * `LIGHT_CLUSTER_LOOKUP_RESOURCE`.
30
+ *
31
+ * @returns {number}
32
+ */
33
+ get light_cluster_lookup(): number;
34
+ /**
35
+ * The light clusters' light indices: a graph handle of a storage buffer, `LIGHT_CLUSTER_DATA_RESOURCE`.
36
+ *
37
+ * @returns {number}
38
+ */
39
+ get light_cluster_data(): number;
40
+ /**
41
+ * The shadow atlas every shadow-casting light samples: a graph handle of a depth texture.
42
+ *
43
+ * @returns {number}
44
+ */
45
+ get shadowmap_atlas(): number;
46
+ /**
47
+ * The volumetrics' resolved look-up table, the in-scatter and transmittance a point is seen through:
48
+ * a graph handle of a 3D texture. Reads as no fog when the scene has none.
49
+ *
50
+ * @returns {number}
51
+ */
52
+ get volumetrics_lut(): number;
53
+ /**
54
+ * How {@link volumetrics_lut} is addressed: a graph handle of a uniform buffer, `VOLUMETRICS_METADATA_STRUCT`.
55
+ *
56
+ * @returns {number}
57
+ */
58
+ get volumetrics_metadata(): number;
59
+ /**
60
+ * The renderer's shader switches, which pick the shadow technique and the indirect lighting a lit pass links.
61
+ *
62
+ * @returns {ShaderSwitchSet}
63
+ */
64
+ get shader_switches(): import("../shader/compiler/ShaderSwitchSet.js").ShaderSwitchSet;
65
+ /**
66
+ * The renderer's probe clipmap GI. A pass that can read indirect light binds its probes in every mode
67
+ * (`GPUProbeClipmapGI#write_sampling_bindings`); while it has no probes it is a clipmap of no cascade.
68
+ *
69
+ * @returns {GPUProbeClipmapGI}
70
+ */
71
+ get probes(): import("../global_illumination/probe_clipmap/GPUProbeClipmapGI.js").GPUProbeClipmapGI;
72
+ /**
73
+ * State what the frame lights with. The renderer's, once, as the record is created; not an extension's.
74
+ *
75
+ * @param {{
76
+ * light_cluster_parameters: number,
77
+ * light_cluster_lookup: number,
78
+ * light_cluster_data: number,
79
+ * shadowmap_atlas: number,
80
+ * volumetrics_lut: number,
81
+ * volumetrics_metadata: number,
82
+ * shader_switches: ShaderSwitchSet,
83
+ * probes: GPUProbeClipmapGI,
84
+ * }} lighting
85
+ */
86
+ state(lighting: {
87
+ light_cluster_parameters: number;
88
+ light_cluster_lookup: number;
89
+ light_cluster_data: number;
90
+ shadowmap_atlas: number;
91
+ volumetrics_lut: number;
92
+ volumetrics_metadata: number;
93
+ shader_switches: ShaderSwitchSet;
94
+ probes: GPUProbeClipmapGI;
95
+ }): void;
96
+ #private;
97
+ }
98
+ export type ShaderSwitchSet = import("../shader/compiler/ShaderSwitchSet.js").ShaderSwitchSet;
99
+ export type GPUProbeClipmapGI = import("../global_illumination/probe_clipmap/GPUProbeClipmapGI.js").GPUProbeClipmapGI;
100
+ import { FrameRecord } from "./FrameRecord.js";
101
+ //# sourceMappingURL=ViewLighting.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ViewLighting.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/extension/ViewLighting.js"],"names":[],"mappings":"AAIA;;;GAGG;AAEH;;;;;;;;;;;;GAYG;AACH;IAkBI,0CAGC;IAED,2CAEC;IAED;;;;OAIG;IACH,uCAEC;IAED;;;;;OAKG;IACH,mCAEC;IAED;;;;OAIG;IACH,iCAEC;IAED;;;;OAIG;IACH,8BAEC;IAED;;;;;OAKG;IACH,8BAEC;IAED;;;;OAIG;IACH,mCAEC;IAED;;;;OAIG;IACH,uFAEC;IAED;;;;;OAKG;IACH,oGAEC;IAED;;;;;;;;;;;;;OAaG;IACH,gBAXW;QACV,wBAA8B,EAAE,MAAM,CAAC;QACvC,oBAA0B,EAAE,MAAM,CAAC;QACnC,kBAAwB,EAAE,MAAM,CAAC;QACjC,eAAqB,EAAE,MAAM,CAAC;QAC9B,eAAqB,EAAE,MAAM,CAAC;QAC9B,oBAA0B,EAAE,MAAM,CAAC;QACnC,eAAqB,EAAE,eAAe,CAAC;QACvC,MAAY,EAAE,iBAAiB,CAAC;KAC7B,QAcH;;CAiBJ;8BAlKY,OAAO,uCAAuC,EAAE,eAAe;gCAC/D,OAAO,2DAA2D,EAAE,iBAAiB;4BAJtE,kBAAkB"}
@@ -0,0 +1,168 @@
1
+ import { assert } from "../../../core/assert.js";
2
+ import { FramePhase } from "./FramePhase.js";
3
+ import { FrameRecord } from "./FrameRecord.js";
4
+
5
+ /**
6
+ * @typedef {import("../shader/compiler/ShaderSwitchSet.js").ShaderSwitchSet} ShaderSwitchSet
7
+ * @typedef {import("../global_illumination/probe_clipmap/GPUProbeClipmapGI.js").GPUProbeClipmapGI} GPUProbeClipmapGI
8
+ */
9
+
10
+ /**
11
+ * What the frame lights a surface with, for an extension that shades samples of its own: this frame's light
12
+ * clusters, the shadow atlas, the volumetrics' look-up table and its metadata (the fog a surface is seen through),
13
+ * the renderer's shader switches (the shadow technique and the indirect lighting mode among them) and the probe
14
+ * clipmap GI, whose probes a pass that can read indirect light binds in every mode. The transparent surfaces are lit
15
+ * by exactly these.
16
+ *
17
+ * The light records, the environment and the shadow tables are the scene's and are reached through the view
18
+ * (`frame.view.scene.lights`, `frame.view.scene.shadow_context`); this record carries what only the frame has.
19
+ *
20
+ * Carried at {@link FramePhase.AfterLighting} and {@link FramePhase.AfterTransparency}, and **frozen at both**: the
21
+ * renderer states it once, and nothing an extension publishes into it would reach a pass that lights anything.
22
+ */
23
+ export class ViewLighting extends FrameRecord {
24
+ #light_cluster_parameters = -1;
25
+ #light_cluster_lookup = -1;
26
+ #light_cluster_data = -1;
27
+ #shadowmap_atlas = -1;
28
+ #volumetrics_lut = -1;
29
+ #volumetrics_metadata = -1;
30
+
31
+ /**
32
+ * @type {ShaderSwitchSet|null}
33
+ */
34
+ #shader_switches = null;
35
+
36
+ /**
37
+ * @type {GPUProbeClipmapGI|null}
38
+ */
39
+ #probes = null;
40
+
41
+ static is_present_at(phase) {
42
+ return phase === FramePhase.AfterLighting
43
+ || phase === FramePhase.AfterTransparency;
44
+ }
45
+
46
+ static is_writable_at(phase) {
47
+ return false;
48
+ }
49
+
50
+ /**
51
+ * The light clusters' depth curve: a graph handle of a uniform buffer, `LIGHT_CLUSTER_PARAMETERS_RESOURCE`.
52
+ *
53
+ * @returns {number}
54
+ */
55
+ get light_cluster_parameters() {
56
+ return this.read(this.#light_cluster_parameters);
57
+ }
58
+
59
+ /**
60
+ * The light clusters' per-cell counts and offsets: a graph handle of a storage buffer,
61
+ * `LIGHT_CLUSTER_LOOKUP_RESOURCE`.
62
+ *
63
+ * @returns {number}
64
+ */
65
+ get light_cluster_lookup() {
66
+ return this.read(this.#light_cluster_lookup);
67
+ }
68
+
69
+ /**
70
+ * The light clusters' light indices: a graph handle of a storage buffer, `LIGHT_CLUSTER_DATA_RESOURCE`.
71
+ *
72
+ * @returns {number}
73
+ */
74
+ get light_cluster_data() {
75
+ return this.read(this.#light_cluster_data);
76
+ }
77
+
78
+ /**
79
+ * The shadow atlas every shadow-casting light samples: a graph handle of a depth texture.
80
+ *
81
+ * @returns {number}
82
+ */
83
+ get shadowmap_atlas() {
84
+ return this.read(this.#shadowmap_atlas);
85
+ }
86
+
87
+ /**
88
+ * The volumetrics' resolved look-up table, the in-scatter and transmittance a point is seen through:
89
+ * a graph handle of a 3D texture. Reads as no fog when the scene has none.
90
+ *
91
+ * @returns {number}
92
+ */
93
+ get volumetrics_lut() {
94
+ return this.read(this.#volumetrics_lut);
95
+ }
96
+
97
+ /**
98
+ * How {@link volumetrics_lut} is addressed: a graph handle of a uniform buffer, `VOLUMETRICS_METADATA_STRUCT`.
99
+ *
100
+ * @returns {number}
101
+ */
102
+ get volumetrics_metadata() {
103
+ return this.read(this.#volumetrics_metadata);
104
+ }
105
+
106
+ /**
107
+ * The renderer's shader switches, which pick the shadow technique and the indirect lighting a lit pass links.
108
+ *
109
+ * @returns {ShaderSwitchSet}
110
+ */
111
+ get shader_switches() {
112
+ return this.#read_object(this.#shader_switches, 'shader_switches');
113
+ }
114
+
115
+ /**
116
+ * The renderer's probe clipmap GI. A pass that can read indirect light binds its probes in every mode
117
+ * (`GPUProbeClipmapGI#write_sampling_bindings`); while it has no probes it is a clipmap of no cascade.
118
+ *
119
+ * @returns {GPUProbeClipmapGI}
120
+ */
121
+ get probes() {
122
+ return this.#read_object(this.#probes, 'probes');
123
+ }
124
+
125
+ /**
126
+ * State what the frame lights with. The renderer's, once, as the record is created; not an extension's.
127
+ *
128
+ * @param {{
129
+ * light_cluster_parameters: number,
130
+ * light_cluster_lookup: number,
131
+ * light_cluster_data: number,
132
+ * shadowmap_atlas: number,
133
+ * volumetrics_lut: number,
134
+ * volumetrics_metadata: number,
135
+ * shader_switches: ShaderSwitchSet,
136
+ * probes: GPUProbeClipmapGI,
137
+ * }} lighting
138
+ */
139
+ state(lighting) {
140
+ assert.defined(lighting.shader_switches, 'shader_switches');
141
+ assert.defined(lighting.probes, 'probes');
142
+
143
+ this.#light_cluster_parameters = this.republish(lighting.light_cluster_parameters);
144
+ this.#light_cluster_lookup = this.republish(lighting.light_cluster_lookup);
145
+ this.#light_cluster_data = this.republish(lighting.light_cluster_data);
146
+ this.#shadowmap_atlas = this.republish(lighting.shadowmap_atlas);
147
+ this.#volumetrics_lut = this.republish(lighting.volumetrics_lut);
148
+ this.#volumetrics_metadata = this.republish(lighting.volumetrics_metadata);
149
+ this.#shader_switches = lighting.shader_switches;
150
+ this.#probes = lighting.probes;
151
+ }
152
+
153
+ /**
154
+ * @template T
155
+ * @param {T|null} value
156
+ * @param {string} name
157
+ * @returns {T}
158
+ */
159
+ #read_object(value, name) {
160
+ const frame = this.frame;
161
+
162
+ assert.notNull(frame, `ViewLighting was read without belonging to a frame`);
163
+ assert.equal(frame.is_open, true, `ViewLighting belongs to a frame that has finished`);
164
+ assert.notNull(value, `ViewLighting.${name} read before the renderer stated it`);
165
+
166
+ return value;
167
+ }
168
+ }
@@ -145,7 +145,7 @@ export class GPUFluidCascade {
145
145
  * @param {*} _resources
146
146
  * @param {{encoder: ShadeGPUCommandContext}} context
147
147
  */
148
- static "__#295@#execute_restrict"(record: object, _resources: any, context: {
148
+ static "__#296@#execute_restrict"(record: object, _resources: any, context: {
149
149
  encoder: ShadeGPUCommandContext;
150
150
  }): void;
151
151
  /**
@@ -153,7 +153,7 @@ export class GPUFluidCascade {
153
153
  * @param {*} _resources
154
154
  * @param {{encoder: ShadeGPUCommandContext}} context
155
155
  */
156
- static "__#295@#execute_fill"(record: object, _resources: any, context: {
156
+ static "__#296@#execute_fill"(record: object, _resources: any, context: {
157
157
  encoder: ShadeGPUCommandContext;
158
158
  }): void;
159
159
  /**
@@ -161,7 +161,7 @@ export class GPUFluidCascade {
161
161
  * @param {import("../../../engine/graphics/render/frame_graph/FramePassResources.js").FramePassResources} resources
162
162
  * @param {{encoder: ShadeGPUCommandContext}} context
163
163
  */
164
- static "__#295@#execute"(record: object, resources: import("../../../engine/graphics/render/frame_graph/FramePassResources.js").FramePassResources, context: {
164
+ static "__#296@#execute"(record: object, resources: import("../../../engine/graphics/render/frame_graph/FramePassResources.js").FramePassResources, context: {
165
165
  encoder: ShadeGPUCommandContext;
166
166
  }): void;
167
167
  /**
@@ -65,7 +65,7 @@ export class GPUFluidCascadeStack {
65
65
  * @param {*} _resources
66
66
  * @param {{encoder: import("../../device/ShadeGPUCommandContext.js").ShadeGPUCommandContext}} context
67
67
  */
68
- static "__#297@#execute_publish"(pass: object, _resources: any, context: {
68
+ static "__#298@#execute_publish"(pass: object, _resources: any, context: {
69
69
  encoder: import("../../device/ShadeGPUCommandContext.js").ShadeGPUCommandContext;
70
70
  }): void;
71
71
  /**
@@ -86,7 +86,7 @@ export class GPUFluidForcing {
86
86
  * @param {FluidObstacleRecord} record
87
87
  * @returns {number} metres
88
88
  */
89
- static "__#298@#resolved_extent"(record: FluidObstacleRecord): number;
89
+ static "__#299@#resolved_extent"(record: FluidObstacleRecord): number;
90
90
  /**
91
91
  * The descriptor of a transient of `role`, `size` bytes, from `kept` (by role): the one kept for
92
92
  * the role while its size holds, a new one when it moves. A role's usage and clear range never
@@ -99,19 +99,19 @@ export class GPUFluidForcing {
99
99
  * @param {number} clear_size bytes cleared from 0 when the pool reuses the buffer
100
100
  * @returns {BufferResourceDescriptor}
101
101
  */
102
- static "__#298@#descriptor"(kept: BufferResourceDescriptor[], role: number, size: number, usage: number, clear_size: number): BufferResourceDescriptor;
102
+ static "__#299@#descriptor"(kept: BufferResourceDescriptor[], role: number, size: number, usage: number, clear_size: number): BufferResourceDescriptor;
103
103
  /**
104
104
  * @param {object} record
105
105
  * @param {FramePassResources} resources
106
106
  * @param {{encoder: ShadeGPUCommandContext}} context
107
107
  */
108
- static "__#298@#execute_extract"(record: object, resources: FramePassResources, context: {
108
+ static "__#299@#execute_extract"(record: object, resources: FramePassResources, context: {
109
109
  encoder: ShadeGPUCommandContext;
110
110
  }): void;
111
- static "__#298@#execute_clear"(record: any, _resources: any, context: any): void;
112
- static "__#298@#execute_query"(record: any, resources: any, context: any): void;
113
- static "__#298@#execute_command"(record: any, resources: any, context: any): void;
114
- static "__#298@#execute_apply"(record: any, resources: any, context: any): void;
111
+ static "__#299@#execute_clear"(record: any, _resources: any, context: any): void;
112
+ static "__#299@#execute_query"(record: any, resources: any, context: any): void;
113
+ static "__#299@#execute_command"(record: any, resources: any, context: any): void;
114
+ static "__#299@#execute_apply"(record: any, resources: any, context: any): void;
115
115
  /**
116
116
  * @param {object} options
117
117
  * @param {GPUDevice} options.device
@@ -41,7 +41,7 @@ export class GPUFluidPressureSolve {
41
41
  * @param {*} _resources
42
42
  * @param {{encoder: ShadeGPUCommandContext}} context
43
43
  */
44
- static "__#294@#execute"(data: {
44
+ static "__#295@#execute"(data: {
45
45
  solve: GPUFluidPressureSolve;
46
46
  arm: number;
47
47
  count: number;
@@ -49,7 +49,7 @@ export class GPUFluidQueries {
49
49
  * @param {import("../../../../engine/graphics/render/frame_graph/FramePassResources.js").FramePassResources} resources
50
50
  * @param {{encoder: import("../../../device/ShadeGPUCommandContext.js").ShadeGPUCommandContext}} context
51
51
  */
52
- static "__#299@#execute"(pass: object, resources: import("../../../../engine/graphics/render/frame_graph/FramePassResources.js").FramePassResources, context: {
52
+ static "__#300@#execute"(pass: object, resources: import("../../../../engine/graphics/render/frame_graph/FramePassResources.js").FramePassResources, context: {
53
53
  encoder: import("../../../device/ShadeGPUCommandContext.js").ShadeGPUCommandContext;
54
54
  }): void;
55
55
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"shader_brick4_indirect_lighting.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.js"],"names":[],"mappings":"AA0MA,0DAwBE;4BA3M0B,mCAAmC"}
1
+ {"version":3,"file":"shader_brick4_indirect_lighting.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/global_illumination/brick4/gpu/draw/shader_brick4_indirect_lighting.js"],"names":[],"mappings":"AA4MA,0DAwBE;4BA5M0B,mCAAmC"}
@@ -13,6 +13,7 @@ import { chunk_compute_indirect_specular } from "../../../../shader/chunk/materi
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 {
17
18
  chunk_sh3_color_estimate_for_cone
18
19
  } from "../../../../shader/chunk/spherical_harmonics/chunk_sh3_color_estimate_for_cone.js";
@@ -81,7 +82,7 @@ fn main(
81
82
  let alpha = roughness * roughness;
82
83
 
83
84
  let material_specularF0 = metalness_to_specular_color(f_metalness, albedo);
84
- let material_specularF90 = 1.0;
85
+ let material_specularF90 = metalness_to_specular_F90(f_metalness, albedo);
85
86
 
86
87
  let shading_normal = decode_g_buffer_normal(g_buffer_sample_normal.x);
87
88
  let bent_normal = decode_g_buffer_normal(g_buffer_bent_normal.x);
@@ -184,6 +185,7 @@ fn main(
184
185
  chunk_decode_g_buffer_metalness,
185
186
  chunk_decode_g_buffer_roughness,
186
187
  chunk_metalness_to_specular_color,
188
+ chunk_metalness_to_specular_F90,
187
189
  chunk_MIN_DIELECTRICS_F0,
188
190
  chunk_brick4_node_by_position,
189
191
  chunk_brick4_node_sample_probes_meta,
@@ -35,7 +35,7 @@ export class GPUProbeClipmapGI {
35
35
  * @param {ProbeClipmapSettings} settings
36
36
  * @returns {boolean} whether it is what the settings' world cache describes, in their frustum's windows
37
37
  */
38
- static "__#213@#world_cache_built_for"(world_cache: GPUProbeClipmap, settings: ProbeClipmapSettings): boolean;
38
+ static "__#212@#world_cache_built_for"(world_cache: GPUProbeClipmap, settings: ProbeClipmapSettings): boolean;
39
39
  /**
40
40
  * @param {GraphicsContext} graphics
41
41
  */
@@ -1 +1 @@
1
- {"version":3,"file":"shader_probe_clipmap_indirect_lighting.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js"],"names":[],"mappings":"AAyIA;;;;;;;;;;;;;GAaG;AACH,qDAFU,WAAW,CA0BlB;4BA1JyB,gCAAgC"}
1
+ {"version":3,"file":"shader_probe_clipmap_indirect_lighting.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_indirect_lighting.js"],"names":[],"mappings":"AA2IA;;;;;;;;;;;;;GAaG;AACH,qDAFU,WAAW,CA0BlB;4BA3JyB,gCAAgC"}
@@ -14,6 +14,7 @@ import { chunk_compute_indirect_specular } from "../../../shader/chunk/material/
14
14
  import { chunk_decode_g_buffer_metalness } from "../../../shader/chunk/material/chunk_decode_g_buffer_metalness.js";
15
15
  import { chunk_decode_g_buffer_roughness } from "../../../shader/chunk/material/chunk_decode_g_buffer_roughness.js";
16
16
  import { chunk_metalness_to_specular_color } from "../../../shader/chunk/material/chunk_metalness_to_specular_color.js";
17
+ import { chunk_metalness_to_specular_F90 } from "../../../shader/chunk/material/chunk_metalness_to_specular_F90.js";
17
18
  import { chunk_stbn_sample_vec2 } from "../../../shader/chunk/noise/chunk_stbn_sample_vec2.js";
18
19
  import {
19
20
  chunk_sh3_color_get_irradiance_at
@@ -107,7 +108,7 @@ fn main(
107
108
  metalness_to_specular_color(f_metalness, albedo),
108
109
  vec3(MIN_DIELECTRICS_F0),
109
110
  albedo,
110
- 1.0,
111
+ metalness_to_specular_F90(f_metalness, albedo),
111
112
  roughness,
112
113
  );
113
114
 
@@ -123,6 +124,7 @@ fn main(
123
124
  chunk_decode_g_buffer_metalness,
124
125
  chunk_decode_g_buffer_roughness,
125
126
  chunk_metalness_to_specular_color,
127
+ chunk_metalness_to_specular_F90,
126
128
  chunk_MIN_DIELECTRICS_F0,
127
129
  chunk_stbn_sample_vec2,
128
130
  chunk_probe_clipmap_pick,
@@ -12,12 +12,12 @@
12
12
  * it wants); its BRDF and lighting densities and its rays, reassigned to where its light is; the screen trace; the
13
13
  * bricks' trace, shade, local light and bounce of what the screen left; the hits' wants; the composite into each
14
14
  * probe's radiance, the spatial filter's passes, and the probes' SH3.
15
- * 3. **Resolve** ({@link graph_resolve}), once the bent normals exist: each pixel's irradiance from its probes, then
16
- * the temporal filter into the frame's diffuse, which the deferred passes read.
15
+ * 3. **Resolve** ({@link graph_resolve}), once the bent normals exist: each pixel's irradiance and rough specular from
16
+ * its probes, then the temporal filter into the frame's diffuse and specular, which the deferred passes read.
17
17
  * 4. **Capture** ({@link graph_capture}): the lit colour of the opaque surfaces, for the next frame's screen hits.
18
18
  *
19
- * **Its history**: last frame's probes (their records and filtered radiance, for the lighting density), its diffuse
20
- * and frames (for the temporal filter) and its colour (for the screen hits) are kept while the structure and the view
19
+ * **Its history**: last frame's probes (their records and filtered radiance, for the lighting density), its diffuse,
20
+ * specular and frames (for the temporal filter) and its colour (for the screen hits) are kept while the structure and the view
21
21
  * stay, until {@link reset_history}; any change starts it again. Nothing is allocated on a frame that changes neither: the adaptive probes' slots
22
22
  * are made with the rest, as many as the uniform probes (`screen_probe_adaptive_capacity`), and a frame that would
23
23
  * place more places no more.
@@ -80,13 +80,14 @@ export class GPUScreenProbeGI {
80
80
  exposure: number;
81
81
  }): void;
82
82
  /**
83
- * Take the frame's resolve, once the bent normals exist: each pixel's irradiance from its probes, then the temporal
84
- * filter into the frame's diffuse.
83
+ * Take the frame's resolve, once the bent normals exist: each pixel's irradiance and rough specular from its
84
+ * probes, then the temporal filter into the frame's diffuse and specular ({@link specular_handle}).
85
85
  *
86
86
  * @param {Object} options
87
87
  * @param {FrameGraph} options.graph
88
88
  * @param {number} options.depth graph handle of the view's reverse-Z depth
89
89
  * @param {number} options.depth_previous graph handle of last frame's
90
+ * @param {number} options.normal graph handle of the G-buffer's shading normals, which the specular lobe stands on
90
91
  * @param {number} options.pbr graph handle of the G-buffer's PBR target
91
92
  * @param {number} options.velocity graph handle of the frame's motion
92
93
  * @param {number} options.bent_normals graph handle of the bent normals (the shading normals where GTAO is off)
@@ -94,15 +95,22 @@ export class GPUScreenProbeGI {
94
95
  * was shown, the one {@link graph_update} took: what the probes' radiance is pre-exposed by
95
96
  * @returns {number} graph handle of the frame's diffuse, `rgba16float`: E at the bent normal, before AO
96
97
  */
97
- graph_resolve({ graph, depth, depth_previous, pbr, velocity, bent_normals, exposure }: {
98
+ graph_resolve({ graph, depth, depth_previous, normal, pbr, velocity, bent_normals, exposure }: {
98
99
  graph: FrameGraph;
99
100
  depth: number;
100
101
  depth_previous: number;
102
+ normal: number;
101
103
  pbr: number;
102
104
  velocity: number;
103
105
  bent_normals: number;
104
106
  exposure: number;
105
107
  }): number;
108
+ /**
109
+ * @returns {number} graph handle of the rough specular this frame's {@link graph_resolve} wrote, `rgba16float`: the
110
+ * screen probes' radiance along each pixel's specular lobe, and in alpha the share of the pixel's specular the
111
+ * world-space probes keep, so a pixel's specular light is `rgb · (1 − a) + world · a`
112
+ */
113
+ get specular_handle(): number;
106
114
  /**
107
115
  * @returns {number} graph handle of the diffuse this frame's {@link graph_resolve} wrote
108
116
  */
@@ -1 +1 @@
1
- {"version":3,"file":"GPUScreenProbeGI.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js"],"names":[],"mappings":"AAqEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;IAsHI;;OAEG;IACH,+BAIC;IAED;;;OAGG;IACH,sBAEC;IAED;;OAEG;IACH,qBAEC;IAED;;OAEG;IACH,4BAEC;IAED;;OAEG;IACH,gCAEC;IAiBD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH;QAf+B,KAAK,EAAzB,UAAU;QACc,IAAI,EAA5B,cAAc;QACe,QAAQ,EAArC,mBAAmB;QACQ,KAAK,EAAhC,iBAAiB;QAEN,IAAI;QACC,KAAK,EAArB,MAAM;QACU,MAAM,EAAtB,MAAM;QACU,GAAG,EAAnB,MAAM;QACU,QAAQ,EAAxB,MAAM;QACU,SAAS,EAAzB,MAAM;QACU,GAAG,EAAnB,MAAM;QACU,QAAQ,EAAxB,MAAM;aAoFhB;IAED;;;;;;;;;;;;;;OAcG;IACH;QAV+B,KAAK,EAAzB,UAAU;QACM,KAAK,EAArB,MAAM;QACU,cAAc,EAA9B,MAAM;QACU,GAAG,EAAnB,MAAM;QACU,QAAQ,EAAxB,MAAM;QACU,YAAY,EAA5B,MAAM;QACU,QAAQ,EAAxB,MAAM;QAEJ,MAAM,CAqBlB;IAED;;OAEG;IACH,6BAEC;IAED;;;;;;OAMG;IACH,yCASC;IAED;;;;;;;OAOG;IACH;QAH+B,KAAK,EAAzB,UAAU;QACM,KAAK,EAArB,MAAM;aAWhB;IA6bD;;;OAGG;IACH,gBA+BC;IAED,gBAQC;;CACJ;yBAh3BY,OAAO,8DAA8D,EAAE,UAAU;6BACjF,OAAO,8BAA8B,EAAE,cAAc;kCACrD,OAAO,0BAA0B,EAAE,mBAAmB;gCACtD,OAAO,uCAAuC,EAAE,iBAAiB"}
1
+ {"version":3,"file":"GPUScreenProbeGI.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js"],"names":[],"mappings":"AAqEA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH;IA6HI;;OAEG;IACH,+BAIC;IAED;;;OAGG;IACH,sBAEC;IAED;;OAEG;IACH,qBAEC;IAED;;OAEG;IACH,4BAEC;IAED;;OAEG;IACH,gCAEC;IAiBD;;;;;;;;;;;;;;;;;;;;OAoBG;IACH;QAf+B,KAAK,EAAzB,UAAU;QACc,IAAI,EAA5B,cAAc;QACe,QAAQ,EAArC,mBAAmB;QACQ,KAAK,EAAhC,iBAAiB;QAEN,IAAI;QACC,KAAK,EAArB,MAAM;QACU,MAAM,EAAtB,MAAM;QACU,GAAG,EAAnB,MAAM;QACU,QAAQ,EAAxB,MAAM;QACU,SAAS,EAAzB,MAAM;QACU,GAAG,EAAnB,MAAM;QACU,QAAQ,EAAxB,MAAM;aAoFhB;IAED;;;;;;;;;;;;;;;OAeG;IACH;QAX+B,KAAK,EAAzB,UAAU;QACM,KAAK,EAArB,MAAM;QACU,cAAc,EAA9B,MAAM;QACU,MAAM,EAAtB,MAAM;QACU,GAAG,EAAnB,MAAM;QACU,QAAQ,EAAxB,MAAM;QACU,YAAY,EAA5B,MAAM;QACU,QAAQ,EAAxB,MAAM;QAEJ,MAAM,CAyBlB;IAED;;;;OAIG;IACH,8BAEC;IAED;;OAEG;IACH,6BAEC;IAED;;;;;;OAMG;IACH,yCASC;IAED;;;;;;;OAOG;IACH;QAH+B,KAAK,EAAzB,UAAU;QACM,KAAK,EAArB,MAAM;aAWhB;IAqcD;;;OAGG;IACH,gBAiCC;IAED,gBAQC;;CACJ;yBA/4BY,OAAO,8DAA8D,EAAE,UAAU;6BACjF,OAAO,8BAA8B,EAAE,cAAc;kCACrD,OAAO,0BAA0B,EAAE,mBAAmB;gCACtD,OAAO,uCAAuC,EAAE,iBAAiB"}