@woosh/meep-engine 3.78.0 → 3.78.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (190) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +1 -1
  3. package/package.json +1 -1
  4. package/src/engine/graphics3/GraphicsEngine.d.ts +19 -1
  5. package/src/engine/graphics3/GraphicsEngine.d.ts.map +1 -1
  6. package/src/engine/graphics3/GraphicsEngine.js +24 -2
  7. package/src/engine/physics/cloth/solver/cloth_step.d.ts.map +1 -1
  8. package/src/engine/physics/cloth/solver/cloth_step.js +4 -1
  9. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts +36 -2
  10. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.d.ts.map +1 -1
  11. package/src/engine/physics/cloth/solver/constraint/cloth_contact_row.js +60 -3
  12. package/src/shade/device/pipeline/ComputePipelineManager.d.ts +8 -0
  13. package/src/shade/device/pipeline/ComputePipelineManager.d.ts.map +1 -1
  14. package/src/shade/device/pipeline/ComputePipelineManager.js +18 -0
  15. package/src/shade/device/pipeline/RenderPipelineManager.d.ts +8 -0
  16. package/src/shade/device/pipeline/RenderPipelineManager.d.ts.map +1 -1
  17. package/src/shade/device/pipeline/RenderPipelineManager.js +17 -0
  18. package/src/shade/playground/avboit_footprint/index.html +20 -0
  19. package/src/shade/playground/avboit_footprint/main.d.ts +2 -0
  20. package/src/shade/playground/avboit_footprint/main.d.ts.map +1 -0
  21. package/src/shade/playground/avboit_footprint/main.js +428 -0
  22. package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
  23. package/src/shade/playground/probe_clipmap/main.js +7 -3
  24. package/src/shade/playground/screen_probes/main.d.ts.map +1 -1
  25. package/src/shade/playground/screen_probes/main.js +7 -3
  26. package/src/shade/renderer/Renderer.d.ts +18 -8
  27. package/src/shade/renderer/Renderer.d.ts.map +1 -1
  28. package/src/shade/renderer/Renderer.js +201 -16
  29. package/src/shade/renderer/RendererConfiguration.d.ts +95 -0
  30. package/src/shade/renderer/RendererConfiguration.d.ts.map +1 -0
  31. package/src/shade/renderer/RendererConfiguration.js +119 -0
  32. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts +8 -0
  33. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.d.ts.map +1 -1
  34. package/src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js +34 -0
  35. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts +7 -0
  36. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.d.ts.map +1 -1
  37. package/src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.js +15 -0
  38. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +10 -2
  39. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
  40. package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +37 -3
  41. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +6 -0
  42. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
  43. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +31 -0
  44. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts +7 -0
  45. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.d.ts.map +1 -1
  46. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUBrickClipmap.js +20 -0
  47. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts +8 -0
  48. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.d.ts.map +1 -1
  49. package/src/shade/renderer/global_illumination/probe_clipmap/brick/GPUSceneBrickClipmap.js +14 -0
  50. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts +7 -0
  51. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.d.ts.map +1 -1
  52. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/MeshSDFBrickProvider.js +13 -0
  53. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts +6 -0
  54. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.d.ts.map +1 -1
  55. package/src/shade/renderer/global_illumination/probe_clipmap/material/GPUBrickMaterial.js +9 -0
  56. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts +11 -0
  57. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.d.ts.map +1 -1
  58. package/src/shade/renderer/global_illumination/probe_clipmap/probe/GPUProbeClipmap.js +71 -1
  59. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts +6 -0
  60. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.d.ts.map +1 -1
  61. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapHitWants.js +9 -0
  62. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts +6 -0
  63. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.d.ts.map +1 -1
  64. package/src/shade/renderer/global_illumination/probe_clipmap/probe/ProbeClipmapScreenWants.js +9 -0
  65. package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts +6 -0
  66. package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.d.ts.map +1 -1
  67. package/src/shade/renderer/global_illumination/probe_clipmap/probe/graph_probe_clipmap_want_meshlets.js +13 -0
  68. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +9 -0
  69. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts.map +1 -1
  70. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +47 -0
  71. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +6 -0
  72. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
  73. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +17 -0
  74. package/src/shade/renderer/particles/GPUParticleSystem.d.ts +8 -0
  75. package/src/shade/renderer/particles/GPUParticleSystem.d.ts.map +1 -1
  76. package/src/shade/renderer/particles/GPUParticleSystem.js +20 -1
  77. package/src/shade/renderer/particles/bounds/graph_particle_bounds.d.ts +6 -0
  78. package/src/shade/renderer/particles/bounds/graph_particle_bounds.d.ts.map +1 -1
  79. package/src/shade/renderer/particles/bounds/graph_particle_bounds.js +11 -1
  80. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts +6 -0
  81. package/src/shade/renderer/particles/coherence/graph_particle_bucket.d.ts.map +1 -1
  82. package/src/shade/renderer/particles/coherence/graph_particle_bucket.js +15 -0
  83. package/src/shade/renderer/particles/graph_particles.d.ts +8 -0
  84. package/src/shade/renderer/particles/graph_particles.d.ts.map +1 -1
  85. package/src/shade/renderer/particles/graph_particles.js +28 -3
  86. package/src/shade/renderer/particles/graph_particles_avboit.d.ts +7 -0
  87. package/src/shade/renderer/particles/graph_particles_avboit.d.ts.map +1 -1
  88. package/src/shade/renderer/particles/graph_particles_avboit.js +14 -0
  89. package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.d.ts.map +1 -1
  90. package/src/shade/renderer/particles/shaders/shader_particle_avboit_draw.js +5 -7
  91. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts +7 -0
  92. package/src/shade/renderer/particles/warmup/graph_particle_warmup.d.ts.map +1 -1
  93. package/src/shade/renderer/particles/warmup/graph_particle_warmup.js +15 -0
  94. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts +6 -0
  95. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.d.ts.map +1 -1
  96. package/src/shade/renderer/path_tracer/accumulating/AccumulatingPathTracer.js +16 -2
  97. package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.d.ts +6 -0
  98. package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.d.ts.map +1 -1
  99. package/src/shade/renderer/path_tracer/accumulating/graph_float32rgba_to_float16rgba.js +9 -0
  100. package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.d.ts +11 -0
  101. package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.d.ts.map +1 -1
  102. package/src/shade/renderer/path_tracer/accumulating/graph_flood_fill.js +10 -0
  103. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts +6 -0
  104. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts.map +1 -1
  105. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.js +10 -1
  106. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts +7 -0
  107. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts.map +1 -1
  108. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.js +21 -0
  109. package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.d.ts +7 -0
  110. package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.d.ts.map +1 -1
  111. package/src/shade/renderer/postprocess/dof/raymarch/DepthOfField.js +11 -1
  112. package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.d.ts +9 -0
  113. package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.d.ts.map +1 -1
  114. package/src/shade/renderer/postprocess/dof/raymarch/graph_postprocess_dof.js +29 -0
  115. package/src/shade/renderer/postprocess/motion_blur/MotionBlur.d.ts +6 -0
  116. package/src/shade/renderer/postprocess/motion_blur/MotionBlur.d.ts.map +1 -1
  117. package/src/shade/renderer/postprocess/motion_blur/MotionBlur.js +13 -1
  118. package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.d.ts +6 -0
  119. package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.d.ts.map +1 -1
  120. package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.js +11 -0
  121. package/src/shade/renderer/postprocess/nss/NSS.d.ts +9 -0
  122. package/src/shade/renderer/postprocess/nss/NSS.d.ts.map +1 -1
  123. package/src/shade/renderer/postprocess/nss/NSS.js +33 -18
  124. package/src/shade/renderer/postprocess/ssr/SSR.d.ts +8 -0
  125. package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
  126. package/src/shade/renderer/postprocess/ssr/SSR.js +42 -2
  127. package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.d.ts +6 -0
  128. package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.d.ts.map +1 -1
  129. package/src/shade/renderer/postprocess/ssr/ssr_graph_denoise_tiles.js +10 -0
  130. package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.d.ts +6 -0
  131. package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.d.ts.map +1 -1
  132. package/src/shade/renderer/postprocess/ssr/ssr_graph_prefilter_color.js +11 -0
  133. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts +8 -0
  134. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.d.ts.map +1 -1
  135. package/src/shade/renderer/rasterize/bucket/prepare_meshlet_draw_commands_by_material.js +27 -3
  136. package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.d.ts +6 -0
  137. package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.d.ts.map +1 -1
  138. package/src/shade/renderer/rasterize/native/avboit/AVBOITSettings.js +10 -0
  139. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts +5 -4
  140. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.d.ts.map +1 -1
  141. package/src/shade/renderer/rasterize/native/avboit/AVBOITSideChannel.js +5 -4
  142. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.d.ts +3 -3
  143. package/src/shade/renderer/rasterize/native/avboit/AVBOIT_CONSTANTS.js +3 -3
  144. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.d.ts.map +1 -1
  145. package/src/shade/renderer/rasterize/native/avboit/avboit_draw_fragment_body.js +5 -7
  146. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.d.ts.map +1 -1
  147. package/src/shade/renderer/rasterize/native/avboit/avboit_unlit_draw.js +5 -7
  148. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.d.ts +34 -0
  149. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.d.ts.map +1 -0
  150. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_depth.js +42 -0
  151. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.d.ts +5 -4
  152. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.d.ts.map +1 -1
  153. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_integral_depth_coordinate.js +8 -7
  154. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.d.ts +2 -2
  155. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.d.ts.map +1 -1
  156. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_sample_transmittance.js +4 -5
  157. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts +9 -0
  158. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.d.ts.map +1 -1
  159. package/src/shade/renderer/rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js +18 -0
  160. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts +9 -0
  161. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.d.ts.map +1 -1
  162. package/src/shade/renderer/rasterize/native/oit/graph_rasterize_meshes_transparent_oit.js +15 -0
  163. package/src/shade/renderer/restir/di/ReSTIRDI.d.ts +6 -0
  164. package/src/shade/renderer/restir/di/ReSTIRDI.d.ts.map +1 -1
  165. package/src/shade/renderer/restir/di/ReSTIRDI.js +10 -1
  166. package/src/shade/renderer/restir/di/graph_restir_di.d.ts +9 -0
  167. package/src/shade/renderer/restir/di/graph_restir_di.d.ts.map +1 -1
  168. package/src/shade/renderer/restir/di/graph_restir_di.js +19 -1
  169. package/src/shade/renderer/restir/di/graph_restir_di_denoise.d.ts +6 -0
  170. package/src/shade/renderer/restir/di/graph_restir_di_denoise.d.ts.map +1 -1
  171. package/src/shade/renderer/restir/di/graph_restir_di_denoise.js +9 -0
  172. package/src/shade/renderer/scene/movers/graph_scene_movers.d.ts +7 -0
  173. package/src/shade/renderer/scene/movers/graph_scene_movers.d.ts.map +1 -1
  174. package/src/shade/renderer/scene/movers/graph_scene_movers.js +11 -0
  175. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts +10 -0
  176. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.d.ts.map +1 -1
  177. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +25 -1
  178. package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.d.ts +7 -0
  179. package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.d.ts.map +1 -1
  180. package/src/shade/renderer/shadow/vsm/graph_vsm_feedback.js +14 -0
  181. package/src/shade/renderer/text/shaders/shader_text_avboit.d.ts.map +1 -1
  182. package/src/shade/renderer/text/shaders/shader_text_avboit.js +5 -7
  183. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts +9 -1
  184. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
  185. package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +16 -1
  186. package/src/shade/renderer/water/shader_water_avboit.d.ts.map +1 -1
  187. package/src/shade/renderer/water/shader_water_avboit.js +16 -13
  188. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.d.ts +0 -33
  189. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.d.ts.map +0 -1
  190. package/src/shade/renderer/rasterize/native/avboit/chunk_avboit_footprint_bias.js +0 -45
@@ -86,9 +86,11 @@ import {
86
86
  } from "./postprocess/velocity/graph_add_per_object_velocity.js";
87
87
  import { shader_debug_velocity } from "./postprocess/velocity/shader_debug_velocity.js";
88
88
  import {
89
+ enquire_rasterize_meshes_transparent_oit_pipelines,
89
90
  graph_rasterize_meshes_transparent_oit
90
91
  } from "./rasterize/native/oit/graph_rasterize_meshes_transparent_oit.js";
91
92
  import {
93
+ enquire_rasterize_meshes_transparent_avboit_pipelines,
92
94
  graph_rasterize_meshes_transparent_avboit
93
95
  } from "./rasterize/native/avboit/graph_rasterize_meshes_transparent_avboit.js";
94
96
  import {
@@ -102,6 +104,7 @@ import { RasterizationJob } from "./rasterize/RasterizationJob.js";
102
104
  import { enquire_rasterize_scene_pipelines, graph_rasterize_scene } from "./rasterize/standard/graph_rasterize_scene.js";
103
105
  import { ReSTIRDI } from "./restir/di/ReSTIRDI.js";
104
106
  import { GPUParticleSystem } from "./particles/GPUParticleSystem.js";
107
+ import { enquire_scene_movers_pipelines } from "./scene/movers/graph_scene_movers.js";
105
108
  import { SceneManager } from "./scene/SceneManager.js";
106
109
  import { ShadeIndirectLightingMode } from "./ShadeIndirectLightingMode.js";
107
110
  import { MaterialDispatch } from "./material/dispatch/MaterialDispatch.js";
@@ -113,6 +116,7 @@ import { graph_import_buffer } from "./shader/graph/graph_import_buffer.js";
113
116
  import { graph_import_texture } from "./shader/graph/graph_import_texture.js";
114
117
  import { ShadeUpscalerType } from "./ShadeUpscalerType.js";
115
118
  import { DEFAULT_SHADOWMAP_UPDATE_BUDGET } from "./shadow/map/DEFAULT_SHADOWMAP_UPDATE_BUDGET.js";
119
+ import { GPUSceneShadowmapContext } from "./shadow/map/GPUSceneShadowmapContext.js";
116
120
  import { SHADOW_DIRECTIONAL_TECHNIQUE } from "./shadow/map/shader/SHADOW_DIRECTIONAL_TECHNIQUE.js";
117
121
  import { INDIRECT_LIGHTING } from "./INDIRECT_LIGHTING.js";
118
122
  import { ShadowDirectionalTechnique } from "./shadow/map/ShadowDirectionalTechnique.js";
@@ -136,6 +140,7 @@ import { GPUViewVolumetrics } from "./volumetrics/GPUViewVolumetrics.js";
136
140
  * @typedef {import("./camera/PerspectiveCamera.js").PerspectiveCamera} PerspectiveCamera
137
141
  * @typedef {import("./extension/RenderExtension.js").RenderExtension} RenderExtension
138
142
  * @typedef {import("./rasterize/native/avboit/AVBOITSideChannel.js").AVBOITSideChannel} AVBOITSideChannel
143
+ * @typedef {import("./RendererConfiguration.js").RendererConfiguration} RendererConfiguration
139
144
  * @typedef {import("./scene/GPUSceneContext.js").GPUSceneContext} GPUSceneContext
140
145
  * @typedef {import("./scene/Scene.js").Scene} Scene
141
146
  */
@@ -1401,7 +1406,8 @@ export class Renderer {
1401
1406
  * Discard the history every temporal filter blends with.
1402
1407
  */
1403
1408
  #reset_temporal_filters() {
1404
- this.#postprocess.reset_history();
1409
+ // made by initialize, as the two below are: before it there is no history to reset
1410
+ this.#postprocess?.reset_history();
1405
1411
 
1406
1412
  this.#taa.reset_history = true;
1407
1413
 
@@ -1922,6 +1928,65 @@ export class Renderer {
1922
1928
  this.#context_needs_update = true;
1923
1929
  }
1924
1930
 
1931
+ /**
1932
+ * Set every field a {@link RendererConfiguration} holds, from it. The settings objects are copied by value, so
1933
+ * the renderer shares none with the configuration.
1934
+ *
1935
+ * @param {RendererConfiguration} configuration
1936
+ */
1937
+ #apply_configuration(configuration) {
1938
+ assert.equal(configuration.isRendererConfiguration, true, 'configuration.isRendererConfiguration !== true');
1939
+
1940
+ assert.enum(configuration.indirect_lighting_mode, ShadeIndirectLightingMode, 'configuration.indirect_lighting_mode');
1941
+ assert.enum(configuration.transparency_mode, ShadeTransparencyMode, 'configuration.transparency_mode');
1942
+ assert.enum(configuration.material_dispatch, MaterialDispatch, 'configuration.material_dispatch');
1943
+ assert.enum(configuration.upscale_type, ShadeUpscalerType, 'configuration.upscale_type');
1944
+ assert.ok(
1945
+ configuration.dof_algorithm === "raymarch" || configuration.dof_algorithm === "unreal",
1946
+ `configuration.dof_algorithm must be "raymarch" or "unreal", got '${configuration.dof_algorithm}'`
1947
+ );
1948
+ assert.isBoolean(configuration.feature_shadows_enabled, 'configuration.feature_shadows_enabled');
1949
+ assert.isBoolean(configuration.feature_virtual_shadow_maps, 'configuration.feature_virtual_shadow_maps');
1950
+ assert.isBoolean(configuration.feature_tetrahedron_point_shadows, 'configuration.feature_tetrahedron_point_shadows');
1951
+ assert.isBoolean(configuration.feature_restir_di_enabled, 'configuration.feature_restir_di_enabled');
1952
+ assert.isBoolean(configuration.feature_ssr_enabled, 'configuration.feature_ssr_enabled');
1953
+ assert.isBoolean(configuration.feature_ssao_enabled, 'configuration.feature_ssao_enabled');
1954
+ assert.isBoolean(configuration.feature_taa_enabled, 'configuration.feature_taa_enabled');
1955
+ assert.isBoolean(configuration.feature_sharpening_enabled, 'configuration.feature_sharpening_enabled');
1956
+ assert.isBoolean(configuration.feature_bloom_enabled, 'configuration.feature_bloom_enabled');
1957
+ assert.isBoolean(configuration.feature_automatic_exposure_enabled, 'configuration.feature_automatic_exposure_enabled');
1958
+ assert.isBoolean(configuration.feature_motion_blur_enabled, 'configuration.feature_motion_blur_enabled');
1959
+ assert.isBoolean(configuration.feature_dof_enabled, 'configuration.feature_dof_enabled');
1960
+ assert.isBoolean(configuration.feature_path_tracing_enabled, 'configuration.feature_path_tracing_enabled');
1961
+ assert.isBoolean(configuration.feature_particles_enabled, 'configuration.feature_particles_enabled');
1962
+
1963
+ this.indirect_lighting_mode = configuration.indirect_lighting_mode;
1964
+ this.probe_clipmap.copy(configuration.probe_clipmap);
1965
+ this.screen_probes.copy(configuration.screen_probes);
1966
+
1967
+ this.transparency_mode = configuration.transparency_mode;
1968
+ this.avboit.copy(configuration.avboit);
1969
+
1970
+ this.material_dispatch = configuration.material_dispatch;
1971
+ this.upscale_type = configuration.upscale_type;
1972
+ this.dof_algorithm = configuration.dof_algorithm;
1973
+
1974
+ this.feature_shadows_enabled = configuration.feature_shadows_enabled;
1975
+ this.feature_virtual_shadow_maps = configuration.feature_virtual_shadow_maps;
1976
+ this.feature_tetrahedron_point_shadows = configuration.feature_tetrahedron_point_shadows;
1977
+ this.feature_restir_di_enabled = configuration.feature_restir_di_enabled;
1978
+ this.feature_ssr_enabled = configuration.feature_ssr_enabled;
1979
+ this.feature_ssao_enabled = configuration.feature_ssao_enabled;
1980
+ this.feature_taa_enabled = configuration.feature_taa_enabled;
1981
+ this.feature_sharpening_enabled = configuration.feature_sharpening_enabled;
1982
+ this.feature_bloom_enabled = configuration.feature_bloom_enabled;
1983
+ this.feature_automatic_exposure_enabled = configuration.feature_automatic_exposure_enabled;
1984
+ this.feature_motion_blur_enabled = configuration.feature_motion_blur_enabled;
1985
+ this.feature_dof_enabled = configuration.feature_dof_enabled;
1986
+ this.feature_path_tracing_enabled = configuration.feature_path_tracing_enabled;
1987
+ this.feature_particles_enabled = configuration.feature_particles_enabled;
1988
+ }
1989
+
1925
1990
  /**
1926
1991
  * Rejects with a {@link ShadeDeviceFailure} when there is no usable device — no WebGPU, no
1927
1992
  * adapter, an adapter below {@link SHADE_DEVICE_FLOOR}, or a refused device request.
@@ -1930,13 +1995,22 @@ export class Renderer {
1930
1995
  * @param {GPUCanvasContext} [options.context] Optional, if not provided - one will be created.
1931
1996
  * @param {GPUDevice} [options.device] Optional, if not provided - one will be created.
1932
1997
  * @param {number} [options.pixelRatio] Optional, if not provided - will be taken from browser context
1998
+ * @param {RendererConfiguration} [options.configuration] What the renderer starts as: every field of it is
1999
+ * copied onto the renderer's field of the same name before anything is built, so the pipelines compiled ahead
2000
+ * of the first frame are the ones that configuration draws with. Read here and never again. Without one the
2001
+ * renderer starts as its fields stand.
1933
2002
  */
1934
2003
  async initialize({
1935
2004
  context,
1936
2005
  device,
1937
2006
  pixelRatio = window.devicePixelRatio,
2007
+ configuration,
1938
2008
  } = {}) {
1939
2009
 
2010
+ if (configuration !== undefined) {
2011
+ this.#apply_configuration(configuration);
2012
+ }
2013
+
1940
2014
  if (navigator.gpu === undefined) {
1941
2015
  throw ShadeDeviceFailure.webgpu_unavailable();
1942
2016
  }
@@ -2205,18 +2279,125 @@ export class Renderer {
2205
2279
  enquiry.render.push(shader_sky_view_lut.pipeline);
2206
2280
  enquiry.render.push(shader_background_sky.pipeline_for(color_formats));
2207
2281
 
2208
- if (this.indirect_lighting_mode === ShadeIndirectLightingMode.IBL) {
2209
- if (!this.feature_ssr_enabled) {
2210
- // what SSR replaces
2211
- enquiry.render.push(shader_specular_IBL.pipeline);
2282
+ // The passes that light the frame indirectly, as #graph_indirect_lighting records them for the mode. Without SSR
2283
+ // every mode but IBL lights both lobes in one pass; with it, the mode's diffuse is resolved with SSR's
2284
+ // specular.
2285
+ const mode = this.indirect_lighting_mode;
2286
+ const fused = !this.feature_ssr_enabled;
2287
+
2288
+ switch (mode) {
2289
+ case ShadeIndirectLightingMode.IBL:
2290
+ if (!this.feature_ssr_enabled) {
2291
+ // what SSR replaces
2292
+ enquiry.render.push(shader_specular_IBL.pipeline);
2293
+ }
2294
+
2295
+ enquiry.render.push(shader_diffuse_IBL.pipeline);
2296
+ enquiry.render.push(shader_resolve_indirect_lighting.pipeline_for(color_formats));
2297
+ break;
2298
+
2299
+ case ShadeIndirectLightingMode.ProbeClipmap:
2300
+ if (fused) {
2301
+ enquiry.render.push(shader_probe_clipmap_indirect_lighting.pipeline_for(color_formats));
2302
+ } else {
2303
+ enquiry.render.push(shader_probe_clipmap_diffuse.pipeline);
2304
+ enquiry.render.push(shader_resolve_indirect_lighting.pipeline_for(color_formats));
2305
+ }
2306
+ break;
2307
+
2308
+ case ShadeIndirectLightingMode.ScreenProbes:
2309
+ if (fused) {
2310
+ enquiry.render.push(shader_screen_probe_indirect_lighting.pipeline_for(color_formats));
2311
+ } else {
2312
+ enquiry.render.push(shader_screen_probe_diffuse.pipeline);
2313
+ enquiry.render.push(shader_resolve_indirect_lighting.pipeline_for(color_formats));
2314
+ }
2315
+ break;
2316
+
2317
+ case ShadeIndirectLightingMode.Brick4:
2318
+ if (fused) {
2319
+ enquiry.render.push(shader_brick4_indirect_lighting.pipeline_for(color_formats));
2320
+ } else {
2321
+ enquiry.render.push(shader_brick4_diffuse.pipeline);
2322
+ enquiry.render.push(shader_resolve_indirect_lighting.pipeline_for(color_formats));
2323
+ }
2324
+ break;
2325
+ }
2326
+
2327
+ // the world the probes are traced through and the probes themselves; the screen probes over that world
2328
+ if (mode === ShadeIndirectLightingMode.ProbeClipmap || mode === ShadeIndirectLightingMode.ScreenProbes) {
2329
+ // the world's bricks are built again where the scene's movers went
2330
+ enquire_scene_movers_pipelines(enquiry);
2331
+
2332
+ this.#probe_clipmap_gi.enquirePipelines(enquiry, this.probe_clipmap);
2333
+
2334
+ if (mode === ShadeIndirectLightingMode.ScreenProbes) {
2335
+ this.#screen_probe_gi.enquirePipelines(enquiry, this.screen_probes);
2212
2336
  }
2337
+ }
2213
2338
 
2214
- enquiry.render.push(shader_diffuse_IBL.pipeline);
2215
- enquiry.render.push(shader_resolve_indirect_lighting.pipeline_for(color_formats));
2339
+ if (this.feature_ssr_enabled) {
2340
+ this.#postprocess.ssr.enquirePipelines(enquiry, this.#shader_switches);
2216
2341
  }
2217
2342
 
2218
- if (this.feature_taa_enabled && this.upscale_type === ShadeUpscalerType.TAA) {
2219
- this.#taa.enquirePipelines(enquiry, this.#textures_taa_history[0].descriptor.format);
2343
+ if (this.feature_restir_di_enabled) {
2344
+ this.#restir_di.enquirePipelines(enquiry);
2345
+ }
2346
+
2347
+ // what the shadow maps' settings pick; virtual shadow maps read the scene's movers
2348
+ if (this.#feature_shadows_enabled) {
2349
+ GPUSceneShadowmapContext.enquireSettingPipelines(
2350
+ enquiry,
2351
+ this.feature_tetrahedron_point_shadows,
2352
+ this.feature_virtual_shadow_maps
2353
+ );
2354
+
2355
+ if (this.feature_virtual_shadow_maps) {
2356
+ enquire_scene_movers_pipelines(enquiry);
2357
+ }
2358
+ }
2359
+
2360
+ // The transparency pipeline's own passes, which run once anything is transparent: a material, or a side
2361
+ // channel. What draws a material is a pipeline of its template, and arrives with it.
2362
+ if (this.#feature_enabled_transparencies) {
2363
+ if (this.transparency_mode === ShadeTransparencyMode.AVBOIT) {
2364
+ enquire_rasterize_meshes_transparent_avboit_pipelines(enquiry);
2365
+ } else {
2366
+ enquire_rasterize_meshes_transparent_oit_pipelines(enquiry, color_formats[0]);
2367
+ }
2368
+ }
2369
+
2370
+ // simulated under either transparency mode, and drawn as a side channel of AVBOIT, lit by the irradiance
2371
+ // clipmap
2372
+ if (this.feature_particles_enabled) {
2373
+ GPUParticleSystem.enquirePipelines(enquiry);
2374
+ this.#volumetrics.irradiance_clipmap.enquirePipelines(enquiry, this.#shader_switches);
2375
+ }
2376
+
2377
+ if (this.feature_path_tracing_enabled) {
2378
+ AccumulatingPathTracer.enquirePipelines(enquiry);
2379
+ }
2380
+
2381
+ // one upscaler resolves a frame, whichever `upscale_type` names
2382
+ if (this.feature_taa_enabled) {
2383
+ if (this.upscale_type === ShadeUpscalerType.NSS) {
2384
+ NSS.enquirePipelines(enquiry);
2385
+ } else {
2386
+ this.#taa.enquirePipelines(enquiry, this.#textures_taa_history[0].descriptor.format);
2387
+ }
2388
+ }
2389
+
2390
+ // for a perspective camera, the only kind it is drawn for
2391
+ if (this.feature_dof_enabled) {
2392
+ if (this.dof_algorithm === "unreal") {
2393
+ this.#depth_of_field_unreal.enquirePipelines(enquiry);
2394
+ } else {
2395
+ this.#depth_of_field.enquirePipelines(enquiry);
2396
+ }
2397
+ }
2398
+
2399
+ if (this.feature_motion_blur_enabled) {
2400
+ this.#motion_blur.enquirePipelines(enquiry);
2220
2401
  }
2221
2402
 
2222
2403
  if (this.feature_sharpening_enabled) {
@@ -2239,13 +2420,17 @@ export class Renderer {
2239
2420
  * compiles the answer off the main thread, and {@link render} draws nothing until it is in.
2240
2421
  *
2241
2422
  * Each subsystem is asked only when the feature flag that runs it is on, so the answer follows the
2242
- * features as they are set at that moment. It covers the default renderer: the opaque raster,
2243
- * shading, IBL, ambient occlusion, TAA, sharpening, bloom, exposure and the tonemap. Everything
2244
- * else is made the old way, by the first frame that draws with it: the features that are off by
2245
- * default (ReSTIR's passes, SSR, depth of field, motion blur, NSS, path tracing), the indirect
2246
- * lighting modes other than IBL, a feature turned on after {@link initialize}, and whatever a
2247
- * scene's content brings — shadow casters, transparent and alpha-tested materials, volumes,
2248
- * particles.
2423
+ * features as they are set at that moment. It covers the opaque raster, shading, the indirect
2424
+ * lighting of whichever {@link indirect_lighting_mode} is set — with the world, the probes and the
2425
+ * screen probes of the modes that have them, as their settings stand — SSR, ReSTIR's passes, the
2426
+ * shadow maps' technique, the transparency mode's own passes, the particles, path tracing, ambient
2427
+ * occlusion, TAA or NSS as {@link upscale_type} picks, either depth of field, motion blur,
2428
+ * sharpening, bloom, exposure and the tonemap.
2429
+ *
2430
+ * What it leaves to the first frame that draws with it: the indirect lighting modes' debug
2431
+ * views, a feature turned on or a mode changed after {@link initialize}, and the pipelines a
2432
+ * scene's content brings, one a material template — its alpha-tested, transparent and
2433
+ * shadow-casting draws — and its volumes.
2249
2434
  *
2250
2435
  * @param {PipelineEnquiry} enquiry
2251
2436
  */
@@ -0,0 +1,95 @@
1
+ /**
2
+ * What a {@link Renderer} starts as: the settings that decide which pipelines a frame draws with.
3
+ *
4
+ * Handed to `Renderer.initialize`, which copies every field onto the renderer's field of the same name before it
5
+ * builds anything, so the pipelines it compiles ahead of the first frame are the ones this configuration draws with
6
+ * — see {@link PipelineEnquiry}. An engine application states it on `GraphicsEngine.renderer_configuration`, before
7
+ * the engine starts.
8
+ *
9
+ * Read once. After `initialize` the renderer's own fields are the state: they are read every frame and changed at
10
+ * any time, and a change to this object reaches no renderer already initialized.
11
+ *
12
+ * Every field has the name, the meaning and the default of the renderer's field it sets. A renderer setting that
13
+ * selects no pipeline is not here; set it on the renderer once `initialize` has resolved.
14
+ */
15
+ export class RendererConfiguration {
16
+ /**
17
+ * @returns {boolean}
18
+ */
19
+ get isRendererConfiguration(): boolean;
20
+ /**
21
+ * @type {ShadeIndirectLightingMode}
22
+ */
23
+ indirect_lighting_mode: ShadeIndirectLightingMode;
24
+ /**
25
+ * Settings of {@link ShadeIndirectLightingMode.ProbeClipmap}, and the world of
26
+ * {@link ShadeIndirectLightingMode.ScreenProbes}.
27
+ * @readonly
28
+ * @type {ProbeClipmapSettings}
29
+ */
30
+ readonly probe_clipmap: ProbeClipmapSettings;
31
+ /**
32
+ * Settings of {@link ShadeIndirectLightingMode.ScreenProbes}.
33
+ * @readonly
34
+ * @type {ScreenProbeSettings}
35
+ */
36
+ readonly screen_probes: ScreenProbeSettings;
37
+ /**
38
+ * @type {ShadeTransparencyMode}
39
+ */
40
+ transparency_mode: ShadeTransparencyMode;
41
+ /**
42
+ * Settings of {@link ShadeTransparencyMode.AVBOIT}.
43
+ * @readonly
44
+ * @type {AVBOITSettings}
45
+ */
46
+ readonly avboit: AVBOITSettings;
47
+ /**
48
+ * @type {MaterialDispatch}
49
+ */
50
+ material_dispatch: MaterialDispatch;
51
+ /**
52
+ * @type {ShadeUpscalerType}
53
+ */
54
+ upscale_type: ShadeUpscalerType;
55
+ /**
56
+ * @type {"raymarch"|"unreal"}
57
+ */
58
+ dof_algorithm: "raymarch" | "unreal";
59
+ /** @type {boolean} */
60
+ feature_shadows_enabled: boolean;
61
+ /** @type {boolean} */
62
+ feature_virtual_shadow_maps: boolean;
63
+ /** @type {boolean} */
64
+ feature_tetrahedron_point_shadows: boolean;
65
+ /** @type {boolean} */
66
+ feature_restir_di_enabled: boolean;
67
+ /** @type {boolean} */
68
+ feature_ssr_enabled: boolean;
69
+ /** @type {boolean} */
70
+ feature_ssao_enabled: boolean;
71
+ /** @type {boolean} */
72
+ feature_taa_enabled: boolean;
73
+ /** @type {boolean} */
74
+ feature_sharpening_enabled: boolean;
75
+ /** @type {boolean} */
76
+ feature_bloom_enabled: boolean;
77
+ /** @type {boolean} */
78
+ feature_automatic_exposure_enabled: boolean;
79
+ /** @type {boolean} */
80
+ feature_motion_blur_enabled: boolean;
81
+ /** @type {boolean} */
82
+ feature_dof_enabled: boolean;
83
+ /** @type {boolean} */
84
+ feature_path_tracing_enabled: boolean;
85
+ /** @type {boolean} */
86
+ feature_particles_enabled: boolean;
87
+ }
88
+ import { ShadeIndirectLightingMode } from "./ShadeIndirectLightingMode.js";
89
+ import { ProbeClipmapSettings } from "./global_illumination/probe_clipmap/ProbeClipmapSettings.js";
90
+ import { ScreenProbeSettings } from "./global_illumination/screen_probe/ScreenProbeSettings.js";
91
+ import { ShadeTransparencyMode } from "./ShadeTransparencyMode.js";
92
+ import { AVBOITSettings } from "./rasterize/native/avboit/AVBOITSettings.js";
93
+ import { MaterialDispatch } from "./material/dispatch/MaterialDispatch.js";
94
+ import { ShadeUpscalerType } from "./ShadeUpscalerType.js";
95
+ //# sourceMappingURL=RendererConfiguration.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RendererConfiguration.d.ts","sourceRoot":"","sources":["../../../../src/shade/renderer/RendererConfiguration.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;GAaG;AACH;IACI;;OAEG;IACH,uCAEC;IAED;;OAEG;IACH,wBAFU,yBAAyB,CAEoB;IAEvD;;;;;OAKG;IACH,wBAFU,oBAAoB,CAEa;IAE3C;;;;OAIG;IACH,wBAFU,mBAAmB,CAEa;IAE1C;;OAEG;IACH,mBAFU,qBAAqB,CAEkB;IAEjD;;;;OAIG;IACH,iBAFU,cAAc,CAEM;IAE9B;;OAEG;IACH,mBAFU,gBAAgB,CAEgB;IAE1C;;OAEG;IACH,cAFU,iBAAiB,CAEU;IAErC;;OAEG;IACH,eAFU,UAAU,GAAC,QAAQ,CAEF;IAE3B,sBAAsB;IACtB,yBADW,OAAO,CACa;IAE/B,sBAAsB;IACtB,6BADW,OAAO,CACkB;IAEpC,sBAAsB;IACtB,mCADW,OAAO,CACwB;IAE1C,sBAAsB;IACtB,2BADW,OAAO,CACgB;IAElC,sBAAsB;IACtB,qBADW,OAAO,CACU;IAE5B,sBAAsB;IACtB,sBADW,OAAO,CACU;IAE5B,sBAAsB;IACtB,qBADW,OAAO,CACS;IAE3B,sBAAsB;IACtB,4BADW,OAAO,CACgB;IAElC,sBAAsB;IACtB,uBADW,OAAO,CACW;IAE7B,sBAAsB;IACtB,oCADW,OAAO,CACwB;IAE1C,sBAAsB;IACtB,6BADW,OAAO,CACkB;IAEpC,sBAAsB;IACtB,qBADW,OAAO,CACU;IAE5B,sBAAsB;IACtB,8BADW,OAAO,CACmB;IAErC,sBAAsB;IACtB,2BADW,OAAO,CACgB;CACrC;0CAlHyC,gCAAgC;qCAJrC,6DAA6D;oCAC9D,2DAA2D;sCAIzD,4BAA4B;+BAFnC,6CAA6C;iCAD3C,yCAAyC;kCAIxC,wBAAwB"}
@@ -0,0 +1,119 @@
1
+ import { ProbeClipmapSettings } from "./global_illumination/probe_clipmap/ProbeClipmapSettings.js";
2
+ import { ScreenProbeSettings } from "./global_illumination/screen_probe/ScreenProbeSettings.js";
3
+ import { MaterialDispatch } from "./material/dispatch/MaterialDispatch.js";
4
+ import { AVBOITSettings } from "./rasterize/native/avboit/AVBOITSettings.js";
5
+ import { ShadeIndirectLightingMode } from "./ShadeIndirectLightingMode.js";
6
+ import { ShadeTransparencyMode } from "./ShadeTransparencyMode.js";
7
+ import { ShadeUpscalerType } from "./ShadeUpscalerType.js";
8
+
9
+ /**
10
+ * What a {@link Renderer} starts as: the settings that decide which pipelines a frame draws with.
11
+ *
12
+ * Handed to `Renderer.initialize`, which copies every field onto the renderer's field of the same name before it
13
+ * builds anything, so the pipelines it compiles ahead of the first frame are the ones this configuration draws with
14
+ * — see {@link PipelineEnquiry}. An engine application states it on `GraphicsEngine.renderer_configuration`, before
15
+ * the engine starts.
16
+ *
17
+ * Read once. After `initialize` the renderer's own fields are the state: they are read every frame and changed at
18
+ * any time, and a change to this object reaches no renderer already initialized.
19
+ *
20
+ * Every field has the name, the meaning and the default of the renderer's field it sets. A renderer setting that
21
+ * selects no pipeline is not here; set it on the renderer once `initialize` has resolved.
22
+ */
23
+ export class RendererConfiguration {
24
+ /**
25
+ * @returns {boolean}
26
+ */
27
+ get isRendererConfiguration() {
28
+ return true;
29
+ }
30
+
31
+ /**
32
+ * @type {ShadeIndirectLightingMode}
33
+ */
34
+ indirect_lighting_mode = ShadeIndirectLightingMode.IBL;
35
+
36
+ /**
37
+ * Settings of {@link ShadeIndirectLightingMode.ProbeClipmap}, and the world of
38
+ * {@link ShadeIndirectLightingMode.ScreenProbes}.
39
+ * @readonly
40
+ * @type {ProbeClipmapSettings}
41
+ */
42
+ probe_clipmap = new ProbeClipmapSettings();
43
+
44
+ /**
45
+ * Settings of {@link ShadeIndirectLightingMode.ScreenProbes}.
46
+ * @readonly
47
+ * @type {ScreenProbeSettings}
48
+ */
49
+ screen_probes = new ScreenProbeSettings();
50
+
51
+ /**
52
+ * @type {ShadeTransparencyMode}
53
+ */
54
+ transparency_mode = ShadeTransparencyMode.AVBOIT;
55
+
56
+ /**
57
+ * Settings of {@link ShadeTransparencyMode.AVBOIT}.
58
+ * @readonly
59
+ * @type {AVBOITSettings}
60
+ */
61
+ avboit = new AVBOITSettings();
62
+
63
+ /**
64
+ * @type {MaterialDispatch}
65
+ */
66
+ material_dispatch = MaterialDispatch.Quad;
67
+
68
+ /**
69
+ * @type {ShadeUpscalerType}
70
+ */
71
+ upscale_type = ShadeUpscalerType.TAA;
72
+
73
+ /**
74
+ * @type {"raymarch"|"unreal"}
75
+ */
76
+ dof_algorithm = "raymarch";
77
+
78
+ /** @type {boolean} */
79
+ feature_shadows_enabled = true;
80
+
81
+ /** @type {boolean} */
82
+ feature_virtual_shadow_maps = false;
83
+
84
+ /** @type {boolean} */
85
+ feature_tetrahedron_point_shadows = false;
86
+
87
+ /** @type {boolean} */
88
+ feature_restir_di_enabled = false;
89
+
90
+ /** @type {boolean} */
91
+ feature_ssr_enabled = false;
92
+
93
+ /** @type {boolean} */
94
+ feature_ssao_enabled = true;
95
+
96
+ /** @type {boolean} */
97
+ feature_taa_enabled = true;
98
+
99
+ /** @type {boolean} */
100
+ feature_sharpening_enabled = true;
101
+
102
+ /** @type {boolean} */
103
+ feature_bloom_enabled = true;
104
+
105
+ /** @type {boolean} */
106
+ feature_automatic_exposure_enabled = true;
107
+
108
+ /** @type {boolean} */
109
+ feature_motion_blur_enabled = false;
110
+
111
+ /** @type {boolean} */
112
+ feature_dof_enabled = false;
113
+
114
+ /** @type {boolean} */
115
+ feature_path_tracing_enabled = false;
116
+
117
+ /** @type {boolean} */
118
+ feature_particles_enabled = false;
119
+ }
@@ -58,6 +58,14 @@ export const MESH_SDF_BAKE_BUDGET_MAX: number;
58
58
  * Device storage is made on first use: a renderer that never asks for a cache allocates nothing.
59
59
  */
60
60
  export class GPUGeometrySDFManager {
61
+ /**
62
+ * Offer the pipelines the geometries' distance fields are baked, uploaded, deduplicated and freed with — see
63
+ * {@link PipelineEnquiry}. For whoever holds a cache: a renderer nothing asks a field of dispatches none. The
64
+ * surface caches' are {@link GPUMeshSurfaceCaches.enquirePipelines}.
65
+ *
66
+ * @param {import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
67
+ */
68
+ static enquirePipelines(enquiry: import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry): void;
61
69
  /**
62
70
  * @param {GPUDevice} device
63
71
  * @param {GPUGeometryManager} geometries whose ids the caches are kept by, and whose trees the bake reads
@@ -1 +1 @@
1
- {"version":3,"file":"GPUGeometrySDFManager.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer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AED;;;OAGG;IACH,8EAIC;IAED;;;;;;OAMG;IACH,mCAOC;IAED;;OAEG;IACH,+BAcC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH,sBANW,gBAAgB,WAChB,CAAC,mBAAmB,GAAC,IAAI,CAAC,EAAE,aAC5B,CAAC,aAAa,GAAC,IAAI,CAAC,EAAE,eACtB,OAAO,GACL,MAAM,CAiLlB;IA2CD;;;;;;;;;;;;;;OAcG;IACH,uBALW,mBAAmB,EAAE,UACrB,MAAM,EAAE,WACR,OAAO,GACL,QAAQ,gBAAgB,CAAC,CAuIrC;IAED;;;;;;;;;;;;;OAaG;IACH;QAP+B,KAAK,EAAzB,UAAU;QACM,MAAM,EAAtB,MAAM;QACW,cAAc,GAA/B,MAAM;QAEoC,SAAS,GAAnD,0BAA0B,GAAC,IAAI;aA+EzC;IA2+BD,gBAsCC;;CACJ;yBAvgFY,OAAO,8DAA8D,EAAE,UAAU;iCACjF,OAAO,0BAA0B,EAAE,kBAAkB;kCACrD,OAAO,2BAA2B,EAAE,mBAAmB;yCACvD,OAAO,uDAAuD,EAAE,0BAA0B;4BAC1F,OAAO,iCAAiC,EAAE,aAAa;qCAnB/B,mCAAmC;6BAOjE,eAAe;iCAVyD,8BAA8B"}
1
+ {"version":3,"file":"GPUGeometrySDFManager.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/geometry/sdf/GPUGeometrySDFManager.js"],"names":[],"mappings":"AAoLA;;;;GAIG;AACH,uCAFU,MAAM,CAEuH;AAoEvI;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AACH;IAEI;;;;;;OAMG;IACH,iCAFW,OAAO,6CAA6C,EAAE,eAAe,QA2B/E;IAiRD;;;OAGG;IACH,2CAFW,kBAAkB,EAS5B;IAhRD;;;;OAIG;IACH,aAAuB;IAEvB;;;;OAIG;IACH,iBAA2B;IAE3B;;;;OAIG;IACH,iBAA2B;IA+P3B;;;;;OAKG;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AE,WACR,OAAO,GACL,QAAQ,gBAAgB,CAAC,CAuIrC;IAED;;;;;;;;;;;;;OAaG;IACH;QAP+B,KAAK,EAAzB,UAAU;QACM,MAAM,EAAtB,MAAM;QACW,cAAc,GAA/B,MAAM;QAEoC,SAAS,GAAnD,0BAA0B,GAAC,IAAI;aA+EzC;IA2+BD,gBAsCC;;CACJ;yBAziFY,OAAO,8DAA8D,EAAE,UAAU;iCACjF,OAAO,0BAA0B,EAAE,kBAAkB;kCACrD,OAAO,2BAA2B,EAAE,mBAAmB;yCACvD,OAAO,uDAAuD,EAAE,0BAA0B;4BAC1F,OAAO,iCAAiC,EAAE,aAAa;qCAnB/B,mCAAmC;6BAOjE,eAAe;iCAVyD,8BAA8B"}
@@ -306,6 +306,40 @@ function grow_typed(array, length) {
306
306
  */
307
307
  export class GPUGeometrySDFManager {
308
308
 
309
+ /**
310
+ * Offer the pipelines the geometries' distance fields are baked, uploaded, deduplicated and freed with — see
311
+ * {@link PipelineEnquiry}. For whoever holds a cache: a renderer nothing asks a field of dispatches none. The
312
+ * surface caches' are {@link GPUMeshSurfaceCaches.enquirePipelines}.
313
+ *
314
+ * @param {import("../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
315
+ */
316
+ static enquirePipelines(enquiry) {
317
+ enquiry.compute.push(shader_slot_stack_fill.pipeline);
318
+ enquiry.compute.push(shader_slot_stack_push_range.pipeline);
319
+
320
+ // a bake
321
+ enquiry.compute.push(shader_mesh_sdf_take.pipeline);
322
+ enquiry.compute.push(shader_mesh_sdf_evaluate.pipeline);
323
+ enquiry.compute.push(shader_mesh_sdf_classify.pipeline);
324
+ enquiry.compute.push(shader_mesh_sdf_key.pipeline);
325
+ enquiry.compute.push(shader_mesh_sdf_resolve_find.pipeline);
326
+ enquiry.compute.push(shader_mesh_sdf_resolve_compare.pipeline);
327
+ enquiry.compute.push(shader_mesh_sdf_resolve_fresh.pipeline);
328
+ enquiry.compute.push(shader_mesh_sdf_resolve_hold.pipeline);
329
+ enquiry.compute.push(shader_mesh_sdf_store.pipeline);
330
+ enquiry.compute.push(shader_mesh_sdf_count.pipeline);
331
+ enquiry.compute.push(shader_mesh_sdf_free.pipeline);
332
+ enquiry.compute.push(shader_mesh_sdf_content_rehash.pipeline);
333
+
334
+ // a cache that arrives baked
335
+ enquiry.compute.push(shader_mesh_sdf_upload_key.pipeline);
336
+ enquiry.compute.push(shader_mesh_sdf_upload_find.pipeline);
337
+ enquiry.compute.push(shader_mesh_sdf_upload_compare.pipeline);
338
+ enquiry.compute.push(shader_mesh_sdf_upload_fresh.pipeline);
339
+ enquiry.compute.push(shader_mesh_sdf_upload_link.pipeline);
340
+ enquiry.compute.push(shader_mesh_sdf_upload_store.pipeline);
341
+ }
342
+
309
343
  /**
310
344
  * @type {GPUDevice}
311
345
  */
@@ -33,6 +33,13 @@
33
33
  * needs neither.
34
34
  */
35
35
  export class GPUMeshSurfaceCaches {
36
+ /**
37
+ * Offer the pipelines the surface caches are surveyed, baked and coded with — see {@link PipelineEnquiry}. For
38
+ * whoever has them baked: a frame that bakes none dispatches none.
39
+ *
40
+ * @param {import("../../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
41
+ */
42
+ static enquirePipelines(enquiry: import("../../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry): void;
36
43
  /**
37
44
  * @param {GPUDevice} device
38
45
  */
@@ -1 +1 @@
1
- {"version":3,"file":"GPUMeshSurfaceCaches.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.js"],"names":[],"mappings":"AAuHA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH;IAkNI;;OAEG;IACH,+BAIC;IAlND;;;;OAIG;IACH,aAAuB;IAEvB;;;;OAIG;IACH,iBAA2B;IAwM3B;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,6BAEC;IAED;;;OAGG;IACH,2BAEC;IAED;;;;OAIG;IACH,gC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,WAAW;QACC,SAAS,EAA7C,0BAA0B;QAEV,IAAI;aAiE9B;IA6UD;;OAEG;IACH,+BAUC;IAED,gBAgBC;;CACJ;yBApvDY,OAAO,iEAAiE,EAAE,UAAU;4BACpF,OAAO,oCAAoC,EAAE,aAAa;yCAC1D,OAAO,0DAA0D,EAAE,0BAA0B;yBAC7F,OAAO,yDAAyD,EAAE,UAAU;oCAC5E,OAAO,+BAA+B,EAAE,qBAAqB"}
1
+ {"version":3,"file":"GPUMeshSurfaceCaches.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/geometry/sdf/surface/GPUMeshSurfaceCaches.js"],"names":[],"mappings":"AAuHA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH;IAEI;;;;;OAKG;IACH,iCAFW,OAAO,gDAAgD,EAAE,eAAe,QASlF;IAkND;;OAEG;IACH,+BAIC;IAlND;;;;OAIG;IACH,aAAuB;IAEvB;;;;OAIG;IACH,iBAA2B;IAwM3B;;;OAGG;IACH,oBAEC;IAED;;;OAGG;IACH,6BAEC;IAED;;;OAGG;IACH,2BAEC;IAED;;;;OAIG;IACH,gCAKC;IAED;;;;;OAKG;IACH,gBAHW,MAAM,GACJ,OAAO,CAInB;IAED;;;;;OAKG;IACH,gBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;OAMG;IACH,gBAHW,MAAM,GACJ,aAAa,CAIzB;IAED;;;;;OAKG;IACH,oBAHW,MAAM,GACJ,MAAM,GAAC,SAAS,CAI5B;IAED;;;OAGG;IACH,yBAIC;IAED;;;;OAIG;IACH,sBAIC;IAED;;;;;;OAMG;IACH,mCAOC;IAED;;;;;;OAMG;IACH,kBAJW,MAAM,YACN,aAAa,GACX,MAAM,CAkClB;IAED;;OAEG;IACH,YAFW,MAAM,QA4BhB;IAED;;;;;;;OAOG;IACH,cAFW,MAAM,QAiDhB;IAED;;;;;;;;OAQG;IACH,qBALW,MAAM,UACN,MAAM,WACN,OAAO,QAuBjB;IAED;;;;;;;;;;;;;;;OAeG;IACH,uBAPW,MAAM,UACN,MAAM,WACN,OAAO,UACP,MAAM,SACN,WAAW,cACX;QAAC,QAAQ,EAAE,aAAa,CAAC;QAAC,KAAK,EAAE,qBAAqB,CAAA;KAAC,EAAE,QA+BnE;IA2CD;;;;;;;OAOG;IACH,uBAJW,MAAM,SACN,WAAW,GACT;QAAC,MAAM,EAAE,MAAM,CAAC;QAAC,KAAK,EAAE,WAAW,CAAA;KAAC,CAWhD;IAED;;;;;;;;;OASG;IACH,iBANW,MAAM,SACN,MAAM,SACN,WAAW,OACX,qBAAqB,GACnB,qBAAqB,CAqBjC;IA6BD;;;;;;OAMG;IACH,qBAHW,MAAM,UACN,MAAM,QAWhB;IAED;;;;OAIG;IACH,sBAFW,MAAM,QA0ChB;IAED;;;;;;;OAOG;IACH,aAHW,MAAM,UACN,MAAM,QAoChB;IAED;;;;;OAKG;IACH,eAFW,MAAM,QAIhB;IA8bD;;;;;;;;;;;;;;;OAeG;IACH;QAV+B,KAAK,EAAzB,UAAU;QACM,MAAM,EAAtB,MAAM;QAEU,KAAK,EAArB,MAAM;QACa,OAAO;QACF,WAAW;QACC,SAAS,EAA7C,0BAA0B;QAEV,IAAI;aAiE9B;IA6UD;;OAEG;IACH,+BAUC;IAED,gBAgBC;;CACJ;yBAnwDY,OAAO,iEAAiE,EAAE,UAAU;4BACpF,OAAO,oCAAoC,EAAE,aAAa;yCAC1D,OAAO,0DAA0D,EAAE,0BAA0B;yBAC7F,OAAO,yDAAyD,EAAE,UAAU;oCAC5E,OAAO,+BAA+B,EAAE,qBAAqB"}
@@ -153,6 +153,21 @@ function run_words(run, count, words) {
153
153
  */
154
154
  export class GPUMeshSurfaceCaches {
155
155
 
156
+ /**
157
+ * Offer the pipelines the surface caches are surveyed, baked and coded with — see {@link PipelineEnquiry}. For
158
+ * whoever has them baked: a frame that bakes none dispatches none.
159
+ *
160
+ * @param {import("../../../../device/pipeline/PipelineEnquiry.js").PipelineEnquiry} enquiry
161
+ */
162
+ static enquirePipelines(enquiry) {
163
+ enquiry.compute.push(shader_mesh_surface_survey.pipeline);
164
+ enquiry.compute.push(shader_mesh_surface_number.pipeline);
165
+ enquiry.compute.push(shader_mesh_surface_list.pipeline);
166
+ enquiry.compute.push(shader_mesh_surface_command.pipeline);
167
+ enquiry.compute.push(shader_mesh_surface_trace.pipeline);
168
+ enquiry.compute.push(shader_mesh_surface_encode.pipeline);
169
+ }
170
+
156
171
  /**
157
172
  * @type {GPUDevice}
158
173
  */