@woosh/meep-engine 3.78.3 → 3.79.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 (367) hide show
  1. package/CHANGELOG.md +80 -13
  2. package/editor/view/node-graph/NodeGraphView.d.ts +1 -1
  3. package/editor/view/node-graph/NodeGraphView.js +1 -1
  4. package/package.json +1 -1
  5. package/src/core/math/physics/brdf/fresnel_Schlick_optimized.d.ts +2 -1
  6. package/src/core/math/physics/brdf/fresnel_Schlick_optimized.d.ts.map +1 -1
  7. package/src/core/math/physics/brdf/fresnel_Schlick_optimized.js +2 -1
  8. package/src/core/math/snap_to_integer.d.ts +13 -0
  9. package/src/core/math/snap_to_integer.d.ts.map +1 -0
  10. package/src/core/math/snap_to_integer.js +20 -0
  11. package/src/core/model/node-graph/NodeGraph.d.ts +0 -1
  12. package/src/core/model/node-graph/NodeGraph.d.ts.map +1 -1
  13. package/src/core/model/node-graph/NodeGraph.js +0 -1
  14. package/src/engine/asset/GameAssetType.d.ts +2 -0
  15. package/src/engine/asset/GameAssetType.js +10 -0
  16. package/src/engine/asset/guessAssetType.d.ts.map +1 -1
  17. package/src/engine/asset/guessAssetType.js +4 -0
  18. package/src/engine/asset/load_model_scene_bundle.d.ts +1 -1
  19. package/src/engine/asset/load_model_scene_bundle.js +2 -2
  20. package/src/engine/asset/loaders/MTFSceneBundleAssetLoader.d.ts +42 -0
  21. package/src/engine/asset/loaders/MTFSceneBundleAssetLoader.d.ts.map +1 -0
  22. package/src/engine/asset/loaders/MTFSceneBundleAssetLoader.js +83 -0
  23. package/src/engine/asset/loaders/MTFTextureAssetLoader.d.ts +36 -0
  24. package/src/engine/asset/loaders/MTFTextureAssetLoader.d.ts.map +1 -0
  25. package/src/engine/asset/loaders/MTFTextureAssetLoader.js +78 -0
  26. package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.d.ts +6 -1
  27. package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.d.ts.map +1 -1
  28. package/src/engine/ecs/storage/binary/collection/BinaryCollectionSerializer.js +8 -2
  29. package/src/engine/graphics/hair/groom_bind_to_mesh.d.ts +1 -1
  30. package/src/engine/graphics/hair/groom_bind_to_mesh.js +1 -1
  31. package/src/engine/graphics/hair/groom_build_guides.d.ts +1 -1
  32. package/src/engine/graphics/hair/groom_build_guides.js +1 -1
  33. package/src/engine/graphics/impostors/voxel/README.md +11 -11
  34. package/src/engine/physics/cloth/collider/ClothColliderKind.js +1 -1
  35. package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +1 -1
  36. package/src/engine/physics/cloth/ecs/cloth_geodesic.js +1 -1
  37. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts +2 -3
  38. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts.map +1 -1
  39. package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.js +2 -3
  40. package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
  41. package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.d.ts +0 -2
  42. package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.d.ts.map +1 -1
  43. package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.js +0 -5
  44. package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerCubic.d.ts.map +1 -1
  45. package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerCubic.js +5 -3
  46. package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.d.ts.map +1 -1
  47. package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.js +5 -3
  48. package/src/generation/grid/coords/grid_to_texel.d.ts +7 -1
  49. package/src/generation/grid/coords/grid_to_texel.d.ts.map +1 -1
  50. package/src/generation/grid/coords/grid_to_texel.js +11 -1
  51. package/src/generation/grid/coords/grid_to_texel_span.d.ts +15 -0
  52. package/src/generation/grid/coords/grid_to_texel_span.d.ts.map +1 -0
  53. package/src/generation/grid/coords/grid_to_texel_span.js +38 -0
  54. package/src/generation/grid/coords/texel_to_grid.d.ts +2 -1
  55. package/src/generation/grid/coords/texel_to_grid.d.ts.map +1 -1
  56. package/src/generation/grid/coords/texel_to_grid.js +6 -1
  57. package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts +32 -1
  58. package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts.map +1 -1
  59. package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.js +114 -9
  60. package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts +8 -0
  61. package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
  62. package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +91 -29
  63. package/src/generation/grid/layers/GridDataLayer.d.ts +21 -2
  64. package/src/generation/grid/layers/GridDataLayer.d.ts.map +1 -1
  65. package/src/generation/grid/layers/GridDataLayer.js +43 -4
  66. package/src/generation/placement/action/GridCellActionPlaceTags.d.ts +7 -1
  67. package/src/generation/placement/action/GridCellActionPlaceTags.d.ts.map +1 -1
  68. package/src/generation/placement/action/GridCellActionPlaceTags.js +42 -16
  69. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.d.ts +5 -0
  70. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.d.ts.map +1 -1
  71. package/src/generation/placement/action/GridCellActionWriteFilterToLayer.js +32 -9
  72. package/src/generation/rules/CellMatcherLayerBitMaskTest.d.ts.map +1 -1
  73. package/src/generation/rules/CellMatcherLayerBitMaskTest.js +6 -2
  74. package/src/generation/wfc/GridWFCCompiledTileSet.d.ts +4 -2
  75. package/src/generation/wfc/GridWFCCompiledTileSet.d.ts.map +1 -1
  76. package/src/generation/wfc/GridWFCCompiledTileSet.js +2 -2
  77. package/src/generation/wfc/GridWFCTileSet.d.ts +16 -7
  78. package/src/generation/wfc/GridWFCTileSet.d.ts.map +1 -1
  79. package/src/generation/wfc/GridWFCTileSet.js +32 -8
  80. package/src/shade/playground/contact_shadows/shader_contact_lab_composite.js +2 -2
  81. package/src/shade/playground/particle_editor/README.md +2 -2
  82. package/src/shade/playground/probe_clipmap/index.html +1 -1
  83. package/src/shade/playground/screen_probes/README.md +5 -5
  84. package/src/shade/playground/screen_probes/main.js +1 -1
  85. package/src/shade/playground/tonemap_sdr/README.md +3 -2
  86. package/src/shade/playground/vgeo_scene/README.md +1 -3
  87. package/src/shade/playground/vgeo_scene/main.js +3 -3
  88. package/src/shade/renderer/Renderer.d.ts +3 -3
  89. package/src/shade/renderer/Renderer.js +4 -4
  90. package/src/shade/renderer/ShadeIndirectLightingMode.js +1 -1
  91. package/src/shade/renderer/acoustics/GPUAcousticLattice.d.ts +1 -1
  92. package/src/shade/renderer/acoustics/GPUAcousticProbes.d.ts +1 -1
  93. package/src/shade/renderer/acoustics/GPUAcoustics.d.ts +1 -1
  94. package/src/shade/renderer/animation/ShadeAnimationClipSerializationAdapter.d.ts +33 -0
  95. package/src/shade/renderer/animation/ShadeAnimationClipSerializationAdapter.d.ts.map +1 -0
  96. package/src/shade/renderer/animation/ShadeAnimationClipSerializationAdapter.js +196 -0
  97. package/src/shade/renderer/animation/SkinSerializationAdapter.d.ts +25 -0
  98. package/src/shade/renderer/animation/SkinSerializationAdapter.d.ts.map +1 -0
  99. package/src/shade/renderer/animation/SkinSerializationAdapter.js +85 -0
  100. package/src/shade/renderer/camera/PerspectiveCamera.js +1 -1
  101. package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts +11 -13
  102. package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts.map +1 -1
  103. package/src/shade/renderer/deferred/tonemap/ColorGrade.js +11 -13
  104. package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_ACES.d.ts.map +1 -1
  105. package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_ACES.js +6 -7
  106. package/src/shade/renderer/deferred/tonemap/ToneMapper.d.ts +1 -1
  107. package/src/shade/renderer/deferred/tonemap/ToneMapper.js +1 -1
  108. package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.d.ts +6 -8
  109. package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.d.ts.map +1 -1
  110. package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.js +7 -10
  111. package/src/shade/renderer/geometry/sdf/MESH_SDF.d.ts +1 -1
  112. package/src/shade/renderer/geometry/sdf/MESH_SDF.js +1 -1
  113. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts +1 -1
  114. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.js +1 -1
  115. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts +1 -1
  116. package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.js +1 -1
  117. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts +1 -2
  118. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts.map +1 -1
  119. package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.js +1 -2
  120. package/src/shade/renderer/geometry/sdf/chunk_scene_point_query_volume_sign.d.ts.map +1 -1
  121. package/src/shade/renderer/geometry/sdf/chunk_scene_point_query_volume_sign.js +2 -1
  122. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.d.ts +1 -1
  123. package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.js +1 -1
  124. package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_cluster_graph.js +1 -1
  125. package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.d.ts +2 -2
  126. package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.js +2 -2
  127. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.d.ts +2 -2
  128. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.js +4 -4
  129. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.d.ts +1 -1
  130. package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.js +1 -1
  131. package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.js +1 -1
  132. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.d.ts +3 -3
  133. package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.js +3 -3
  134. package/src/shade/renderer/global_illumination/brick4/README.md +2 -1
  135. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +4 -6
  136. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
  137. package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +4 -6
  138. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_MOVERS.d.ts +1 -1
  139. package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_MOVERS.js +1 -1
  140. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +1 -1
  141. package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +2 -2
  142. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.d.ts +1 -1
  143. package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.js +1 -1
  144. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +1 -1
  145. package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +1 -1
  146. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts +28 -35
  147. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts.map +1 -1
  148. package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js +28 -35
  149. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +21 -24
  150. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
  151. package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +21 -24
  152. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.d.ts +8 -8
  153. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js +8 -8
  154. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brdf_density.d.ts +4 -4
  155. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brdf_density.js +4 -4
  156. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.d.ts +3 -5
  157. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.d.ts.map +1 -1
  158. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.js +3 -5
  159. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_lighting_history.d.ts +4 -4
  160. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_lighting_history.js +4 -4
  161. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts +2 -3
  162. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts.map +1 -1
  163. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.js +2 -3
  164. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_screen_march.d.ts +4 -4
  165. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_screen_march.js +4 -4
  166. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.d.ts +2 -4
  167. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.d.ts.map +1 -1
  168. package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.js +2 -4
  169. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.d.ts +2 -4
  170. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.d.ts.map +1 -1
  171. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.js +2 -4
  172. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts +13 -17
  173. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts.map +1 -1
  174. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js +13 -17
  175. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.d.ts +11 -14
  176. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.d.ts.map +1 -1
  177. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.js +11 -14
  178. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.d.ts +2 -2
  179. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.js +2 -2
  180. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.d.ts +9 -9
  181. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.js +9 -9
  182. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts +15 -18
  183. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts.map +1 -1
  184. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.js +16 -19
  185. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.d.ts +10 -11
  186. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.d.ts.map +1 -1
  187. package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.js +11 -12
  188. package/src/shade/renderer/hair/GPUHairSystem.d.ts.map +1 -1
  189. package/src/shade/renderer/hair/GPUHairSystem.js +16 -7
  190. package/src/shade/renderer/hair/HAIR.d.ts +5 -3
  191. package/src/shade/renderer/hair/HAIR.d.ts.map +1 -1
  192. package/src/shade/renderer/hair/HAIR.js +6 -4
  193. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts +9 -8
  194. package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts.map +1 -1
  195. package/src/shade/renderer/hair/chunk_hair_bsdf.js +10 -9
  196. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts +5 -6
  197. package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts.map +1 -1
  198. package/src/shade/renderer/hair/chunk_hair_dual_scattering.js +5 -6
  199. package/src/shade/renderer/hair/hair_lighting.d.ts +3 -3
  200. package/src/shade/renderer/hair/hair_lighting.d.ts.map +1 -1
  201. package/src/shade/renderer/hair/hair_lighting.js +4 -5
  202. package/src/shade/renderer/hair/hair_scattering_lut.d.ts +5 -5
  203. package/src/shade/renderer/hair/hair_scattering_lut.js +5 -5
  204. package/src/shade/renderer/hair/hair_shadow_draw.d.ts +10 -10
  205. package/src/shade/renderer/hair/hair_shadow_draw.d.ts.map +1 -1
  206. package/src/shade/renderer/hair/hair_shadow_draw.js +21 -17
  207. package/src/shade/renderer/hair/shader_hair_cull.d.ts.map +1 -1
  208. package/src/shade/renderer/hair/shader_hair_cull.js +6 -2
  209. package/src/shade/renderer/hair/shader_hair_roots.d.ts +2 -2
  210. package/src/shade/renderer/hair/shader_hair_roots.js +2 -2
  211. package/src/shade/renderer/hair/shader_hair_shadow_list.d.ts +5 -4
  212. package/src/shade/renderer/hair/shader_hair_shadow_list.d.ts.map +1 -1
  213. package/src/shade/renderer/hair/shader_hair_shadow_list.js +10 -12
  214. package/src/shade/renderer/light/environment/DEFINES.d.ts +1 -1
  215. package/src/shade/renderer/light/environment/DEFINES.js +1 -1
  216. package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_blurred.js +2 -2
  217. package/src/shade/renderer/loader/SceneNodeSerializationAdapter.d.ts +38 -0
  218. package/src/shade/renderer/loader/SceneNodeSerializationAdapter.d.ts.map +1 -0
  219. package/src/shade/renderer/loader/SceneNodeSerializationAdapter.js +198 -0
  220. package/src/shade/renderer/loader/mtf/MTFTexture.d.ts +88 -0
  221. package/src/shade/renderer/loader/mtf/MTFTexture.d.ts.map +1 -0
  222. package/src/shade/renderer/loader/mtf/MTFTexture.js +159 -0
  223. package/src/shade/renderer/loader/mtf/MTFTextureSerializationAdapter.d.ts +30 -0
  224. package/src/shade/renderer/loader/mtf/MTFTextureSerializationAdapter.d.ts.map +1 -0
  225. package/src/shade/renderer/loader/mtf/MTFTextureSerializationAdapter.js +136 -0
  226. package/src/shade/renderer/loader/mtf/MTF_PACKAGE_MAGIC.d.ts +7 -0
  227. package/src/shade/renderer/loader/mtf/MTF_PACKAGE_MAGIC.d.ts.map +1 -0
  228. package/src/shade/renderer/loader/mtf/MTF_PACKAGE_MAGIC.js +6 -0
  229. package/src/shade/renderer/loader/mtf/MTF_PACKAGE_VERSION.d.ts +8 -0
  230. package/src/shade/renderer/loader/mtf/MTF_PACKAGE_VERSION.d.ts.map +1 -0
  231. package/src/shade/renderer/loader/mtf/MTF_PACKAGE_VERSION.js +7 -0
  232. package/src/shade/renderer/loader/mtf/MTF_TEXTURE_MAGIC.d.ts +7 -0
  233. package/src/shade/renderer/loader/mtf/MTF_TEXTURE_MAGIC.d.ts.map +1 -0
  234. package/src/shade/renderer/loader/mtf/MTF_TEXTURE_MAGIC.js +6 -0
  235. package/src/shade/renderer/loader/mtf/MTF_TEXTURE_VERSION.d.ts +7 -0
  236. package/src/shade/renderer/loader/mtf/MTF_TEXTURE_VERSION.d.ts.map +1 -0
  237. package/src/shade/renderer/loader/mtf/MTF_TEXTURE_VERSION.js +6 -0
  238. package/src/shade/renderer/loader/mtf/load_mtf.d.ts +41 -0
  239. package/src/shade/renderer/loader/mtf/load_mtf.d.ts.map +1 -0
  240. package/src/shade/renderer/loader/mtf/load_mtf.js +73 -0
  241. package/src/shade/renderer/loader/mtf/mtf_bundle_textures.d.ts +19 -0
  242. package/src/shade/renderer/loader/mtf/mtf_bundle_textures.d.ts.map +1 -0
  243. package/src/shade/renderer/loader/mtf/mtf_bundle_textures.js +57 -0
  244. package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts +9 -0
  245. package/src/shade/renderer/loader/mtf/mtf_encode_texture.d.ts.map +1 -0
  246. package/src/shade/renderer/loader/mtf/mtf_encode_texture.js +78 -0
  247. package/src/shade/renderer/loader/mtf/mtf_export.d.ts +45 -0
  248. package/src/shade/renderer/loader/mtf/mtf_export.d.ts.map +1 -0
  249. package/src/shade/renderer/loader/mtf/mtf_export.js +161 -0
  250. package/src/shade/renderer/loader/mtf/mtf_is_texture.d.ts +9 -0
  251. package/src/shade/renderer/loader/mtf/mtf_is_texture.d.ts.map +1 -0
  252. package/src/shade/renderer/loader/mtf/mtf_is_texture.js +12 -0
  253. package/src/shade/renderer/loader/mtf/mtf_read_collection.d.ts +24 -0
  254. package/src/shade/renderer/loader/mtf/mtf_read_collection.d.ts.map +1 -0
  255. package/src/shade/renderer/loader/mtf/mtf_read_collection.js +37 -0
  256. package/src/shade/renderer/loader/mtf/mtf_read_scene.d.ts +27 -0
  257. package/src/shade/renderer/loader/mtf/mtf_read_scene.d.ts.map +1 -0
  258. package/src/shade/renderer/loader/mtf/mtf_read_scene.js +121 -0
  259. package/src/shade/renderer/loader/mtf/mtf_read_textures.d.ts +18 -0
  260. package/src/shade/renderer/loader/mtf/mtf_read_textures.d.ts.map +1 -0
  261. package/src/shade/renderer/loader/mtf/mtf_read_textures.js +51 -0
  262. package/src/shade/renderer/loader/mtf/mtf_resolve_uri.d.ts +21 -0
  263. package/src/shade/renderer/loader/mtf/mtf_resolve_uri.d.ts.map +1 -0
  264. package/src/shade/renderer/loader/mtf/mtf_resolve_uri.js +98 -0
  265. package/src/shade/renderer/loader/mtf/mtf_serialization_registry.d.ts +25 -0
  266. package/src/shade/renderer/loader/mtf/mtf_serialization_registry.d.ts.map +1 -0
  267. package/src/shade/renderer/loader/mtf/mtf_serialization_registry.js +51 -0
  268. package/src/shade/renderer/loader/mtf/mtf_texture_read.d.ts +20 -0
  269. package/src/shade/renderer/loader/mtf/mtf_texture_read.d.ts.map +1 -0
  270. package/src/shade/renderer/loader/mtf/mtf_texture_read.js +80 -0
  271. package/src/shade/renderer/loader/mtf/mtf_texture_select.d.ts +24 -0
  272. package/src/shade/renderer/loader/mtf/mtf_texture_select.d.ts.map +1 -0
  273. package/src/shade/renderer/loader/mtf/mtf_texture_select.js +42 -0
  274. package/src/shade/renderer/loader/mtf/mtf_texture_write.d.ts +31 -0
  275. package/src/shade/renderer/loader/mtf/mtf_texture_write.d.ts.map +1 -0
  276. package/src/shade/renderer/loader/mtf/mtf_texture_write.js +87 -0
  277. package/src/shade/renderer/loader/mtf/mtf_write.d.ts +36 -0
  278. package/src/shade/renderer/loader/mtf/mtf_write.d.ts.map +1 -0
  279. package/src/shade/renderer/loader/mtf/mtf_write.js +161 -0
  280. package/src/shade/renderer/material/StandardShadeMaterialSerializationAdapter.d.ts +39 -0
  281. package/src/shade/renderer/material/StandardShadeMaterialSerializationAdapter.d.ts.map +1 -0
  282. package/src/shade/renderer/material/StandardShadeMaterialSerializationAdapter.js +207 -0
  283. package/src/shade/renderer/material/dispatch/MaterialDispatch.d.ts +1 -2
  284. package/src/shade/renderer/material/dispatch/MaterialDispatch.d.ts.map +1 -1
  285. package/src/shade/renderer/material/dispatch/MaterialDispatch.js +1 -2
  286. package/src/shade/renderer/material/standard/fragment_gbuffer.d.ts.map +1 -1
  287. package/src/shade/renderer/material/standard/fragment_gbuffer.js +2 -1
  288. package/src/shade/renderer/material/util/dielectric_specular_color.d.ts +1 -1
  289. package/src/shade/renderer/material/util/dielectric_specular_color.js +1 -1
  290. package/src/shade/renderer/postprocess/dof/gather/DOF2_CONFIG.d.ts +1 -1
  291. package/src/shade/renderer/postprocess/dof/gather/DOF2_CONFIG.js +1 -1
  292. package/src/shade/renderer/postprocess/dof/gather/DOF2_PRESETS.js +1 -1
  293. package/src/shade/renderer/postprocess/dof/gather/DOF2_SETTINGS_STRUCT.d.ts +1 -1
  294. package/src/shade/renderer/postprocess/dof/gather/DOF2_SETTINGS_STRUCT.js +1 -1
  295. package/src/shade/renderer/postprocess/dof/gather/DOF2_TEXTURE_FORMAT.d.ts +1 -1
  296. package/src/shade/renderer/postprocess/dof/gather/DOF2_TEXTURE_FORMAT.js +1 -1
  297. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts +3 -4
  298. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts.map +1 -1
  299. package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.js +3 -4
  300. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts +1 -1
  301. package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.js +1 -1
  302. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.d.ts +1 -1
  303. package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.js +1 -1
  304. package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts.map +1 -1
  305. package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.js +2 -3
  306. package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.d.ts +1 -2
  307. package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.d.ts.map +1 -1
  308. package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.js +1 -2
  309. package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.d.ts +2 -3
  310. package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.d.ts.map +1 -1
  311. package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.js +2 -3
  312. package/src/shade/renderer/postprocess/taa/filter_blackman_harris.d.ts +1 -1
  313. package/src/shade/renderer/postprocess/taa/filter_blackman_harris.js +1 -1
  314. package/src/shade/renderer/rasterize/native/depth/shadow_cascade_rasterization_pass_descriptor.d.ts +1 -1
  315. package/src/shade/renderer/rasterize/native/depth/shadow_cascade_rasterization_pass_descriptor.js +1 -1
  316. package/src/shade/renderer/rasterize/native/depth/shadow_rasterization_alpha_tested_pass_descriptor.js +1 -1
  317. package/src/shade/renderer/restir/di/ReSTIRDI.d.ts +3 -3
  318. package/src/shade/renderer/restir/di/ReSTIRDI.js +3 -3
  319. package/src/shade/renderer/restir/di/chunk_restir_trace_visibility.d.ts +1 -1
  320. package/src/shade/renderer/restir/di/chunk_restir_trace_visibility.js +1 -1
  321. package/src/shade/renderer/scene/optimization/source_to_sampler2d.d.ts.map +1 -1
  322. package/src/shade/renderer/scene/optimization/source_to_sampler2d.js +3 -1
  323. package/src/shade/renderer/scene/serialization/STANDARD_MATERIAL_SERIALIZED_BYTE_SIZE.d.ts +5 -5
  324. package/src/shade/renderer/scene/serialization/STANDARD_MATERIAL_SERIALIZED_BYTE_SIZE.js +5 -5
  325. package/src/shade/renderer/scene/serialization/deserialize_scene.d.ts.map +1 -1
  326. package/src/shade/renderer/scene/serialization/deserialize_scene.js +491 -528
  327. package/src/shade/renderer/scene/serialization/serialize_scene.d.ts +0 -10
  328. package/src/shade/renderer/scene/serialization/serialize_scene.d.ts.map +1 -1
  329. package/src/shade/renderer/scene/serialization/serialize_scene.js +15 -71
  330. package/src/shade/renderer/shader/chunk/brdf/chunk_MIN_DIELECTRICS_F0.d.ts +1 -1
  331. package/src/shade/renderer/shader/chunk/brdf/chunk_MIN_DIELECTRICS_F0.js +1 -1
  332. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts +1 -2
  333. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts.map +1 -1
  334. package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.js +1 -2
  335. package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.d.ts +4 -5
  336. package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.d.ts.map +1 -1
  337. package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.js +4 -5
  338. package/src/shade/renderer/shader/chunk/color/grade/chunk_color_grade.js +2 -2
  339. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.d.ts +2 -2
  340. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.js +2 -2
  341. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.d.ts +14 -17
  342. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.d.ts.map +1 -1
  343. package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.js +18 -21
  344. package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris.d.ts +1 -1
  345. package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris.js +1 -1
  346. package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris229.d.ts +1 -1
  347. package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris229.js +1 -1
  348. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts +3 -4
  349. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -1
  350. package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +3 -4
  351. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.d.ts +1 -1
  352. package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.js +1 -1
  353. package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +3 -3
  354. package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.d.ts +6 -8
  355. package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.d.ts.map +1 -1
  356. package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.js +8 -10
  357. package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.d.ts +5 -7
  358. package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.d.ts.map +1 -1
  359. package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.js +5 -7
  360. package/src/shade/renderer/texture/format/gpu_texture_format_without_srgb.d.ts +11 -0
  361. package/src/shade/renderer/texture/format/gpu_texture_format_without_srgb.d.ts.map +1 -0
  362. package/src/shade/renderer/texture/format/gpu_texture_format_without_srgb.js +14 -0
  363. package/src/shade/renderer/texture/texture_role_image_quality.d.ts +10 -0
  364. package/src/shade/renderer/texture/texture_role_image_quality.d.ts.map +1 -0
  365. package/src/shade/renderer/texture/texture_role_image_quality.js +29 -0
  366. package/src/shade/renderer/texture/virtual/README.md +257 -257
  367. package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +2 -2
@@ -1,13 +1,3 @@
1
- /**
2
- * @typedef {import("../../loader/SceneBundle.js").SceneBundle} SceneBundle
3
- */
4
- /**
5
- *
6
- * @param {BinaryBuffer} buffer
7
- * @param {StandardShadeMaterial} material
8
- * @param {Map<ShadeTexture, number>} texture_lookup
9
- */
10
- export function material_write_standard(buffer: BinaryBuffer, material: StandardShadeMaterial, texture_lookup: Map<ShadeTexture, number>): void;
11
1
  /**
12
2
  *
13
3
  * @param {Object} options
@@ -1 +1 @@
1
- {"version":3,"file":"serialize_scene.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/scene/serialization/serialize_scene.js"],"names":[],"mappings":"AAOA;;GAEG;AAGH;;;;;GAKG;AACH,gDAJW,YAAY,mDAEZ,kBAAkB,MAAM,CAAC,QAsDnC;AAoJD;;;;;;;GAOG;AACH;IALgC,MAAM,EAA3B,WAAW;IAEI,KAAK;IACF,YAAY,GAA9B,OAAO;0BAiQjB;0BAzdY,OAAO,6BAA6B,EAAE,WAAW;6BAPjC,yCAAyC"}
1
+ {"version":3,"file":"serialize_scene.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/scene/serialization/serialize_scene.js"],"names":[],"mappings":"AAkKA;;;;;;;GAOG;AACH;IALgC,MAAM,EAA3B,WAAW;IAEI,KAAK;IACF,YAAY,GAA9B,OAAO;0BAiQjB;0BA9ZY,OAAO,6BAA6B,EAAE,WAAW;6BAVjC,yCAAyC"}
@@ -2,6 +2,9 @@ import { assert } from "../../../../core/assert.js";
2
2
  import { BinaryBuffer } from "../../../../core/binary/BinaryBuffer.js";
3
3
  import { dataTypeIndex } from "../../../../core/binary/type/DataTypeIndices.js";
4
4
  import { MeshletGeometrySerializationAdapter } from "../../geometry/MeshletGeometrySerializationAdapter.js";
5
+ import { StandardShadeMaterialSerializationAdapter } from "../../material/StandardShadeMaterialSerializationAdapter.js";
6
+ import { texture_role_image_quality } from "../../texture/texture_role_image_quality.js";
7
+ import { TextureRole } from "../../texture/TextureRole.js";
5
8
  import { LightTypeSerializationIndex } from "./LightTypeSerializationIndex.js";
6
9
  import { write_image_source } from "./write_image_source.js";
7
10
 
@@ -10,66 +13,6 @@ import { write_image_source } from "./write_image_source.js";
10
13
  */
11
14
 
12
15
 
13
- /**
14
- *
15
- * @param {BinaryBuffer} buffer
16
- * @param {StandardShadeMaterial} material
17
- * @param {Map<ShadeTexture, number>} texture_lookup
18
- */
19
- export function material_write_standard(buffer, material, texture_lookup) {
20
-
21
- assert.defined(material, 'material');
22
- assert.equal(material.isStandardShadeMaterial, true, 'material.isStandardShadeMaterial !== true');
23
-
24
- /**
25
- *
26
- * @param {ShadeTexture} texture
27
- */
28
- function texture_to_id(texture) {
29
- if (texture === undefined) {
30
- // special NULL value
31
- return 0xffffffff;
32
- }
33
-
34
- assert.defined(texture, 'texture');
35
-
36
- const index = texture_lookup.get(texture);
37
-
38
- assert.isNonNegativeInteger(index, 'index');
39
-
40
- return index;
41
-
42
- }
43
-
44
- // textures
45
- buffer.writeUint32(texture_to_id(material.texture_albedo));
46
- buffer.writeUint32(texture_to_id(material.texture_normal));
47
- buffer.writeUint32(texture_to_id(material.texture_orm));
48
- buffer.writeUint32(texture_to_id(material.texture_emissive));
49
-
50
- // v2: colors and factors as floats — uint32 quantization clamped HDR emissive/diffuse
51
- // values to [0,1] and the format had no transmission/ior at all
52
- buffer.writeFloat32(material.diffuse_color.r);
53
- buffer.writeFloat32(material.diffuse_color.g);
54
- buffer.writeFloat32(material.diffuse_color.b);
55
- buffer.writeFloat32(material.diffuse_color.a);
56
-
57
- buffer.writeFloat32(material.roughness_factor);
58
- buffer.writeFloat32(material.metallic_factor);
59
-
60
- buffer.writeFloat32(material.emissive_factor.r);
61
- buffer.writeFloat32(material.emissive_factor.g);
62
- buffer.writeFloat32(material.emissive_factor.b);
63
- buffer.writeFloat32(material.emissive_factor.a);
64
-
65
- buffer.writeFloat32(material.transmission_factor);
66
- buffer.writeFloat32(material.ior_factor);
67
-
68
- buffer.writeFloat32(material.ambient_factors.a);
69
- buffer.writeFloat32(material.ambient_factors.b);
70
-
71
- }
72
-
73
16
  /**
74
17
  *
75
18
  * @param {BinaryBuffer} buffer
@@ -167,20 +110,21 @@ function build_texture_usage_mask(materials) {
167
110
  */
168
111
  function image_compression_quality_from_usage(usage) {
169
112
 
113
+ // an image several slots use is encoded for the one an error costs most in
170
114
  if ((usage & TextureUsageFlags.Normal) !== 0) {
171
- return 0.75;
115
+ return texture_role_image_quality(TextureRole.Normal);
172
116
  }
173
117
 
174
118
  if ((usage & TextureUsageFlags.Albedo) !== 0) {
175
- return 0.5;
119
+ return texture_role_image_quality(TextureRole.Albedo);
176
120
  }
177
121
 
178
122
  if ((usage & TextureUsageFlags.Orm) !== 0) {
179
- return 0.4;
123
+ return texture_role_image_quality(TextureRole.Orm);
180
124
  }
181
125
 
182
126
  if ((usage & TextureUsageFlags.Emissive) !== 0) {
183
- return 0.4;
127
+ return texture_role_image_quality(TextureRole.Emissive);
184
128
  }
185
129
 
186
130
  // default
@@ -379,17 +323,17 @@ export async function serialize_scene({
379
323
  adapter_geometry.serialize(buffer, geometry);
380
324
  }
381
325
 
382
- // write materials
326
+ // write materials: each names its textures by their place among the textures written below
327
+ const adapter_material = new StandardShadeMaterialSerializationAdapter();
328
+ adapter_material.initialize(Array.from(textures));
329
+
383
330
  buffer.writeUint32(materials.size);
384
331
  for (const material of materials) {
385
- buffer.writeUTF8String(material.name);
386
- buffer.writeUint32(material.transparency_mode);
387
- buffer.writeUint32(material.draw_mode);
388
- buffer.writeUint32(material.draw_side);
389
-
390
- material_write_standard(buffer, material, texture_indices);
332
+ adapter_material.serialize(buffer, material);
391
333
  }
392
334
 
335
+ adapter_material.finalize();
336
+
393
337
  // write textures
394
338
  buffer.writeUint32(textures.size);
395
339
  for (const texture of textures) {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Specifies minimal reflectance for dielectrics (when metalness is zero)
3
- * Nothing has lower reflectance than 2%, but we use 4% to have consistent results with UE4, Frostbite, et al.
3
+ * Nothing has lower reflectance than 2%, but we use 4% to have consistent results with Frostbite, et al.
4
4
  * @type {CodeChunk}
5
5
  */
6
6
  export const chunk_MIN_DIELECTRICS_F0: CodeChunk;
@@ -3,7 +3,7 @@ import { CodeChunk } from "../../compiler/CodeChunk.js";
3
3
 
4
4
  /**
5
5
  * Specifies minimal reflectance for dielectrics (when metalness is zero)
6
- * Nothing has lower reflectance than 2%, but we use 4% to have consistent results with UE4, Frostbite, et al.
6
+ * Nothing has lower reflectance than 2%, but we use 4% to have consistent results with Frostbite, et al.
7
7
  * @type {CodeChunk}
8
8
  */
9
9
  export const chunk_MIN_DIELECTRICS_F0 = CodeChunk.from(
@@ -4,8 +4,7 @@
4
4
  *
5
5
  * No material reflects less than 2% head-on, so a lower authored F0 is not a material's but an author's way of
6
6
  * saying "less specular", down to none at 0: a black metal. Schlick's Fresnel with F90 held at 1 still returns
7
- * `(1 - VoH)^5` of the light there, so F90 follows F0 down. UE does the same with the same 2% (`F_Schlick` and
8
- * `EnvBRDF` in `BRDF.ush`, `saturate(50 * SpecularColor.g)`), after Schuler, "An Efficient and Physically
7
+ * `(1 - VoH)^5` of the light there, so F90 follows F0 down, after Schuler, "An Efficient and Physically
9
8
  * Plausible Real-Time Shading Model", ShaderX7, and Hoffman 2010, "Crafting Physically Motivated Shading Models
10
9
  * for Game Development".
11
10
  *
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_shadowed_F90.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;GAgBG;AACH,iCAFU,SAAS,CAcjB;0BAhCwB,6BAA6B"}
1
+ {"version":3,"file":"chunk_shadowed_F90.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;GAeG;AACH,iCAFU,SAAS,CAcjB;0BA/BwB,6BAA6B"}
@@ -7,8 +7,7 @@ import { chunk_rgb_to_luminance } from "../color/chunk_rgb_to_luminance.js";
7
7
  *
8
8
  * No material reflects less than 2% head-on, so a lower authored F0 is not a material's but an author's way of
9
9
  * saying "less specular", down to none at 0: a black metal. Schlick's Fresnel with F90 held at 1 still returns
10
- * `(1 - VoH)^5` of the light there, so F90 follows F0 down. UE does the same with the same 2% (`F_Schlick` and
11
- * `EnvBRDF` in `BRDF.ush`, `saturate(50 * SpecularColor.g)`), after Schuler, "An Efficient and Physically
10
+ * `(1 - VoH)^5` of the light there, so F90 follows F0 down, after Schuler, "An Efficient and Physically
12
11
  * Plausible Real-Time Shading Model", ShaderX7, and Hoffman 2010, "Crafting Physically Motivated Shading Models
13
12
  * for Game Development".
14
13
  *
@@ -1,6 +1,5 @@
1
1
  /**
2
- * Linear Rec.709 (D65) to AP1 (ACES white), Bradford-adapted, as Unreal's `WorkingColorSpace.ToAP1` for an sRGB
3
- * working space. Row-major.
2
+ * Linear Rec.709 (D65) to AP1 (ACES white), Bradford-adapted. Row-major.
4
3
  * @type {Float64Array}
5
4
  */
6
5
  export const M3_REC709_TO_AP1: Float64Array;
@@ -10,14 +9,14 @@ export const M3_REC709_TO_AP1: Float64Array;
10
9
  */
11
10
  export const M3_AP1_TO_REC709: Float64Array;
12
11
  /**
13
- * AP1's contribution of each channel to Y, the row Unreal calls `AP1_RGB2Y`: the shader's `AP1_LUMINANCE`, for code that
14
- * measures AP1 luma on the CPU.
12
+ * AP1's contribution of each channel to Y, the Y row of the AP1-to-XYZ matrix: the shader's `AP1_LUMINANCE`, for code
13
+ * that measures AP1 luma on the CPU.
15
14
  * @type {Float64Array}
16
15
  */
17
16
  export const AP1_LUMINANCE: Float64Array;
18
17
  /**
19
18
  * - `CRM_FROM_REC709_TO_AP1` and `CRM_FROM_AP1_TO_REC709`: {@link M3_REC709_TO_AP1} and its inverse.
20
- * - `AP1_LUMINANCE`: AP1's contribution of each channel to Y, the row Unreal calls `AP1_RGB2Y`.
19
+ * - `AP1_LUMINANCE`: AP1's contribution of each channel to Y, the Y row of the AP1-to-XYZ matrix.
21
20
  *
22
21
  * Derived from the two spaces' chromaticities, so neither matrix is a rounded transcription of the other.
23
22
  *
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_CRM_REC709_AP1.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.js"],"names":[],"mappings":"AAqBA;;;;GAIG;AACH,+BAFU,YAAY,CAE8B;AAIpD;;;GAGG;AACH,+BAFU,YAAY,CAE8B;AAGpD;;;;GAIG;AACH,4BAFU,YAAY,CAEoE;AAW1F;;;;;;;GAOG;AACH,mCAFU,SAAS,CASjB;0BAhEwB,gCAAgC"}
1
+ {"version":3,"file":"chunk_CRM_REC709_AP1.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.js"],"names":[],"mappings":"AAqBA;;;GAGG;AACH,+BAFU,YAAY,CAE8B;AAIpD;;;GAGG;AACH,+BAFU,YAAY,CAE8B;AAGpD;;;;GAIG;AACH,4BAFU,YAAY,CAEoE;AAW1F;;;;;;;GAOG;AACH,mCAFU,SAAS,CASjB;0BA/DwB,gCAAgC"}
@@ -20,8 +20,7 @@ const D65_TO_ACES_WHITE = new Float64Array(9);
20
20
  m3_chromatic_adaptation_bradford(D65_TO_ACES_WHITE, 0.3127, 0.3290, AP1_WHITE_X, AP1_WHITE_Y);
21
21
 
22
22
  /**
23
- * Linear Rec.709 (D65) to AP1 (ACES white), Bradford-adapted, as Unreal's `WorkingColorSpace.ToAP1` for an sRGB
24
- * working space. Row-major.
23
+ * Linear Rec.709 (D65) to AP1 (ACES white), Bradford-adapted. Row-major.
25
24
  * @type {Float64Array}
26
25
  */
27
26
  export const M3_REC709_TO_AP1 = new Float64Array(9);
@@ -36,8 +35,8 @@ export const M3_AP1_TO_REC709 = new Float64Array(9);
36
35
  m3_invert(M3_AP1_TO_REC709, M3_REC709_TO_AP1);
37
36
 
38
37
  /**
39
- * AP1's contribution of each channel to Y, the row Unreal calls `AP1_RGB2Y`: the shader's `AP1_LUMINANCE`, for code that
40
- * measures AP1 luma on the CPU.
38
+ * AP1's contribution of each channel to Y, the Y row of the AP1-to-XYZ matrix: the shader's `AP1_LUMINANCE`, for code
39
+ * that measures AP1 luma on the CPU.
41
40
  * @type {Float64Array}
42
41
  */
43
42
  export const AP1_LUMINANCE = Float64Array.of(AP1_TO_XYZ[3], AP1_TO_XYZ[4], AP1_TO_XYZ[5]);
@@ -53,7 +52,7 @@ function wgsl_mat3(m) {
53
52
 
54
53
  /**
55
54
  * - `CRM_FROM_REC709_TO_AP1` and `CRM_FROM_AP1_TO_REC709`: {@link M3_REC709_TO_AP1} and its inverse.
56
- * - `AP1_LUMINANCE`: AP1's contribution of each channel to Y, the row Unreal calls `AP1_RGB2Y`.
55
+ * - `AP1_LUMINANCE`: AP1's contribution of each channel to Y, the Y row of the AP1-to-XYZ matrix.
57
56
  *
58
57
  * Derived from the two spaces' chromaticities, so neither matrix is a rounded transcription of the other.
59
58
  *
@@ -20,7 +20,7 @@ import { chunk_oklab_to_linear_srgb } from "../oklab/chunk_oklab_to_linear_srgb.
20
20
  export const chunk_color_grade = CodeChunk.from(
21
21
  //language=WGSL
22
22
  `
23
- // Unreal's ColorCorrect: one zone's grade, in AP1
23
+ // one zone's grade, in AP1: saturation about the luma, contrast about 0.18, gamma, gain, offset
24
24
  fn color_grade_correct(
25
25
  color: vec3<f32>,
26
26
  saturation: vec3<f32>,
@@ -38,7 +38,7 @@ fn color_grade_correct(
38
38
  return c * gain + offset;
39
39
  }
40
40
 
41
- // Unreal's ColorCorrectAll: the three zones, blended by luma
41
+ // the primaries: the three zones, blended by luma
42
42
  fn color_grade_primaries(ap1: vec3<f32>, grade: ${COLOR_GRADE_STRUCT.wgsl_ref}) -> vec3<f32> {
43
43
  let luma = dot(ap1, AP1_LUMINANCE);
44
44
 
@@ -1,8 +1,8 @@
1
1
  /**
2
- * The colour matrices of Unreal Engine 5.4's default tone mapping, each the product of the standard colour-space
2
+ * The colour matrices of the filmic ACES tone mapping, each the product of the standard colour-space
3
3
  * transforms, taken in float64 and written out.
4
4
  *
5
- * - `UE_REC709_TO_AP1`, `UE_AP1_TO_REC709`: UE's default working space (sRGB primaries, D65) to ACEScg and back,
5
+ * - `UE_REC709_TO_AP1`, `UE_AP1_TO_REC709`: the working space (sRGB primaries, D65) to ACEScg and back,
6
6
  * through XYZ with Bradford D65/D60 adaptation.
7
7
  * - `UE_AP1_TO_AP0`, `UE_AP0_TO_AP1`: ACEScg (AP1) to ACES2065-1 (AP0) and back.
8
8
  * - `UE_EXPAND_GAMUT`: gamut expansion matrix from sRGB toward wide primaries,
@@ -1,10 +1,10 @@
1
1
  import { CodeChunk } from "../../../../compiler/CodeChunk.js";
2
2
 
3
3
  /**
4
- * The colour matrices of Unreal Engine 5.4's default tone mapping, each the product of the standard colour-space
4
+ * The colour matrices of the filmic ACES tone mapping, each the product of the standard colour-space
5
5
  * transforms, taken in float64 and written out.
6
6
  *
7
- * - `UE_REC709_TO_AP1`, `UE_AP1_TO_REC709`: UE's default working space (sRGB primaries, D65) to ACEScg and back,
7
+ * - `UE_REC709_TO_AP1`, `UE_AP1_TO_REC709`: the working space (sRGB primaries, D65) to ACEScg and back,
8
8
  * through XYZ with Bradford D65/D60 adaptation.
9
9
  * - `UE_AP1_TO_AP0`, `UE_AP0_TO_AP1`: ACEScg (AP1) to ACES2065-1 (AP0) and back.
10
10
  * - `UE_EXPAND_GAMUT`: gamut expansion matrix from sRGB toward wide primaries,
@@ -1,30 +1,27 @@
1
1
  /**
2
- * Unreal Engine's default SDR tone mapping, "Filmic", with every setting at its default.
2
+ * Filmic SDR tone mapping on ACES, at fixed settings.
3
3
  *
4
- * Evaluates UE 5.4's sRGB LUT colour-grading and filmic tone-mapping pipeline,
5
- * as UE evaluates them into its colour grading LUT, here evaluated per pixel:
4
+ * Evaluates a colour-grading and filmic tone-mapping pipeline per pixel:
6
5
  *
7
- * 1. into ACEScg (AP1) from UE's default sRGB working space;
8
- * 2. Expand Gamut at its default 1.0, which pushes bright saturated colours toward wider primaries;
9
- * 3. the colour corrections at their defaults, which only clamp AP1 at zero;
10
- * 4. Blue Correction at its default 0.6, a matrix that turns bright blue toward cyan rather than violet, before the
6
+ * 1. into ACEScg (AP1) from the sRGB/Rec.709 working space;
7
+ * 2. gamut expansion at 1.0, which pushes bright saturated colours toward wider primaries;
8
+ * 3. the colour corrections at identity, which only clamp AP1 at zero;
9
+ * 4. blue correction at 0.6, a matrix that turns bright blue toward cyan rather than violet, before the
11
10
  * curve, and its inverse after;
12
- * 5. The filmic curve with Slope 0.88, Toe 0.55, Shoulder 0.26, Black Clip 0 and White Clip 0.04 (the default
13
- * post-process settings). It is the ACES reference rendering's glow and red modifier and its 0.96 desaturation, then a
14
- * parametric toe-straight-shoulder curve on log10 of each AP1 channel, solved so that 0.18 comes out at 0.18, then a
15
- * 0.93 desaturation;
11
+ * 5. the filmic curve with slope 0.88, toe 0.55, shoulder 0.26, black clip 0 and white clip 0.04. It is the ACES
12
+ * reference rendering's glow and red modifier and its 0.96 desaturation, then a parametric toe-straight-shoulder
13
+ * curve on log10 of each AP1 channel, solved so that 0.18 comes out at 0.18, then a 0.93 desaturation;
16
14
  * 6. back to the working space, clamped at zero, and clipped at 1 as the sRGB target clips it.
17
15
  *
18
- * UE 5.8 keeps Filmic as its default method and its SDR output unchanged. What it does on an HDR display is in
19
- * shader_tonemap_HDR_aces.
16
+ * What an HDR display shows is in shader_tonemap_HDR_aces.
20
17
  *
21
- * Where UE divides 0 by 0 (gamut expansion of black) or takes log10(0), this takes the limit, so black stays black.
22
- * UE's LUT also limits its input to 43.7, the top of its log encoding; this does not, which moves a few saturated
23
- * highlights over 43.7 by a few codes.
18
+ * Where gamut expansion of black would divide 0 by 0, or the curve take log10(0), this takes the limit, so black
19
+ * stays black. The input has no upper limit.
24
20
  *
25
21
  * Input: exposed linear Rec.709. Output: display-linear Rec.709 in [0, 1].
26
22
  *
27
- * @see "Color Grading and the Filmic Tonemapper in Unreal Engine", Epic Games
23
+ * @see "Color Grading and the Filmic Tonemapper in Unreal Engine", Epic Games: the public documentation of the
24
+ * curve's slope, toe, shoulder, black clip and white clip parameterisation
28
25
  * @type {CodeChunk}
29
26
  */
30
27
  export const chunk_tonemap_ue_filmic: CodeChunk;
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_tonemap_ue_filmic.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,sCAFU,SAAS,CAoIjB;0BAlKwB,mCAAmC"}
1
+ {"version":3,"file":"chunk_tonemap_ue_filmic.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.js"],"names":[],"mappings":"AAGA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,sCAFU,SAAS,CAoIjB;0BA/JwB,mCAAmC"}
@@ -2,32 +2,29 @@ import { CodeChunk } from "../../../../compiler/CodeChunk.js";
2
2
  import { chunk_aces_ue_matrices } from "./chunk_aces_ue_matrices.js";
3
3
 
4
4
  /**
5
- * Unreal Engine's default SDR tone mapping, "Filmic", with every setting at its default.
5
+ * Filmic SDR tone mapping on ACES, at fixed settings.
6
6
  *
7
- * Evaluates UE 5.4's sRGB LUT colour-grading and filmic tone-mapping pipeline,
8
- * as UE evaluates them into its colour grading LUT, here evaluated per pixel:
7
+ * Evaluates a colour-grading and filmic tone-mapping pipeline per pixel:
9
8
  *
10
- * 1. into ACEScg (AP1) from UE's default sRGB working space;
11
- * 2. Expand Gamut at its default 1.0, which pushes bright saturated colours toward wider primaries;
12
- * 3. the colour corrections at their defaults, which only clamp AP1 at zero;
13
- * 4. Blue Correction at its default 0.6, a matrix that turns bright blue toward cyan rather than violet, before the
9
+ * 1. into ACEScg (AP1) from the sRGB/Rec.709 working space;
10
+ * 2. gamut expansion at 1.0, which pushes bright saturated colours toward wider primaries;
11
+ * 3. the colour corrections at identity, which only clamp AP1 at zero;
12
+ * 4. blue correction at 0.6, a matrix that turns bright blue toward cyan rather than violet, before the
14
13
  * curve, and its inverse after;
15
- * 5. The filmic curve with Slope 0.88, Toe 0.55, Shoulder 0.26, Black Clip 0 and White Clip 0.04 (the default
16
- * post-process settings). It is the ACES reference rendering's glow and red modifier and its 0.96 desaturation, then a
17
- * parametric toe-straight-shoulder curve on log10 of each AP1 channel, solved so that 0.18 comes out at 0.18, then a
18
- * 0.93 desaturation;
14
+ * 5. the filmic curve with slope 0.88, toe 0.55, shoulder 0.26, black clip 0 and white clip 0.04. It is the ACES
15
+ * reference rendering's glow and red modifier and its 0.96 desaturation, then a parametric toe-straight-shoulder
16
+ * curve on log10 of each AP1 channel, solved so that 0.18 comes out at 0.18, then a 0.93 desaturation;
19
17
  * 6. back to the working space, clamped at zero, and clipped at 1 as the sRGB target clips it.
20
18
  *
21
- * UE 5.8 keeps Filmic as its default method and its SDR output unchanged. What it does on an HDR display is in
22
- * shader_tonemap_HDR_aces.
19
+ * What an HDR display shows is in shader_tonemap_HDR_aces.
23
20
  *
24
- * Where UE divides 0 by 0 (gamut expansion of black) or takes log10(0), this takes the limit, so black stays black.
25
- * UE's LUT also limits its input to 43.7, the top of its log encoding; this does not, which moves a few saturated
26
- * highlights over 43.7 by a few codes.
21
+ * Where gamut expansion of black would divide 0 by 0, or the curve take log10(0), this takes the limit, so black
22
+ * stays black. The input has no upper limit.
27
23
  *
28
24
  * Input: exposed linear Rec.709. Output: display-linear Rec.709 in [0, 1].
29
25
  *
30
- * @see "Color Grading and the Filmic Tonemapper in Unreal Engine", Epic Games
26
+ * @see "Color Grading and the Filmic Tonemapper in Unreal Engine", Epic Games: the public documentation of the
27
+ * curve's slope, toe, shoulder, black clip and white clip parameterisation
31
28
  * @type {CodeChunk}
32
29
  */
33
30
  export const chunk_tonemap_ue_filmic = CodeChunk.from(
@@ -80,7 +77,7 @@ fn ue_film_hue(rgb: vec3<f32>) -> f32 {
80
77
  return clamp(hue, 0.0, 360.0);
81
78
  }
82
79
 
83
- // Filmic curve: AP1 in, AP1 out
80
+ // the filmic curve: AP1 in, AP1 out
84
81
  fn ue_film_tone_map(color_ap1: vec3<f32>) -> vec3<f32> {
85
82
  var aces = UE_AP1_TO_AP0 * color_ap1;
86
83
 
@@ -138,10 +135,10 @@ fn ue_film_tone_map(color_ap1: vec3<f32>) -> vec3<f32> {
138
135
  }
139
136
 
140
137
  fn tonemap_ue_filmic(color_rec709: vec3<f32>) -> vec3<f32> {
141
- // the scene from zero up, as UE's LUT encodes it
138
+ // the scene from zero up
142
139
  var color = UE_REC709_TO_AP1 * max(color_rec709, vec3<f32>(0.0));
143
140
 
144
- // Expand Gamut. Black has no chroma to expand, and UE's 0 / 0 there comes out as black too
141
+ // gamut expansion. Black has no chroma to expand, so it stays black
145
142
  let luma = dot(color, UE_AP1_LUMINANCE);
146
143
  if (luma > 0.0) {
147
144
  let chroma = color / luma - 1.0;
@@ -149,7 +146,7 @@ fn tonemap_ue_filmic(color_rec709: vec3<f32>) -> vec3<f32> {
149
146
  color = mix(color, UE_EXPAND_GAMUT * color, amount);
150
147
  }
151
148
 
152
- // the colour corrections at their defaults
149
+ // the colour corrections at identity
153
150
  color = max(color, vec3<f32>(0.0));
154
151
 
155
152
  color = mix(color, UE_BLUE_CORRECT * color, UE_BLUE_CORRECTION);
@@ -1,5 +1,5 @@
1
1
  /**
2
- * Based on Brian Karis' paper on TAA, from Epic Games
2
+ * Based on Karis 2014, "High Quality Temporal Supersampling", SIGGRAPH Advances in Real-Time Rendering
3
3
  *
4
4
  * @see https://github.com/Kabinet0/Halogen-Pathtracer/blob/b8f035991779a6fcc6583e8f631704cddc4c58f5/Assets/Scripts/Halogen%20Shaders/HalogenRandom.hlsl#L314
5
5
  * @see https://github.com/TheRealMJP/MSAAFilter/blob/cfc1c19411e24dc07f74272c17f423330ac96941/MSAAFilter/Resolve.hlsl#L133
@@ -2,7 +2,7 @@ import { CodeChunk } from "../../compiler/CodeChunk.js";
2
2
  import { PI_DECLARATION } from "../math/PI_DECLARATION.js";
3
3
 
4
4
  /**
5
- * Based on Brian Karis' paper on TAA, from Epic Games
5
+ * Based on Karis 2014, "High Quality Temporal Supersampling", SIGGRAPH Advances in Real-Time Rendering
6
6
  *
7
7
  * @see https://github.com/Kabinet0/Halogen-Pathtracer/blob/b8f035991779a6fcc6583e8f631704cddc4c58f5/Assets/Scripts/Halogen%20Shaders/HalogenRandom.hlsl#L314
8
8
  * @see https://github.com/TheRealMJP/MSAAFilter/blob/cfc1c19411e24dc07f74272c17f423330ac96941/MSAAFilter/Resolve.hlsl#L133
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * Blackman-Harris 3.3 approximation: W(x) = exp(-2.29 * x * x)
3
- * Suggested by Brian Karis, in the UE4 SIGGRAPH presentation on TAA
3
+ * Suggested by Karis 2014, "High Quality Temporal Supersampling", SIGGRAPH Advances in Real-Time Rendering
4
4
  * @type {CodeChunk}
5
5
  */
6
6
  export const chunk_filter_blackman_harris229: CodeChunk;
@@ -2,7 +2,7 @@ import { CodeChunk } from "../../compiler/CodeChunk.js";
2
2
 
3
3
  /**
4
4
  * Blackman-Harris 3.3 approximation: W(x) = exp(-2.29 * x * x)
5
- * Suggested by Brian Karis, in the UE4 SIGGRAPH presentation on TAA
5
+ * Suggested by Karis 2014, "High Quality Temporal Supersampling", SIGGRAPH Advances in Real-Time Rendering
6
6
  * @type {CodeChunk}
7
7
  */
8
8
  export const chunk_filter_blackman_harris229 = CodeChunk.from(
@@ -20,10 +20,9 @@
20
20
  *
21
21
  * `MultiscaleMean` is {@link MULTISCALE_MEAN_STRUCT}.
22
22
  *
23
- * - **Exposure**: the factor the display multiplies the samples by ahead of its tone curve, Unreal Engine's
24
- * `View.PreExposure`. The reference's two absolute constants, its variance floor of 1e-5 and its firefly offset
25
- * of 0.1, are in exposed units, as Unreal states its world caches' thresholds (`MaxRayIntensity ·
26
- * OneOverPreExposure`): over a stream scaled by 1/E at an exposure of E the estimator does what it does over
23
+ * - **Exposure**: the factor the display multiplies the samples by ahead of its tone curve, the pre-exposure.
24
+ * The reference's two absolute constants, its variance floor of 1e-5 and its firefly offset of 0.1, are in
25
+ * exposed units: over a stream scaled by 1/E at an exposure of E the estimator does what it does over
27
26
  * the stream at an exposure of one, so it tells a change from noise as far as the display shows it. Held to the
28
27
  * positive normal f32 range, where neither constant overflows or vanishes.
29
28
  * - **Deviation floor**: the least deviation the estimator divides by, √1e-5 / exposure, and never under one
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_multiscale_mean.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DG;AACH,oCAFU,SAAS,CAiEZ;0BAlImB,6BAA6B"}
1
+ {"version":3,"file":"chunk_multiscale_mean.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AACH,oCAFU,SAAS,CAiEZ;0BAjImB,6BAA6B"}
@@ -28,10 +28,9 @@ const EXPOSURE_MAX = '1.70141183e38';
28
28
  *
29
29
  * `MultiscaleMean` is {@link MULTISCALE_MEAN_STRUCT}.
30
30
  *
31
- * - **Exposure**: the factor the display multiplies the samples by ahead of its tone curve, Unreal Engine's
32
- * `View.PreExposure`. The reference's two absolute constants, its variance floor of 1e-5 and its firefly offset
33
- * of 0.1, are in exposed units, as Unreal states its world caches' thresholds (`MaxRayIntensity ·
34
- * OneOverPreExposure`): over a stream scaled by 1/E at an exposure of E the estimator does what it does over
31
+ * - **Exposure**: the factor the display multiplies the samples by ahead of its tone curve, the pre-exposure.
32
+ * The reference's two absolute constants, its variance floor of 1e-5 and its firefly offset of 0.1, are in
33
+ * exposed units: over a stream scaled by 1/E at an exposure of E the estimator does what it does over
35
34
  * the stream at an exposure of one, so it tells a change from noise as far as the display shows it. Held to the
36
35
  * positive normal f32 range, where neither constant overflows or vanishes.
37
36
  * - **Deviation floor**: the least deviation the estimator divides by, √1e-5 / exposure, and never under one
@@ -12,7 +12,7 @@
12
12
  *
13
13
  * `re_direct_physical` also adds its diffuse on top of the specular, and a white dielectric returned up to 1.4
14
14
  * of a uniform sky that way. The diffuse is scaled here by 1 − the dielectric's specular albedo at N·V, from the
15
- * same fetch: the indirect path's factor, and what UE5, EEVEE and OpenPBR apply ("albedo scaling"). It is
15
+ * same fetch: the indirect path's factor, and what EEVEE and OpenPBR apply ("albedo scaling"). It is
16
16
  * the view's side of the interface only; the light's (Kulla–Conty's 1 − E(N·L)) would cost a fetch per light.
17
17
  *
18
18
  * Requires `tSplitSum` and `sLinear` in the shader's resources. See `MULTISCATTER.md` beside this chunk.
@@ -20,7 +20,7 @@ import { SAMPLER_LINEAR_RESOURCE } from "../../../texture/SAMPLER_LINEAR_RESOURC
20
20
  *
21
21
  * `re_direct_physical` also adds its diffuse on top of the specular, and a white dielectric returned up to 1.4
22
22
  * of a uniform sky that way. The diffuse is scaled here by 1 − the dielectric's specular albedo at N·V, from the
23
- * same fetch: the indirect path's factor, and what UE5, EEVEE and OpenPBR apply ("albedo scaling"). It is
23
+ * same fetch: the indirect path's factor, and what EEVEE and OpenPBR apply ("albedo scaling"). It is
24
24
  * the view's side of the interface only; the light's (Kulla–Conty's 1 − E(N·L)) would cost a fetch per light.
25
25
  *
26
26
  * Requires `tSplitSum` and `sLinear` in the shader's resources. See `MULTISCATTER.md` beside this chunk.
@@ -145,7 +145,7 @@ const VSM_LEVEL_COUNT = 12;
145
145
  const VSM_PAGES_PER_LEVEL = 64;
146
146
 
147
147
  /**
148
- * Texels on a side of a virtual shadow map page — the reference's and UE's 128 — and of the pool
148
+ * Texels on a side of a virtual shadow map page — the reference's 128 — and of the pool
149
149
  * the map claims in the atlas for them, 30 × 30 slots of 128 plus {@link SHADOWMAP_ATLAS_BORDER}
150
150
  * each side. A device whose atlas is smaller gets a pool of what fits.
151
151
  */
@@ -1643,8 +1643,8 @@ export class GPUSceneShadowmapContext {
1643
1643
  view_ctx.update();
1644
1644
 
1645
1645
  const job = new RasterizationJob();
1646
- // a directional light's cascades are biased the way Unreal biases them, in the vertex stage of an
1647
- // orthographic view; a spot light keeps the rasterizer's bias
1646
+ // a directional light's cascades are biased in the vertex stage of an orthographic view; a spot
1647
+ // light keeps the rasterizer's bias
1648
1648
  const cascade = map.light.isDirectionalLight === true;
1649
1649
  job.opaque_pass = cascade ? shadow_cascade_rasterization_pass_descriptor : shadow_rasterization_pass_descriptor;
1650
1650
  job.alpha_tested_pass = cascade ? shadow_cascade_alpha_tested_pass_descriptor : shadow_rasterization_alpha_tested_pass_descriptor;
@@ -1,7 +1,6 @@
1
1
  /**
2
- * Visibility of a point in one of a directional light's cascades: Unreal's receiver for cascaded shadow
3
- * maps (UE 5.4 `ShadowProjectionPixelShader.usf`, `ShadowFilteringCommon.ush` `Manual5x5PCF`) at its
4
- * defaults, the receiver half of the scheme whose caster half is {@link chunk_shadow_caster_depth_bias}.
2
+ * Visibility of a point in one of a directional light's cascades: a cascaded shadow receiver with a soft
3
+ * 5×5 PCF, the receiver half of the scheme whose caster half is {@link chunk_shadow_caster_depth_bias}.
5
4
  *
6
5
  * ```wgsl
7
6
  * fn sample_shadowmap_cascade(
@@ -16,11 +15,10 @@
16
15
  * The point is projected as it is, with no offset. Each of the 6×6 texels around it is compared softly,
17
16
  * `saturate((receiver − texel) / transition + 1)` in reverse-Z depth: a texel nearer the light by the
18
17
  * transition or more shadows the point fully, one level with it not at all. The transition is 2.5 texels
19
- * along the light (the caster bias's constant, `ComputeTransitionSize`), widened by
20
- * `1 / lerp(1 − r.Shadow.CSMReceiverBias, 1, N·L)` with `CSMReceiverBias` 0.9: tenfold where the surface
21
- * meets the light edge-on. The 36 results are weighted as a 5×5 box filter at the point's sub-texel
22
- * position, the edge rows and columns by the fraction that falls inside it, and the filtered value is
23
- * squared, Unreal's `ApplyPCFOverBlurCorrection`.
18
+ * along the light (the caster bias's constant), widened by `1 / lerp(1 − b, 1, N·L)` with the receiver
19
+ * bias `b` 0.9: tenfold where the surface meets the light edge-on. The 36 results are weighted as a 5×5
20
+ * box filter at the point's sub-texel position, the edge rows and columns by the fraction that falls
21
+ * inside it, and the filtered value is squared, which corrects the box filter's over-blur.
24
22
  *
25
23
  * A receiver past the far plane, depth at or below 0, is shadowed only by what was drawn in front of it:
26
24
  * against a texel nothing was drawn into, depth 0, it is level and lit.
@@ -1 +1 @@
1
- {"version":3,"file":"chunk_sample_shadowmap_cascade.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,6CAFU,SAAS,CAqEjB;0BArGwB,uCAAuC"}
1
+ {"version":3,"file":"chunk_sample_shadowmap_cascade.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.js"],"names":[],"mappings":"AAKA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,6CAFU,SAAS,CAqEjB;0BAnGwB,uCAAuC"}