@woosh/meep-engine 3.78.3 → 3.78.4
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.
- package/CHANGELOG.md +46 -13
- package/editor/view/node-graph/NodeGraphView.d.ts +1 -1
- package/editor/view/node-graph/NodeGraphView.js +1 -1
- package/package.json +1 -1
- package/src/core/math/physics/brdf/fresnel_Schlick_optimized.d.ts +2 -1
- package/src/core/math/physics/brdf/fresnel_Schlick_optimized.d.ts.map +1 -1
- package/src/core/math/physics/brdf/fresnel_Schlick_optimized.js +2 -1
- package/src/core/math/snap_to_integer.d.ts +13 -0
- package/src/core/math/snap_to_integer.d.ts.map +1 -0
- package/src/core/math/snap_to_integer.js +20 -0
- package/src/core/model/node-graph/NodeGraph.d.ts +0 -1
- package/src/core/model/node-graph/NodeGraph.d.ts.map +1 -1
- package/src/core/model/node-graph/NodeGraph.js +0 -1
- package/src/engine/graphics/hair/groom_bind_to_mesh.d.ts +1 -1
- package/src/engine/graphics/hair/groom_bind_to_mesh.js +1 -1
- package/src/engine/graphics/hair/groom_build_guides.d.ts +1 -1
- package/src/engine/graphics/hair/groom_build_guides.js +1 -1
- package/src/engine/graphics/impostors/voxel/README.md +11 -11
- package/src/engine/physics/cloth/collider/ClothColliderKind.js +1 -1
- package/src/engine/physics/cloth/ecs/cloth_geodesic.d.ts +1 -1
- package/src/engine/physics/cloth/ecs/cloth_geodesic.js +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts +2 -3
- package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.d.ts.map +1 -1
- package/src/engine/physics/cloth/solver/constraint/cloth_backstop_row.js +2 -3
- package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.d.ts +0 -2
- package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.d.ts.map +1 -1
- package/src/generation/filtering/numeric/sampling/AbstractCellFilterSampleGridLayer.js +0 -5
- package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerCubic.d.ts.map +1 -1
- package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerCubic.js +5 -3
- package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.d.ts.map +1 -1
- package/src/generation/filtering/numeric/sampling/CellFilterSampleLayerLinear.js +5 -3
- package/src/generation/grid/coords/grid_to_texel.d.ts +7 -1
- package/src/generation/grid/coords/grid_to_texel.d.ts.map +1 -1
- package/src/generation/grid/coords/grid_to_texel.js +11 -1
- package/src/generation/grid/coords/grid_to_texel_span.d.ts +15 -0
- package/src/generation/grid/coords/grid_to_texel_span.d.ts.map +1 -0
- package/src/generation/grid/coords/grid_to_texel_span.js +38 -0
- package/src/generation/grid/coords/texel_to_grid.d.ts +2 -1
- package/src/generation/grid/coords/texel_to_grid.d.ts.map +1 -1
- package/src/generation/grid/coords/texel_to_grid.js +6 -1
- package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts +32 -1
- package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/GridTaskWaveFunctionCollapse.js +114 -9
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts +8 -0
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.d.ts.map +1 -1
- package/src/generation/grid/generation/discrete/layer/GridTaskBuildSourceDistanceMap.js +91 -29
- package/src/generation/grid/layers/GridDataLayer.d.ts +21 -2
- package/src/generation/grid/layers/GridDataLayer.d.ts.map +1 -1
- package/src/generation/grid/layers/GridDataLayer.js +43 -4
- package/src/generation/placement/action/GridCellActionPlaceTags.d.ts +7 -1
- package/src/generation/placement/action/GridCellActionPlaceTags.d.ts.map +1 -1
- package/src/generation/placement/action/GridCellActionPlaceTags.js +42 -16
- package/src/generation/placement/action/GridCellActionWriteFilterToLayer.d.ts +5 -0
- package/src/generation/placement/action/GridCellActionWriteFilterToLayer.d.ts.map +1 -1
- package/src/generation/placement/action/GridCellActionWriteFilterToLayer.js +32 -9
- package/src/generation/rules/CellMatcherLayerBitMaskTest.d.ts.map +1 -1
- package/src/generation/rules/CellMatcherLayerBitMaskTest.js +6 -2
- package/src/generation/wfc/GridWFCCompiledTileSet.d.ts +4 -2
- package/src/generation/wfc/GridWFCCompiledTileSet.d.ts.map +1 -1
- package/src/generation/wfc/GridWFCCompiledTileSet.js +2 -2
- package/src/generation/wfc/GridWFCTileSet.d.ts +16 -7
- package/src/generation/wfc/GridWFCTileSet.d.ts.map +1 -1
- package/src/generation/wfc/GridWFCTileSet.js +32 -8
- package/src/shade/playground/contact_shadows/shader_contact_lab_composite.js +2 -2
- package/src/shade/playground/particle_editor/README.md +2 -2
- package/src/shade/playground/probe_clipmap/index.html +1 -1
- package/src/shade/playground/screen_probes/README.md +5 -5
- package/src/shade/playground/screen_probes/main.js +1 -1
- package/src/shade/playground/tonemap_sdr/README.md +3 -2
- package/src/shade/playground/vgeo_scene/README.md +1 -3
- package/src/shade/playground/vgeo_scene/main.js +3 -3
- package/src/shade/renderer/Renderer.d.ts +3 -3
- package/src/shade/renderer/Renderer.js +4 -4
- package/src/shade/renderer/ShadeIndirectLightingMode.js +1 -1
- package/src/shade/renderer/camera/PerspectiveCamera.js +1 -1
- package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts +11 -13
- package/src/shade/renderer/deferred/tonemap/ColorGrade.d.ts.map +1 -1
- package/src/shade/renderer/deferred/tonemap/ColorGrade.js +11 -13
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_ACES.d.ts.map +1 -1
- package/src/shade/renderer/deferred/tonemap/TONE_MAP_OPERATOR_ACES.js +6 -7
- package/src/shade/renderer/deferred/tonemap/ToneMapper.d.ts +1 -1
- package/src/shade/renderer/deferred/tonemap/ToneMapper.js +1 -1
- package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.d.ts +6 -8
- package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.d.ts.map +1 -1
- package/src/shade/renderer/deferred/tonemap/m3_white_balance_rec709.js +7 -10
- package/src/shade/renderer/geometry/sdf/MESH_SDF.d.ts +1 -1
- package/src/shade/renderer/geometry/sdf/MESH_SDF.js +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.d.ts +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_classify.js +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.d.ts +1 -1
- package/src/shade/renderer/geometry/sdf/bake/shader_mesh_sdf_evaluate.js +1 -1
- package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts +1 -2
- package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/chunk_blas_query_band_sdf.js +1 -2
- package/src/shade/renderer/geometry/sdf/chunk_scene_point_query_volume_sign.d.ts.map +1 -1
- package/src/shade/renderer/geometry/sdf/chunk_scene_point_query_volume_sign.js +2 -1
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.d.ts +1 -1
- package/src/shade/renderer/geometry/sdf/surface/MESH_SURFACE_BAKE.js +1 -1
- package/src/shade/renderer/geometry/virtual/build/level/vgeo_build_cluster_graph.js +1 -1
- package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.d.ts +2 -2
- package/src/shade/renderer/geometry/virtual/format/page/VGEO_DEFAULT_PAGE_SIZE.js +2 -2
- package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.d.ts +2 -2
- package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_access.js +4 -4
- package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.d.ts +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/cut/chunk_vgeo_cut_instance.js +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/cut/shader_vgeo_cut_collect.js +1 -1
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.d.ts +3 -3
- package/src/shade/renderer/geometry/virtual/runtime/layout/VGEO_INSTANCE_OFFSET.js +3 -3
- package/src/shade/renderer/global_illumination/brick4/README.md +2 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts +4 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/ProbeClipmapSettings.js +4 -6
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_MOVERS.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/BRICK_MOVERS.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/chunk_brick_clipmap_trace.js +2 -2
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/brick/mesh/chunk_mesh_brick_texel.js +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts +28 -35
- package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js +28 -35
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +21 -24
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +21 -24
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.d.ts +8 -8
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js +8 -8
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brdf_density.d.ts +4 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brdf_density.js +4 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.d.ts +3 -5
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.js +3 -5
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_lighting_history.d.ts +4 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_lighting_history.js +4 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts +2 -3
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_rough_specular.js +2 -3
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_screen_march.d.ts +4 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_screen_march.js +4 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.d.ts +2 -4
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.js +2 -4
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.d.ts +2 -4
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.js +2 -4
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts +13 -17
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js +13 -17
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.d.ts +11 -14
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.js +11 -14
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.d.ts +2 -2
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.js +2 -2
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.d.ts +9 -9
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.js +9 -9
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts +15 -18
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.js +16 -19
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.d.ts +10 -11
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.js +11 -12
- package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts +9 -8
- package/src/shade/renderer/hair/chunk_hair_bsdf.d.ts.map +1 -1
- package/src/shade/renderer/hair/chunk_hair_bsdf.js +10 -9
- package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts +5 -6
- package/src/shade/renderer/hair/chunk_hair_dual_scattering.d.ts.map +1 -1
- package/src/shade/renderer/hair/chunk_hair_dual_scattering.js +5 -6
- package/src/shade/renderer/hair/hair_lighting.d.ts +3 -3
- package/src/shade/renderer/hair/hair_lighting.d.ts.map +1 -1
- package/src/shade/renderer/hair/hair_lighting.js +4 -5
- package/src/shade/renderer/hair/hair_scattering_lut.d.ts +5 -5
- package/src/shade/renderer/hair/hair_scattering_lut.js +5 -5
- package/src/shade/renderer/hair/shader_hair_roots.d.ts +2 -2
- package/src/shade/renderer/hair/shader_hair_roots.js +2 -2
- package/src/shade/renderer/light/environment/DEFINES.d.ts +1 -1
- package/src/shade/renderer/light/environment/DEFINES.js +1 -1
- package/src/shade/renderer/light/environment/shader_convolve_reflection_map_from_blurred.js +2 -2
- package/src/shade/renderer/material/dispatch/MaterialDispatch.d.ts +1 -2
- package/src/shade/renderer/material/dispatch/MaterialDispatch.d.ts.map +1 -1
- package/src/shade/renderer/material/dispatch/MaterialDispatch.js +1 -2
- package/src/shade/renderer/material/standard/fragment_gbuffer.d.ts.map +1 -1
- package/src/shade/renderer/material/standard/fragment_gbuffer.js +2 -1
- package/src/shade/renderer/material/util/dielectric_specular_color.d.ts +1 -1
- package/src/shade/renderer/material/util/dielectric_specular_color.js +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_CONFIG.d.ts +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_CONFIG.js +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_PRESETS.js +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_SETTINGS_STRUCT.d.ts +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_SETTINGS_STRUCT.js +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_TEXTURE_FORMAT.d.ts +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DOF2_TEXTURE_FORMAT.js +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts +3 -4
- package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/dof/gather/DepthOfFieldU.js +3 -4
- package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.d.ts +1 -1
- package/src/shade/renderer/postprocess/dof/gather/graph_postprocess_dof2.js +1 -1
- package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.d.ts +1 -1
- package/src/shade/renderer/postprocess/eye/GPUCameraExposureManager.js +1 -1
- package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/gtao/ao_reproject_shader.js +2 -3
- package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.d.ts +1 -2
- package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/motion_blur/MOTION_BLUR_CONFIG.js +1 -2
- package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.d.ts +2 -3
- package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.js +2 -3
- package/src/shade/renderer/postprocess/taa/filter_blackman_harris.d.ts +1 -1
- package/src/shade/renderer/postprocess/taa/filter_blackman_harris.js +1 -1
- package/src/shade/renderer/rasterize/native/depth/shadow_cascade_rasterization_pass_descriptor.d.ts +1 -1
- package/src/shade/renderer/rasterize/native/depth/shadow_cascade_rasterization_pass_descriptor.js +1 -1
- package/src/shade/renderer/rasterize/native/depth/shadow_rasterization_alpha_tested_pass_descriptor.js +1 -1
- package/src/shade/renderer/restir/di/ReSTIRDI.d.ts +3 -3
- package/src/shade/renderer/restir/di/ReSTIRDI.js +3 -3
- package/src/shade/renderer/restir/di/chunk_restir_trace_visibility.d.ts +1 -1
- package/src/shade/renderer/restir/di/chunk_restir_trace_visibility.js +1 -1
- package/src/shade/renderer/shader/chunk/brdf/chunk_MIN_DIELECTRICS_F0.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/brdf/chunk_MIN_DIELECTRICS_F0.js +1 -1
- package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts +1 -2
- package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/brdf/chunk_shadowed_F90.js +1 -2
- package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.d.ts +4 -5
- package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/conversion/chunk_CRM_REC709_AP1.js +4 -5
- package/src/shade/renderer/shader/chunk/color/grade/chunk_color_grade.js +2 -2
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.d.ts +2 -2
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_aces_ue_matrices.js +2 -2
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.d.ts +14 -17
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/tonemap/aces/chunk_tonemap_ue_filmic.js +18 -21
- package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris.js +1 -1
- package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris229.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/filter/chunk_filter_blackman_harris229.js +1 -1
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts +3 -4
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/filter/chunk_multiscale_mean.js +3 -4
- package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/material/chunk_re_direct_multiscatter.js +1 -1
- package/src/shade/renderer/shadow/map/GPUSceneShadowmapContext.js +3 -3
- package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.d.ts +6 -8
- package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.d.ts.map +1 -1
- package/src/shade/renderer/shadow/map/shader/chunk_sample_shadowmap_cascade.js +8 -10
- package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.d.ts +5 -7
- package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.d.ts.map +1 -1
- package/src/shade/renderer/shadow/map/shader/chunk_shadow_caster_depth_bias.js +5 -7
- package/src/shade/renderer/texture/virtual/README.md +257 -257
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridCellActionPlaceTags.d.ts","sourceRoot":"","sources":["../../../../../src/generation/placement/action/GridCellActionPlaceTags.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GridCellActionPlaceTags.d.ts","sourceRoot":"","sources":["../../../../../src/generation/placement/action/GridCellActionPlaceTags.js"],"names":[],"mappings":"AAsBA;IA0CI;;;;;OAKG;IACH,mBAJW,MAAM,SACN,MAAM,GACJ,uBAAuB,CAcnC;IA1DD;;;OAGG;IACH,kBAFmB,MAAM,QAAE,MAAM,KAAG,MAAM,CAEpB;IAEtB;;;OAGG;IACH,MAFU,SAAS,CAEc;IAEjC;;;OAGG;IACH,SAFU,MAAM,CAED;IAEf;;;;OAIG;IACH,gBAAe;IAOf,uCAQC;IAsBD;;;OAGG;IACH,WAFW,MAAM,QAMhB;IAED;;;;OAIG;IACH,UAHW,MAAM,KACN,MAAM,QAIhB;IAED;;;;;;;;OAQG;IACH,wDAoDC;CACJ;+BA9J8B,qBAAqB;0BAF1B,uDAAuD"}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { assert } from "../../../core/assert.js";
|
|
2
2
|
import { bitwiseOr } from "../../../core/binary/operations/bitwiseOr.js";
|
|
3
3
|
import { v2_rotate_cos_sin } from "../../../core/geom/vec2/v2_rotate_cos_sin.js";
|
|
4
|
+
import { max2 } from "../../../core/math/max2.js";
|
|
5
|
+
import { min2 } from "../../../core/math/min2.js";
|
|
4
6
|
import { Sampler2D } from "../../../engine/graphics/texture/sampler/Sampler2D.js";
|
|
7
|
+
import { grid_to_texel_span } from "../../grid/coords/grid_to_texel_span.js";
|
|
5
8
|
import { GridCellAction } from "./GridCellAction.js";
|
|
6
9
|
|
|
7
10
|
/**
|
|
@@ -10,6 +13,13 @@ import { GridCellAction } from "./GridCellAction.js";
|
|
|
10
13
|
*/
|
|
11
14
|
const scratch_offset = new Float64Array(2);
|
|
12
15
|
|
|
16
|
+
/**
|
|
17
|
+
* The texels a pattern cell covers along each axis, `[first, last]`; read out before the next cell
|
|
18
|
+
* @type {Int32Array}
|
|
19
|
+
*/
|
|
20
|
+
const scratch_span_x = new Int32Array(2);
|
|
21
|
+
const scratch_span_y = new Int32Array(2);
|
|
22
|
+
|
|
13
23
|
export class GridCellActionPlaceTags extends GridCellAction {
|
|
14
24
|
|
|
15
25
|
/**
|
|
@@ -92,7 +102,13 @@ export class GridCellActionPlaceTags extends GridCellAction {
|
|
|
92
102
|
}
|
|
93
103
|
|
|
94
104
|
/**
|
|
95
|
-
* Write placement tags into the grid at a given position, the tag pattern will be rotated as specified
|
|
105
|
+
* Write placement tags into the grid at a given position, the tag pattern will be rotated as specified.
|
|
106
|
+
*
|
|
107
|
+
* Each cell of the pattern lands on a grid cell, and goes into that cell's texels as a write at the cell would
|
|
108
|
+
* ({@link grid_to_texel_span}): the texel a {@link CellMatcherLayerBitMaskTest} reads at that cell, all of the
|
|
109
|
+
* cell's texels on a stretched layer finer than the grid, and on a coarser layer the texel holding the cell, where
|
|
110
|
+
* it is combined by {@link operation} with whatever else the pattern put there. A pattern cell off the grid writes
|
|
111
|
+
* nothing, though a texel of a coarse layer may reach there.
|
|
96
112
|
*/
|
|
97
113
|
execute(data, x, y, rotation) {
|
|
98
114
|
const sin = Math.sin(rotation);
|
|
@@ -103,7 +119,8 @@ export class GridCellActionPlaceTags extends GridCellAction {
|
|
|
103
119
|
const height = tags.height;
|
|
104
120
|
const width = tags.width;
|
|
105
121
|
|
|
106
|
-
const
|
|
122
|
+
const layer = this.__layer;
|
|
123
|
+
const sampler = layer.sampler;
|
|
107
124
|
|
|
108
125
|
for (let local_y = 0; local_y < height; local_y++) {
|
|
109
126
|
for (let local_x = 0; local_x < width; local_x++) {
|
|
@@ -112,28 +129,37 @@ export class GridCellActionPlaceTags extends GridCellAction {
|
|
|
112
129
|
//rotate rule position
|
|
113
130
|
v2_rotate_cos_sin(scratch_offset, 0, local_x, local_y, cos, sin);
|
|
114
131
|
|
|
115
|
-
//
|
|
116
|
-
|
|
117
|
-
const
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|| target_y < 0
|
|
123
|
-
|| target_y >= sampler.height
|
|
124
|
-
) {
|
|
125
|
-
// out of bounds
|
|
132
|
+
// the cell the pattern cell lands on; rounded before it is mapped, so that the residue of a turn
|
|
133
|
+
// cannot tip it onto the other side of a texel boundary from where a matcher reads the cell
|
|
134
|
+
const cell_x = Math.round(scratch_offset[0] + x);
|
|
135
|
+
const cell_y = Math.round(scratch_offset[1] + y);
|
|
136
|
+
|
|
137
|
+
if (cell_x < 0 || cell_x >= data.width || cell_y < 0 || cell_y >= data.height) {
|
|
138
|
+
// off the grid
|
|
126
139
|
continue;
|
|
127
140
|
}
|
|
128
141
|
|
|
142
|
+
grid_to_texel_span(scratch_span_x, cell_x, layer.resolution, layer.stretch);
|
|
143
|
+
grid_to_texel_span(scratch_span_y, cell_y, layer.resolution, layer.stretch);
|
|
144
|
+
|
|
145
|
+
// out of the layer
|
|
146
|
+
const x0 = max2(scratch_span_x[0], 0);
|
|
147
|
+
const x1 = min2(scratch_span_x[1], sampler.width - 1);
|
|
148
|
+
const y0 = max2(scratch_span_y[0], 0);
|
|
149
|
+
const y1 = min2(scratch_span_y[1], sampler.height - 1);
|
|
150
|
+
|
|
129
151
|
//read the tag value
|
|
130
152
|
const cell_tags = tags.readChannel(local_x, local_y, 0);
|
|
131
153
|
|
|
132
|
-
|
|
154
|
+
for (let target_y = y0; target_y <= y1; target_y++) {
|
|
155
|
+
for (let target_x = x0; target_x <= x1; target_x++) {
|
|
156
|
+
const source = sampler.readChannel(target_x, target_y, 0);
|
|
133
157
|
|
|
134
|
-
|
|
158
|
+
const result = this.operation(source, cell_tags);
|
|
135
159
|
|
|
136
|
-
|
|
160
|
+
sampler.writeChannel(target_x, target_y, 0, result);
|
|
161
|
+
}
|
|
162
|
+
}
|
|
137
163
|
}
|
|
138
164
|
}
|
|
139
165
|
}
|
|
@@ -22,6 +22,11 @@ export class GridCellActionWriteFilterToLayer extends GridCellAction {
|
|
|
22
22
|
*/
|
|
23
23
|
private __layer;
|
|
24
24
|
initialize(data: any, seed: any): void;
|
|
25
|
+
/**
|
|
26
|
+
* Writes the filter's value at grid position (x, y): into the texel nearest it, or on a stretched layer into the
|
|
27
|
+
* texels of the cell holding it ({@link grid_to_texel_span}). A position off the grid writes nothing, though a
|
|
28
|
+
* texel of a coarse layer may reach there.
|
|
29
|
+
*/
|
|
25
30
|
execute(data: any, x: any, y: any, rotation: any): void;
|
|
26
31
|
}
|
|
27
32
|
import { GridCellAction } from "./GridCellAction.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridCellActionWriteFilterToLayer.d.ts","sourceRoot":"","sources":["../../../../../src/generation/placement/action/GridCellActionWriteFilterToLayer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GridCellActionWriteFilterToLayer.d.ts","sourceRoot":"","sources":["../../../../../src/generation/placement/action/GridCellActionWriteFilterToLayer.js"],"names":[],"mappings":"AAaA;IAqBI;;;;OAIG;IACH,mBAHW,MAAM,wDAahB;IAlCD;;;OAGG;IACH,mBAAc;IAEd;;;OAGG;IACH,SAFU,MAAM,CAED;IAEf;;;;OAIG;IACH,gBAAe;IAuBf,uCAoBC;IAED;;;;OAIG;IACH,wDAmCC;CACJ;+BAlH8B,qBAAqB"}
|
|
@@ -1,7 +1,16 @@
|
|
|
1
1
|
import { assert } from "../../../core/assert.js";
|
|
2
|
-
import {
|
|
2
|
+
import { max2 } from "../../../core/math/max2.js";
|
|
3
|
+
import { min2 } from "../../../core/math/min2.js";
|
|
4
|
+
import { grid_to_texel_span } from "../../grid/coords/grid_to_texel_span.js";
|
|
3
5
|
import { GridCellAction } from "./GridCellAction.js";
|
|
4
6
|
|
|
7
|
+
/**
|
|
8
|
+
* The texels a write covers along each axis, `[first, last]`; read out before the next write
|
|
9
|
+
* @type {Int32Array}
|
|
10
|
+
*/
|
|
11
|
+
const scratch_span_x = new Int32Array(2);
|
|
12
|
+
const scratch_span_y = new Int32Array(2);
|
|
13
|
+
|
|
5
14
|
export class GridCellActionWriteFilterToLayer extends GridCellAction {
|
|
6
15
|
|
|
7
16
|
/**
|
|
@@ -66,10 +75,20 @@ export class GridCellActionWriteFilterToLayer extends GridCellAction {
|
|
|
66
75
|
this.filter.ensureInitialized(data, seed);
|
|
67
76
|
}
|
|
68
77
|
|
|
78
|
+
/**
|
|
79
|
+
* Writes the filter's value at grid position (x, y): into the texel nearest it, or on a stretched layer into the
|
|
80
|
+
* texels of the cell holding it ({@link grid_to_texel_span}). A position off the grid writes nothing, though a
|
|
81
|
+
* texel of a coarse layer may reach there.
|
|
82
|
+
*/
|
|
69
83
|
execute(data, x, y, rotation) {
|
|
70
84
|
|
|
71
85
|
const value = this.filter.execute(data, x, y, rotation);
|
|
72
86
|
|
|
87
|
+
if (x < -0.5 || x >= data.width - 0.5 || y < -0.5 || y >= data.height - 0.5) {
|
|
88
|
+
// off the grid, write is discarded
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
|
|
73
92
|
/**
|
|
74
93
|
*
|
|
75
94
|
* @type {GridDataLayer}
|
|
@@ -82,15 +101,19 @@ export class GridCellActionWriteFilterToLayer extends GridCellAction {
|
|
|
82
101
|
*/
|
|
83
102
|
const sampler = layer.sampler;
|
|
84
103
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
const iY = Math.round(grid_to_texel(y, layer.resolution));
|
|
104
|
+
grid_to_texel_span(scratch_span_x, x, layer.resolution, layer.stretch);
|
|
105
|
+
grid_to_texel_span(scratch_span_y, y, layer.resolution, layer.stretch);
|
|
88
106
|
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
107
|
+
// out of the layer, write is discarded
|
|
108
|
+
const x0 = max2(scratch_span_x[0], 0);
|
|
109
|
+
const x1 = min2(scratch_span_x[1], sampler.width - 1);
|
|
110
|
+
const y0 = max2(scratch_span_y[0], 0);
|
|
111
|
+
const y1 = min2(scratch_span_y[1], sampler.height - 1);
|
|
93
112
|
|
|
94
|
-
|
|
113
|
+
for (let texel_y = y0; texel_y <= y1; texel_y++) {
|
|
114
|
+
for (let texel_x = x0; texel_x <= x1; texel_x++) {
|
|
115
|
+
sampler.writeChannel(texel_x, texel_y, 0, value);
|
|
116
|
+
}
|
|
117
|
+
}
|
|
95
118
|
}
|
|
96
119
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CellMatcherLayerBitMaskTest.d.ts","sourceRoot":"","sources":["../../../../src/generation/rules/CellMatcherLayerBitMaskTest.js"],"names":[],"mappings":"AAIA;
|
|
1
|
+
{"version":3,"file":"CellMatcherLayerBitMaskTest.d.ts","sourceRoot":"","sources":["../../../../src/generation/rules/CellMatcherLayerBitMaskTest.js"],"names":[],"mappings":"AAIA;IAgCI;;;;;OAKG;IACH,kBAJW,MAAM,SACN,MAAM,GACL,2BAA2B,CAYtC;IA9CD;;;OAGG;IACH,MAFU,MAAM,CAEP;IAGT,yDAqBC;CAmBJ;qCAnDoC,2BAA2B"}
|
|
@@ -13,12 +13,16 @@ export class CellMatcherLayerBitMaskTest extends GridLayerCellMatcher {
|
|
|
13
13
|
|
|
14
14
|
match(grid, x, y, rotation) {
|
|
15
15
|
|
|
16
|
+
if (x < -0.5 || x >= grid.width - 0.5 || y < -0.5 || y >= grid.height - 0.5) {
|
|
17
|
+
// off the grid matches nothing, though a texel of a coarse layer may reach there
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
16
20
|
|
|
17
21
|
const layer = this.__layer;
|
|
18
22
|
const sampler = layer.sampler;
|
|
19
23
|
|
|
20
|
-
const _x = Math.round(grid_to_texel(x, layer.resolution));
|
|
21
|
-
const _y = Math.round(grid_to_texel(y, layer.resolution));
|
|
24
|
+
const _x = Math.round(grid_to_texel(x, layer.resolution, layer.stretch));
|
|
25
|
+
const _y = Math.round(grid_to_texel(y, layer.resolution, layer.stretch));
|
|
22
26
|
|
|
23
27
|
if (_x < 0 || _x >= sampler.width || _y < 0 || _y >= sampler.height) {
|
|
24
28
|
// out of bounds matches nothing; probing off-map must not match border cells
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*/
|
|
7
7
|
export class GridWFCCompiledTileSet {
|
|
8
8
|
/**
|
|
9
|
-
* @param {{name:string, edges:string[], weight:number, rotations:number, tags:string[], action:(GridCellAction|null)}[]} prototypes
|
|
9
|
+
* @param {{name:string, edges:string[], weight:number, rotations:number, tags:string[], value:number, action:(GridCellAction|null)}[]} prototypes
|
|
10
10
|
*/
|
|
11
11
|
constructor(prototypes: {
|
|
12
12
|
name: string;
|
|
@@ -14,10 +14,11 @@ export class GridWFCCompiledTileSet {
|
|
|
14
14
|
weight: number;
|
|
15
15
|
rotations: number;
|
|
16
16
|
tags: string[];
|
|
17
|
+
value: number;
|
|
17
18
|
action: (GridCellAction | null);
|
|
18
19
|
}[]);
|
|
19
20
|
/**
|
|
20
|
-
* @type {{name:string, edges:string[], weight:number, rotations:number, tags:string[], action:(GridCellAction|null)}[]}
|
|
21
|
+
* @type {{name:string, edges:string[], weight:number, rotations:number, tags:string[], value:number, action:(GridCellAction|null)}[]}
|
|
21
22
|
*/
|
|
22
23
|
prototypes: {
|
|
23
24
|
name: string;
|
|
@@ -25,6 +26,7 @@ export class GridWFCCompiledTileSet {
|
|
|
25
26
|
weight: number;
|
|
26
27
|
rotations: number;
|
|
27
28
|
tags: string[];
|
|
29
|
+
value: number;
|
|
28
30
|
action: (GridCellAction | null);
|
|
29
31
|
}[];
|
|
30
32
|
/** @type {number} */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridWFCCompiledTileSet.d.ts","sourceRoot":"","sources":["../../../../src/generation/wfc/GridWFCCompiledTileSet.js"],"names":[],"mappings":"AA2CA;;;;;GAKG;AACH;IACI;;OAEG;IACH,wBAFW;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,KAAK,EAAC,MAAM,EAAE,CAAC;QAAC,MAAM,EAAC,MAAM,CAAC;QAAC,SAAS,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,EAAE,CAAC;QAAC,MAAM,EAAC,CAAC,iBAAe,IAAI,CAAC,CAAA;KAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"GridWFCCompiledTileSet.d.ts","sourceRoot":"","sources":["../../../../src/generation/wfc/GridWFCCompiledTileSet.js"],"names":[],"mappings":"AA2CA;;;;;GAKG;AACH;IACI;;OAEG;IACH,wBAFW;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,KAAK,EAAC,MAAM,EAAE,CAAC;QAAC,MAAM,EAAC,MAAM,CAAC;QAAC,SAAS,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,EAAE,CAAC;QAAC,KAAK,EAAC,MAAM,CAAC;QAAC,MAAM,EAAC,CAAC,iBAAe,IAAI,CAAC,CAAA;KAAC,EAAE,EAiHrI;IA1GG;;OAEG;IACH,YAFU;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,KAAK,EAAC,MAAM,EAAE,CAAC;QAAC,MAAM,EAAC,MAAM,CAAC;QAAC,SAAS,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,EAAE,CAAC;QAAC,KAAK,EAAC,MAAM,CAAC;QAAC,MAAM,EAAC,CAAC,iBAAe,IAAI,CAAC,CAAA;KAAC,EAAE,CAEjG;IAuCpC,qBAAqB;IACrB,YADW,MAAM,CACW;IAC5B,0BAA0B;IAC1B,gBADW,WAAW,CACgC;IACtD,6CAA6C;IAC7C,YAD+B,UAAU,CACI;IAC7C,uBAAuB;IACvB,YADW,MAAM,EAAE,CACS;IAyC5B,2BAA2B;IAC3B,OADW,YAAY,CACL;IAClB,6BAA6B;IAC7B,SADW,cAAc,CACiB;IAE1C;;;OAGG;IACH,oBAA4B;IAE5B;;;OAGG;IACH,oBAA4B;IAGhC;;;;;OAKG;IACH,mBAHW,WAAW,GACT,MAAM,CAIlB;IAED;;;OAGG;IACH,sBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;OAIG;IACH,mBAJW,MAAM,OACN,MAAM,GACJ,OAAO,CAInB;IAED;;;;;OAKG;IACH,iBAHW,MAAM,GACJ,WAAW,CAoBvB;IAED;;;;;;;;;;OAUG;IACH,eAJW,MAAM,OACN,MAAM,GACJ,MAAM,EAAE,CAoCpB;IAED;;;;;;;;;;;OAWG;IACH,qBAHW,MAAM,GAAC,IAAI,GACT,WAAW,CAuBvB;IAED;;;;;;;;;;OAUG;IACH,QAFa,MAAM,EAAE,CAiCpB;IAED;;;OAGG;IACH,eAHW,MAAM,GACJ,MAAM,CAMlB;CACJ;6BAjW4B,gCAAgC;+BAC9B,kCAAkC;4BAGrC,kBAAkB"}
|
|
@@ -49,7 +49,7 @@ EDGE_TO_DIRECTION[GridWFCEdge.PositiveY] = 1;
|
|
|
49
49
|
*/
|
|
50
50
|
export class GridWFCCompiledTileSet {
|
|
51
51
|
/**
|
|
52
|
-
* @param {{name:string, edges:string[], weight:number, rotations:number, tags:string[], action:(GridCellAction|null)}[]} prototypes
|
|
52
|
+
* @param {{name:string, edges:string[], weight:number, rotations:number, tags:string[], value:number, action:(GridCellAction|null)}[]} prototypes
|
|
53
53
|
*/
|
|
54
54
|
constructor(prototypes) {
|
|
55
55
|
if (prototypes.length === 0) {
|
|
@@ -57,7 +57,7 @@ export class GridWFCCompiledTileSet {
|
|
|
57
57
|
}
|
|
58
58
|
|
|
59
59
|
/**
|
|
60
|
-
* @type {{name:string, edges:string[], weight:number, rotations:number, tags:string[], action:(GridCellAction|null)}[]}
|
|
60
|
+
* @type {{name:string, edges:string[], weight:number, rotations:number, tags:string[], value:number, action:(GridCellAction|null)}[]}
|
|
61
61
|
*/
|
|
62
62
|
this.prototypes = prototypes.slice();
|
|
63
63
|
|
|
@@ -24,7 +24,7 @@ export class GridWFCTileSet {
|
|
|
24
24
|
/**
|
|
25
25
|
* Tiles as they were added — one per {@link add} call, one per cell of an {@link add_piece}.
|
|
26
26
|
*
|
|
27
|
-
* @type {{name:string, edges:string[], weight:number, rotations:number, tags:string[], action:(GridCellAction|null)}[]}
|
|
27
|
+
* @type {{name:string, edges:string[], weight:number, rotations:number, tags:string[], value:number, action:(GridCellAction|null)}[]}
|
|
28
28
|
*/
|
|
29
29
|
prototypes: {
|
|
30
30
|
name: string;
|
|
@@ -32,6 +32,7 @@ export class GridWFCTileSet {
|
|
|
32
32
|
weight: number;
|
|
33
33
|
rotations: number;
|
|
34
34
|
tags: string[];
|
|
35
|
+
value: number;
|
|
35
36
|
action: (GridCellAction | null);
|
|
36
37
|
}[];
|
|
37
38
|
/**
|
|
@@ -55,16 +56,19 @@ export class GridWFCTileSet {
|
|
|
55
56
|
* that looks the same turned any way, 2 for one with a half-turn symmetry (a straight
|
|
56
57
|
* wall), 4 for one with none (a bend)
|
|
57
58
|
* @param {string[]} [options.tags] what the tile is, for restricting cells to a kind of tile
|
|
59
|
+
* @param {number} [options.value] what the grid task writes into its layer where the tile lands,
|
|
60
|
+
* however it is turned; the index of the prototype unless given
|
|
58
61
|
* @param {GridCellAction|null} [options.action] run on the cell the tile lands in, with the
|
|
59
62
|
* tile's rotation in radians
|
|
60
63
|
* @returns {number} index of the prototype
|
|
61
64
|
*/
|
|
62
|
-
add({ name, edges, weight, rotations, tags, action }: {
|
|
65
|
+
add({ name, edges, weight, rotations, tags, value, action }: {
|
|
63
66
|
name: string;
|
|
64
67
|
edges: string[];
|
|
65
68
|
weight?: number;
|
|
66
69
|
rotations?: number;
|
|
67
70
|
tags?: string[];
|
|
71
|
+
value?: number;
|
|
68
72
|
action?: GridCellAction | null;
|
|
69
73
|
}): number;
|
|
70
74
|
/**
|
|
@@ -76,35 +80,40 @@ export class GridWFCTileSet {
|
|
|
76
80
|
*
|
|
77
81
|
* @param {Object} options
|
|
78
82
|
* @param {string} options.name
|
|
79
|
-
* @param {{x:number, y:number, edges?:string[], tags?:string[], action?:(GridCellAction|null)}[]} options.cells
|
|
83
|
+
* @param {{x:number, y:number, edges?:string[], tags?:string[], value?:number, action?:(GridCellAction|null)}[]} options.cells
|
|
80
84
|
* offsets of the piece's cells at rotation 0, every cell sharing an edge with another —
|
|
81
85
|
* cells that only touch at a corner, or not at all, would be placed apart, so they are an
|
|
82
86
|
* error. `edges` gives a cell's OUTWARD-facing
|
|
83
87
|
* sockets (entries for edges that face another cell of the piece are ignored) and
|
|
84
|
-
* defaults to `edge` all round. `
|
|
85
|
-
* piece's model stands on.
|
|
88
|
+
* defaults to `edge` all round. `value` is the cell's own, in place of the piece's.
|
|
89
|
+
* `action` usually sits on one cell only — the one the piece's model stands on.
|
|
86
90
|
* @param {string} [options.edge] socket of every outward-facing edge a cell does not name
|
|
87
91
|
* @param {number} [options.weight=1]
|
|
88
92
|
* @param {number} [options.rotations=1]
|
|
89
93
|
* @param {string[]} [options.tags] carried by every cell of the piece, with the cell's own
|
|
94
|
+
* @param {number} [options.value] what the grid task writes into its layer under every cell of
|
|
95
|
+
* the piece that names no value of its own; with neither, a cell writes the index of its
|
|
96
|
+
* prototype
|
|
90
97
|
* @returns {number[]} index of each cell's prototype, in the order of `cells`
|
|
91
98
|
*/
|
|
92
|
-
add_piece({ name, cells, edge, weight, rotations, tags }: {
|
|
99
|
+
add_piece({ name, cells, edge, weight, rotations, tags, value }: {
|
|
93
100
|
name: string;
|
|
94
101
|
cells: {
|
|
95
102
|
x: number;
|
|
96
103
|
y: number;
|
|
97
104
|
edges?: string[];
|
|
98
105
|
tags?: string[];
|
|
106
|
+
value?: number;
|
|
99
107
|
action?: (GridCellAction | null);
|
|
100
108
|
}[];
|
|
101
109
|
edge?: string;
|
|
102
110
|
weight?: number;
|
|
103
111
|
rotations?: number;
|
|
104
112
|
tags?: string[];
|
|
113
|
+
value?: number;
|
|
105
114
|
}): number[];
|
|
106
115
|
/**
|
|
107
|
-
* @param {{name:string, edges:string[], weight:number, rotations:number, tags:string[], action:(GridCellAction|null)}} prototype
|
|
116
|
+
* @param {{name:string, edges:string[], weight:number, rotations:number, tags:string[], value:number, action:(GridCellAction|null)}} prototype
|
|
108
117
|
* @returns {number}
|
|
109
118
|
* @private
|
|
110
119
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GridWFCTileSet.d.ts","sourceRoot":"","sources":["../../../../src/generation/wfc/GridWFCTileSet.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"GridWFCTileSet.d.ts","sourceRoot":"","sources":["../../../../src/generation/wfc/GridWFCTileSet.js"],"names":[],"mappings":"AAwEA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;IAEI;;;;OAIG;IACH,YAFU;QAAC,IAAI,EAAC,MAAM,CAAC;QAAC,KAAK,EAAC,MAAM,EAAE,CAAC;QAAC,MAAM,EAAC,MAAM,CAAC;QAAC,SAAS,EAAC,MAAM,CAAC;QAAC,IAAI,EAAC,MAAM,EAAE,CAAC;QAAC,KAAK,EAAC,MAAM,CAAC;QAAC,MAAM,EAAC,CAAC,iBAAe,IAAI,CAAC,CAAA;KAAC,EAAE,CAErH;IAEhB;;;OAGG;IACH,sBAAkB;IAElB;;;OAGG;IACH,mBAAkB;IAElB;;;;;;;;;;;;;;;;OAgBG;IACH;QAb2B,IAAI,EAApB,MAAM;QACY,KAAK,EAAvB,MAAM,EAAE;QACS,MAAM,GAAvB,MAAM;QACW,SAAS,GAA1B,MAAM;QAGa,IAAI,GAAvB,MAAM,EAAE;QACS,KAAK,GAAtB,MAAM;QAEwB,MAAM,GAApC,iBAAe,IAAI;QAEjB,MAAM,CAUlB;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACH;QAjB2B,IAAI,EAApB,MAAM;QACyG,KAAK,EAApH;YAAC,CAAC,EAAC,MAAM,CAAC;YAAC,CAAC,EAAC,MAAM,CAAC;YAAC,KAAK,CAAC,EAAC,MAAM,EAAE,CAAC;YAAC,IAAI,CAAC,EAAC,MAAM,EAAE,CAAC;YAAC,KAAK,CAAC,EAAC,MAAM,CAAC;YAAC,MAAM,CAAC,EAAC,CAAC,iBAAe,IAAI,CAAC,CAAA;SAAC,EAAE;QAOpF,IAAI,GAArB,MAAM;QACW,MAAM,GAAvB,MAAM;QACW,SAAS,GAA1B,MAAM;QACa,IAAI,GAAvB,MAAM,EAAE;QACS,KAAK,GAAtB,MAAM;QAGJ,MAAM,EAAE,CA2GpB;IAED;;;;OAIG;IACH,eAKC;IAED;;;;OAIG;IACH,WAFa,sBAAsB,CAQlC;CACJ;uCAxSsC,6BAA6B"}
|
|
@@ -40,6 +40,15 @@ function assert_tile_options(weight, rotations, tags) {
|
|
|
40
40
|
assert.isArray(tags, 'tags');
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
+
/**
|
|
44
|
+
* @param {number} value
|
|
45
|
+
* @param {string} what
|
|
46
|
+
*/
|
|
47
|
+
function assert_value(value, what) {
|
|
48
|
+
assert.isNumber(value, what);
|
|
49
|
+
assert.isFinite(value, what);
|
|
50
|
+
}
|
|
51
|
+
|
|
43
52
|
/**
|
|
44
53
|
* @param {GridCellAction|null} action
|
|
45
54
|
* @param {string} what
|
|
@@ -88,7 +97,7 @@ export class GridWFCTileSet {
|
|
|
88
97
|
/**
|
|
89
98
|
* Tiles as they were added — one per {@link add} call, one per cell of an {@link add_piece}.
|
|
90
99
|
*
|
|
91
|
-
* @type {{name:string, edges:string[], weight:number, rotations:number, tags:string[], action:(GridCellAction|null)}[]}
|
|
100
|
+
* @type {{name:string, edges:string[], weight:number, rotations:number, tags:string[], value:number, action:(GridCellAction|null)}[]}
|
|
92
101
|
*/
|
|
93
102
|
prototypes = [];
|
|
94
103
|
|
|
@@ -115,17 +124,20 @@ export class GridWFCTileSet {
|
|
|
115
124
|
* that looks the same turned any way, 2 for one with a half-turn symmetry (a straight
|
|
116
125
|
* wall), 4 for one with none (a bend)
|
|
117
126
|
* @param {string[]} [options.tags] what the tile is, for restricting cells to a kind of tile
|
|
127
|
+
* @param {number} [options.value] what the grid task writes into its layer where the tile lands,
|
|
128
|
+
* however it is turned; the index of the prototype unless given
|
|
118
129
|
* @param {GridCellAction|null} [options.action] run on the cell the tile lands in, with the
|
|
119
130
|
* tile's rotation in radians
|
|
120
131
|
* @returns {number} index of the prototype
|
|
121
132
|
*/
|
|
122
|
-
add({ name, edges, weight = 1, rotations = 1, tags = [], action = null }) {
|
|
133
|
+
add({ name, edges, weight = 1, rotations = 1, tags = [], value = this.prototypes.length, action = null }) {
|
|
123
134
|
assert.isString(name, 'name');
|
|
124
135
|
assert_edges(edges, 'edges');
|
|
125
136
|
assert_tile_options(weight, rotations, tags);
|
|
137
|
+
assert_value(value, 'value');
|
|
126
138
|
assert_action(action, 'action');
|
|
127
139
|
|
|
128
|
-
return this.__push({ name, edges: edges.slice(), weight, rotations, tags: tags.slice(), action });
|
|
140
|
+
return this.__push({ name, edges: edges.slice(), weight, rotations, tags: tags.slice(), value, action });
|
|
129
141
|
}
|
|
130
142
|
|
|
131
143
|
/**
|
|
@@ -137,20 +149,23 @@ export class GridWFCTileSet {
|
|
|
137
149
|
*
|
|
138
150
|
* @param {Object} options
|
|
139
151
|
* @param {string} options.name
|
|
140
|
-
* @param {{x:number, y:number, edges?:string[], tags?:string[], action?:(GridCellAction|null)}[]} options.cells
|
|
152
|
+
* @param {{x:number, y:number, edges?:string[], tags?:string[], value?:number, action?:(GridCellAction|null)}[]} options.cells
|
|
141
153
|
* offsets of the piece's cells at rotation 0, every cell sharing an edge with another —
|
|
142
154
|
* cells that only touch at a corner, or not at all, would be placed apart, so they are an
|
|
143
155
|
* error. `edges` gives a cell's OUTWARD-facing
|
|
144
156
|
* sockets (entries for edges that face another cell of the piece are ignored) and
|
|
145
|
-
* defaults to `edge` all round. `
|
|
146
|
-
* piece's model stands on.
|
|
157
|
+
* defaults to `edge` all round. `value` is the cell's own, in place of the piece's.
|
|
158
|
+
* `action` usually sits on one cell only — the one the piece's model stands on.
|
|
147
159
|
* @param {string} [options.edge] socket of every outward-facing edge a cell does not name
|
|
148
160
|
* @param {number} [options.weight=1]
|
|
149
161
|
* @param {number} [options.rotations=1]
|
|
150
162
|
* @param {string[]} [options.tags] carried by every cell of the piece, with the cell's own
|
|
163
|
+
* @param {number} [options.value] what the grid task writes into its layer under every cell of
|
|
164
|
+
* the piece that names no value of its own; with neither, a cell writes the index of its
|
|
165
|
+
* prototype
|
|
151
166
|
* @returns {number[]} index of each cell's prototype, in the order of `cells`
|
|
152
167
|
*/
|
|
153
|
-
add_piece({ name, cells, edge, weight = 1, rotations = 1, tags = [] }) {
|
|
168
|
+
add_piece({ name, cells, edge, weight = 1, rotations = 1, tags = [], value }) {
|
|
154
169
|
assert.isString(name, 'name');
|
|
155
170
|
assert.isArray(cells, 'cells');
|
|
156
171
|
assert.greaterThan(cells.length, 0, 'cells.length');
|
|
@@ -160,6 +175,10 @@ export class GridWFCTileSet {
|
|
|
160
175
|
assert_socket(edge, 'edge');
|
|
161
176
|
}
|
|
162
177
|
|
|
178
|
+
if (value !== undefined) {
|
|
179
|
+
assert_value(value, 'value');
|
|
180
|
+
}
|
|
181
|
+
|
|
163
182
|
const at = new Map();
|
|
164
183
|
|
|
165
184
|
for (let i = 0; i < cells.length; i++) {
|
|
@@ -218,6 +237,10 @@ export class GridWFCTileSet {
|
|
|
218
237
|
assert.isArray(cell.tags, `cells[${i}].tags`);
|
|
219
238
|
}
|
|
220
239
|
|
|
240
|
+
if (cell.value !== undefined) {
|
|
241
|
+
assert_value(cell.value, `cells[${i}].value`);
|
|
242
|
+
}
|
|
243
|
+
|
|
221
244
|
assert_action(cell_action, `cells[${i}].action`);
|
|
222
245
|
|
|
223
246
|
const edges = [];
|
|
@@ -241,6 +264,7 @@ export class GridWFCTileSet {
|
|
|
241
264
|
weight,
|
|
242
265
|
rotations,
|
|
243
266
|
tags: tags.concat(cell.tags ?? []),
|
|
267
|
+
value: cell.value ?? value ?? this.prototypes.length,
|
|
244
268
|
action: cell_action
|
|
245
269
|
}));
|
|
246
270
|
}
|
|
@@ -249,7 +273,7 @@ export class GridWFCTileSet {
|
|
|
249
273
|
}
|
|
250
274
|
|
|
251
275
|
/**
|
|
252
|
-
* @param {{name:string, edges:string[], weight:number, rotations:number, tags:string[], action:(GridCellAction|null)}} prototype
|
|
276
|
+
* @param {{name:string, edges:string[], weight:number, rotations:number, tags:string[], value:number, action:(GridCellAction|null)}} prototype
|
|
253
277
|
* @returns {number}
|
|
254
278
|
* @private
|
|
255
279
|
*/
|
|
@@ -32,9 +32,9 @@ import { VIEW_UNIFORM_STRUCT } from "../../renderer/view/VIEW_UNIFORM_STRUCT.js"
|
|
|
32
32
|
* @enum {number}
|
|
33
33
|
*/
|
|
34
34
|
export const ContactCombine = {
|
|
35
|
-
/** visibility = shadow map × contact: what
|
|
35
|
+
/** visibility = shadow map × contact: what Filament/Bevy do */
|
|
36
36
|
Multiply: 0,
|
|
37
|
-
/** visibility = min(shadow map, contact): what Godot
|
|
37
|
+
/** visibility = min(shadow map, contact): what Godot does */
|
|
38
38
|
Min: 1,
|
|
39
39
|
/**
|
|
40
40
|
* visibility = 0: takes the whole sun term back out. Only for checking the composite, against a
|
|
@@ -27,8 +27,8 @@ edits it at both altitudes.
|
|
|
27
27
|
was selected, `Ctrl` toggles what the box covers, and the box says which of the three it is
|
|
28
28
|
while you are still holding it. Which button began the press decides which gesture it is, and
|
|
29
29
|
how far it travelled decides whether it was a press or a drag — so a right press that stays put
|
|
30
|
-
is the menu below and one that moves is a pan, the way
|
|
31
|
-
same three gestures.
|
|
30
|
+
is the menu below and one that moves is a pan, the way graph editors of this kind have long
|
|
31
|
+
arranged the same three gestures.
|
|
32
32
|
- **Right-click the canvas** to add a node. The library opens under the cursor with the caret
|
|
33
33
|
already in a search field and the first match already chosen: type a few letters, press Enter, and
|
|
34
34
|
the node lands at the point that was clicked with the defaults its type declares, so it compiles
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
<span>Indirect light</span>
|
|
90
90
|
<select id="indirect">
|
|
91
91
|
<option value="ProbeClipmap" selected>Probe clipmap</option>
|
|
92
|
-
<option value="ScreenProbes">Screen probes —
|
|
92
|
+
<option value="ScreenProbes">Screen probes — screen-space probe gather over the clipmap's world</option>
|
|
93
93
|
<option value="IBL">IBL</option>
|
|
94
94
|
</select>
|
|
95
95
|
</label>
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Screen probe GI
|
|
2
2
|
|
|
3
|
-
A page to drive `ShadeIndirectLightingMode.ScreenProbes` by hand on Sponza:
|
|
3
|
+
A page to drive `ShadeIndirectLightingMode.ScreenProbes` by hand on Sponza: a screen-space probe gather over the
|
|
4
4
|
probe clipmap's world (`src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js`), against the
|
|
5
5
|
probe clipmap alone and IBL, with the mode's debug views, the world's, and every field of `ScreenProbeSettings`.
|
|
6
6
|
|
|
@@ -29,7 +29,7 @@ with `?mode=ProbeClipmap` or `?mode=IBL`.
|
|
|
29
29
|
| Octahedron | rays a probe casts, n × n (`octahedron_resolution`); remakes the probes |
|
|
30
30
|
| Importance sampling (I) | rays follow the pixels' BRDF and the probe's last light (`importance_sampling`) |
|
|
31
31
|
| Screen traces (K) | rays go through the depth buffer before the SDF bricks (`screen_traces`) |
|
|
32
|
-
| Rough specular (R) | the probes light the specular of surfaces rougher than 0.3–0.4
|
|
32
|
+
| Rough specular (R) | the probes light the specular of surfaces rougher than 0.3–0.4; off, the world probes light every surface's specular (`rough_specular`) |
|
|
33
33
|
| Spatial filter | passes between neighbouring probes (`spatial_filter_passes`); 0 runs none |
|
|
34
34
|
| Temporal | the most frames a pixel's diffuse and rough specular average (`temporal_frames`) |
|
|
35
35
|
| Sun (L), Sun height, Sun turn | the directional light, and where it stands |
|
|
@@ -49,6 +49,6 @@ the camera, the sun or the point lights restarts it. It stops at three bounces.
|
|
|
49
49
|
## What to expect
|
|
50
50
|
|
|
51
51
|
The diffuse is the screen probes'. The specular is theirs on rough surfaces and the world probes' on smooth ones,
|
|
52
|
-
blended between roughness 0.3 and 0.4
|
|
53
|
-
|
|
54
|
-
|
|
52
|
+
blended between roughness 0.3 and 0.4. Rays that leave the screen and the bricks' reach take the world probes'
|
|
53
|
+
radiance, which converge over tens of seconds after the page loads whichever mode runs, so compare against the path
|
|
54
|
+
tracer once the world has settled.
|
|
@@ -29,7 +29,7 @@ import { make_playground_asset_manager } from "../make_playground_asset_manager.
|
|
|
29
29
|
import { install_profile_hotkey } from "../profile_hotkey.js";
|
|
30
30
|
|
|
31
31
|
/**
|
|
32
|
-
* The screen probe GI (`ShadeIndirectLightingMode.ScreenProbes`,
|
|
32
|
+
* The screen probe GI (`ShadeIndirectLightingMode.ScreenProbes`, a screen-space probe gather over the probe
|
|
33
33
|
* clipmap's world) on Sponza, to drive by hand: the mode against the probe clipmap and IBL, its debug views and
|
|
34
34
|
* those of the world its rays trace, every `ScreenProbeSettings` field, the sun moved, point lights for the hits'
|
|
35
35
|
* local lights.
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
The renderer's `ToneMapper` has four built-in operators, each one choice for every output (`renderer.tone_mapper.operator`):
|
|
4
4
|
|
|
5
|
-
- `TONE_MAP_OPERATOR_ACES`, the default:
|
|
5
|
+
- `TONE_MAP_OPERATOR_ACES`, the default: filmic ACES;
|
|
6
6
|
- `TONE_MAP_OPERATOR_GT7`;
|
|
7
7
|
- `TONE_MAP_OPERATOR_PBR_NEUTRAL`;
|
|
8
8
|
- `TONE_MAP_OPERATOR_NONE`.
|
|
@@ -11,7 +11,8 @@ The tone mapper bakes the operator into a 3D LUT per output and draws through it
|
|
|
11
11
|
directly.
|
|
12
12
|
|
|
13
13
|
This page compares GT7 and PBR Neutral, and shows each one's HDR form beside its SDR form. ACES is not one of its
|
|
14
|
-
views; the engine's own canvas shows it, and `TONE_MAP_OPERATOR_ACES.spec.js` holds it to
|
|
14
|
+
views; the engine's own canvas shows it, and `TONE_MAP_OPERATOR_ACES.spec.js` holds it to a float64 filmic reference and
|
|
15
|
+
OpenColorIO's numbers.
|
|
15
16
|
|
|
16
17
|
The engine renders and tonemaps each frame as usual. Two extensions then redraw the canvas from the HDR colour the
|
|
17
18
|
tonemapper was given:
|
|
@@ -274,9 +274,7 @@ every draw of a meshlet emits that instance's triangle corners in the opposite o
|
|
|
274
274
|
the device as they are stored — by the vertex shader where the draw is non-indexed, and by the index
|
|
275
275
|
build of an indexed opaque draw (`shader_meshlet_draw_indices`) — so which corner lands where is
|
|
276
276
|
already its choice; reversing it costs a `select`, no pipeline of its own, and no fourth field in the
|
|
277
|
-
bucket key. It is what
|
|
278
|
-
reason, and what the glTF spec
|
|
279
|
-
requires of a conformant renderer. The tangent frame's handedness flips with it.
|
|
277
|
+
bucket key. It is what the glTF spec requires of a conformant renderer. The tangent frame's handedness flips with it.
|
|
280
278
|
|
|
281
279
|
The parameters remain, and now read as diagnostics rather than as fixes:
|
|
282
280
|
|
|
@@ -1123,7 +1123,7 @@ function make_scene_material(definition, side) {
|
|
|
1123
1123
|
is therefore unoccluded, which is the right answer and the reason the default is that pair.
|
|
1124
1124
|
|
|
1125
1125
|
This states it rather than reaching it by saturation, because the value here has to survive
|
|
1126
|
-
`bind_scene_textures` switching to (1, 0) when a real ORM arrives:
|
|
1126
|
+
`bind_scene_textures` switching to (1, 0) when a real ORM arrives: the source's red channel *is*
|
|
1127
1127
|
ambient occlusion and the conversion wants it applied, which is a decision about the source
|
|
1128
1128
|
rather than a correction to the engine.
|
|
1129
1129
|
*/
|
|
@@ -1203,7 +1203,7 @@ function make_uniform_environment(value) {
|
|
|
1203
1203
|
*
|
|
1204
1204
|
* `createImageBitmap` rather than `ShadeImage.fromArrayBuffer`: these are ordinary PNGs written by
|
|
1205
1205
|
* the extraction and the browser's own decoder is what should read them.
|
|
1206
|
-
* `colorSpaceConversion: 'none'` matters — the extraction already wrote the exact bytes
|
|
1206
|
+
* `colorSpaceConversion: 'none'` matters — the extraction already wrote the exact bytes the source asset had,
|
|
1207
1207
|
* and letting the browser convert them to the display profile on the way in shifts every albedo.
|
|
1208
1208
|
*
|
|
1209
1209
|
* A UDIM set has no place to go in a fixed material, so its first tile is taken and the caller is
|
|
@@ -1237,7 +1237,7 @@ async function load_scene_texture(slot, base) {
|
|
|
1237
1237
|
/*
|
|
1238
1238
|
A base colour map is sRGB encoded and everything else — normals, and an ORM's occlusion,
|
|
1239
1239
|
roughness and metalness — is linear data that must not be decoded on the way in. The extraction
|
|
1240
|
-
read the flag off the
|
|
1240
|
+
read the flag off the source asset and wrote it into the sidecar rather than guessing it from
|
|
1241
1241
|
the slot, because the two disagree often enough to matter.
|
|
1242
1242
|
*/
|
|
1243
1243
|
image.color_space = slot.srgb === true ? ColorSpace.SRGB : ColorSpace.None;
|