@woosh/meep-engine 3.67.0 → 3.68.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/src/engine/graphics3/GraphicsEngine.d.ts.map +1 -1
- package/src/engine/graphics3/GraphicsEngine.js +4 -9
- package/src/engine/graphics3/load_cube_environment.js +3 -3
- package/src/engine/physics/fluid/ecs/FluidObstacleSystem.d.ts +4 -4
- package/src/shade/playground/probe_clipmap/index.html +43 -0
- package/src/shade/playground/probe_clipmap/main.d.ts.map +1 -1
- package/src/shade/playground/probe_clipmap/main.js +29 -0
- package/src/shade/renderer/Renderer.d.ts +7 -0
- package/src/shade/renderer/Renderer.d.ts.map +1 -1
- package/src/shade/renderer/Renderer.js +213 -15
- package/src/shade/renderer/ShadeIndirectLightingMode.d.ts +1 -0
- package/src/shade/renderer/ShadeIndirectLightingMode.js +9 -0
- package/src/shade/renderer/atmosphere/ATMOSPHERE_PARAMETERS_STRUCT.d.ts +22 -0
- package/src/shade/renderer/atmosphere/ATMOSPHERE_PARAMETERS_STRUCT.d.ts.map +1 -0
- package/src/shade/renderer/atmosphere/ATMOSPHERE_PARAMETERS_STRUCT.js +160 -0
- package/src/shade/renderer/atmosphere/ATMOSPHERE_UNIT_SCALE.d.ts +45 -0
- package/src/shade/renderer/atmosphere/ATMOSPHERE_UNIT_SCALE.d.ts.map +1 -0
- package/src/shade/renderer/atmosphere/ATMOSPHERE_UNIT_SCALE.js +57 -0
- package/src/shade/renderer/atmosphere/GPUSky.d.ts +23 -8
- package/src/shade/renderer/atmosphere/GPUSky.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/GPUSky.js +91 -34
- package/src/shade/renderer/atmosphere/SAMPLER_SKY_LUT.d.ts +17 -0
- package/src/shade/renderer/atmosphere/SAMPLER_SKY_LUT.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/SAMPLER_SKY_LUT.js +55 -25
- package/src/shade/renderer/atmosphere/SceneAtmosphere.d.ts +164 -0
- package/src/shade/renderer/atmosphere/SceneAtmosphere.d.ts.map +1 -0
- package/src/shade/renderer/atmosphere/SceneAtmosphere.js +308 -0
- package/src/shade/renderer/atmosphere/chunk_get_multiscatter_values.d.ts +3 -12
- package/src/shade/renderer/atmosphere/chunk_get_multiscatter_values.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/chunk_get_multiscatter_values.js +52 -89
- package/src/shade/renderer/atmosphere/chunk_raymarch_sky_scattering.d.ts +14 -0
- package/src/shade/renderer/atmosphere/chunk_raymarch_sky_scattering.d.ts.map +1 -0
- package/src/shade/renderer/atmosphere/chunk_raymarch_sky_scattering.js +103 -0
- package/src/shade/renderer/atmosphere/chunk_sample_multiscatter_lut.d.ts +10 -4
- package/src/shade/renderer/atmosphere/chunk_sample_multiscatter_lut.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/chunk_sample_multiscatter_lut.js +95 -57
- package/src/shade/renderer/atmosphere/chunk_sample_transmittance_lut.d.ts +10 -14
- package/src/shade/renderer/atmosphere/chunk_sample_transmittance_lut.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/chunk_sample_transmittance_lut.js +97 -69
- package/src/shade/renderer/atmosphere/chunk_sky_irradiance_lut_encode_uv.d.ts +17 -0
- package/src/shade/renderer/atmosphere/chunk_sky_irradiance_lut_encode_uv.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/chunk_sky_irradiance_lut_encode_uv.js +117 -48
- package/src/shade/renderer/atmosphere/chunk_sky_lut_compute_uv.d.ts +8 -0
- package/src/shade/renderer/atmosphere/chunk_sky_lut_compute_uv.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/chunk_sky_lut_compute_uv.js +65 -35
- package/src/shade/renderer/atmosphere/compute_mie_absorption.d.ts +2 -1
- package/src/shade/renderer/atmosphere/compute_mie_absorption.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/compute_mie_absorption.js +6 -6
- package/src/shade/renderer/atmosphere/resolve_atmosphere_sun.d.ts +41 -0
- package/src/shade/renderer/atmosphere/resolve_atmosphere_sun.d.ts.map +1 -0
- package/src/shade/renderer/atmosphere/resolve_atmosphere_sun.js +123 -0
- package/src/shade/renderer/atmosphere/shader_multiscatter_lut.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/shader_multiscatter_lut.js +21 -64
- package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.d.ts +6 -2
- package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/shader_sky_irradiance_lut.js +55 -179
- package/src/shade/renderer/atmosphere/shader_sky_view_lut.d.ts +7 -0
- package/src/shade/renderer/atmosphere/shader_sky_view_lut.d.ts.map +1 -0
- package/src/shade/renderer/atmosphere/shader_sky_view_lut.js +111 -0
- package/src/shade/renderer/atmosphere/shader_transmittance_lut.d.ts +0 -1
- package/src/shade/renderer/atmosphere/shader_transmittance_lut.d.ts.map +1 -1
- package/src/shade/renderer/atmosphere/shader_transmittance_lut.js +68 -79
- package/src/shade/renderer/deferred/shader_background.js +1 -1
- package/src/shade/renderer/deferred/shader_background_sky.d.ts +5 -0
- package/src/shade/renderer/deferred/shader_background_sky.d.ts.map +1 -0
- package/src/shade/renderer/deferred/shader_background_sky.js +130 -0
- package/src/shade/renderer/deferred/tonemap/chunk_tonemap_purkinje.d.ts +2 -1
- package/src/shade/renderer/deferred/tonemap/chunk_tonemap_purkinje.d.ts.map +1 -1
- package/src/shade/renderer/deferred/tonemap/chunk_tonemap_purkinje.js +6 -2
- package/src/shade/renderer/extension/ViewTextures.d.ts +3 -2
- package/src/shade/renderer/extension/ViewTextures.d.ts.map +1 -1
- package/src/shade/renderer/extension/ViewTextures.js +3 -2
- 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 +6 -6
- 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/octahedral/shader_lpv_build_gbuffer.js +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts +20 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/GPUProbeClipmapGI.js +29 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_light.d.ts +47 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_light.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/chunk_probe_clipmap_hit_light.js +246 -0
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts +4 -15
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_light.js +8 -148
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts +4 -9
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.d.ts.map +1 -1
- package/src/shade/renderer/global_illumination/probe_clipmap/probe/shader_probe_clipmap_trace.js +9 -58
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts +142 -0
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/GPUScreenProbeGI.js +938 -0
- package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts +192 -0
- package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/SCREEN_PROBE.js +231 -0
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.d.ts +11 -0
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeDebugView.js +25 -0
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts +110 -0
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/ScreenProbeSettings.js +197 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.d.ts +150 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe.js +408 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brdf_density.d.ts +23 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brdf_density.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brdf_density.js +63 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brick_origin.d.ts +24 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brick_origin.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_brick_origin.js +61 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.d.ts +39 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_interpolate.js +126 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_lighting_history.d.ts +21 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_lighting_history.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_lighting_history.js +74 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_march_distance.d.ts +20 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_march_distance.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_march_distance.js +26 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_ray_sort.d.ts +24 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_ray_sort.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_ray_sort.js +57 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_screen_march.d.ts +22 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_screen_march.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_screen_march.js +53 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.d.ts +62 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_surface.js +156 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_workgroup_sum.d.ts +18 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_workgroup_sum.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/chunk_screen_probe_workgroup_sum.js +50 -0
- package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts +21 -0
- package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/graph_screen_probe_debug_view.js +54 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.d.ts +67 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_brick.js +509 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_debug.d.ts +20 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_debug.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_debug.js +128 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts +62 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_gather.js +478 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.d.ts +69 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_importance.js +457 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts +27 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.js +219 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.d.ts +22 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.js +151 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.d.ts +66 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.js +301 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts +59 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_resolve.js +364 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.d.ts +40 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.d.ts.map +1 -0
- package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_trace_screen.js +275 -0
- package/src/shade/renderer/grass/blade/GPUGrassBlades.d.ts.map +1 -1
- package/src/shade/renderer/grass/blade/GPUGrassBlades.js +17 -2
- package/src/shade/renderer/grass/blade/grass_blade_resolve.d.ts +18 -8
- package/src/shade/renderer/grass/blade/grass_blade_resolve.d.ts.map +1 -1
- package/src/shade/renderer/grass/blade/grass_blade_resolve.js +114 -32
- package/src/shade/renderer/light/GPULightCollection.d.ts +1 -1
- package/src/shade/renderer/light/GPULightCollection.d.ts.map +1 -1
- package/src/shade/renderer/light/GPULightCollection.js +213 -80
- package/src/shade/renderer/{atmosphere → light/environment}/chunk_sample_environment_color.d.ts +1 -2
- package/src/shade/renderer/light/environment/chunk_sample_environment_color.d.ts.map +1 -0
- package/src/shade/renderer/{atmosphere → light/environment}/chunk_sample_environment_color.js +3 -4
- package/src/shade/renderer/loader/gltf/tiny-gltf.d.ts +1 -1
- package/src/shade/renderer/path_tracer/shader/chunk_render_trace_path.js +1 -1
- package/src/shade/renderer/postprocess/denoise/debug/graph_pass_debug_reprojection.js +1 -1
- package/src/shade/renderer/postprocess/motion_blur/MotionBlur.d.ts +1 -1
- package/src/shade/renderer/postprocess/motion_blur/MotionBlur.js +1 -1
- package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.d.ts +1 -1
- package/src/shade/renderer/postprocess/motion_blur/graph_postprocess_motion_blur.js +1 -1
- package/src/shade/renderer/postprocess/motion_blur/shader_motion_blur_reconstruct.js +1 -1
- package/src/shade/renderer/postprocess/nss/NSS.d.ts +1 -1
- package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_add_hit_irradiance.js +2 -0
- package/src/shade/renderer/postprocess/ssr/resolve/chunk_ssr_sample_radiance.js +2 -0
- package/src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.d.ts +6 -0
- 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 +9 -1
- package/src/shade/renderer/postprocess/taa/shader_depth_occlusion_clip.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/taa/shader_depth_occlusion_clip.js +4 -3
- package/src/shade/renderer/postprocess/velocity/VELOCITY_BUFFER.d.ts +17 -0
- package/src/shade/renderer/postprocess/velocity/VELOCITY_BUFFER.d.ts.map +1 -0
- package/src/shade/renderer/postprocess/velocity/VELOCITY_BUFFER.js +16 -0
- package/src/shade/renderer/postprocess/velocity/chunk_velocity_texel.d.ts +21 -0
- package/src/shade/renderer/postprocess/velocity/chunk_velocity_texel.d.ts.map +1 -0
- package/src/shade/renderer/postprocess/velocity/chunk_velocity_texel.js +30 -0
- package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.d.ts +7 -5
- package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.d.ts.map +1 -1
- package/src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.js +19 -17
- package/src/shade/renderer/rasterize/forward/chunk_forward_sample_indirect.js +2 -0
- package/src/shade/renderer/scene/GPUSceneContext.d.ts.map +1 -1
- package/src/shade/renderer/scene/GPUSceneContext.js +2 -1
- package/src/shade/renderer/scene/Scene.d.ts +9 -2
- package/src/shade/renderer/scene/Scene.d.ts.map +1 -1
- package/src/shade/renderer/scene/Scene.js +10 -2
- package/src/shade/renderer/shader/ImageShader.d.ts +24 -12
- package/src/shade/renderer/shader/ImageShader.d.ts.map +1 -1
- package/src/shade/renderer/shader/ImageShader.js +11 -8
- package/src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_HEIGHT_DECLARATION.d.ts +3 -1
- package/src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_HEIGHT_DECLARATION.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_HEIGHT_DECLARATION.js +11 -3
- package/src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_RADII_DECLARATION.d.ts +2 -11
- package/src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_RADII_DECLARATION.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_RADII_DECLARATION.js +23 -32
- package/src/shade/renderer/shader/chunk/atmosphere/PLANET_RADIUS_DECLARATION.d.ts +6 -0
- package/src/shade/renderer/shader/chunk/atmosphere/PLANET_RADIUS_DECLARATION.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/atmosphere/PLANET_RADIUS_DECLARATION.js +14 -2
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_atmosphere_height.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_atmosphere_height.js +4 -2
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_atmosphere_intersection.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_atmosphere_intersection.js +11 -3
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_atmosphere_ray_bounds.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_atmosphere_ray_bounds.js +68 -69
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_get_sun_transmittance.d.ts +4 -1
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_get_sun_transmittance.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_get_sun_transmittance.js +46 -39
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_position_relative_to_planet_center.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_position_relative_to_planet_center.js +5 -3
- package/src/shade/renderer/shader/chunk/color/tonemap/purkinje/chunk_apply_purkinje_shift.d.ts +18 -10
- package/src/shade/renderer/shader/chunk/color/tonemap/purkinje/chunk_apply_purkinje_shift.d.ts.map +1 -1
- package/src/shade/renderer/shader/chunk/color/tonemap/purkinje/chunk_apply_purkinje_shift.js +30 -27
- package/src/shade/renderer/shader/chunk/depth/chunk_get_device_depth.d.ts +14 -0
- package/src/shade/renderer/shader/chunk/depth/chunk_get_device_depth.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/depth/chunk_get_device_depth.js +30 -0
- package/src/shade/renderer/shader/chunk/geometry/octahedron/chunk_uv_equal_area_sphere.d.ts +21 -0
- package/src/shade/renderer/shader/chunk/geometry/octahedron/chunk_uv_equal_area_sphere.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/geometry/octahedron/chunk_uv_equal_area_sphere.js +60 -0
- package/src/shade/renderer/shader/chunk/light/{sky/chunk_sample_sky_color.d.ts → io/chunk_light_get_sun.d.ts} +3 -6
- package/src/shade/renderer/shader/chunk/light/io/chunk_light_get_sun.d.ts.map +1 -0
- package/src/shade/renderer/shader/chunk/light/{sky/chunk_sample_sky_color.js → io/chunk_light_get_sun.js} +6 -26
- package/src/shade/renderer/shadow/sdf/cascade/shader_scene_sdf_soft_shadows.js +1 -1
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts +3 -1
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/GPUViewVolumetrics.js +4 -2
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/graph_build_volumetrics.js +743 -739
- package/src/shade/renderer/volumetrics/irradiance_clipmap/chunk_irradiance_clipmap_gi_sample.js +2 -0
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.d.ts.map +1 -1
- package/src/shade/renderer/volumetrics/shader_volumetrics_build_lighting.js +19 -17
- 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 +5 -3
- package/src/shade/renderer/water/chunk_water_gi.js +2 -0
- package/src/shade/renderer/water/query/GPUWaterQueries.d.ts +1 -1
- package/src/shade/renderer/wind/GPUSceneWind.d.ts +1 -1
- package/src/engine/graphics/sh3/path_tracer/make_sky_hosek.d.ts +0 -2
- package/src/engine/graphics/sh3/path_tracer/make_sky_hosek.d.ts.map +0 -1
- package/src/engine/graphics/sh3/path_tracer/make_sky_hosek.js +0 -45
- package/src/engine/graphics/sh3/path_tracer/make_sky_rtiw.d.ts +0 -2
- package/src/engine/graphics/sh3/path_tracer/make_sky_rtiw.d.ts.map +0 -1
- package/src/engine/graphics/sh3/path_tracer/make_sky_rtiw.js +0 -17
- package/src/engine/graphics/sh3/sky/hosek/README.md +0 -4
- package/src/engine/graphics/sh3/sky/hosek/data.d.ts +0 -17
- package/src/engine/graphics/sh3/sky/hosek/data.d.ts.map +0 -1
- package/src/engine/graphics/sh3/sky/hosek/data.js +0 -3744
- package/src/engine/graphics/sh3/sky/hosek/prototype_hosek.d.ts +0 -2
- package/src/engine/graphics/sh3/sky/hosek/prototype_hosek.d.ts.map +0 -1
- package/src/engine/graphics/sh3/sky/hosek/prototype_hosek.js +0 -71
- package/src/engine/graphics/sh3/sky/hosek/render_hosek_sky_to_equirectangular.d.ts +0 -26
- package/src/engine/graphics/sh3/sky/hosek/render_hosek_sky_to_equirectangular.d.ts.map +0 -1
- package/src/engine/graphics/sh3/sky/hosek/render_hosek_sky_to_equirectangular.js +0 -70
- package/src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.d.ts +0 -22
- package/src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.d.ts.map +0 -1
- package/src/engine/graphics/sh3/sky/hosek/sky_hosek_compute_irradiance_by_direction.js +0 -388
- package/src/engine/graphics3/make_default_environment.d.ts +0 -15
- package/src/engine/graphics3/make_default_environment.d.ts.map +0 -1
- package/src/engine/graphics3/make_default_environment.js +0 -111
- package/src/shade/renderer/atmosphere/MIE_G.d.ts +0 -6
- package/src/shade/renderer/atmosphere/MIE_G.d.ts.map +0 -1
- package/src/shade/renderer/atmosphere/MIE_G.js +0 -5
- package/src/shade/renderer/atmosphere/chunk_sample_environment_color.d.ts.map +0 -1
- package/src/shade/renderer/atmosphere/hillaire/ATMOSPHERE_EARTH.d.ts +0 -4
- package/src/shade/renderer/atmosphere/hillaire/ATMOSPHERE_EARTH.d.ts.map +0 -1
- package/src/shade/renderer/atmosphere/hillaire/ATMOSPHERE_EARTH.js +0 -44
- package/src/shade/renderer/atmosphere/hillaire/ATMOSPHERE_PARAMETERS_STRUCT.d.ts +0 -2
- package/src/shade/renderer/atmosphere/hillaire/ATMOSPHERE_PARAMETERS_STRUCT.d.ts.map +0 -1
- package/src/shade/renderer/atmosphere/hillaire/ATMOSPHERE_PARAMETERS_STRUCT.js +0 -43
- package/src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_DENSITY_DECLARATION.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_DENSITY_DECLARATION.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_DENSITY_DECLARATION.js +0 -6
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_absorb.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_absorb.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_absorb.js +0 -18
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_integrate_optical_depth.d.ts +0 -14
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_integrate_optical_depth.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_integrate_optical_depth.js +0 -86
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_integrate_scattering.d.ts +0 -8
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_integrate_scattering.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_integrate_scattering.js +0 -125
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_planet_intersection.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_planet_intersection.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_planet_intersection.js +0 -17
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_sphere_intersection_nearest.d.ts +0 -3
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_sphere_intersection_nearest.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/atmosphere/chunk_sphere_intersection_nearest.js +0 -38
- package/src/shade/renderer/shader/chunk/atmosphere/hillaire/DENSITY_PROFILE_LAYER_STRUCT.d.ts +0 -16
- package/src/shade/renderer/shader/chunk/atmosphere/hillaire/DENSITY_PROFILE_LAYER_STRUCT.d.ts.map +0 -1
- package/src/shade/renderer/shader/chunk/atmosphere/hillaire/DENSITY_PROFILE_LAYER_STRUCT.js +0 -28
- package/src/shade/renderer/shader/chunk/light/sky/chunk_sample_sky_color.d.ts.map +0 -1
- package/src/shade/renderer/view/GPUViewSkyContext.d.ts +0 -26
- package/src/shade/renderer/view/GPUViewSkyContext.d.ts.map +0 -1
- package/src/shade/renderer/view/GPUViewSkyContext.js +0 -170
package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_indirect_lighting.js
ADDED
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
import { CAMERA_UNIFORM_STRUCT } from "../../camera/CAMERA_UNIFORM_STRUCT.js";
|
|
2
|
+
import { chunk_get_ibl_radiance } from "../../deferred/indirect/chunk_get_ibl_radiance.js";
|
|
3
|
+
import { DEPTH_STENCIL_FOREGROUND_ONLY } from "../../depth/DEPTH_STENCIL_FOREGROUND_ONLY.js";
|
|
4
|
+
import { BSDF_ROUGHNESS_MINIMUM } from "../../light/environment/DEFINES.js";
|
|
5
|
+
import { ENVIRONMENT_MAP_RESOURCE } from "../../light/environment/ENVIRONMENT_MAP_RESOURCE.js";
|
|
6
|
+
import { ENVIRONMENT_MAP_SAMPLER_RESOURCE } from "../../light/environment/ENVIRONMENT_MAP_SAMPLER_RESOURCE.js";
|
|
7
|
+
import { chunk_compute_specular_occlusion_bn } from "../../shader/chunk/brdf/chunk_compute_specular_occlusion_bn.js";
|
|
8
|
+
import { chunk_MIN_DIELECTRICS_F0 } from "../../shader/chunk/brdf/chunk_MIN_DIELECTRICS_F0.js";
|
|
9
|
+
import { chunk_project_position_from_depth } from "../../shader/chunk/camera/chunk_project_position_from_depth.js";
|
|
10
|
+
import { chunk_mat4_extract_position } from "../../shader/chunk/geometry/mat4/chunk_mat4_extract_position.js";
|
|
11
|
+
import { chunk_decode_g_buffer_normal } from "../../shader/chunk/geometry/normal/chunk_decode_g_buffer_normal.js";
|
|
12
|
+
import { chunk_compute_indirect_specular } from "../../shader/chunk/material/chunk_compute_indirect_specular.js";
|
|
13
|
+
import { chunk_decode_g_buffer_metalness } from "../../shader/chunk/material/chunk_decode_g_buffer_metalness.js";
|
|
14
|
+
import { chunk_decode_g_buffer_roughness } from "../../shader/chunk/material/chunk_decode_g_buffer_roughness.js";
|
|
15
|
+
import { chunk_metalness_to_specular_color } from "../../shader/chunk/material/chunk_metalness_to_specular_color.js";
|
|
16
|
+
import { chunk_stbn_sample_vec2 } from "../../shader/chunk/noise/chunk_stbn_sample_vec2.js";
|
|
17
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
18
|
+
import { ComputeShader } from "../../shader/ComputeShader.js";
|
|
19
|
+
import { ImageShader } from "../../shader/ImageShader.js";
|
|
20
|
+
import { ShaderResourceSetDescriptor } from "../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
21
|
+
import { ShaderDescriptor } from "../../shader/ShaderDescriptor.js";
|
|
22
|
+
import { STBN_VEC2_RESOURCE } from "../../STATIC_GRAPHICS_ENGINE_ASSET_RESOURCES.js";
|
|
23
|
+
import { SAMPLER_LINEAR_UPSCALE } from "../../texture/SAMPLER_LINEAR_UPSCALE.js";
|
|
24
|
+
import { VIEW_UNIFORM_STRUCT } from "../../view/VIEW_UNIFORM_STRUCT.js";
|
|
25
|
+
import {
|
|
26
|
+
chunk_probe_clipmap_pick,
|
|
27
|
+
PROBE_CLIPMAP_SAMPLING_GROUP
|
|
28
|
+
} from "../probe_clipmap/probe/chunk_probe_clipmap_pick.js";
|
|
29
|
+
import { chunk_probe_clipmap_sample_radiance } from "../probe_clipmap/probe/chunk_probe_clipmap_sample_radiance.js";
|
|
30
|
+
import { SCREEN_PROBE_TILE_WORKGROUP_SIZE } from "./SCREEN_PROBE.js";
|
|
31
|
+
import { ShaderResourceDescriptor } from "../../shader/resource/ShaderResourceDescriptor.js";
|
|
32
|
+
|
|
33
|
+
const fused_resources = new ShaderResourceSetDescriptor();
|
|
34
|
+
|
|
35
|
+
fused_resources.createGroup()
|
|
36
|
+
.addTexture("tDepth")
|
|
37
|
+
.addTexture("tNormals", "uint")
|
|
38
|
+
.addTexture("tBentNormals", "uint")
|
|
39
|
+
.addTexture("tGBufferAlbedo")
|
|
40
|
+
.addTexture("tGBufferPBR")
|
|
41
|
+
.addTexture("tScreenProbeDiffuse")
|
|
42
|
+
.add(STBN_VEC2_RESOURCE)
|
|
43
|
+
.addUniform("view", VIEW_UNIFORM_STRUCT)
|
|
44
|
+
.addUniform("camera", CAMERA_UNIFORM_STRUCT)
|
|
45
|
+
.add(ENVIRONMENT_MAP_RESOURCE)
|
|
46
|
+
.add(ENVIRONMENT_MAP_SAMPLER_RESOURCE)
|
|
47
|
+
.addSampler("sLinear", "filtering", SAMPLER_LINEAR_UPSCALE)
|
|
48
|
+
.addTexture("tSplitSum", "float");
|
|
49
|
+
|
|
50
|
+
fused_resources.addGroup(PROBE_CLIPMAP_SAMPLING_GROUP);
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* The screen probes' deferred indirect light in one pass, for SSR off: the diffuse is the screen probes' (the temporal
|
|
54
|
+
* filter's output, E at the bent normal), and the specular the world-space probes', picked and resolved as the probe
|
|
55
|
+
* clipmap's fused pass takes it (`probe_clipmap_radiance_of`), the environment's where no probe weighs anything. The
|
|
56
|
+
* two are resolved as `shader_resolve_indirect_lighting` resolves the IBL pair: AO multiplies the diffuse, the
|
|
57
|
+
* specular is occluded along its lobe, and the result is added to the scene's colour.
|
|
58
|
+
*
|
|
59
|
+
* @type {ImageShader}
|
|
60
|
+
*/
|
|
61
|
+
export const shader_screen_probe_indirect_lighting = ImageShader.from({
|
|
62
|
+
descriptor: ShaderDescriptor.from({
|
|
63
|
+
label: "Screen Probe / Indirect Lighting (Fused)",
|
|
64
|
+
resources: fused_resources,
|
|
65
|
+
body: CodeChunk.from(
|
|
66
|
+
//language=WGSL
|
|
67
|
+
`
|
|
68
|
+
@fragment
|
|
69
|
+
fn main(
|
|
70
|
+
@builtin(position) coord: vec4<f32>,
|
|
71
|
+
@location(0) uv: vec2<f32>,
|
|
72
|
+
) -> @location(0) vec4<f32> {
|
|
73
|
+
let i_coord = vec2<u32>(coord.xy);
|
|
74
|
+
|
|
75
|
+
let depth = textureLoad(tDepth, i_coord, 0).r;
|
|
76
|
+
let texel_pbr = textureLoad(tGBufferPBR, i_coord, 0);
|
|
77
|
+
let albedo_ao = textureLoad(tGBufferAlbedo, i_coord, 0);
|
|
78
|
+
|
|
79
|
+
let albedo = albedo_ao.rgb;
|
|
80
|
+
let occlusion = albedo_ao.a;
|
|
81
|
+
|
|
82
|
+
let f_metalness = decode_g_buffer_metalness(texel_pbr);
|
|
83
|
+
|
|
84
|
+
// the radiance is sampled at the surface's roughness, as the IBL pass samples it; the resolve holds it off zero
|
|
85
|
+
let surface_roughness = decode_g_buffer_roughness(texel_pbr);
|
|
86
|
+
let roughness = max(surface_roughness, ${BSDF_ROUGHNESS_MINIMUM});
|
|
87
|
+
let alpha = roughness * roughness;
|
|
88
|
+
|
|
89
|
+
let position = project_position_from_depth(uv, depth, camera.view_projection_matrix_inverse);
|
|
90
|
+
let view_direction = normalize(mat4_extract_position(camera.transform) - position);
|
|
91
|
+
|
|
92
|
+
let normal = decode_g_buffer_normal(textureLoad(tNormals, i_coord, 0).x);
|
|
93
|
+
let bent_normal = decode_g_buffer_normal(textureLoad(tBentNormals, i_coord, 0).x);
|
|
94
|
+
|
|
95
|
+
let irradiance = textureLoad(tScreenProbeDiffuse, i_coord, 0).rgb;
|
|
96
|
+
|
|
97
|
+
let pick = probe_clipmap_pick(position, normal, view_direction, stbn_sample_vec2(vec3<u32>(i_coord, view.frame_index)));
|
|
98
|
+
let found = probe_clipmap_radiance_of(pick, position, normal, view_direction, surface_roughness);
|
|
99
|
+
let radiance = select(get_ibl_radiance(view_direction, normal, surface_roughness), found.radiance, found.found);
|
|
100
|
+
|
|
101
|
+
let indirect = compute_indirect_specular(
|
|
102
|
+
radiance,
|
|
103
|
+
irradiance * occlusion,
|
|
104
|
+
normal,
|
|
105
|
+
view_direction,
|
|
106
|
+
albedo * (1.0 - f_metalness),
|
|
107
|
+
metalness_to_specular_color(f_metalness, albedo),
|
|
108
|
+
vec3(MIN_DIELECTRICS_F0),
|
|
109
|
+
albedo,
|
|
110
|
+
1.0,
|
|
111
|
+
roughness,
|
|
112
|
+
);
|
|
113
|
+
|
|
114
|
+
let spec_direction = normalize(mix(reflect(-view_direction, normal), normal, alpha));
|
|
115
|
+
let specular_occlusion = compute_specular_occlusion_bn(spec_direction, bent_normal, occlusion, roughness);
|
|
116
|
+
|
|
117
|
+
return vec4(indirect[0] * specular_occlusion + indirect[1], 1.0);
|
|
118
|
+
}
|
|
119
|
+
`, [
|
|
120
|
+
chunk_project_position_from_depth,
|
|
121
|
+
chunk_mat4_extract_position,
|
|
122
|
+
chunk_decode_g_buffer_normal,
|
|
123
|
+
chunk_decode_g_buffer_metalness,
|
|
124
|
+
chunk_decode_g_buffer_roughness,
|
|
125
|
+
chunk_metalness_to_specular_color,
|
|
126
|
+
chunk_MIN_DIELECTRICS_F0,
|
|
127
|
+
chunk_stbn_sample_vec2,
|
|
128
|
+
chunk_probe_clipmap_pick,
|
|
129
|
+
chunk_probe_clipmap_sample_radiance,
|
|
130
|
+
chunk_get_ibl_radiance,
|
|
131
|
+
chunk_compute_indirect_specular,
|
|
132
|
+
chunk_compute_specular_occlusion_bn,
|
|
133
|
+
]),
|
|
134
|
+
}),
|
|
135
|
+
targets: [
|
|
136
|
+
{
|
|
137
|
+
format: "rgba16float",
|
|
138
|
+
blend: {
|
|
139
|
+
color: {
|
|
140
|
+
operation: "add",
|
|
141
|
+
srcFactor: "one",
|
|
142
|
+
dstFactor: "one",
|
|
143
|
+
},
|
|
144
|
+
alpha: {
|
|
145
|
+
operation: "add",
|
|
146
|
+
srcFactor: "zero",
|
|
147
|
+
dstFactor: "one",
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
],
|
|
152
|
+
depthStencil: DEPTH_STENCIL_FOREGROUND_ONLY,
|
|
153
|
+
});
|
|
154
|
+
|
|
155
|
+
const diffuse_resources = new ShaderResourceSetDescriptor();
|
|
156
|
+
|
|
157
|
+
diffuse_resources.createGroup()
|
|
158
|
+
.addTexture("tGBufferAlbedo")
|
|
159
|
+
.addTexture("tScreenProbeDiffuse");
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* The screen probes' deferred diffuse, for SSR on: the temporal filter's output, E at the bent normal, times AO, as
|
|
163
|
+
* the IBL pass bakes AO in at the source, so `shader_resolve_indirect_lighting` and SSR's hits read it as any mode's.
|
|
164
|
+
*
|
|
165
|
+
* @type {ImageShader}
|
|
166
|
+
*/
|
|
167
|
+
export const shader_screen_probe_diffuse = ImageShader.from({
|
|
168
|
+
descriptor: ShaderDescriptor.from({
|
|
169
|
+
label: "Screen Probe / Indirect Diffuse",
|
|
170
|
+
resources: diffuse_resources,
|
|
171
|
+
body: CodeChunk.from(
|
|
172
|
+
//language=WGSL
|
|
173
|
+
`
|
|
174
|
+
@fragment
|
|
175
|
+
fn main(
|
|
176
|
+
@builtin(position) coord: vec4<f32>,
|
|
177
|
+
@location(0) uv: vec2<f32>,
|
|
178
|
+
) -> @location(0) vec4<f32> {
|
|
179
|
+
let i_coord = vec2<u32>(coord.xy);
|
|
180
|
+
|
|
181
|
+
return vec4<f32>(textureLoad(tScreenProbeDiffuse, i_coord, 0).rgb * textureLoad(tGBufferAlbedo, i_coord, 0).a, 0.0);
|
|
182
|
+
}
|
|
183
|
+
`),
|
|
184
|
+
}),
|
|
185
|
+
depthStencil: DEPTH_STENCIL_FOREGROUND_ONLY,
|
|
186
|
+
targets: [{
|
|
187
|
+
label: "Diffuse Indirect lighting",
|
|
188
|
+
format: "rgba16float"
|
|
189
|
+
}]
|
|
190
|
+
});
|
|
191
|
+
|
|
192
|
+
const capture_resources = new ShaderResourceSetDescriptor();
|
|
193
|
+
|
|
194
|
+
capture_resources.createGroup()
|
|
195
|
+
.add(ShaderResourceDescriptor.texture("tColor", "unfilterable-float"))
|
|
196
|
+
.add(ShaderResourceDescriptor.storageTexture("screen_probe_color_history", "rgba16float", "2d", "write-only"));
|
|
197
|
+
|
|
198
|
+
/**
|
|
199
|
+
* Keep the frame's lit colour of the opaque surfaces for the next frame's screen traces: a thread a pixel, copied as
|
|
200
|
+
* it stands once the indirect light is added, before fog and transparencies, which are not the surfaces' radiance.
|
|
201
|
+
*
|
|
202
|
+
* @type {ComputeShader}
|
|
203
|
+
*/
|
|
204
|
+
export const shader_screen_probe_color_capture = ComputeShader.from({
|
|
205
|
+
label: "Screen Probe Color Capture",
|
|
206
|
+
resources: capture_resources,
|
|
207
|
+
body: CodeChunk.from(
|
|
208
|
+
//language=WGSL
|
|
209
|
+
`
|
|
210
|
+
@compute @workgroup_size(${SCREEN_PROBE_TILE_WORKGROUP_SIZE}, ${SCREEN_PROBE_TILE_WORKGROUP_SIZE}, 1)
|
|
211
|
+
fn main(@builtin(global_invocation_id) id: vec3<u32>) {
|
|
212
|
+
if (any(id.xy >= textureDimensions(tColor, 0))) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
textureStore(screen_probe_color_history, id.xy, textureLoad(tColor, id.xy, 0));
|
|
217
|
+
}
|
|
218
|
+
`),
|
|
219
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Where a screen probe's rays leave from in the bricks, and what answers for them past their reach (Lumen's radiance
|
|
3
|
+
* cache coverage), a thread a probe, dispatched through the frame's thread-a-probe command:
|
|
4
|
+
*
|
|
5
|
+
* - **The origin** (`screen_probe_brick_origin`): off the probe's surface point along its face normal, and on along
|
|
6
|
+
* the bricks' field until it reads a voxel clear, so its rays do not start in the solid they leave.
|
|
7
|
+
* - **The pick**: the world-space probes around the probe's surface point, picked as a pixel there picks them for its
|
|
8
|
+
* own light (`probe_clipmap_pick`): by the face normal and the view, two of a cage's eight by the visibility of the
|
|
9
|
+
* point, with the frame's blue noise at the probe's pixel. Every ray of the probe that reaches its reach unoccluded
|
|
10
|
+
* reads their radiance along its own direction.
|
|
11
|
+
* - **The reach**: `SCREEN_PROBE_REACH_SPACINGS` spacings of the coarsest cascade the pick drew from, the furthest a
|
|
12
|
+
* corner it reads stands from the point. Where nothing weighs anything, a ray is traced through the whole world
|
|
13
|
+
* (`brick_t_max`) and nothing stands in for what it does not reach.
|
|
14
|
+
* - **Its wants**: each probe on a surface wants the cages its pick reads, in the world-space probes' late set, so a
|
|
15
|
+
* probe its rays read is there whether or not a pixel's pick wants it. Every lane calls `probe_clipmap_want`,
|
|
16
|
+
* wanting or not, from uniform control flow.
|
|
17
|
+
*
|
|
18
|
+
* @type {ComputeShader}
|
|
19
|
+
*/
|
|
20
|
+
export const shader_screen_probe_pick: ComputeShader;
|
|
21
|
+
import { ComputeShader } from "../../shader/ComputeShader.js";
|
|
22
|
+
//# sourceMappingURL=shader_screen_probe_pick.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shader_screen_probe_pick.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_pick.js"],"names":[],"mappings":"AAyDA;;;;;;;;;;;;;;;;;;GAkBG;AACH,uCAFU,aAAa,CA4EpB;8BA/I2B,+BAA+B"}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
import { chunk_mat4_extract_position } from "../../shader/chunk/geometry/mat4/chunk_mat4_extract_position.js";
|
|
2
|
+
import {
|
|
3
|
+
chunk_uv_octahedral_unit_decode
|
|
4
|
+
} from "../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_decode.js";
|
|
5
|
+
import { chunk_folded_workgroup_index } from "../../shader/chunk/grid/chunk_folded_workgroup_index.js";
|
|
6
|
+
import { chunk_stbn_sample_vec2 } from "../../shader/chunk/noise/chunk_stbn_sample_vec2.js";
|
|
7
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
8
|
+
import { ComputeShader } from "../../shader/ComputeShader.js";
|
|
9
|
+
import { ShaderResourceSetDescriptor } from "../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
10
|
+
import { STBN_VEC2_RESOURCE } from "../../STATIC_GRAPHICS_ENGINE_ASSET_RESOURCES.js";
|
|
11
|
+
import {
|
|
12
|
+
BRICK_ATLAS_TEXTURE_RESOURCE,
|
|
13
|
+
BRICK_LEVELS_RESOURCE,
|
|
14
|
+
BRICK_MAP_TEXTURE_RESOURCE,
|
|
15
|
+
BRICK_SAMPLER_RESOURCE
|
|
16
|
+
} from "../probe_clipmap/brick/chunk_brick_clipmap_trace.js";
|
|
17
|
+
import { PROBE_WANTED_BITS_RESOURCE, PROBE_WANTED_WRITE_RESOURCE } from "../probe_clipmap/probe/chunk_probe_clipmap.js";
|
|
18
|
+
import {
|
|
19
|
+
chunk_probe_clipmap_pick,
|
|
20
|
+
PROBE_CLIPMAP_SAMPLING_GROUP
|
|
21
|
+
} from "../probe_clipmap/probe/chunk_probe_clipmap_pick.js";
|
|
22
|
+
import { chunk_probe_clipmap_want } from "../probe_clipmap/probe/chunk_probe_clipmap_want.js";
|
|
23
|
+
import { PROBE_RECEIVER_BIAS_VIEW } from "../probe_clipmap/probe/PROBE_CLIPMAP.js";
|
|
24
|
+
import { PROBE_WANT_SETTINGS } from "../probe_clipmap/probe/shader_probe_clipmap_want.js";
|
|
25
|
+
import {
|
|
26
|
+
chunk_screen_probe,
|
|
27
|
+
chunk_screen_probe_counts,
|
|
28
|
+
SCREEN_PROBE_DISPATCH_READ_RESOURCE,
|
|
29
|
+
SCREEN_PROBE_FRAME_RESOURCE,
|
|
30
|
+
SCREEN_PROBE_PICKS_WRITE_RESOURCE,
|
|
31
|
+
SCREEN_PROBES_READ_RESOURCE
|
|
32
|
+
} from "./chunk_screen_probe.js";
|
|
33
|
+
import { chunk_screen_probe_brick_origin } from "./chunk_screen_probe_brick_origin.js";
|
|
34
|
+
import { SCREEN_PROBE_CAMERA_RESOURCE } from "./chunk_screen_probe_surface.js";
|
|
35
|
+
import { SCREEN_PROBE_REACH_SPACINGS, SCREEN_PROBE_THREAD_WORKGROUP_SIZE } from "./SCREEN_PROBE.js";
|
|
36
|
+
|
|
37
|
+
const resources = new ShaderResourceSetDescriptor();
|
|
38
|
+
|
|
39
|
+
// the world-space probes' late wants, as `GPUProbeClipmap#write_want_bindings` hands them
|
|
40
|
+
resources.setImmediate("settings", PROBE_WANT_SETTINGS);
|
|
41
|
+
|
|
42
|
+
resources.createGroup()
|
|
43
|
+
.add(SCREEN_PROBE_FRAME_RESOURCE)
|
|
44
|
+
.add(SCREEN_PROBE_CAMERA_RESOURCE)
|
|
45
|
+
.add(SCREEN_PROBES_READ_RESOURCE)
|
|
46
|
+
.add(SCREEN_PROBE_PICKS_WRITE_RESOURCE)
|
|
47
|
+
.add(SCREEN_PROBE_DISPATCH_READ_RESOURCE)
|
|
48
|
+
.add(STBN_VEC2_RESOURCE)
|
|
49
|
+
.add(PROBE_WANTED_WRITE_RESOURCE)
|
|
50
|
+
.add(PROBE_WANTED_BITS_RESOURCE)
|
|
51
|
+
.add(BRICK_LEVELS_RESOURCE)
|
|
52
|
+
.add(BRICK_MAP_TEXTURE_RESOURCE)
|
|
53
|
+
.add(BRICK_ATLAS_TEXTURE_RESOURCE)
|
|
54
|
+
.add(BRICK_SAMPLER_RESOURCE);
|
|
55
|
+
|
|
56
|
+
resources.addGroup(PROBE_CLIPMAP_SAMPLING_GROUP);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Where a screen probe's rays leave from in the bricks, and what answers for them past their reach (Lumen's radiance
|
|
60
|
+
* cache coverage), a thread a probe, dispatched through the frame's thread-a-probe command:
|
|
61
|
+
*
|
|
62
|
+
* - **The origin** (`screen_probe_brick_origin`): off the probe's surface point along its face normal, and on along
|
|
63
|
+
* the bricks' field until it reads a voxel clear, so its rays do not start in the solid they leave.
|
|
64
|
+
* - **The pick**: the world-space probes around the probe's surface point, picked as a pixel there picks them for its
|
|
65
|
+
* own light (`probe_clipmap_pick`): by the face normal and the view, two of a cage's eight by the visibility of the
|
|
66
|
+
* point, with the frame's blue noise at the probe's pixel. Every ray of the probe that reaches its reach unoccluded
|
|
67
|
+
* reads their radiance along its own direction.
|
|
68
|
+
* - **The reach**: `SCREEN_PROBE_REACH_SPACINGS` spacings of the coarsest cascade the pick drew from, the furthest a
|
|
69
|
+
* corner it reads stands from the point. Where nothing weighs anything, a ray is traced through the whole world
|
|
70
|
+
* (`brick_t_max`) and nothing stands in for what it does not reach.
|
|
71
|
+
* - **Its wants**: each probe on a surface wants the cages its pick reads, in the world-space probes' late set, so a
|
|
72
|
+
* probe its rays read is there whether or not a pixel's pick wants it. Every lane calls `probe_clipmap_want`,
|
|
73
|
+
* wanting or not, from uniform control flow.
|
|
74
|
+
*
|
|
75
|
+
* @type {ComputeShader}
|
|
76
|
+
*/
|
|
77
|
+
export const shader_screen_probe_pick = ComputeShader.from({
|
|
78
|
+
label: "Screen Probe Pick",
|
|
79
|
+
resources,
|
|
80
|
+
body: CodeChunk.from(
|
|
81
|
+
//language=WGSL
|
|
82
|
+
`
|
|
83
|
+
// the spacing of a picked probe's cascade, or zero for a share of nothing
|
|
84
|
+
fn screen_probe_picked_spacing(slot: u32, weight: f32) -> f32 {
|
|
85
|
+
if (weight <= 0.0) {
|
|
86
|
+
return 0.0;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return probe_levels[probe_record_cascade(probe_records[slot].flags)].cell_size;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
@compute @workgroup_size(${SCREEN_PROBE_THREAD_WORKGROUP_SIZE})
|
|
93
|
+
fn main(
|
|
94
|
+
@builtin(workgroup_id) workgroup_id: vec3<u32>,
|
|
95
|
+
@builtin(local_invocation_index) lane: u32,
|
|
96
|
+
) {
|
|
97
|
+
let probe = folded_workgroup_index(workgroup_id) * ${SCREEN_PROBE_THREAD_WORKGROUP_SIZE}u + lane;
|
|
98
|
+
|
|
99
|
+
var wants = false;
|
|
100
|
+
var position = vec3<f32>(0.0);
|
|
101
|
+
var bias_direction = vec3<f32>(0.0, 0.0, 1.0);
|
|
102
|
+
|
|
103
|
+
if (probe < screen_probe_count()) {
|
|
104
|
+
let record = screen_probes[probe];
|
|
105
|
+
|
|
106
|
+
var pick: ScreenProbePick;
|
|
107
|
+
|
|
108
|
+
pick.reach = screen_probe_frame.brick_t_max;
|
|
109
|
+
|
|
110
|
+
if (record.depth > 0.0) {
|
|
111
|
+
let normal = uv_octahedral_unit_decode(unpack2x16unorm(record.normal));
|
|
112
|
+
let view_direction = normalize(mat4_extract_position(camera.transform) - record.position);
|
|
113
|
+
let noise = stbn_sample_vec2(vec3<u32>(screen_probe_pixel_decode(record.pixel), screen_probe_frame.frame_index));
|
|
114
|
+
let found = probe_clipmap_pick(record.position, normal, view_direction, noise);
|
|
115
|
+
|
|
116
|
+
pick.slots = found.slots;
|
|
117
|
+
pick.weights = found.weights;
|
|
118
|
+
pick.origin = screen_probe_brick_origin(record.position, normal, screen_probe_frame.brick_cascade_count, screen_probe_frame.brick_atlas_shift);
|
|
119
|
+
|
|
120
|
+
// each share by name: an index into the vectors would put them in local memory
|
|
121
|
+
let spacing = max(
|
|
122
|
+
max(screen_probe_picked_spacing(found.slots.x, found.weights.x), screen_probe_picked_spacing(found.slots.y, found.weights.y)),
|
|
123
|
+
max(screen_probe_picked_spacing(found.slots.z, found.weights.z), screen_probe_picked_spacing(found.slots.w, found.weights.w)),
|
|
124
|
+
);
|
|
125
|
+
|
|
126
|
+
if (spacing > 0.0) {
|
|
127
|
+
pick.reach = ${SCREEN_PROBE_REACH_SPACINGS} * spacing;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
wants = true;
|
|
131
|
+
position = record.position;
|
|
132
|
+
bias_direction = mix(normal, view_direction, ${PROBE_RECEIVER_BIAS_VIEW});
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
screen_probe_picks[probe] = pick;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
probe_clipmap_want(wants, position, bias_direction, settings.cascade_count, settings.resolution, settings.anchor, settings.select_half, settings.wanted_capacity);
|
|
139
|
+
}
|
|
140
|
+
`, [
|
|
141
|
+
chunk_screen_probe,
|
|
142
|
+
chunk_screen_probe_counts,
|
|
143
|
+
chunk_folded_workgroup_index,
|
|
144
|
+
chunk_uv_octahedral_unit_decode,
|
|
145
|
+
chunk_mat4_extract_position,
|
|
146
|
+
chunk_stbn_sample_vec2,
|
|
147
|
+
chunk_probe_clipmap_pick,
|
|
148
|
+
chunk_probe_clipmap_want,
|
|
149
|
+
chunk_screen_probe_brick_origin,
|
|
150
|
+
]),
|
|
151
|
+
});
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Whether a point's interpolation weights cover it, Lumen's rule: the weights normalised by their sum held to
|
|
3
|
+
* `SCREEN_PROBE_WEIGHT_EPSILON` from below sum to at least 1 − ε, that is the raw sum is at least ε·(1 − ε). Adaptive
|
|
4
|
+
* placement puts a probe where they do not; integration gives no light there.
|
|
5
|
+
*
|
|
6
|
+
* ```wgsl
|
|
7
|
+
* fn screen_probe_covers(weights: vec4<f32>) -> bool
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* @type {CodeChunk}
|
|
11
|
+
*/
|
|
12
|
+
export const chunk_screen_probe_covers: CodeChunk;
|
|
13
|
+
/**
|
|
14
|
+
* Uniform placement (Lumen's `ScreenProbeDownsampleDepthUniformCS`): a thread a tile of D × D pixels, the probe on the
|
|
15
|
+
* pixel at the frame's jitter in it, held inside the view (`screen_probe_surface_at`), written to its tile's place in
|
|
16
|
+
* the atlas. A tile over the sky gets a record of depth zero. Each tile's count of adaptive probes starts at zero.
|
|
17
|
+
*
|
|
18
|
+
* @type {ComputeShader}
|
|
19
|
+
*/
|
|
20
|
+
export const shader_screen_probe_place_uniform: ComputeShader;
|
|
21
|
+
/**
|
|
22
|
+
* Settings of one level of adaptive placement.
|
|
23
|
+
* @type {WebGPUStruct}
|
|
24
|
+
*/
|
|
25
|
+
export const SCREEN_PROBE_ADAPTIVE_SETTINGS: WebGPUStruct;
|
|
26
|
+
/**
|
|
27
|
+
* Adaptive placement, one level (Lumen's `ScreenProbeAdaptivePlacementCS`): a thread a point of the grid at the
|
|
28
|
+
* level's spacing, D >> level, with the frame's jitter. A point that a coarser level's grid already holds, both its
|
|
29
|
+
* indices even, is skipped. A point on a surface that the probes placed so far do not cover (`screen_probe_interpolate`,
|
|
30
|
+
* `screen_probe_covers`), the uniform ones and the coarser levels' adaptive ones, gets a probe:
|
|
31
|
+
*
|
|
32
|
+
* - its slot from the frame's count of adaptive probes, one atomic a subgroup; past `adaptive_capacity` no probe is
|
|
33
|
+
* placed, so where the view wants more than the slots hold, the coarser levels, placed first, keep theirs;
|
|
34
|
+
* - its record at probe `uniform_count + slot`, and its slot on its tile's list, whose count of
|
|
35
|
+
* `adaptive_tile_capacity` it cannot pass, since the tile holds that many of the grids' points.
|
|
36
|
+
*
|
|
37
|
+
* The levels run one dispatch each, coarsest first, so a level sees every coarser one's probes; within a level,
|
|
38
|
+
* another workgroup's placement may not be seen yet, as in Lumen.
|
|
39
|
+
*
|
|
40
|
+
* @type {ComputeShader}
|
|
41
|
+
*/
|
|
42
|
+
export const shader_screen_probe_place_adaptive: ComputeShader;
|
|
43
|
+
/**
|
|
44
|
+
* The commands of the frame's passes over its probes, one thread after placement: the frame's probes, the uniform ones
|
|
45
|
+
* and the adaptive ones placed, held to their slots; a workgroup a probe, a thread a probe and a thread a ray, folded
|
|
46
|
+
* (`folded_dispatch`), and the count.
|
|
47
|
+
*
|
|
48
|
+
* @type {ComputeShader}
|
|
49
|
+
*/
|
|
50
|
+
export const shader_screen_probe_command: ComputeShader;
|
|
51
|
+
/**
|
|
52
|
+
* Settings of the bricks' command.
|
|
53
|
+
* @type {WebGPUStruct}
|
|
54
|
+
*/
|
|
55
|
+
export const SCREEN_PROBE_BRICK_COMMAND_SETTINGS: WebGPUStruct;
|
|
56
|
+
/**
|
|
57
|
+
* The command of the passes over the rays the screen left to the bricks, one thread after the screen trace: the count,
|
|
58
|
+
* held to the list's slots, and a thread a ray, folded.
|
|
59
|
+
*
|
|
60
|
+
* @type {ComputeShader}
|
|
61
|
+
*/
|
|
62
|
+
export const shader_screen_probe_brick_command: ComputeShader;
|
|
63
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
64
|
+
import { ComputeShader } from "../../shader/ComputeShader.js";
|
|
65
|
+
import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
|
|
66
|
+
//# sourceMappingURL=shader_screen_probe_place.d.ts.map
|
package/src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"shader_screen_probe_place.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/global_illumination/screen_probe/shader_screen_probe_place.js"],"names":[],"mappings":"AA+CA;;;;;;;;;;GAUG;AACH,wCAFU,SAAS,CAQhB;AAkBH;;;;;;GAMG;AACH,gDAFU,aAAa,CA2BpB;AAEH;;;GAGG;AACH,6CAFU,YAAY,CAKY;AAclC;;;;;;;;;;;;;;;GAeG;AACH,iDAFU,aAAa,CAyDpB;AASH;;;;;;GAMG;AACH,0CAFU,aAAa,CAiCpB;AAEH;;;GAGG;AACH,kDAFU,YAAY,CAKgB;AAUtC;;;;;GAKG;AACH,gDAFU,aAAa,CAsBpB;0BAnSuB,oCAAoC;8BAChC,+BAA+B;6BAGhC,mCAAmC"}
|