@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
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { assert } from "../../../core/assert.js";
|
|
2
2
|
import { gpu_texture_format_info } from "../../descriptor/texture/format/gpu_texture_format_info.js";
|
|
3
|
+
import { TextureViewDescriptor } from "../../descriptor/texture/TextureViewDescriptor.js";
|
|
3
4
|
import { isImageBitmap } from "../../../core/dom/isImageBitmap.js";
|
|
4
5
|
import { ShadeGPUCommandContext } from "../../device/ShadeGPUCommandContext.js";
|
|
6
|
+
import { create_atmosphere_sun_state, resolve_atmosphere_sun } from "../atmosphere/resolve_atmosphere_sun.js";
|
|
7
|
+
import { SKY_IRRADIANCE_LUT_RESOLUTION, shader_sky_irradiance_lut } from "../atmosphere/shader_sky_irradiance_lut.js";
|
|
5
8
|
import { GPUDatabase } from "../buffer/table/GPUDatabase.js";
|
|
6
9
|
import { GPUSceneShadowmapContext } from "../shadow/map/GPUSceneShadowmapContext.js";
|
|
7
10
|
import { GPUTextureContext } from "../texture/GPUTextureContext.js";
|
|
@@ -50,15 +53,23 @@ import {
|
|
|
50
53
|
*/
|
|
51
54
|
const MAX_DIRECTIONAL_LIGHTS = 32;
|
|
52
55
|
|
|
56
|
+
const MIP_0_VIEW_DESCRIPTOR = TextureViewDescriptor.from({
|
|
57
|
+
baseMipLevel: 0,
|
|
58
|
+
mipLevelCount: 1,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
const ZERO_ENVIRONMENT_SH = new Float32Array(ENVIRONMENT_SH_TYPE.size / 4);
|
|
62
|
+
|
|
53
63
|
export class GPULightCollection {
|
|
54
64
|
|
|
55
65
|
/**
|
|
56
66
|
* Offer the pipelines a scene's lights are updated with — the environment map's filtering and
|
|
57
|
-
* projection, and the pose refresh — see {@link PipelineEnquiry}.
|
|
67
|
+
* projection, procedural sky mip-0 synthesis, and the pose refresh — see {@link PipelineEnquiry}.
|
|
58
68
|
*
|
|
59
69
|
* @param {PipelineEnquiry} enquiry
|
|
60
70
|
*/
|
|
61
71
|
static enquirePipelines(enquiry) {
|
|
72
|
+
enquiry.render.push(shader_sky_irradiance_lut.pipeline);
|
|
62
73
|
enquire_filter_environment_map_pipelines(enquiry);
|
|
63
74
|
enquiry.compute.push(shader_project_environment_sh.pipeline);
|
|
64
75
|
enquiry.compute.push(shader_project_far_field_irradiance_sh.pipeline);
|
|
@@ -66,6 +77,11 @@ export class GPULightCollection {
|
|
|
66
77
|
}
|
|
67
78
|
|
|
68
79
|
|
|
80
|
+
/**
|
|
81
|
+
* @type {GPUSceneContext}
|
|
82
|
+
*/
|
|
83
|
+
#scene_ctx;
|
|
84
|
+
|
|
69
85
|
/**
|
|
70
86
|
* @type {LightCollection}
|
|
71
87
|
*/
|
|
@@ -178,10 +194,39 @@ export class GPULightCollection {
|
|
|
178
194
|
#environment;
|
|
179
195
|
|
|
180
196
|
/**
|
|
181
|
-
* @type {ShadeTexture}
|
|
197
|
+
* @type {ShadeTexture|undefined}
|
|
182
198
|
*/
|
|
183
199
|
#environment_source;
|
|
184
200
|
|
|
201
|
+
/**
|
|
202
|
+
* Active backing mode for {@link #environment}: `"black"` (`1×1` zeroed fallback),
|
|
203
|
+
* `"texture"` (authored `ShadeTexture` from `lights.environment`), or `"atmosphere"`
|
|
204
|
+
* (procedural Hillaire octahedral sky driven by `scene.atmosphere`).
|
|
205
|
+
*
|
|
206
|
+
* @type {"black" | "texture" | "atmosphere"}
|
|
207
|
+
*/
|
|
208
|
+
#environment_mode = "black";
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Reusable per-update sun descriptor for procedural sky synthesis.
|
|
212
|
+
*/
|
|
213
|
+
#atmosphere_sun_state = create_atmosphere_sun_state();
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* Reusable immediate settings payload for {@link shader_sky_irradiance_lut}.
|
|
217
|
+
*/
|
|
218
|
+
#sky_irradiance_settings = {
|
|
219
|
+
sun_direction: this.#atmosphere_sun_state.sun_direction,
|
|
220
|
+
reference_altitude: 0,
|
|
221
|
+
sun_irradiance: this.#atmosphere_sun_state.sun_irradiance,
|
|
222
|
+
resolution: SKY_IRRADIANCE_LUT_RESOLUTION,
|
|
223
|
+
};
|
|
224
|
+
|
|
225
|
+
#committed_atmosphere_version = -1;
|
|
226
|
+
#committed_reference_altitude = NaN;
|
|
227
|
+
#committed_sun_direction = new Float32Array([NaN, NaN, NaN]);
|
|
228
|
+
#committed_sun_irradiance = new Float32Array([NaN, NaN, NaN]);
|
|
229
|
+
|
|
185
230
|
/**
|
|
186
231
|
* The environment's radiance as RGB SH2, projected from {@link #environment} whenever it changes;
|
|
187
232
|
* see {@link shader_project_environment_sh}.
|
|
@@ -258,6 +303,7 @@ export class GPULightCollection {
|
|
|
258
303
|
const device = graphics.device;
|
|
259
304
|
|
|
260
305
|
this.#device = device;
|
|
306
|
+
this.#scene_ctx = scene_ctx;
|
|
261
307
|
this.#source = scene.lights;
|
|
262
308
|
|
|
263
309
|
this.#source.onRemoved.add(this.#removed, this);
|
|
@@ -268,6 +314,7 @@ export class GPULightCollection {
|
|
|
268
314
|
this.#environment.descriptor.usage |=
|
|
269
315
|
GPUTextureUsage.COPY_DST // so we can write to it
|
|
270
316
|
| GPUTextureUsage.STORAGE_BINDING // so we can convolve it in compute shader
|
|
317
|
+
| GPUTextureUsage.RENDER_ATTACHMENT // for procedural sky mip-0 synthesis and ImageBitmap uploads
|
|
271
318
|
;
|
|
272
319
|
|
|
273
320
|
// zeroed on creation, which is what an absent environment projects to
|
|
@@ -298,115 +345,201 @@ export class GPULightCollection {
|
|
|
298
345
|
*/
|
|
299
346
|
#update_environment(ctx) {
|
|
300
347
|
const source_env = this.#source.environment;
|
|
348
|
+
const gpu_ctx = this.#environment;
|
|
349
|
+
|
|
350
|
+
if (source_env !== undefined) {
|
|
351
|
+
if (this.#environment_mode === "texture" && this.#environment_source === source_env) {
|
|
352
|
+
return;
|
|
353
|
+
}
|
|
354
|
+
|
|
355
|
+
const source_image = source_env.image;
|
|
356
|
+
|
|
357
|
+
/*
|
|
358
|
+
An environment map comes with a one-texel octahedral skirt: the octahedral square in the
|
|
359
|
+
interior, each texel of the outer ring a copy of the one the fold puts beside it. The renderer
|
|
360
|
+
filters it in hardware through that skirt and skirts the levels it filters itself; an
|
|
361
|
+
unskirted map is the caller's error, and it would read as seams along the octahedron's
|
|
362
|
+
edges. Every level the roughness mapping reaches needs an interior, so 3 texels at the last.
|
|
363
|
+
`resample_equirectangular_to_octahedral` and the offline converter write the skirt by default.
|
|
364
|
+
|
|
365
|
+
Checked where the pixels are on hand; an ImageBitmap's are not.
|
|
366
|
+
*/
|
|
367
|
+
assert.greaterThanOrEqual(
|
|
368
|
+
source_image.width >> (SPHERE_PROBE_MIPMAP_LEVELS - 1),
|
|
369
|
+
3,
|
|
370
|
+
'environment map too small for its last filtered level'
|
|
371
|
+
);
|
|
372
|
+
|
|
373
|
+
assert.equal(source_image.width, source_image.height, 'an octahedral environment map is square');
|
|
374
|
+
|
|
375
|
+
const source_texels = source_image.source;
|
|
376
|
+
|
|
377
|
+
if (source_texels?.isSampler2D === true) {
|
|
378
|
+
assert.ok(
|
|
379
|
+
octahedral_skirt_matches(source_texels.data, source_texels.itemSize, source_texels.width),
|
|
380
|
+
'environment map has no octahedral skirt (see sampler2d_octahedral_skirt_fill)'
|
|
381
|
+
);
|
|
382
|
+
} else if (
|
|
383
|
+
source_texels?.isShadeTexelData === true
|
|
384
|
+
&& source_texels.levels[0] !== undefined
|
|
385
|
+
&& gpu_texture_format_info(source_texels.format).block_width === 1
|
|
386
|
+
) {
|
|
387
|
+
assert.ok(
|
|
388
|
+
octahedral_skirt_matches(
|
|
389
|
+
source_texels.levels[0],
|
|
390
|
+
gpu_texture_format_info(source_texels.format).bytes_per_block,
|
|
391
|
+
source_texels.width
|
|
392
|
+
),
|
|
393
|
+
'environment map has no octahedral skirt (see sampler2d_octahedral_skirt_fill)'
|
|
394
|
+
);
|
|
395
|
+
}
|
|
396
|
+
|
|
397
|
+
this.#environment_mode = "texture";
|
|
398
|
+
this.#environment_source = source_env;
|
|
399
|
+
|
|
400
|
+
/*
|
|
401
|
+
Assign descriptor.size directly rather than calling gpu_ctx.resize(): resize() immediately
|
|
402
|
+
re-allocates when the context is already in TEXTURE_STATE_ALLOCATED, which would call
|
|
403
|
+
createTexture with the new size and the previous map's mipLevelCount (failing WebGPU
|
|
404
|
+
validation whenever the new map is smaller) before allocate() below replaces it again.
|
|
405
|
+
*/
|
|
406
|
+
gpu_ctx.descriptor.size = [source_image.width, source_image.height, 1];
|
|
407
|
+
/*
|
|
408
|
+
The environment map is octahedral 2D and this context keeps the default dimension while
|
|
409
|
+
`size` above sets two spatial axes. Asked of the descriptor rather than assumed, so the
|
|
410
|
+
count follows if that ever stops being true.
|
|
411
|
+
*/
|
|
412
|
+
const gpu_size = gpu_ctx.descriptor.size;
|
|
413
|
+
|
|
414
|
+
gpu_ctx.descriptor.mipLevelCount = texture_mip_level_count(
|
|
415
|
+
gpu_size.width, gpu_size.height, gpu_size.depthOrArrayLayers, gpu_ctx.descriptor.dimension
|
|
416
|
+
);
|
|
417
|
+
|
|
418
|
+
if (isImageBitmap(source_image.source)) {
|
|
419
|
+
// need RENDER_ATTACHMENT to use GPUQueue.copyExternalImageToTexture API
|
|
420
|
+
gpu_ctx.descriptor.usage |= GPUTextureUsage.RENDER_ATTACHMENT;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
gpu_ctx.allocate();
|
|
424
|
+
gpu_ctx.incrementVersion();
|
|
425
|
+
|
|
426
|
+
texture_write_to_gpu(source_image, gpu_ctx.gpu_texture, this.#device.queue, source_image.level_count);
|
|
427
|
+
|
|
428
|
+
// convolve
|
|
429
|
+
const cmd = ShadeGPUCommandContext.create(ctx);
|
|
430
|
+
|
|
431
|
+
encode_filter_environment_map(gpu_ctx, cmd);
|
|
301
432
|
|
|
302
|
-
|
|
303
|
-
|
|
433
|
+
// after the prefilter, whose roughest levels are what it reads
|
|
434
|
+
shader_project_environment_sh.dispatch({
|
|
435
|
+
encoder: cmd,
|
|
436
|
+
group_count_x: 1,
|
|
437
|
+
bindings: {
|
|
438
|
+
tEnvironment: gpu_ctx.obtainView(),
|
|
439
|
+
output: this.#environment_sh,
|
|
440
|
+
},
|
|
441
|
+
});
|
|
442
|
+
|
|
443
|
+
this.#far_field_sh_dirty = true;
|
|
444
|
+
|
|
445
|
+
cmd.finish();
|
|
304
446
|
return;
|
|
305
447
|
}
|
|
306
448
|
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
const gpu_ctx = this.#environment;
|
|
449
|
+
const scene = this.#scene_ctx.scene;
|
|
450
|
+
const atmosphere = scene.atmosphere;
|
|
310
451
|
|
|
311
452
|
/*
|
|
312
|
-
No environment
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
source_env.image and take the frame down from inside the renderer's per-frame update.
|
|
316
|
-
|
|
317
|
-
Every consumer binds this texture unconditionally — the path tracer, the probe atlas, the
|
|
318
|
-
lightmap baker, the transparent passes all call obtainView() on it without asking whether
|
|
319
|
-
there is an environment — so it has to keep existing. A freshly allocated 1x1 at one mip
|
|
320
|
-
is zeroed, which is the same black IBL they read before an environment is ever assigned.
|
|
453
|
+
No authored environment and procedural atmosphere disabled: keep a valid 1x1 zeroed texture
|
|
454
|
+
and zeroed SH buffer because downstream consumers (path tracer, probe atlas, lightmap baker,
|
|
455
|
+
transparent passes) bind `environment` unconditionally via `obtainView()`.
|
|
321
456
|
*/
|
|
322
|
-
if (
|
|
457
|
+
if (!atmosphere.enabled) {
|
|
458
|
+
if (this.#environment_mode === "black") {
|
|
459
|
+
return;
|
|
460
|
+
}
|
|
461
|
+
|
|
462
|
+
this.#environment_mode = "black";
|
|
463
|
+
this.#environment_source = undefined;
|
|
464
|
+
|
|
323
465
|
gpu_ctx.descriptor.mipLevelCount = 1;
|
|
324
466
|
gpu_ctx.descriptor.size = [1, 1, 1];
|
|
325
467
|
|
|
326
468
|
gpu_ctx.allocate();
|
|
469
|
+
gpu_ctx.incrementVersion();
|
|
327
470
|
|
|
328
471
|
// what a black environment projects to; nothing to run the projection over
|
|
329
|
-
this.#device.queue.writeBuffer(this.#environment_sh, 0,
|
|
472
|
+
this.#device.queue.writeBuffer(this.#environment_sh, 0, ZERO_ENVIRONMENT_SH);
|
|
330
473
|
this.#far_field_sh_dirty = true;
|
|
331
474
|
|
|
332
475
|
return;
|
|
333
476
|
}
|
|
334
477
|
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
'environment map too small for its last filtered level'
|
|
351
|
-
);
|
|
352
|
-
|
|
353
|
-
assert.equal(source_image.width, source_image.height, 'an octahedral environment map is square');
|
|
478
|
+
const sun = resolve_atmosphere_sun(scene, this.#atmosphere_sun_state);
|
|
479
|
+
|
|
480
|
+
if (
|
|
481
|
+
this.#environment_mode === "atmosphere"
|
|
482
|
+
&& this.#committed_atmosphere_version === atmosphere.version
|
|
483
|
+
&& this.#committed_reference_altitude === atmosphere.reference_altitude
|
|
484
|
+
&& this.#committed_sun_direction[0] === sun.sun_direction[0]
|
|
485
|
+
&& this.#committed_sun_direction[1] === sun.sun_direction[1]
|
|
486
|
+
&& this.#committed_sun_direction[2] === sun.sun_direction[2]
|
|
487
|
+
&& this.#committed_sun_irradiance[0] === sun.sun_irradiance[0]
|
|
488
|
+
&& this.#committed_sun_irradiance[1] === sun.sun_irradiance[1]
|
|
489
|
+
&& this.#committed_sun_irradiance[2] === sun.sun_irradiance[2]
|
|
490
|
+
) {
|
|
491
|
+
return;
|
|
492
|
+
}
|
|
354
493
|
|
|
355
|
-
const
|
|
494
|
+
const sky = this.#scene_ctx.sky;
|
|
495
|
+
sky.update();
|
|
356
496
|
|
|
357
|
-
if (
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
);
|
|
362
|
-
} else if (
|
|
363
|
-
source_texels?.isShadeTexelData === true
|
|
364
|
-
&& source_texels.levels[0] !== undefined
|
|
365
|
-
&& gpu_texture_format_info(source_texels.format).block_width === 1
|
|
497
|
+
if (
|
|
498
|
+
this.#environment_mode !== "atmosphere"
|
|
499
|
+
|| gpu_ctx.width !== SKY_IRRADIANCE_LUT_RESOLUTION
|
|
500
|
+
|| gpu_ctx.height !== SKY_IRRADIANCE_LUT_RESOLUTION
|
|
366
501
|
) {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
source_texels.width
|
|
372
|
-
),
|
|
373
|
-
'environment map has no octahedral skirt (see sampler2d_octahedral_skirt_fill)'
|
|
502
|
+
gpu_ctx.descriptor.size = [SKY_IRRADIANCE_LUT_RESOLUTION, SKY_IRRADIANCE_LUT_RESOLUTION, 1];
|
|
503
|
+
const gpu_size = gpu_ctx.descriptor.size;
|
|
504
|
+
gpu_ctx.descriptor.mipLevelCount = texture_mip_level_count(
|
|
505
|
+
gpu_size.width, gpu_size.height, gpu_size.depthOrArrayLayers, gpu_ctx.descriptor.dimension
|
|
374
506
|
);
|
|
507
|
+
gpu_ctx.allocate();
|
|
375
508
|
}
|
|
376
509
|
|
|
377
|
-
|
|
378
|
-
Assign descriptor.size directly rather than calling gpu_ctx.resize(): resize() immediately
|
|
379
|
-
re-allocates when the context is already in TEXTURE_STATE_ALLOCATED, which would call
|
|
380
|
-
createTexture with the new size and the previous map's mipLevelCount (failing WebGPU
|
|
381
|
-
validation whenever the new map is smaller) before allocate() below replaces it again.
|
|
382
|
-
*/
|
|
383
|
-
gpu_ctx.descriptor.size = [source_image.width, source_image.height, 1];
|
|
384
|
-
/*
|
|
385
|
-
The environment map is equirectangular and this context is built 2D a few lines up — the
|
|
386
|
-
descriptor keeps the default dimension and `size` above only sets two spatial axes. Asked of
|
|
387
|
-
the descriptor rather than assumed, so the count follows if that ever stops being true.
|
|
388
|
-
*/
|
|
389
|
-
const gpu_size = gpu_ctx.descriptor.size;
|
|
510
|
+
gpu_ctx.incrementVersion();
|
|
390
511
|
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
512
|
+
this.#environment_mode = "atmosphere";
|
|
513
|
+
this.#environment_source = undefined;
|
|
514
|
+
this.#committed_atmosphere_version = atmosphere.version;
|
|
515
|
+
this.#committed_reference_altitude = atmosphere.reference_altitude;
|
|
516
|
+
this.#committed_sun_direction.set(sun.sun_direction);
|
|
517
|
+
this.#committed_sun_irradiance.set(sun.sun_irradiance);
|
|
394
518
|
|
|
395
|
-
|
|
396
|
-
// need RENDER_ATTACHMENT to use GPUQueue.copyExternalImageToTexture API
|
|
397
|
-
gpu_ctx.descriptor.usage |= GPUTextureUsage.RENDER_ATTACHMENT;
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
gpu_ctx.allocate();
|
|
519
|
+
this.#sky_irradiance_settings.reference_altitude = atmosphere.reference_altitude;
|
|
401
520
|
|
|
402
|
-
|
|
521
|
+
const cmd = ShadeGPUCommandContext.create(ctx, "GPULightCollection/sky_environment");
|
|
403
522
|
|
|
404
|
-
|
|
405
|
-
|
|
523
|
+
shader_sky_irradiance_lut.draw({
|
|
524
|
+
encoder: cmd,
|
|
525
|
+
bindings: {
|
|
526
|
+
settings: this.#sky_irradiance_settings,
|
|
527
|
+
atmosphere: sky.parameters_buffer.buffer,
|
|
528
|
+
tSkyLutTransmittance: sky.lut_transmittance.obtainView(),
|
|
529
|
+
tSkyLutMultiscatter: sky.lut_multiple_scattering.obtainView(),
|
|
530
|
+
},
|
|
531
|
+
colorAttachments: [
|
|
532
|
+
{
|
|
533
|
+
view: gpu_ctx.obtainView(MIP_0_VIEW_DESCRIPTOR),
|
|
534
|
+
loadOp: "clear",
|
|
535
|
+
storeOp: "store",
|
|
536
|
+
clearValue: [0, 0, 0, 1],
|
|
537
|
+
}
|
|
538
|
+
],
|
|
539
|
+
});
|
|
406
540
|
|
|
407
541
|
encode_filter_environment_map(gpu_ctx, cmd);
|
|
408
542
|
|
|
409
|
-
// after the prefilter, whose roughest levels are what it reads
|
|
410
543
|
shader_project_environment_sh.dispatch({
|
|
411
544
|
encoder: cmd,
|
|
412
545
|
group_count_x: 1,
|
package/src/shade/renderer/{atmosphere → light/environment}/chunk_sample_environment_color.d.ts
RENAMED
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
* The environment map's level 0 in a direction: one hardware bilinear tap through the octahedral
|
|
3
3
|
* skirt (see `texture_octahedral_skirt_uv`).
|
|
4
4
|
*
|
|
5
|
-
* see {@link shader_sky_irradiance_lut}
|
|
6
5
|
* @type {CodeChunk}
|
|
7
6
|
*/
|
|
8
7
|
export const chunk_sample_environment_color: CodeChunk;
|
|
9
|
-
import { CodeChunk } from "
|
|
8
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
10
9
|
//# sourceMappingURL=chunk_sample_environment_color.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_sample_environment_color.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/light/environment/chunk_sample_environment_color.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,6CAFU,SAAS,CAcjB;0BApBwB,oCAAoC"}
|
package/src/shade/renderer/{atmosphere → light/environment}/chunk_sample_environment_color.js
RENAMED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { chunk_uv_octahedral_unit_encode } from "
|
|
2
|
-
import { chunk_texture_octahedral_skirt_uv } from "
|
|
3
|
-
import { CodeChunk } from "
|
|
1
|
+
import { chunk_uv_octahedral_unit_encode } from "../../shader/chunk/geometry/octahedron/chunk_uv_octahedral_unit_encode.js";
|
|
2
|
+
import { chunk_texture_octahedral_skirt_uv } from "../../shader/chunk/texture/octahedral/chunk_texture_octahedral_skirt_uv.js";
|
|
3
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The environment map's level 0 in a direction: one hardware bilinear tap through the octahedral
|
|
7
7
|
* skirt (see `texture_octahedral_skirt_uv`).
|
|
8
8
|
*
|
|
9
|
-
* see {@link shader_sky_irradiance_lut}
|
|
10
9
|
* @type {CodeChunk}
|
|
11
10
|
*/
|
|
12
11
|
export const chunk_sample_environment_color = CodeChunk.from(
|
|
@@ -13,7 +13,7 @@ export class TinyGltf {
|
|
|
13
13
|
* @readonly
|
|
14
14
|
* @type {TextureFormat}
|
|
15
15
|
*/
|
|
16
|
-
static readonly "__#
|
|
16
|
+
static readonly "__#315@#UNCOMPRESSED_TARGET": TextureFormat;
|
|
17
17
|
/**
|
|
18
18
|
* @param {AssetManager} assetManager
|
|
19
19
|
* @param {AssetRequestScope} [scope]
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { f32, u32, vec3f } from "../../shader/type/WEBGPU_WGSL_PRIMITIVE_TYPES.js";
|
|
2
2
|
import { WebGPUStruct } from "../../shader/type/WebGPUStruct.js";
|
|
3
|
-
import { chunk_sample_environment_color } from "../../
|
|
3
|
+
import { chunk_sample_environment_color } from "../../light/environment/chunk_sample_environment_color.js";
|
|
4
4
|
import { chunk_scene_database_access } from "../../scene/chunk_scene_database_access.js";
|
|
5
5
|
import { chunk_BRDF_GGX } from "../../shader/chunk/brdf/chunk_BRDF_GGX.js";
|
|
6
6
|
import { chunk_compute_ggx_vndf_pdf } from "../../shader/chunk/brdf/chunk_compute_ggx_pdf.js";
|
|
@@ -41,7 +41,7 @@ fn main(
|
|
|
41
41
|
|
|
42
42
|
let depth = textureLoad( DepthBuffer, current_coord, 0 ).r;
|
|
43
43
|
|
|
44
|
-
let velocity = textureLoad( VelocityBuffer, current_coord, 0 ).
|
|
44
|
+
let velocity = textureLoad( VelocityBuffer, current_coord, 0 ).rg;
|
|
45
45
|
let current_coord_f = vec2<f32>(current_coord.xy);
|
|
46
46
|
|
|
47
47
|
let previous_coord = current_coord_f - velocity.xy;
|
|
@@ -38,7 +38,7 @@ export class MotionBlur {
|
|
|
38
38
|
* @param {object} args
|
|
39
39
|
* @param {FrameGraph} args.graph
|
|
40
40
|
* @param {number} args.input_color FrameGraph handle, rgba16float HDR colour (post-TAA)
|
|
41
|
-
* @param {number} args.velocity FrameGraph handle,
|
|
41
|
+
* @param {number} args.velocity FrameGraph handle, the velocity buffer (`VELOCITY_FORMAT`), read for its pixel-space deltas
|
|
42
42
|
* @param {number} args.depth FrameGraph handle, depth texture
|
|
43
43
|
* @param {number[]} args.resolution full output resolution `[w, h]`
|
|
44
44
|
* @param {number[]} [args.velocity_resolution] resolution of `velocity` and `depth`, which are
|
|
@@ -42,7 +42,7 @@ export class MotionBlur {
|
|
|
42
42
|
* @param {object} args
|
|
43
43
|
* @param {FrameGraph} args.graph
|
|
44
44
|
* @param {number} args.input_color FrameGraph handle, rgba16float HDR colour (post-TAA)
|
|
45
|
-
* @param {number} args.velocity FrameGraph handle,
|
|
45
|
+
* @param {number} args.velocity FrameGraph handle, the velocity buffer (`VELOCITY_FORMAT`), read for its pixel-space deltas
|
|
46
46
|
* @param {number} args.depth FrameGraph handle, depth texture
|
|
47
47
|
* @param {number[]} args.resolution full output resolution `[w, h]`
|
|
48
48
|
* @param {number[]} [args.velocity_resolution] resolution of `velocity` and `depth`, which are
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
* @param {object} args
|
|
32
32
|
* @param {FrameGraph} args.graph
|
|
33
33
|
* @param {number} args.input_color FrameGraph handle, rgba16float HDR colour (post-TAA)
|
|
34
|
-
* @param {number} args.velocity FrameGraph handle,
|
|
34
|
+
* @param {number} args.velocity FrameGraph handle, the velocity buffer (`VELOCITY_FORMAT`), read for its pixel-space deltas
|
|
35
35
|
* @param {number} args.depth FrameGraph handle, depth texture
|
|
36
36
|
* @param {number[]} args.resolution Full output resolution `[w, h]`
|
|
37
37
|
* @param {number[]} [args.velocity_resolution] Resolution of `velocity` and `depth`, which are
|
|
@@ -38,7 +38,7 @@ import { shader_motion_blur_tile_max } from "./shader_motion_blur_tile_max.js";
|
|
|
38
38
|
* @param {object} args
|
|
39
39
|
* @param {FrameGraph} args.graph
|
|
40
40
|
* @param {number} args.input_color FrameGraph handle, rgba16float HDR colour (post-TAA)
|
|
41
|
-
* @param {number} args.velocity FrameGraph handle,
|
|
41
|
+
* @param {number} args.velocity FrameGraph handle, the velocity buffer (`VELOCITY_FORMAT`), read for its pixel-space deltas
|
|
42
42
|
* @param {number} args.depth FrameGraph handle, depth texture
|
|
43
43
|
* @param {number[]} args.resolution Full output resolution `[w, h]`
|
|
44
44
|
* @param {number[]} [args.velocity_resolution] Resolution of `velocity` and `depth`, which are
|
|
@@ -19,7 +19,7 @@ resources.setImmediate("uStrength", F32_CONTAINER_STRUCT);
|
|
|
19
19
|
resources.createGroup()
|
|
20
20
|
// Post-TAA HDR color we're blurring.
|
|
21
21
|
.addTexture("tColor", "float")
|
|
22
|
-
// Full-resolution velocity (pixel-space deltas
|
|
22
|
+
// Full-resolution velocity (VELOCITY_FORMAT; its pixel-space deltas in rg).
|
|
23
23
|
.addTexture("tVelocity", "float")
|
|
24
24
|
// 1/K resolution dilated tile velocity from NeighborMax.
|
|
25
25
|
.addTexture("tNeighborMax", "float")
|
|
@@ -51,7 +51,7 @@ export class NSS {
|
|
|
51
51
|
* @returns {number}
|
|
52
52
|
*/
|
|
53
53
|
static recommended_jitter_sequence_size(upscale_ratio: number): number;
|
|
54
|
-
static "__#
|
|
54
|
+
static "__#223@#preprocess_tensor_descriptor"(render_w: any, render_h: any): TextureResourceDescriptor;
|
|
55
55
|
/**
|
|
56
56
|
* @param {GraphicsContext} graphics
|
|
57
57
|
*/
|
|
@@ -128,3 +128,5 @@ chunk_ssr_add_hit_irradiance.add(ShadeIndirectLightingMode.IBL, chunk_ssr_add_hi
|
|
|
128
128
|
chunk_ssr_add_hit_irradiance.add(ShadeIndirectLightingMode.Brick4, chunk_ssr_add_hit_irradiance_none);
|
|
129
129
|
chunk_ssr_add_hit_irradiance.add(ShadeIndirectLightingMode.LPV, chunk_ssr_add_hit_irradiance_lpv);
|
|
130
130
|
chunk_ssr_add_hit_irradiance.add(ShadeIndirectLightingMode.ProbeClipmap, chunk_ssr_add_hit_irradiance_probe_clipmap);
|
|
131
|
+
// the screen probes light only the deferred opaque surfaces: every other reader takes the world-space probes
|
|
132
|
+
chunk_ssr_add_hit_irradiance.add(ShadeIndirectLightingMode.ScreenProbes, chunk_ssr_add_hit_irradiance_probe_clipmap);
|
|
@@ -94,3 +94,5 @@ chunk_ssr_sample_radiance.add(ShadeIndirectLightingMode.IBL, chunk_ssr_sample_ra
|
|
|
94
94
|
chunk_ssr_sample_radiance.add(ShadeIndirectLightingMode.Brick4, chunk_ssr_sample_radiance_brick4);
|
|
95
95
|
chunk_ssr_sample_radiance.add(ShadeIndirectLightingMode.LPV, chunk_ssr_sample_radiance_lpv);
|
|
96
96
|
chunk_ssr_sample_radiance.add(ShadeIndirectLightingMode.ProbeClipmap, chunk_ssr_sample_radiance_probe_clipmap);
|
|
97
|
+
// the screen probes light only the deferred opaque surfaces: every other reader takes the world-space probes
|
|
98
|
+
chunk_ssr_sample_radiance.add(ShadeIndirectLightingMode.ScreenProbes, chunk_ssr_sample_radiance_probe_clipmap);
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Returns confidence level in reprojected sample (1 = trust history, 0 = disocclusion).
|
|
3
3
|
*
|
|
4
|
+
* `depth_motion` is the view depth the point moved through since last frame, the velocity buffer's z
|
|
5
|
+
* (`VELOCITY_FORMAT`). Last frame's depth is weighed against the point's depth then, its depth now
|
|
6
|
+
* less that, as UE's TSR weighs it (`PrevClosestDeviceZ`, TSRDilateVelocity.usf). FSR2 has no depth
|
|
7
|
+
* in its motion and weighs against the depth now, which reads a surface moving away from the camera
|
|
8
|
+
* as a disocclusion.
|
|
9
|
+
*
|
|
4
10
|
* NOTE: deliberately uses a 2x2 *min*-gather over inverted-depth prev samples (= farthest
|
|
5
11
|
* in view space), which is the OPPOSITE of FSR2's "closest reconstructed prev depth"
|
|
6
12
|
* semantic. We do this on purpose:
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_fsr2_compute_depth_clip.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.js"],"names":[],"mappings":"AAQA
|
|
1
|
+
{"version":3,"file":"chunk_fsr2_compute_depth_clip.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/taa/chunk_fsr2_compute_depth_clip.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,4CAFU,SAAS,CAoGjB;0BAtIwB,oCAAoC"}
|
|
@@ -9,6 +9,12 @@ import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
|
9
9
|
/**
|
|
10
10
|
* Returns confidence level in reprojected sample (1 = trust history, 0 = disocclusion).
|
|
11
11
|
*
|
|
12
|
+
* `depth_motion` is the view depth the point moved through since last frame, the velocity buffer's z
|
|
13
|
+
* (`VELOCITY_FORMAT`). Last frame's depth is weighed against the point's depth then, its depth now
|
|
14
|
+
* less that, as UE's TSR weighs it (`PrevClosestDeviceZ`, TSRDilateVelocity.usf). FSR2 has no depth
|
|
15
|
+
* in its motion and weighs against the depth now, which reads a surface moving away from the camera
|
|
16
|
+
* as a disocclusion.
|
|
17
|
+
*
|
|
12
18
|
* NOTE: deliberately uses a 2x2 *min*-gather over inverted-depth prev samples (= farthest
|
|
13
19
|
* in view space), which is the OPPOSITE of FSR2's "closest reconstructed prev depth"
|
|
14
20
|
* semantic. We do this on purpose:
|
|
@@ -39,9 +45,11 @@ export const chunk_fsr2_compute_depth_clip = CodeChunk.from(
|
|
|
39
45
|
fn fsr2_compute_depth_clip(
|
|
40
46
|
previous_coord: vec2<f32>,
|
|
41
47
|
current_depth_sample: f32,
|
|
48
|
+
depth_motion: f32,
|
|
42
49
|
render_size: vec2<i32>
|
|
43
50
|
) -> f32 {
|
|
44
|
-
|
|
51
|
+
// the point's view depth last frame: its depth now less the depth it moved through
|
|
52
|
+
let fCurrentDepthViewSpace = get_view_space_depth(current_depth_sample, camera_current) - depth_motion;
|
|
45
53
|
|
|
46
54
|
// previous_coord is in this frame's pixels, and the previous depth keeps the size it was drawn
|
|
47
55
|
// at across a resolution change, so carry the position into its grid. Equal sizes scale by 1.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shader_depth_occlusion_clip.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/taa/shader_depth_occlusion_clip.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;GAYG;AACH,2CAFU,SAAS,CAsBjB;
|
|
1
|
+
{"version":3,"file":"shader_depth_occlusion_clip.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/taa/shader_depth_occlusion_clip.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;GAYG;AACH,2CAFU,SAAS,CAsBjB;AAsCF,sDAaG;0BArGuB,oCAAoC;4BAElC,6BAA6B"}
|
|
@@ -68,12 +68,13 @@ fn main(
|
|
|
68
68
|
|
|
69
69
|
// Velocity at the nearest-depth pixel (FSR2's strategy). The choice is published in g below so
|
|
70
70
|
// the TAA resolve reprojects with the same velocity; don't chain a second dilation on top.
|
|
71
|
-
let velocity = textureLoad( VelocityBuffer, iNearestDepthCoord, 0 ).
|
|
71
|
+
let velocity = textureLoad( VelocityBuffer, iNearestDepthCoord, 0 ).xyz;
|
|
72
72
|
|
|
73
73
|
let prevFrameScreenST = coord.xy - velocity.xy;
|
|
74
74
|
|
|
75
|
-
// get depth confidence factor, larger then 0, assume the history is valid
|
|
76
|
-
|
|
75
|
+
// get depth confidence factor, larger then 0, assume the history is valid; against the
|
|
76
|
+
// point's depth last frame, by the depth it moved through (velocity.z)
|
|
77
|
+
let confidence = fsr2_compute_depth_clip( prevFrameScreenST, depth, velocity.z, render_size );
|
|
77
78
|
|
|
78
79
|
// r: history confidence. g: which texel won the nearest-depth search, so a consumer can fetch
|
|
79
80
|
// the velocity this confidence was computed for from the raw velocity buffer.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The velocity buffer's format: how each pixel's surface point moved since the last frame, four half floats
|
|
3
|
+
* (`chunk_velocity_texel` makes the texel):
|
|
4
|
+
*
|
|
5
|
+
* - **x, y**: internal pixels from the point's place on last frame's screen to its place on this one;
|
|
6
|
+
* - **z**: the point's view depth now less its view depth then, in world units: negative for a surface coming
|
|
7
|
+
* nearer, zero for one moving across the view at its depth, and zero for the sky;
|
|
8
|
+
* - **w**: zero.
|
|
9
|
+
*
|
|
10
|
+
* Both frames' projections are taken free of the TAA jitter, so a still surface under a still camera holds zero
|
|
11
|
+
* throughout. A delta rather than last frame's depth itself: a half float holds it to a share of the motion, and so
|
|
12
|
+
* holds the depth recovered from it, `depth − z`, to that share of the motion rather than of the depth.
|
|
13
|
+
*
|
|
14
|
+
* @type {GPUTextureFormat}
|
|
15
|
+
*/
|
|
16
|
+
export const VELOCITY_FORMAT: GPUTextureFormat;
|
|
17
|
+
//# sourceMappingURL=VELOCITY_BUFFER.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"VELOCITY_BUFFER.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/velocity/VELOCITY_BUFFER.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AACH,+CAA6C"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The velocity buffer's format: how each pixel's surface point moved since the last frame, four half floats
|
|
3
|
+
* (`chunk_velocity_texel` makes the texel):
|
|
4
|
+
*
|
|
5
|
+
* - **x, y**: internal pixels from the point's place on last frame's screen to its place on this one;
|
|
6
|
+
* - **z**: the point's view depth now less its view depth then, in world units: negative for a surface coming
|
|
7
|
+
* nearer, zero for one moving across the view at its depth, and zero for the sky;
|
|
8
|
+
* - **w**: zero.
|
|
9
|
+
*
|
|
10
|
+
* Both frames' projections are taken free of the TAA jitter, so a still surface under a still camera holds zero
|
|
11
|
+
* throughout. A delta rather than last frame's depth itself: a half float holds it to a share of the motion, and so
|
|
12
|
+
* holds the depth recovered from it, `depth − z`, to that share of the motion rather than of the depth.
|
|
13
|
+
*
|
|
14
|
+
* @type {GPUTextureFormat}
|
|
15
|
+
*/
|
|
16
|
+
export const VELOCITY_FORMAT = 'rgba16float';
|