@woosh/meep-engine 3.70.0 → 3.71.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/MIGRATION_2_TO_3.md +1 -1
- package/package.json +1 -1
- package/src/engine/graphics3/VolumetricLightMapSystem.d.ts +1 -1
- package/src/engine/graphics3/VolumetricLightMapSystem.js +261 -261
- package/src/engine/input/devices/PointerDevice.d.ts +12 -1
- package/src/engine/input/devices/PointerDevice.d.ts.map +1 -1
- package/src/engine/input/devices/PointerDevice.js +266 -24
- package/src/engine/input/devices/mouse/MouseButtons.d.ts +1 -2
- package/src/engine/input/devices/mouse/MouseButtons.d.ts.map +1 -1
- package/src/engine/input/devices/mouse/MouseButtons.js +1 -2
- package/src/engine/input/devices/mouse/mouseButtonToEventButtonsMask.d.ts +13 -0
- package/src/engine/input/devices/mouse/mouseButtonToEventButtonsMask.d.ts.map +1 -0
- package/src/engine/input/devices/mouse/mouseButtonToEventButtonsMask.js +24 -0
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.d.ts.map +1 -1
- package/src/engine/network/orchestrator/ServerAuthoritativeClient.js +3 -1
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/engine/sound/simulation/probe/probe_place_sdf_cover.d.ts +1 -2
- package/src/engine/sound/simulation/probe/probe_place_sdf_cover.d.ts.map +1 -1
- package/src/engine/sound/simulation/probe/probe_place_sdf_cover.js +1 -2
- package/src/shade/renderer/Renderer.d.ts +0 -12
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +0 -101
- package/src/shade/renderer/ShadeIndirectLightingMode.d.ts +0 -1
- package/src/shade/renderer/ShadeIndirectLightingMode.js +0 -2
- package/src/shade/renderer/atmosphere/ATMOSPHERE_PARAMETERS_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/ATMOSPHERE_PARAMETERS_STRUCT.js +7 -0
- package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.js +1 -4
- package/src/shade/renderer/fluid/GPUFluidCascade.d.ts +3 -3
- package/src/shade/renderer/fluid/GPUFluidCascadeStack.d.ts +1 -1
- package/src/shade/renderer/fluid/forcing/GPUFluidForcing.d.ts +7 -7
- package/src/shade/renderer/fluid/pressure/GPUFluidPressureSolve.d.ts +1 -1
- package/src/shade/renderer/fluid/query/GPUFluidQueries.d.ts +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +1 -1
- package/src/shade/renderer/light/GPULightCollection.d.ts +3 -2
- package/src/shade/renderer/light/GPULightCollection.d.ts.map +1 -1
- package/src/shade/renderer/light/GPULightCollection.js +28 -2
- package/src/shade/renderer/light/environment/shader_project_environment_sh.d.ts +2 -2
- package/src/shade/renderer/light/environment/shader_project_environment_sh.js +2 -2
- package/src/shade/renderer/light/make_sunlight.d.ts +14 -0
- package/src/shade/renderer/light/make_sunlight.d.ts.map +1 -1
- package/src/shade/renderer/light/make_sunlight.js +16 -2
- package/src/shade/renderer/light/model/DirectionalLight.d.ts +9 -0
- package/src/shade/renderer/light/model/DirectionalLight.d.ts.map +1 -1
- package/src/shade/renderer/light/model/DirectionalLight.js +10 -1
- package/src/shade/renderer/light/model/Light.d.ts +4 -2
- package/src/shade/renderer/light/model/Light.d.ts.map +1 -1
- package/src/shade/renderer/light/model/Light.js +4 -2
- package/src/shade/renderer/light/model/io/light_record_directional.d.ts.map +1 -1
- package/src/shade/renderer/light/model/io/light_record_directional.js +3 -0
- package/src/shade/renderer/light/shader_refresh_light_poses.d.ts +16 -1
- package/src/shade/renderer/light/shader_refresh_light_poses.d.ts.map +1 -1
- package/src/shade/renderer/light/shader_refresh_light_poses.js +211 -154
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/postprocess/ssr/SSR.d.ts +2 -5
- package/src/shade/renderer/postprocess/ssr/SSR.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/SSR.js +1 -13
- package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.d.ts +2 -9
- package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.js +2 -38
- package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts +0 -5
- package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.js +0 -16
- package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/ssr/resolve/ssr_resolve_shader.js +3 -10
- package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect.d.ts +0 -2
- package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect.d.ts.map +1 -1
- package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect.js +0 -3
- package/src/shade/renderer/scene/GPUSceneContext.d.ts +0 -6
- package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.js +0 -19
- package/src/shade/renderer/scene/Scene.d.ts +1 -7
- package/src/shade/renderer/scene/Scene.d.ts.map +1 -1
- package/src/shade/renderer/scene/Scene.js +1 -8
- package/src/shade/renderer/scene/bvh/sdf_build_from_scene.d.ts.map +1 -0
- package/src/shade/renderer/{global_illumination/lpv/placement/software → scene/bvh}/sdf_build_from_scene.js +6 -6
- package/src/shade/renderer/scene/bvh/sdf_find_local_maxima.d.ts.map +1 -0
- package/src/shade/renderer/{global_illumination/lpv/placement/software → scene/bvh}/sdf_find_local_maxima.js +1 -1
- package/src/shade/renderer/shader/chunk/light/DIRECTIONAL_LIGHT_STRUCT.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/light/DIRECTIONAL_LIGHT_STRUCT.js +12 -2
- package/src/shade/renderer/shader/chunk/light/io/chunk_point_lights_iterate.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/light/io/chunk_point_lights_iterate.js +1 -1
- package/src/shade/renderer/{global_illumination/probe/octahedral/sample → shader/chunk/light/probe}/chunk_parallax_correct_spherical_probe.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/light/probe/chunk_parallax_correct_spherical_probe.d.ts.map +1 -0
- package/src/shade/renderer/{global_illumination/probe/octahedral/sample → shader/chunk/light/probe}/chunk_parallax_correct_spherical_probe.js +2 -2
- package/src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.d.ts +1 -1
- package/src/shade/renderer/shader/chunk/light/probe/chunk_probe_visibility_weight.js +1 -1
- package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh2_dering_optimize_positive.d.ts +1 -2
- package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh2_dering_optimize_positive.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/spherical_harmonics/dering/chunk_sh2_dering_optimize_positive.js +1 -2
- package/src/shade/renderer/trails/GPUTrailSystem.d.ts +4 -0
- package/src/shade/renderer/trails/GPUTrailSystem.d.ts.map +1 -1
- package/src/shade/renderer/trails/GPUTrailSystem.js +9 -3
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts +1 -3
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +0 -3
- package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.d.ts +2 -2
- package/src/shade/renderer/volumetrics/chunk_volumetrics_irradiance_sh.js +2 -2
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts +1 -3
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/GPUIrradianceClipmap.js +0 -9
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts +0 -5
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.js +0 -29
- package/src/shade/renderer/volumetrics/irradiance_clipmap/shader_irradiance_clipmap_build.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/irradiance_clipmap/shader_irradiance_clipmap_build.js +0 -2
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +11 -6
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_scattering_lut.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_scattering_lut.js +10 -4
- package/src/shade/renderer/water/chunk_water_gi.d.ts +1 -1
- package/src/shade/renderer/water/chunk_water_gi.d.ts.map +1 -1
- package/src/shade/renderer/water/chunk_water_gi.js +1 -3
- package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
- package/src/shade/renderer/deferred/indirect/chunk_gi_sample_lpv_cache.d.ts +0 -3
- package/src/shade/renderer/deferred/indirect/chunk_gi_sample_lpv_cache.d.ts.map +0 -1
- package/src/shade/renderer/deferred/indirect/chunk_gi_sample_lpv_cache.js +0 -41
- package/src/shade/renderer/deferred/indirect/chunk_lpv_2d_cache_sample_irradiance.d.ts +0 -6
- package/src/shade/renderer/deferred/indirect/chunk_lpv_2d_cache_sample_irradiance.d.ts.map +0 -1
- package/src/shade/renderer/deferred/indirect/chunk_lpv_2d_cache_sample_irradiance.js +0 -108
- package/src/shade/renderer/deferred/indirect/chunk_lpv_sample_light.d.ts +0 -6
- package/src/shade/renderer/deferred/indirect/chunk_lpv_sample_light.d.ts.map +0 -1
- package/src/shade/renderer/deferred/indirect/chunk_lpv_sample_light.js +0 -100
- package/src/shade/renderer/global_illumination/lpv/GPULightProbeVolume.d.ts +0 -51
- package/src/shade/renderer/global_illumination/lpv/GPULightProbeVolume.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/GPULightProbeVolume.js +0 -384
- package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_STRUCT.d.ts +0 -3
- package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_STRUCT.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_STRUCT.js +0 -20
- package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_VOLUME_METADATA_STRUCT.d.ts +0 -3
- package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_VOLUME_METADATA_STRUCT.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/LIGHT_PROBE_VOLUME_METADATA_STRUCT.js +0 -10
- package/src/shade/renderer/global_illumination/lpv/LightProbeVolume.d.ts +0 -63
- package/src/shade/renderer/global_illumination/lpv/LightProbeVolume.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/LightProbeVolume.js +0 -177
- package/src/shade/renderer/global_illumination/lpv/TETRAHEDRAL_MESH_CELL_STRUCT.d.ts +0 -3
- package/src/shade/renderer/global_illumination/lpv/TETRAHEDRAL_MESH_CELL_STRUCT.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/TETRAHEDRAL_MESH_CELL_STRUCT.js +0 -7
- package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.d.ts +0 -68
- package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/bake/GPULightProbeVolumeRenderer.js +0 -410
- package/src/shade/renderer/global_illumination/lpv/bake/PROBE_RAYS_PER_WORKGROUP.d.ts +0 -2
- package/src/shade/renderer/global_illumination/lpv/bake/PROBE_RAYS_PER_WORKGROUP.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/bake/PROBE_RAYS_PER_WORKGROUP.js +0 -1
- package/src/shade/renderer/global_illumination/lpv/debug/shader_visualize_probe_depth.d.ts +0 -3
- package/src/shade/renderer/global_illumination/lpv/debug/shader_visualize_probe_depth.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/debug/shader_visualize_probe_depth.js +0 -38
- package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_RESOLUTION.d.ts +0 -8
- package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_RESOLUTION.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_RESOLUTION.js +0 -7
- package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_STRUCT.d.ts +0 -3
- package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_STRUCT.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_STRUCT.js +0 -8
- package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_get_visibility_mask.d.ts +0 -3
- package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_get_visibility_mask.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_get_visibility_mask.js +0 -48
- package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_coordinate_to_address.d.ts +0 -3
- package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_coordinate_to_address.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_coordinate_to_address.js +0 -11
- package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_get_pixel.d.ts +0 -3
- package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_get_pixel.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/deprecated/chunk_lpv_probe_depth_get_pixel.js +0 -20
- package/src/shade/renderer/global_illumination/lpv/deprecated/probe_trace_compute_shader_code.d.ts +0 -5
- package/src/shade/renderer/global_illumination/lpv/deprecated/probe_trace_compute_shader_code.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/deprecated/probe_trace_compute_shader_code.js +0 -206
- package/src/shade/renderer/global_illumination/lpv/edit/AddProbeAction.d.ts +0 -14
- package/src/shade/renderer/global_illumination/lpv/edit/AddProbeAction.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/edit/AddProbeAction.js +0 -39
- package/src/shade/renderer/global_illumination/lpv/graph_bake_irradiance_lookup_2d.d.ts +0 -16
- package/src/shade/renderer/global_illumination/lpv/graph_bake_irradiance_lookup_2d.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/graph_bake_irradiance_lookup_2d.js +0 -201
- package/src/shade/renderer/global_illumination/lpv/lpv_jitter_points.d.ts +0 -10
- package/src/shade/renderer/global_illumination/lpv/lpv_jitter_points.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/lpv_jitter_points.js +0 -27
- package/src/shade/renderer/global_illumination/lpv/lpv_visualise_probes.d.ts +0 -18
- package/src/shade/renderer/global_illumination/lpv/lpv_visualise_probes.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/lpv_visualise_probes.js +0 -265
- package/src/shade/renderer/global_illumination/lpv/placement/chunk_refine_probe_placement.d.ts +0 -7
- package/src/shade/renderer/global_illumination/lpv/placement/chunk_refine_probe_placement.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/placement/chunk_refine_probe_placement.js +0 -126
- package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.d.ts +0 -13
- package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/placement/graph_generate_probe_locations.js +0 -373
- package/src/shade/renderer/global_illumination/lpv/placement/software/lpv_generate_probe_locations2.d.ts +0 -14
- package/src/shade/renderer/global_illumination/lpv/placement/software/lpv_generate_probe_locations2.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/placement/software/lpv_generate_probe_locations2.js +0 -225
- package/src/shade/renderer/global_illumination/lpv/placement/software/sdf_build_from_scene.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/placement/software/sdf_find_local_maxima.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/shader_diffuse_LPV.d.ts +0 -3
- package/src/shade/renderer/global_illumination/lpv/shader_diffuse_LPV.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/lpv/shader_diffuse_LPV.js +0 -91
- package/src/shade/renderer/global_illumination/probe/chunk_compute_probe_dering.d.ts +0 -5
- package/src/shade/renderer/global_illumination/probe/chunk_compute_probe_dering.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/chunk_compute_probe_dering.js +0 -45
- package/src/shade/renderer/global_illumination/probe/compute_pipeline_probe_dering.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe/compute_pipeline_probe_dering.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/compute_pipeline_probe_dering.js +0 -17
- package/src/shade/renderer/global_illumination/probe/lpv_dering_software.d.ts +0 -6
- package/src/shade/renderer/global_illumination/probe/lpv_dering_software.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/lpv_dering_software.js +0 -21
- package/src/shade/renderer/global_illumination/probe/octahedral/GPUProbeAtlas.d.ts +0 -79
- package/src/shade/renderer/global_illumination/probe/octahedral/GPUProbeAtlas.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/GPUProbeAtlas.js +0 -437
- package/src/shade/renderer/global_illumination/probe/octahedral/LPV_ACCUMULATION_PUSH_CONSTANTS.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe/octahedral/LPV_ACCUMULATION_PUSH_CONSTANTS.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/LPV_ACCUMULATION_PUSH_CONSTANTS.js +0 -14
- package/src/shade/renderer/global_illumination/probe/octahedral/LPV_SHADER_RESOURCE_GROUP.d.ts +0 -42
- package/src/shade/renderer/global_illumination/probe/octahedral/LPV_SHADER_RESOURCE_GROUP.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/LPV_SHADER_RESOURCE_GROUP.js +0 -68
- package/src/shade/renderer/global_illumination/probe/octahedral/ProbeGBufferTypes.d.ts +0 -9
- package/src/shade/renderer/global_illumination/probe/octahedral/ProbeGBufferTypes.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/ProbeGBufferTypes.js +0 -20
- package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_map_index_to_border.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_map_index_to_border.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_map_index_to_border.js +0 -47
- package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_paint_borders_body.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_paint_borders_body.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/border/chunk_lpv_paint_borders_body.js +0 -55
- package/src/shade/renderer/global_illumination/probe/octahedral/border/graph_lpv_paint_border_depth.d.ts +0 -19
- package/src/shade/renderer/global_illumination/probe/octahedral/border/graph_lpv_paint_border_depth.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/border/graph_lpv_paint_border_depth.js +0 -85
- package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_border_read.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_border_read.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_border_read.js +0 -78
- package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_depth.d.ts +0 -7
- package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_depth.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_depth.js +0 -70
- package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_radiance.d.ts +0 -7
- package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_radiance.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/border/shader_lpv_atlas_paint_borders_radiance.js +0 -20
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/chunk_compute_coefficient_address.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/chunk_compute_coefficient_address.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/chunk_compute_coefficient_address.js +0 -20
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lpv_store_sh.d.ts +0 -19
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lpv_store_sh.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lpv_store_sh.js +0 -128
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lvp_atlas_to_sh.d.ts +0 -22
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lvp_atlas_to_sh.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_lvp_atlas_to_sh.js +0 -200
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.d.ts +0 -23
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/convolve/graph_reduce_atlas_to_sh.js +0 -179
- package/src/shade/renderer/global_illumination/probe/octahedral/graph_lpv_shade.d.ts +0 -13
- package/src/shade/renderer/global_illumination/probe/octahedral/graph_lpv_shade.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/graph_lpv_shade.js +0 -416
- package/src/shade/renderer/global_illumination/probe/octahedral/graph_sample_light_probes.d.ts +0 -16
- package/src/shade/renderer/global_illumination/probe/octahedral/graph_sample_light_probes.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/graph_sample_light_probes.js +0 -268
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_patch_texel_coord.d.ts +0 -17
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_patch_texel_coord.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_patch_texel_coord.js +0 -38
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_read_patch_texel.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_read_patch_texel.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_read_patch_texel.js +0 -34
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance.js +0 -62
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance_nearest.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance_nearest.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_atlas_sample_probe_radiance_nearest.js +0 -37
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_mesh_interpolate_radiance_via_atlas.d.ts +0 -7
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_mesh_interpolate_radiance_via_atlas.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_mesh_interpolate_radiance_via_atlas.js +0 -62
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_radiance_sample_reflection.d.ts +0 -7
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_radiance_sample_reflection.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_lpv_radiance_sample_reflection.js +0 -61
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_parallax_correct_spherical_probe.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_parallax_correct_spherical_probe_iterative.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_parallax_correct_spherical_probe_iterative.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/sample/chunk_parallax_correct_spherical_probe_iterative.js +0 -80
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_accumulate_depth.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_accumulate_depth.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_accumulate_depth.js +0 -143
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_atlas_write_depth.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_atlas_write_depth.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_atlas_write_depth.js +0 -59
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.d.ts +0 -3
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.d.ts.map +0 -1
- package/src/shade/renderer/global_illumination/probe/octahedral/shader_lpv_build_gbuffer.js +0 -227
- package/src/shade/renderer/shader/chunk/light/lpv/INVALID_TET_DECLARATION.d.ts +0 -7
- package/src/shade/renderer/shader/chunk/light/lpv/INVALID_TET_DECLARATION.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/INVALID_TET_DECLARATION.js +0 -12
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_interpolate_probe_irradiance8.d.ts +0 -7
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_interpolate_probe_irradiance8.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_interpolate_probe_irradiance8.js +0 -37
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_barycentric_coordinates.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_barycentric_coordinates.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_barycentric_coordinates.js +0 -29
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_neighbours.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_neighbours.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_neighbours.js +0 -20
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_vertices.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_vertices.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_get_vertices.js +0 -22
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe.d.ts +0 -4
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe.js +0 -53
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance.d.ts +0 -7
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance.js +0 -48
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance_pre.d.ts +0 -7
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance_pre.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolate_probe_irradiance_pre.js +0 -35
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolation_probe_sh.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolation_probe_sh.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_interpolation_probe_sh.js +0 -38
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_lookup_nearest_cell.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_lookup_nearest_cell.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_lookup_nearest_cell.js +0 -67
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_walk_to_tetrahedron.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_walk_to_tetrahedron.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_mesh_walk_to_tetrahedron.js +0 -52
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_data.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_data.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_data.js +0 -22
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_position.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_position.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_probe_get_position.js +0 -17
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance.js +0 -48
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_8.d.ts +0 -9
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_8.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_8.js +0 -126
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_no_depth.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_no_depth.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_no_depth.js +0 -45
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_radiance.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_radiance.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_radiance.js +0 -61
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_sh3_at.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_sh3_at.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_sh3_at.js +0 -33
- package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_mask_weights_by_visibility.d.ts +0 -4
- package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_mask_weights_by_visibility.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_mask_weights_by_visibility.js +0 -161
- package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_probe_sample_depth_array.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_probe_sample_depth_array.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_probe_sample_depth_array.js +0 -59
- package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_sample_depth_atlas.d.ts +0 -4
- package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_sample_depth_atlas.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_sample_depth_atlas.js +0 -97
- /package/src/shade/renderer/{global_illumination/lpv/placement/software → scene/bvh}/sdf_build_from_scene.d.ts +0 -0
- /package/src/shade/renderer/{global_illumination/lpv/placement/software → scene/bvh}/sdf_find_local_maxima.d.ts +0 -0
|
@@ -1,126 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
chunk_lpv_get_visibility_mask
|
|
3
|
-
} from "../../../../global_illumination/lpv/deprecated/chunk_lpv_get_visibility_mask.js";
|
|
4
|
-
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
5
|
-
import { chunk_lpv_interpolate_probe_irradiance8 } from "./chunk_lpv_interpolate_probe_irradiance8.js";
|
|
6
|
-
import { chunk_lpv_mesh_lookup_nearest_cell } from "./chunk_lpv_mesh_lookup_nearest_cell.js";
|
|
7
|
-
import { INVALID_TET_DECLARATION } from "./INVALID_TET_DECLARATION.js";
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Prototype, not fit for production.
|
|
11
|
-
*
|
|
12
|
-
* We sample 8 points instead of 4, this is not C0-continuous.
|
|
13
|
-
* @type {CodeChunk}
|
|
14
|
-
*/
|
|
15
|
-
export const chunk_lpv_sample_irradiance_8 = CodeChunk.from(
|
|
16
|
-
//language=WGSL
|
|
17
|
-
`
|
|
18
|
-
fn lpv_sample_irradiance(
|
|
19
|
-
position: vec3<f32>,
|
|
20
|
-
normal: vec3<f32>,
|
|
21
|
-
view_direction: vec3<f32>
|
|
22
|
-
) -> vec3<f32>{
|
|
23
|
-
|
|
24
|
-
var barycentric_coordinates: vec4<f32>;
|
|
25
|
-
|
|
26
|
-
let tet = lpv_mesh_lookup_nearest_cell(position, &barycentric_coordinates);
|
|
27
|
-
|
|
28
|
-
if(tet == INVALID_TET){
|
|
29
|
-
|
|
30
|
-
return vec3(0.0);
|
|
31
|
-
|
|
32
|
-
}else{
|
|
33
|
-
|
|
34
|
-
var weights: array< f32, 8>;
|
|
35
|
-
var probe_indices: array< u32, 8>;
|
|
36
|
-
|
|
37
|
-
let tet_cell = lpv_mesh[tet];
|
|
38
|
-
|
|
39
|
-
for(var i=0; i<4; i++){
|
|
40
|
-
probe_indices[i] = tet_cell.vertices[i];
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
let neighbours = tet_cell.neighbours;
|
|
44
|
-
|
|
45
|
-
for(var i=0; i<4; i++){
|
|
46
|
-
let encoded_neighbour = tet_cell.neighbours[i];
|
|
47
|
-
|
|
48
|
-
let neighbour_tet = encoded_neighbour >> 2u;
|
|
49
|
-
let neighbour_vertex = encoded_neighbour & 3u;
|
|
50
|
-
|
|
51
|
-
let neighbour_cell = lpv_mesh[neighbour_tet];
|
|
52
|
-
|
|
53
|
-
probe_indices[4 + i] = neighbour_cell.vertices[neighbour_vertex];
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
// build weights
|
|
58
|
-
var weight_sum = 0.0;
|
|
59
|
-
for(var i = 0; i < 8; i++){
|
|
60
|
-
|
|
61
|
-
let probe_index = probe_indices[i];
|
|
62
|
-
|
|
63
|
-
let probe = lpv_probes[probe_index];
|
|
64
|
-
|
|
65
|
-
let probe_position = vec3(probe.position[0], probe.position[1], probe.position[2]);
|
|
66
|
-
|
|
67
|
-
let to_probe = probe_position - position;
|
|
68
|
-
|
|
69
|
-
let distance_sqr = dot(to_probe, to_probe);
|
|
70
|
-
|
|
71
|
-
var weight = 1.0 / (distance_sqr);
|
|
72
|
-
|
|
73
|
-
let direction_to_probe = normalize(to_probe);
|
|
74
|
-
|
|
75
|
-
{
|
|
76
|
-
|
|
77
|
-
let backface_term = max(0.0001, ( dot(normal, direction_to_probe) + 1.0 ) * 0.5);
|
|
78
|
-
|
|
79
|
-
weight *= backface_term;
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
{
|
|
83
|
-
const TUNABLE_BIAS = 0.05;
|
|
84
|
-
let bias_scale = max(probe.distance_max * TUNABLE_BIAS, 1e-7);
|
|
85
|
-
let bias_vector = mix(normal, view_direction, 0.2) * bias_scale;
|
|
86
|
-
|
|
87
|
-
let lookup_position = position + bias_vector;
|
|
88
|
-
|
|
89
|
-
weight *= lpv_get_visibility_mask(lookup_position, probe_index);
|
|
90
|
-
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
// Avoid zero weight
|
|
94
|
-
weight = max(1e-6, weight);
|
|
95
|
-
|
|
96
|
-
// A tiny bit of light is really visible due to log perception, so
|
|
97
|
-
// crush tiny weights but keep the curve continuous. This must be done
|
|
98
|
-
// before the trilinear weights, because those should be preserved.
|
|
99
|
-
const crushThreshold = 0.2;
|
|
100
|
-
|
|
101
|
-
if (weight < crushThreshold) {
|
|
102
|
-
weight *= weight * weight * (1.0 / (crushThreshold * crushThreshold));
|
|
103
|
-
}
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
weights[i] = weight;
|
|
107
|
-
|
|
108
|
-
weight_sum += weight;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// normalize weights
|
|
112
|
-
for(var i = 0; i < 8; i++){
|
|
113
|
-
weights[i] /= weight_sum;
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
return lpv_interpolate_probe_irradiance8(normal, weights, probe_indices);
|
|
117
|
-
|
|
118
|
-
}
|
|
119
|
-
}
|
|
120
|
-
`, [
|
|
121
|
-
INVALID_TET_DECLARATION,
|
|
122
|
-
chunk_lpv_mesh_lookup_nearest_cell,
|
|
123
|
-
chunk_lpv_interpolate_probe_irradiance8,
|
|
124
|
-
chunk_lpv_get_visibility_mask,
|
|
125
|
-
]
|
|
126
|
-
);
|
package/src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_no_depth.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_lpv_sample_irradiance_no_depth.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_irradiance_no_depth.js"],"names":[],"mappings":"AAMA,6DAsCE;0BA5CwB,gCAAgC"}
|
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
2
|
-
import { chunk_lpv_mesh_interpolate_probe_irradiance_pre } from "./chunk_lpv_mesh_interpolate_probe_irradiance_pre.js";
|
|
3
|
-
import { chunk_lpv_mesh_lookup_nearest_cell } from "./chunk_lpv_mesh_lookup_nearest_cell.js";
|
|
4
|
-
import { chunk_lpv_mask_weights_by_visibility_no_depth } from "./depth/chunk_lpv_mask_weights_by_visibility.js";
|
|
5
|
-
import { INVALID_TET_DECLARATION } from "./INVALID_TET_DECLARATION.js";
|
|
6
|
-
|
|
7
|
-
export const chunk_lpv_sample_irradiance_no_depth = CodeChunk.from(
|
|
8
|
-
//language=WGSL
|
|
9
|
-
`
|
|
10
|
-
fn lpv_sample_irradiance(
|
|
11
|
-
position: vec3<f32>,
|
|
12
|
-
normal: vec3<f32>,
|
|
13
|
-
view_direction: vec3<f32>
|
|
14
|
-
) -> vec3<f32>{
|
|
15
|
-
|
|
16
|
-
var barycentric_coordinates: vec4<f32>;
|
|
17
|
-
|
|
18
|
-
let tet = lpv_mesh_lookup_nearest_cell(position, &barycentric_coordinates);
|
|
19
|
-
|
|
20
|
-
if(tet == INVALID_TET){
|
|
21
|
-
|
|
22
|
-
return vec3(0.0);
|
|
23
|
-
|
|
24
|
-
}else{
|
|
25
|
-
|
|
26
|
-
// apply visibility term
|
|
27
|
-
let weights = lpv_mask_weights_by_visibility(
|
|
28
|
-
position,
|
|
29
|
-
normal,
|
|
30
|
-
view_direction,
|
|
31
|
-
tet,
|
|
32
|
-
barycentric_coordinates
|
|
33
|
-
);
|
|
34
|
-
|
|
35
|
-
return lpv_mesh_interpolate_probe_irradiance(normal, weights, tet);
|
|
36
|
-
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
`, [
|
|
40
|
-
INVALID_TET_DECLARATION,
|
|
41
|
-
chunk_lpv_mesh_lookup_nearest_cell,
|
|
42
|
-
chunk_lpv_mask_weights_by_visibility_no_depth,
|
|
43
|
-
chunk_lpv_mesh_interpolate_probe_irradiance_pre
|
|
44
|
-
]
|
|
45
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_lpv_sample_radiance.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_radiance.js"],"names":[],"mappings":"AAQA,kDAkDO;0BAxDmB,gCAAgC"}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
import { LPV_SAMPLE_COORDINATES } from "../../../../deferred/indirect/chunk_lpv_2d_cache_sample_irradiance.js";
|
|
2
|
-
import { chunk_lpv_sample_light } from "../../../../deferred/indirect/chunk_lpv_sample_light.js";
|
|
3
|
-
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
4
|
-
import { chunk_lpv_mesh_lookup_nearest_cell } from "./chunk_lpv_mesh_lookup_nearest_cell.js";
|
|
5
|
-
import { chunk_lpv_mask_weights_by_visibility } from "./depth/chunk_lpv_mask_weights_by_visibility.js";
|
|
6
|
-
import { INVALID_TET_DECLARATION } from "./INVALID_TET_DECLARATION.js";
|
|
7
|
-
import { LPV_MESH_RESOURCE } from "../../../../global_illumination/probe/octahedral/LPV_SHADER_RESOURCE_GROUP.js";
|
|
8
|
-
|
|
9
|
-
export const chunk_lpv_sample_radiance = CodeChunk.from(
|
|
10
|
-
//language=WGSL
|
|
11
|
-
`
|
|
12
|
-
fn lpv_sample_radiance(
|
|
13
|
-
position_ws: vec3<f32>,
|
|
14
|
-
normal_ws: vec3<f32>,
|
|
15
|
-
view_direction_ws: vec3<f32>,
|
|
16
|
-
roughness: f32,
|
|
17
|
-
) -> vec3<f32>{
|
|
18
|
-
|
|
19
|
-
var barycentric_coordinates: vec4<f32>;
|
|
20
|
-
|
|
21
|
-
let tet_index = lpv_mesh_lookup_nearest_cell(position_ws, &barycentric_coordinates);
|
|
22
|
-
|
|
23
|
-
if(tet_index == INVALID_TET){
|
|
24
|
-
return vec3(0.0);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
let tet = lpv_mesh[tet_index];
|
|
28
|
-
|
|
29
|
-
let weights = lpv_mask_weights_by_visibility(
|
|
30
|
-
position_ws,
|
|
31
|
-
normal_ws,
|
|
32
|
-
view_direction_ws,
|
|
33
|
-
tet_index,
|
|
34
|
-
barycentric_coordinates
|
|
35
|
-
);
|
|
36
|
-
|
|
37
|
-
let lpv_coord = ${LPV_SAMPLE_COORDINATES.wgsl_ref}(
|
|
38
|
-
position_ws,
|
|
39
|
-
weights,
|
|
40
|
-
tet_index,
|
|
41
|
-
);
|
|
42
|
-
|
|
43
|
-
let radiance = lpv_sample_light(
|
|
44
|
-
lpv_coord,
|
|
45
|
-
normal_ws,
|
|
46
|
-
view_direction_ws,
|
|
47
|
-
roughness,
|
|
48
|
-
)[1];
|
|
49
|
-
|
|
50
|
-
return max(vec3(0.0), radiance);
|
|
51
|
-
}
|
|
52
|
-
`, [
|
|
53
|
-
INVALID_TET_DECLARATION,
|
|
54
|
-
LPV_SAMPLE_COORDINATES.declaration_chunk,
|
|
55
|
-
chunk_lpv_sample_light,
|
|
56
|
-
chunk_lpv_mesh_lookup_nearest_cell,
|
|
57
|
-
chunk_lpv_mask_weights_by_visibility,
|
|
58
|
-
|
|
59
|
-
]);
|
|
60
|
-
|
|
61
|
-
chunk_lpv_sample_radiance.requireResource(LPV_MESH_RESOURCE);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_lpv_sample_sh3_at.d.ts","sourceRoot":"","sources":["../../../../../../../../src/shade/renderer/shader/chunk/light/lpv/chunk_lpv_sample_sh3_at.js"],"names":[],"mappings":"AAKA,gDA2BE;0BAhCwB,gCAAgC"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { CodeChunk } from "../../../compiler/CodeChunk.js";
|
|
2
|
-
import { chunk_lpv_mesh_interpolate_probe } from "./chunk_lpv_mesh_interpolate_probe.js";
|
|
3
|
-
import { chunk_lpv_mesh_lookup_nearest_cell } from "./chunk_lpv_mesh_lookup_nearest_cell.js";
|
|
4
|
-
import { INVALID_TET_DECLARATION } from "./INVALID_TET_DECLARATION.js";
|
|
5
|
-
|
|
6
|
-
export const chunk_lpv_sample_sh3_at = CodeChunk.from(
|
|
7
|
-
//language=WGSL
|
|
8
|
-
`
|
|
9
|
-
fn lpv_sample_sh3_at(position:vec3<f32>) -> array< vec3<f32>, 4 >{
|
|
10
|
-
var barycentric_coordinates: vec4<f32>;
|
|
11
|
-
|
|
12
|
-
let tet = lpv_mesh_lookup_nearest_cell(position, &barycentric_coordinates);
|
|
13
|
-
|
|
14
|
-
if(tet == INVALID_TET){
|
|
15
|
-
|
|
16
|
-
return array< vec3<f32>, 4 >(
|
|
17
|
-
vec3(0.0),
|
|
18
|
-
vec3(0.0),
|
|
19
|
-
vec3(0.0),
|
|
20
|
-
vec3(0.0),
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
}else{
|
|
24
|
-
|
|
25
|
-
return lpv_mesh_interpolate_probe(barycentric_coordinates, tet);
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
`, [
|
|
29
|
-
chunk_lpv_mesh_interpolate_probe,
|
|
30
|
-
chunk_lpv_mesh_lookup_nearest_cell,
|
|
31
|
-
INVALID_TET_DECLARATION,
|
|
32
|
-
]
|
|
33
|
-
);
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_lpv_mask_weights_by_visibility.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_mask_weights_by_visibility.js"],"names":[],"mappings":"AAQA,6DAkEO;AAKP,sEA+EO;0BA3JmB,mCAAmC"}
|
package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_mask_weights_by_visibility.js
DELETED
|
@@ -1,161 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
chunk_lpv_get_visibility_mask
|
|
3
|
-
} from "../../../../../global_illumination/lpv/deprecated/chunk_lpv_get_visibility_mask.js";
|
|
4
|
-
import { CodeChunk } from "../../../../compiler/CodeChunk.js";
|
|
5
|
-
import { chunk_probe_visibility_weight } from "../../probe/chunk_probe_visibility_weight.js";
|
|
6
|
-
import { chunk_lpv_mesh_get_vertices } from "../chunk_lpv_mesh_get_vertices.js";
|
|
7
|
-
import { LPV_PROBES_RESOURCE } from "../../../../../global_illumination/probe/octahedral/LPV_SHADER_RESOURCE_GROUP.js";
|
|
8
|
-
|
|
9
|
-
export const chunk_lpv_mask_weights_by_visibility = CodeChunk.from(
|
|
10
|
-
//language=WGSL
|
|
11
|
-
`
|
|
12
|
-
fn lpv_mask_weights_by_visibility(
|
|
13
|
-
position: vec3<f32>,
|
|
14
|
-
normal: vec3<f32>,
|
|
15
|
-
view_direction: vec3<f32>,
|
|
16
|
-
tet_index: u32,
|
|
17
|
-
barycentric: vec4<f32>
|
|
18
|
-
) -> vec4<f32>{
|
|
19
|
-
let vertices = lpv_mesh_get_vertices(tet_index);
|
|
20
|
-
|
|
21
|
-
var visibility: vec4<f32>;
|
|
22
|
-
|
|
23
|
-
var weight_sum = 0.0;
|
|
24
|
-
|
|
25
|
-
for (var i = 0u; i < 4u; i++) {
|
|
26
|
-
|
|
27
|
-
let probe_index = vertices[i];
|
|
28
|
-
|
|
29
|
-
let probe = lpv_probes[probe_index];
|
|
30
|
-
|
|
31
|
-
let probe_position = lpv_probe_get_position(probe_index);
|
|
32
|
-
|
|
33
|
-
// Bias the position at which visibility is computed; this
|
|
34
|
-
// avoids performing a shadow test *at* a surface, which is a
|
|
35
|
-
// dangerous location because that is exactly the line between
|
|
36
|
-
// shadowed and unshadowed. If the normal bias is too small,
|
|
37
|
-
// there will be light and dark leaks. If it is too large,
|
|
38
|
-
// then samples can pass through thin occluders to the other
|
|
39
|
-
// side (this can only happen if there are MULTIPLE occluders
|
|
40
|
-
// near each other, a wall surface won't pass through itself.)
|
|
41
|
-
|
|
42
|
-
// see "Scaling Probe-Based Real-Time Dynamic Global Illumunation for Production" by Zander Majercik et al
|
|
43
|
-
const TUNABLE_BIAS = 0.05;
|
|
44
|
-
let bias_scale = max(probe.distance_max * TUNABLE_BIAS, 1e-7);
|
|
45
|
-
let bias_vector = mix(normal, view_direction, 0.2) * bias_scale;
|
|
46
|
-
|
|
47
|
-
let lookup_position = position + bias_vector;
|
|
48
|
-
|
|
49
|
-
// the back-face term from the point itself, without the bias; the trilinear weight after the crush
|
|
50
|
-
var weight = probe_visibility_weight(
|
|
51
|
-
normalize(probe_position - position),
|
|
52
|
-
normal,
|
|
53
|
-
lpv_get_visibility_mask(lookup_position, probe_index),
|
|
54
|
-
);
|
|
55
|
-
|
|
56
|
-
weight *= barycentric[i];
|
|
57
|
-
|
|
58
|
-
weight_sum += weight;
|
|
59
|
-
|
|
60
|
-
visibility[i] = weight;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
// normalize to 1
|
|
64
|
-
if(weight_sum > 0.0){
|
|
65
|
-
// avoid NaN
|
|
66
|
-
visibility /= weight_sum;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
return visibility;
|
|
70
|
-
}
|
|
71
|
-
`, [
|
|
72
|
-
chunk_lpv_mesh_get_vertices,
|
|
73
|
-
chunk_lpv_get_visibility_mask,
|
|
74
|
-
chunk_probe_visibility_weight,
|
|
75
|
-
]);
|
|
76
|
-
|
|
77
|
-
chunk_lpv_mask_weights_by_visibility.requireResource(LPV_PROBES_RESOURCE);
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
export const chunk_lpv_mask_weights_by_visibility_no_depth = CodeChunk.from(
|
|
81
|
-
//language=WGSL
|
|
82
|
-
`
|
|
83
|
-
fn lpv_mask_weights_by_visibility(
|
|
84
|
-
position:vec3<f32>,
|
|
85
|
-
normal:vec3<f32>,
|
|
86
|
-
view_direction:vec3<f32>,
|
|
87
|
-
tet_index:u32,
|
|
88
|
-
barycentric: vec4<f32>
|
|
89
|
-
) -> vec4<f32>{
|
|
90
|
-
let vertices = lpv_mesh_get_vertices(tet_index);
|
|
91
|
-
|
|
92
|
-
var visibility: vec4<f32>;
|
|
93
|
-
|
|
94
|
-
var weight_sum = 0.0;
|
|
95
|
-
|
|
96
|
-
for (var i = 0u; i < 4u; i++) {
|
|
97
|
-
|
|
98
|
-
var weight = 1.0;
|
|
99
|
-
|
|
100
|
-
let probe_index = vertices[i];
|
|
101
|
-
|
|
102
|
-
let probe = lpv_probes[probe_index];
|
|
103
|
-
|
|
104
|
-
let probe_position = lpv_probe_get_position(probe_index);
|
|
105
|
-
|
|
106
|
-
// Smooth backface test
|
|
107
|
-
{
|
|
108
|
-
|
|
109
|
-
// Computed without the biasing applied to the "dir" variable.
|
|
110
|
-
// This test can cause reflection-map looking errors in the image
|
|
111
|
-
// (stuff looks shiny) if the transition is poor.
|
|
112
|
-
let direction_to_probe = normalize(probe_position - position);
|
|
113
|
-
|
|
114
|
-
// The naive soft backface weight would ignore a probe when
|
|
115
|
-
// it is behind the surface. That's good for walls. But for small details inside of a
|
|
116
|
-
// room, the normals on the details might rule out all of the probes that have mutual
|
|
117
|
-
// visibility to the point. So, we instead use a "wrap shading" test below inspired by
|
|
118
|
-
// NPR work.
|
|
119
|
-
// let backface_term = max(0.0001, dot(direction_to_probe, normal));
|
|
120
|
-
|
|
121
|
-
// The small offset at the end reduces the "going to zero" impact
|
|
122
|
-
// where this is really close to exactly opposite
|
|
123
|
-
let backface_term = max(0.0001, (dot(direction_to_probe, normal) + 1.0) * 0.5);
|
|
124
|
-
// weight *= backface_term * backface_term + 0.2;
|
|
125
|
-
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
// Avoid zero weight
|
|
129
|
-
weight = max(1e-6, weight);
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
// A tiny bit of light is really visible due to log perception, so
|
|
133
|
-
// crush tiny weights but keep the curve continuous. This must be done
|
|
134
|
-
// before the trilinear weights, because those should be preserved.
|
|
135
|
-
const crushThreshold = 0.2;
|
|
136
|
-
|
|
137
|
-
if (weight < crushThreshold) {
|
|
138
|
-
weight *= weight * weight * (1.0 / (crushThreshold * crushThreshold));
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
weight *= barycentric[i];
|
|
142
|
-
|
|
143
|
-
weight_sum += weight;
|
|
144
|
-
|
|
145
|
-
visibility[i] = weight;
|
|
146
|
-
}
|
|
147
|
-
|
|
148
|
-
// normalize to 1
|
|
149
|
-
if(weight_sum > 0.0){
|
|
150
|
-
// avoid NaN
|
|
151
|
-
visibility /= weight_sum;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
return visibility;
|
|
155
|
-
}
|
|
156
|
-
`, [
|
|
157
|
-
chunk_lpv_mesh_get_vertices,
|
|
158
|
-
chunk_lpv_get_visibility_mask
|
|
159
|
-
]);
|
|
160
|
-
|
|
161
|
-
chunk_lpv_mask_weights_by_visibility_no_depth.requireResource(LPV_PROBES_RESOURCE);
|
package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_probe_sample_depth_array.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_lpv_probe_sample_depth_array.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_probe_sample_depth_array.js"],"names":[],"mappings":"AAcA,2DA4CE;0BAnDwB,mCAAmC"}
|
package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_probe_sample_depth_array.js
DELETED
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
chunk_lpv_probe_depth_get_pixel
|
|
3
|
-
} from "../../../../../global_illumination/lpv/deprecated/chunk_lpv_probe_depth_get_pixel.js";
|
|
4
|
-
import {
|
|
5
|
-
LIGHT_PROBE_DEPTH_RESOLUTION
|
|
6
|
-
} from "../../../../../global_illumination/lpv/deprecated/LIGHT_PROBE_DEPTH_RESOLUTION.js";
|
|
7
|
-
import { LIGHT_PROBE_STRUCT } from "../../../../../global_illumination/lpv/LIGHT_PROBE_STRUCT.js";
|
|
8
|
-
import { CodeChunk } from "../../../../compiler/CodeChunk.js";
|
|
9
|
-
import { chunk_uv_octahedral_unit_encode } from "../../../geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
|
|
10
|
-
import {
|
|
11
|
-
chunk_texture_octahedral_wrap_texel_coordinates
|
|
12
|
-
} from "../../../texture/octahedral/chunk_texture_octahedral_wrap_texel_coordinates.js";
|
|
13
|
-
import { chunk_get_bilinear_weights } from "../../../texture/sample/chunk_get_bilinear_weights.js";
|
|
14
|
-
|
|
15
|
-
export const chunk_lpv_probe_sample_depth_array = CodeChunk.from(
|
|
16
|
-
// language=WGSL
|
|
17
|
-
`
|
|
18
|
-
fn lpv_probe_sample_depth_array( direction:vec3<f32>, probe: ${LIGHT_PROBE_STRUCT.wgsl_ref} ) -> vec2<f32> {
|
|
19
|
-
|
|
20
|
-
// convert direction to UV
|
|
21
|
-
let octahedral_uv = saturate(uv_octahedral_unit_encode(-direction));
|
|
22
|
-
|
|
23
|
-
const max_pixel = vec2<f32>(${LIGHT_PROBE_DEPTH_RESOLUTION} - 1);
|
|
24
|
-
|
|
25
|
-
let grid = octahedral_uv * max_pixel;
|
|
26
|
-
|
|
27
|
-
let gridFrac = fract(grid);
|
|
28
|
-
|
|
29
|
-
let texel_position = vec2<i32>(floor(grid));
|
|
30
|
-
|
|
31
|
-
let tile_p_00 = texture_octahedral_wrap_texel_coordinates( texel_position, ${LIGHT_PROBE_DEPTH_RESOLUTION} );
|
|
32
|
-
let tile_p_01 = texture_octahedral_wrap_texel_coordinates( texel_position + vec2(1, 0), ${LIGHT_PROBE_DEPTH_RESOLUTION} );
|
|
33
|
-
let tile_p_10 = texture_octahedral_wrap_texel_coordinates( texel_position + vec2(0, 1), ${LIGHT_PROBE_DEPTH_RESOLUTION} );
|
|
34
|
-
let tile_p_11 = texture_octahedral_wrap_texel_coordinates( texel_position + vec2(1, 1), ${LIGHT_PROBE_DEPTH_RESOLUTION} );
|
|
35
|
-
|
|
36
|
-
let depth = probe.depth;
|
|
37
|
-
|
|
38
|
-
let texel_00 = lpv_get_depth_get_pixel( depth, tile_p_00 );
|
|
39
|
-
let texel_01 = lpv_get_depth_get_pixel( depth, tile_p_01 );
|
|
40
|
-
let texel_10 = lpv_get_depth_get_pixel( depth, tile_p_10 );
|
|
41
|
-
let texel_11 = lpv_get_depth_get_pixel( depth, tile_p_11 );
|
|
42
|
-
|
|
43
|
-
// scale by max distance, as depths that are stored are normalized [0..1]
|
|
44
|
-
let weights = get_bilinear_weights(gridFrac) * probe.distance_max;
|
|
45
|
-
|
|
46
|
-
return texel_00 * weights.x
|
|
47
|
-
+ texel_01 * weights.y
|
|
48
|
-
+ texel_10 * weights.z
|
|
49
|
-
+ texel_11 * weights.w
|
|
50
|
-
;
|
|
51
|
-
}
|
|
52
|
-
`, [
|
|
53
|
-
LIGHT_PROBE_STRUCT.declaration_chunk,
|
|
54
|
-
chunk_uv_octahedral_unit_encode,
|
|
55
|
-
chunk_texture_octahedral_wrap_texel_coordinates,
|
|
56
|
-
chunk_get_bilinear_weights,
|
|
57
|
-
chunk_lpv_probe_depth_get_pixel
|
|
58
|
-
]
|
|
59
|
-
);
|
package/src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_sample_depth_atlas.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_lpv_sample_depth_atlas.d.ts","sourceRoot":"","sources":["../../../../../../../../../src/shade/renderer/shader/chunk/light/lpv/depth/chunk_lpv_sample_depth_atlas.js"],"names":[],"mappings":"AAeA,qDA4CC;AAMD,4DA2BC;0BA5FyB,mCAAmC"}
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { CodeChunk } from "../../../../compiler/CodeChunk.js";
|
|
2
|
-
import { chunk_uv_octahedral_unit_encode } from "../../../geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
|
|
3
|
-
import { chunk_index_to_grid2d } from "../../../grid/chunk_index_to_grid2d.js";
|
|
4
|
-
import { chunk_texel_coordinate_to_uv } from "../../../texture/chunk_texel_coordinate_to_uv.js";
|
|
5
|
-
import { chunk_uv_to_texel_coordinate } from "../../../texture/chunk_uv_to_texel_coordinate.js";
|
|
6
|
-
import {
|
|
7
|
-
chunk_texture_octahedral_wrap_texel_coordinates
|
|
8
|
-
} from "../../../texture/octahedral/chunk_texture_octahedral_wrap_texel_coordinates.js";
|
|
9
|
-
import { chunk_get_bilinear_weights } from "../../../texture/sample/chunk_get_bilinear_weights.js";
|
|
10
|
-
import {
|
|
11
|
-
LPV_ATLAS_DEPTH_RESOURCE,
|
|
12
|
-
LPV_METADATA_RESOURCE
|
|
13
|
-
} from "../../../../../global_illumination/probe/octahedral/LPV_SHADER_RESOURCE_GROUP.js";
|
|
14
|
-
import { SAMPLER_LINEAR_RESOURCE } from "../../../../../texture/SAMPLER_LINEAR_RESOURCE.js";
|
|
15
|
-
|
|
16
|
-
export const chunk_lpv_sample_depth_atlas = CodeChunk.from(
|
|
17
|
-
//language=WGSL
|
|
18
|
-
`
|
|
19
|
-
fn lpv_sample_depth_atlas( direction: vec3<f32>, probe_index: u32 ) -> vec2<f32>{
|
|
20
|
-
let probe_resolution: u32 = lpv_metadata.probe_resolution;
|
|
21
|
-
|
|
22
|
-
let padded_probe_resolution = probe_resolution + 2;
|
|
23
|
-
|
|
24
|
-
let atlas_resolution_in_patches = textureDimensions(lpv_atlas_depth) / padded_probe_resolution;
|
|
25
|
-
|
|
26
|
-
let offset = index_to_grid2d(probe_index, atlas_resolution_in_patches.x) * padded_probe_resolution + vec2(1);
|
|
27
|
-
|
|
28
|
-
let texel_uv = uv_octahedral_unit_encode(direction);
|
|
29
|
-
let texel_coord_f = uv_to_texel_coordinate(texel_uv, vec2(probe_resolution));
|
|
30
|
-
|
|
31
|
-
let gridFrac = fract(texel_coord_f);
|
|
32
|
-
|
|
33
|
-
let texel_position = vec2<i32>(floor(texel_coord_f));
|
|
34
|
-
|
|
35
|
-
let tile_p_00 = texture_octahedral_wrap_texel_coordinates(texel_position, i32(probe_resolution));
|
|
36
|
-
let tile_p_01 = texture_octahedral_wrap_texel_coordinates(texel_position + vec2(1, 0), i32(probe_resolution));
|
|
37
|
-
let tile_p_10 = texture_octahedral_wrap_texel_coordinates(texel_position + vec2(0, 1), i32(probe_resolution));
|
|
38
|
-
let tile_p_11 = texture_octahedral_wrap_texel_coordinates(texel_position + vec2(1, 1), i32(probe_resolution));
|
|
39
|
-
|
|
40
|
-
let texel_00 = unpack2x16float( textureLoad(lpv_atlas_depth, offset + tile_p_00, 0).r );
|
|
41
|
-
let texel_01 = unpack2x16float( textureLoad(lpv_atlas_depth, offset + tile_p_01, 0).r );
|
|
42
|
-
let texel_10 = unpack2x16float( textureLoad(lpv_atlas_depth, offset + tile_p_10, 0).r );
|
|
43
|
-
let texel_11 = unpack2x16float( textureLoad(lpv_atlas_depth, offset + tile_p_11, 0).r );
|
|
44
|
-
|
|
45
|
-
var weights = get_bilinear_weights(gridFrac);
|
|
46
|
-
|
|
47
|
-
return texel_00 * weights.x
|
|
48
|
-
+ texel_01 * weights.y
|
|
49
|
-
+ texel_10 * weights.z
|
|
50
|
-
+ texel_11 * weights.w
|
|
51
|
-
;
|
|
52
|
-
}
|
|
53
|
-
`, [
|
|
54
|
-
chunk_uv_octahedral_unit_encode,
|
|
55
|
-
chunk_uv_to_texel_coordinate,
|
|
56
|
-
chunk_texture_octahedral_wrap_texel_coordinates,
|
|
57
|
-
chunk_get_bilinear_weights,
|
|
58
|
-
chunk_index_to_grid2d,
|
|
59
|
-
]
|
|
60
|
-
)
|
|
61
|
-
|
|
62
|
-
chunk_lpv_sample_depth_atlas.requireResource(LPV_ATLAS_DEPTH_RESOURCE);
|
|
63
|
-
chunk_lpv_sample_depth_atlas.requireResource(LPV_METADATA_RESOURCE);
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
export const chunk_lpv_sample_depth_atlas_native = CodeChunk.from(
|
|
67
|
-
//language=WGSL
|
|
68
|
-
`
|
|
69
|
-
fn lpv_sample_depth_atlas( direction: vec3<f32>, probe_index: u32 ) -> vec2<f32>{
|
|
70
|
-
let probe_resolution: u32 = lpv_metadata.probe_resolution;
|
|
71
|
-
|
|
72
|
-
let padded_probe_resolution = probe_resolution + 2;
|
|
73
|
-
|
|
74
|
-
let atlas_resolution = textureDimensions(lpv_atlas_depth);
|
|
75
|
-
|
|
76
|
-
let atlas_resolution_in_patches = atlas_resolution / padded_probe_resolution;
|
|
77
|
-
|
|
78
|
-
let offset = index_to_grid2d(probe_index, atlas_resolution_in_patches.x) * padded_probe_resolution + vec2(1);
|
|
79
|
-
|
|
80
|
-
let texel_uv = uv_octahedral_unit_encode(direction);
|
|
81
|
-
let texel_coord_f = uv_to_texel_coordinate(texel_uv, vec2(probe_resolution));
|
|
82
|
-
|
|
83
|
-
let atlas_uv = texel_coordinate_to_uv(vec2<f32>(offset) + texel_coord_f, atlas_resolution);
|
|
84
|
-
|
|
85
|
-
return textureSampleLevel(lpv_atlas_depth, sLinear, atlas_uv, 0).rg;
|
|
86
|
-
}
|
|
87
|
-
`, [
|
|
88
|
-
chunk_uv_octahedral_unit_encode,
|
|
89
|
-
chunk_texel_coordinate_to_uv,
|
|
90
|
-
chunk_uv_to_texel_coordinate,
|
|
91
|
-
chunk_index_to_grid2d,
|
|
92
|
-
]
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
chunk_lpv_sample_depth_atlas_native.requireResource(LPV_ATLAS_DEPTH_RESOURCE);
|
|
96
|
-
chunk_lpv_sample_depth_atlas_native.requireResource(LPV_METADATA_RESOURCE);
|
|
97
|
-
chunk_lpv_sample_depth_atlas_native.requireResource(SAMPLER_LINEAR_RESOURCE);
|
|
File without changes
|
|
File without changes
|