@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
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A pixel's texel of the velocity buffer (`VELOCITY_FORMAT`), from its surface point now and where that point stood a
|
|
3
|
+
* frame ago:
|
|
4
|
+
*
|
|
5
|
+
* ```wgsl
|
|
6
|
+
* fn velocity_texel(pixel: vec2<f32>, depth: f32, before: vec4<f32>, size: vec2<f32>) -> vec4<f32>
|
|
7
|
+
* ```
|
|
8
|
+
*
|
|
9
|
+
* - `pixel`: the pixel's centre, in the view's internal pixels; `size`: the view's size in them.
|
|
10
|
+
* - `depth`: the point's clip w this frame.
|
|
11
|
+
* - `before`: the point a frame ago, in last frame's clip space.
|
|
12
|
+
*
|
|
13
|
+
* Both clip spaces are the un-jittered projections' (`view_velocity_matrices`). The texel's z is the clip w now less
|
|
14
|
+
* then, which a perspective projection makes the view depth; under an orthographic one, whose w is always one, it is
|
|
15
|
+
* zero.
|
|
16
|
+
*
|
|
17
|
+
* @type {CodeChunk}
|
|
18
|
+
*/
|
|
19
|
+
export const chunk_velocity_texel: CodeChunk;
|
|
20
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
21
|
+
//# sourceMappingURL=chunk_velocity_texel.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chunk_velocity_texel.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/velocity/chunk_velocity_texel.js"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;GAiBG;AACH,mCAFU,SAAS,CAWhB;0BA7BuB,oCAAoC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { CodeChunk } from "../../shader/compiler/CodeChunk.js";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* A pixel's texel of the velocity buffer (`VELOCITY_FORMAT`), from its surface point now and where that point stood a
|
|
5
|
+
* frame ago:
|
|
6
|
+
*
|
|
7
|
+
* ```wgsl
|
|
8
|
+
* fn velocity_texel(pixel: vec2<f32>, depth: f32, before: vec4<f32>, size: vec2<f32>) -> vec4<f32>
|
|
9
|
+
* ```
|
|
10
|
+
*
|
|
11
|
+
* - `pixel`: the pixel's centre, in the view's internal pixels; `size`: the view's size in them.
|
|
12
|
+
* - `depth`: the point's clip w this frame.
|
|
13
|
+
* - `before`: the point a frame ago, in last frame's clip space.
|
|
14
|
+
*
|
|
15
|
+
* Both clip spaces are the un-jittered projections' (`view_velocity_matrices`). The texel's z is the clip w now less
|
|
16
|
+
* then, which a perspective projection makes the view depth; under an orthographic one, whose w is always one, it is
|
|
17
|
+
* zero.
|
|
18
|
+
*
|
|
19
|
+
* @type {CodeChunk}
|
|
20
|
+
*/
|
|
21
|
+
export const chunk_velocity_texel = CodeChunk.from(
|
|
22
|
+
//language=WGSL
|
|
23
|
+
`
|
|
24
|
+
fn velocity_texel(pixel: vec2<f32>, depth: f32, before: vec4<f32>, size: vec2<f32>) -> vec4<f32> {
|
|
25
|
+
let ndc = before.xy / before.w;
|
|
26
|
+
let previous = vec2<f32>((ndc.x + 1.0) * 0.5 * size.x, (1.0 - ndc.y) * 0.5 * size.y);
|
|
27
|
+
|
|
28
|
+
return vec4<f32>(pixel - previous, depth - before.w, 0.0);
|
|
29
|
+
}
|
|
30
|
+
`);
|
|
@@ -27,10 +27,12 @@ export function enquire_per_object_velocity_pipelines(enquiry: PipelineEnquiry):
|
|
|
27
27
|
* per-vertex skin deformation (the limb-ghosting case Stage 1
|
|
28
28
|
* couldn't address) on top of the per-object motion.
|
|
29
29
|
*
|
|
30
|
-
* The skinned and rigid foreground branches both produce
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
30
|
+
* The skinned and rigid foreground branches both produce the
|
|
31
|
+
* velocity buffer's texel (`VELOCITY_FORMAT`: pixel deltas and the
|
|
32
|
+
* view depth moved through), so downstream consumers (TAA, motion
|
|
33
|
+
* blur, the screen probes) just see velocity — no
|
|
34
|
+
* skinning-awareness needed at any layer above this pass. The
|
|
35
|
+
* background's depth delta is zero.
|
|
34
36
|
*
|
|
35
37
|
* Un-jittered matrices are CPU-built from
|
|
36
38
|
* `camera.projection_matrix × camera.view_matrix` — viewport
|
|
@@ -51,7 +53,7 @@ export function enquire_per_object_velocity_pipelines(enquiry: PipelineEnquiry):
|
|
|
51
53
|
* placeholders and the shader forces the rigid path.
|
|
52
54
|
* @param {number[]} args.resolution
|
|
53
55
|
* @param {GPUViewContext} args.view
|
|
54
|
-
* @returns {number} FrameGraph handle to the velocity texture (
|
|
56
|
+
* @returns {number} FrameGraph handle to the velocity texture (`VELOCITY_FORMAT`)
|
|
55
57
|
*/
|
|
56
58
|
export function graph_add_per_object_velocity({ graph, texture_depth, texture_visibility, buffer_visible_meshlets, buffer_scene_database, buffer_meshlet_metadata, buffer_meshlet_data, buffer_prev_position_offsets, buffer_prev_positions, skinning_active, resolution, view, }: {
|
|
57
59
|
graph: FrameGraph;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"graph_add_per_object_velocity.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.js"],"names":[],"mappings":"AA8QA;;;;GAIG;AACH,+DAFW,eAAe,QAIzB;AAED
|
|
1
|
+
{"version":3,"file":"graph_add_per_object_velocity.d.ts","sourceRoot":"","sources":["../../../../../../src/shade/renderer/postprocess/velocity/graph_add_per_object_velocity.js"],"names":[],"mappings":"AA8QA;;;;GAIG;AACH,+DAFW,eAAe,QAIzB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkDG;AACH;IAhB4B,KAAK;IACT,aAAa,EAA1B,MAAM;IACO,kBAAkB,EAA/B,MAAM;IACO,uBAAuB,EAApC,MAAM;IACO,qBAAqB,EAAlC,MAAM;IACO,uBAAuB,EAApC,MAAM;IACO,mBAAmB,EAAhC,MAAM;IACO,4BAA4B,EAAzC,MAAM;IACO,qBAAqB,EAAlC,MAAM;IACQ,eAAe,EAA7B,OAAO;IAGQ,UAAU,EAAzB,MAAM,EAAE;IACa,IAAI;IACvB,MAAM,CA+DlB;8BA9VY,OAAO,6CAA6C,EAAE,eAAe"}
|
|
@@ -30,7 +30,9 @@ import { graph_image_pass } from "../../shader/graph/graph_image_pass.js";
|
|
|
30
30
|
import { ImageShader } from "../../shader/ImageShader.js";
|
|
31
31
|
import { ShaderResourceSetDescriptor } from "../../shader/resource/ShaderResourceSetDescriptor.js";
|
|
32
32
|
import { ShaderDescriptor } from "../../shader/ShaderDescriptor.js";
|
|
33
|
+
import { chunk_velocity_texel } from "./chunk_velocity_texel.js";
|
|
33
34
|
import { construct_pixel_reprojection_matrix } from "./construct_pixel_reprojection_matrix.js";
|
|
35
|
+
import { VELOCITY_FORMAT } from "./VELOCITY_BUFFER.js";
|
|
34
36
|
import { view_velocity_matrices } from "./view_velocity_matrices.js";
|
|
35
37
|
import {
|
|
36
38
|
construct_reprojection_matrix_rotation_only,
|
|
@@ -92,7 +94,7 @@ fn read_prev_position(base: u32, vertex_index: u32) -> vec3<f32> {
|
|
|
92
94
|
@fragment
|
|
93
95
|
fn main(
|
|
94
96
|
@builtin(position) coord: vec4<f32>,
|
|
95
|
-
) -> @location(0)
|
|
97
|
+
) -> @location(0) vec4<f32> {
|
|
96
98
|
|
|
97
99
|
let cur_px = coord.xy;
|
|
98
100
|
let texel = vec2<u32>(cur_px);
|
|
@@ -103,12 +105,13 @@ fn main(
|
|
|
103
105
|
// Visibility-buffer clears leave VISIBILITY_NONE on sky
|
|
104
106
|
// pixels, where reverse-Z depth is always 0.0. Passing 0.0
|
|
105
107
|
// directly avoids a tDepth textureLoad on every background pixel.
|
|
108
|
+
// The sky stands infinitely far, so it has no depth to move through.
|
|
106
109
|
if visibility_word == VISIBILITY_NONE {
|
|
107
110
|
let position_previous = v3_matrix4_project(
|
|
108
111
|
vec3<f32>(cur_px, 0.0),
|
|
109
112
|
mReprojectionRotation
|
|
110
113
|
);
|
|
111
|
-
return cur_px - position_previous.xy;
|
|
114
|
+
return vec4<f32>(cur_px - position_previous.xy, 0.0, 0.0);
|
|
112
115
|
}
|
|
113
116
|
|
|
114
117
|
// ── Reconstruct world-space position for this pixel ─────────
|
|
@@ -233,15 +236,11 @@ fn main(
|
|
|
233
236
|
prev_world = prev_world_h.xyz / prev_world_h.w;
|
|
234
237
|
}
|
|
235
238
|
|
|
236
|
-
// ── Project to previous frame
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
(1.0 - prev_ndc.y) * 0.5 * res.y,
|
|
242
|
-
);
|
|
243
|
-
|
|
244
|
-
return cur_px - prev_px;
|
|
239
|
+
// ── Project to previous frame: the pixel and depth deltas ───
|
|
240
|
+
//
|
|
241
|
+
// This frame's clip w, the point's view depth, is the reciprocal of
|
|
242
|
+
// the w its unprojection came out with.
|
|
243
|
+
return velocity_texel(cur_px, 1.0 / cur_world_h.w, mViewProjPrevious * vec4<f32>(prev_world, 1.0), res);
|
|
245
244
|
}
|
|
246
245
|
`, [
|
|
247
246
|
chunk_v3_matrix4_project,
|
|
@@ -251,6 +250,7 @@ fn main(
|
|
|
251
250
|
chunk_read_meshlet_vertex_position,
|
|
252
251
|
MESHLET_METADATA_STRUCT.declaration_chunk,
|
|
253
252
|
chunk_visibility_decode,
|
|
253
|
+
chunk_velocity_texel,
|
|
254
254
|
]
|
|
255
255
|
);
|
|
256
256
|
|
|
@@ -261,7 +261,7 @@ const shader = new ImageShader({
|
|
|
261
261
|
body
|
|
262
262
|
}),
|
|
263
263
|
targets: [{
|
|
264
|
-
format:
|
|
264
|
+
format: VELOCITY_FORMAT,
|
|
265
265
|
}]
|
|
266
266
|
});
|
|
267
267
|
|
|
@@ -300,10 +300,12 @@ export function enquire_per_object_velocity_pipelines(enquiry) {
|
|
|
300
300
|
* per-vertex skin deformation (the limb-ghosting case Stage 1
|
|
301
301
|
* couldn't address) on top of the per-object motion.
|
|
302
302
|
*
|
|
303
|
-
* The skinned and rigid foreground branches both produce
|
|
304
|
-
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
303
|
+
* The skinned and rigid foreground branches both produce the
|
|
304
|
+
* velocity buffer's texel (`VELOCITY_FORMAT`: pixel deltas and the
|
|
305
|
+
* view depth moved through), so downstream consumers (TAA, motion
|
|
306
|
+
* blur, the screen probes) just see velocity — no
|
|
307
|
+
* skinning-awareness needed at any layer above this pass. The
|
|
308
|
+
* background's depth delta is zero.
|
|
307
309
|
*
|
|
308
310
|
* Un-jittered matrices are CPU-built from
|
|
309
311
|
* `camera.projection_matrix × camera.view_matrix` — viewport
|
|
@@ -324,7 +326,7 @@ export function enquire_per_object_velocity_pipelines(enquiry) {
|
|
|
324
326
|
* placeholders and the shader forces the rigid path.
|
|
325
327
|
* @param {number[]} args.resolution
|
|
326
328
|
* @param {GPUViewContext} args.view
|
|
327
|
-
* @returns {number} FrameGraph handle to the velocity texture (
|
|
329
|
+
* @returns {number} FrameGraph handle to the velocity texture (`VELOCITY_FORMAT`)
|
|
328
330
|
*/
|
|
329
331
|
export function graph_add_per_object_velocity({
|
|
330
332
|
graph,
|
|
@@ -35,3 +35,5 @@ chunk_forward_sample_indirect.add(ShadeIndirectLightingMode.IBL, chunk_forward_s
|
|
|
35
35
|
chunk_forward_sample_indirect.add(ShadeIndirectLightingMode.Brick4, chunk_forward_sample_indirect_brick4);
|
|
36
36
|
chunk_forward_sample_indirect.add(ShadeIndirectLightingMode.LPV, chunk_forward_sample_indirect_environment);
|
|
37
37
|
chunk_forward_sample_indirect.add(ShadeIndirectLightingMode.ProbeClipmap, chunk_forward_sample_indirect_probe_clipmap);
|
|
38
|
+
// the screen probes light only the deferred opaque surfaces: every other reader takes the world-space probes
|
|
39
|
+
chunk_forward_sample_indirect.add(ShadeIndirectLightingMode.ScreenProbes, chunk_forward_sample_indirect_probe_clipmap);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GPUSceneContext.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/scene/GPUSceneContext.js"],"names":[],"mappings":"AA4EA;;;;;;;;;GASG;AACH;IAEI;;;;;;;OAOG;IACH,iCAFW,eAAe,
|
|
1
|
+
{"version":3,"file":"GPUSceneContext.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/scene/GPUSceneContext.js"],"names":[],"mappings":"AA4EA;;;;;;;;;GASG;AACH;IAEI;;;;;;;OAOG;IACH,iCAFW,eAAe,QAUzB;IA4KD;;;;OAIG;IACH,sBAHW,eAAe,SACf,KAAK,EAyCf;IAtND;;;OAGG;IACH,aAFU,MAAM,CAEE;IAElB;;OAEG;IACH,YAFU,kBAAkB,CAEjB;IAEX;;OAEG;IACH,WAFU,kBAAkB,CAElB;IAGV;;OAEG;IACH,sBAFU,cAAc,CAEH;IASrB;;;OAGG;IACH,mBAEC;IAOD,uCAEC;IAOD;;;;;OAKG;IACH,yBAEC;IAUD;;;;;OAKG;IACH,kBAEC;IAQD;;;OAGG;IACH,iCAEC;IAOD;;;OAGG;IACH,8CAEC;IAOD;;;OAGG;IACH,8CAEC;IA2ID;;OAEG;IACH,kDAEC;IAED;;OAEG;IACH,gDAEC;IAED;;OAEG;IACH,kDAEC;IAED;;OAEG;IACH,+CAEC;IAED;;;;;;;;;;;;;;;;;;;;OAoBG;IACH;QAH0C,SAAS,GAAxC,oBAAoB;QAClB,yBAAyB,CA4DrC;IAED;;OAEG;IACH,6CAEC;IAYD;;;;;OAKG;IACH,gEAEC;IAED;;;OAGG;IACH,kCAEC;IAED;;;;;OAKG;IACH,uCAEC;IAED;;;;;;;;;;;OAWG;IACH,uCAUC;IAED,+BAUC;IAED;;;;;;;;;;;;;;;;OAgBG;IACH,yBAEC;IAED;;;;;OAKG;IACH,sCAMC;IAOD;;;;;;;OAOG;IACH,8EAEC;IA6BD;;;;;OAKG;IACH,cAsEC;IAED;;;;;OAKG;IACH,YAFW,eAAe,QA4BzB;IAED;;;;;;;;;;;;;;;;;;;;;;OAsBG;IACH,cAHW,sBAAsB,cACtB,MAAM,QAuBhB;IAUD;;;;;;;;;;;OAWG;IACH,oBAHW,UAAU,GACR,MAAM,CAQlB;IAoCD;;;;;;;OAOG;IACH,gBAuBC;IAwCL;;;OAGG;IACH,4BAFU,OAAO,CAE0B;;CAN1C;8BAt3BY,OAAO,0CAA0C,EAAE,eAAe;8BAClE,OAAO,uBAAuB,EAAE,eAAe;iCAC/C,OAAO,mCAAmC,EAAE,kBAAkB;iCAC9D,OAAO,mCAAmC,EAAE,kBAAkB;4BAC9D,OAAO,8BAA8B,EAAE,aAAa;8BACpD,OAAO,iDAAiD,EAAE,eAAe;yBACzE,OAAO,2DAA2D,EAAE,UAAU;+BA5B5D,iDAAiD;sBAM1D,YAAY;oCAFE,uCAAuC;6BAC9C,yBAAyB;uBAH/B,yBAAyB;mCACb,gCAAgC;oCAF/B,mDAAmD;kDAMrC,wCAAwC;0CAlBhD,0DAA0D;8BAItE,8CAA8C;iCAF3C,iDAAiD;+BAInD,2CAA2C;qCADrC,qDAAqD;oCAItD,qCAAqC;4BAC7C,gCAAgC;uCASrB,iDAAiD;6BAQ3D,wBAAwB;wCADb,mCAAmC;uCAlBpC,wCAAwC"}
|
|
@@ -98,6 +98,7 @@ export class GPUSceneContext {
|
|
|
98
98
|
GPUDatabase.enquirePipelines(enquiry);
|
|
99
99
|
GPUAnimationManager.enquirePipelines(enquiry);
|
|
100
100
|
enquiry.compute.push(shader_refresh_all_mesh_bounds.pipeline);
|
|
101
|
+
GPUSky.enquirePipelines(enquiry);
|
|
101
102
|
GPULightCollection.enquirePipelines(enquiry);
|
|
102
103
|
GPUInstancesAccelerationStructure.enquirePipelines(enquiry);
|
|
103
104
|
GPUSceneVolumetrics.enquirePipelines(enquiry);
|
|
@@ -314,7 +315,7 @@ export class GPUSceneContext {
|
|
|
314
315
|
|
|
315
316
|
this.#wind = new GPUSceneWind(device);
|
|
316
317
|
|
|
317
|
-
this.#sky = new GPUSky(graphics);
|
|
318
|
+
this.#sky = new GPUSky(graphics, scene.atmosphere);
|
|
318
319
|
|
|
319
320
|
this.#animation_manager = new GPUAnimationManager(device, `GPUSceneContext[${this.id}]/Animation`, this);
|
|
320
321
|
}
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
* @typedef {import("../../../engine/ecs/EntityComponentDataset.js").EntityComponentDataset} EntityComponentDataset
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
|
-
* A scene: the dataset whose entities are what it draws and poses, and the
|
|
6
|
-
* not entities — its lights' collection, a light probe volume, volumetrics.
|
|
5
|
+
* A scene: the dataset whose entities are what it draws and poses, and the things that are
|
|
6
|
+
* not entities — its lights' collection, atmosphere, a light probe volume, volumetrics.
|
|
7
7
|
*
|
|
8
8
|
* Everything drawn is an entity of {@link dataset} holding a row of the scene's GPU database
|
|
9
9
|
* (`GPUSceneContext.rows`), at `entity + 1`. A game's systems take rows as components appear; a
|
|
@@ -27,6 +27,12 @@ export class Scene {
|
|
|
27
27
|
* @type {LightCollection}
|
|
28
28
|
*/
|
|
29
29
|
lights: LightCollection;
|
|
30
|
+
/**
|
|
31
|
+
* Physical Hillaire (2020) sky and atmosphere configuration.
|
|
32
|
+
*
|
|
33
|
+
* @type {SceneAtmosphere}
|
|
34
|
+
*/
|
|
35
|
+
atmosphere: SceneAtmosphere;
|
|
30
36
|
/**
|
|
31
37
|
*
|
|
32
38
|
* @type {LightProbeVolume}
|
|
@@ -45,6 +51,7 @@ export class Scene {
|
|
|
45
51
|
}
|
|
46
52
|
export type EntityComponentDataset = import("../../../engine/ecs/EntityComponentDataset.js").EntityComponentDataset;
|
|
47
53
|
import { LightCollection } from "../light/LightCollection.js";
|
|
54
|
+
import { SceneAtmosphere } from "../atmosphere/SceneAtmosphere.js";
|
|
48
55
|
import { LightProbeVolume } from "../global_illumination/lpv/LightProbeVolume.js";
|
|
49
56
|
import { SceneVolumetrics } from "../volumetrics/SceneVolumetrics.js";
|
|
50
57
|
//# sourceMappingURL=Scene.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Scene.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/scene/Scene.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Scene.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/scene/Scene.js"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;;;;;;GAQG;AACH;IACI;;;;;;;OAOG;IACH,SAFU,sBAAsB,GAAC,IAAI,CAEtB;IAEf;;;;;OAKG;IACH,QAFU,eAAe,CAEM;IAE/B;;;;OAIG;IACH,YAFU,eAAe,CAEU;IAEnC;;;OAGG;IACH,oBAFU,gBAAgB,CAEkB;IAE5C;;;OAGG;IACH,aAFU,gBAAgB,CAEW;IAGzC;;;OAGG;IACH,kBAFU,OAAO,CAEM;CANtB;qCAjDY,OAAO,+CAA+C,EAAE,sBAAsB;gCAJ3D,6BAA6B;gCAF7B,kCAAkC;iCACjC,gDAAgD;iCAEhD,oCAAoC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SceneAtmosphere } from "../atmosphere/SceneAtmosphere.js";
|
|
1
2
|
import { LightProbeVolume } from "../global_illumination/lpv/LightProbeVolume.js";
|
|
2
3
|
import { LightCollection } from "../light/LightCollection.js";
|
|
3
4
|
import { SceneVolumetrics } from "../volumetrics/SceneVolumetrics.js";
|
|
@@ -7,8 +8,8 @@ import { SceneVolumetrics } from "../volumetrics/SceneVolumetrics.js";
|
|
|
7
8
|
*/
|
|
8
9
|
|
|
9
10
|
/**
|
|
10
|
-
* A scene: the dataset whose entities are what it draws and poses, and the
|
|
11
|
-
* not entities — its lights' collection, a light probe volume, volumetrics.
|
|
11
|
+
* A scene: the dataset whose entities are what it draws and poses, and the things that are
|
|
12
|
+
* not entities — its lights' collection, atmosphere, a light probe volume, volumetrics.
|
|
12
13
|
*
|
|
13
14
|
* Everything drawn is an entity of {@link dataset} holding a row of the scene's GPU database
|
|
14
15
|
* (`GPUSceneContext.rows`), at `entity + 1`. A game's systems take rows as components appear; a
|
|
@@ -34,6 +35,13 @@ export class Scene {
|
|
|
34
35
|
*/
|
|
35
36
|
lights = new LightCollection();
|
|
36
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Physical Hillaire (2020) sky and atmosphere configuration.
|
|
40
|
+
*
|
|
41
|
+
* @type {SceneAtmosphere}
|
|
42
|
+
*/
|
|
43
|
+
atmosphere = new SceneAtmosphere();
|
|
44
|
+
|
|
37
45
|
/**
|
|
38
46
|
*
|
|
39
47
|
* @type {LightProbeVolume}
|
|
@@ -6,14 +6,16 @@ export class ImageShader {
|
|
|
6
6
|
* Utility constructor, matching general Shade API
|
|
7
7
|
* @param {Object} options
|
|
8
8
|
* @param {ShaderDescriptor} options.descriptor
|
|
9
|
-
* @param {
|
|
10
|
-
* @param {
|
|
9
|
+
* @param {(GPUColorTargetState|{clearValue?:number[]})[]} options.targets
|
|
10
|
+
* @param {GPUDepthStencilState} [options.depthStencil]
|
|
11
11
|
* @returns {ImageShader}
|
|
12
12
|
*/
|
|
13
13
|
static from({ descriptor, targets, depthStencil, }: {
|
|
14
14
|
descriptor: ShaderDescriptor;
|
|
15
|
-
targets:
|
|
16
|
-
|
|
15
|
+
targets: (GPUColorTargetState | {
|
|
16
|
+
clearValue?: number[];
|
|
17
|
+
})[];
|
|
18
|
+
depthStencil?: GPUDepthStencilState;
|
|
17
19
|
}): ImageShader;
|
|
18
20
|
constructor({ descriptor, targets, depthStencil, }: {
|
|
19
21
|
descriptor: any;
|
|
@@ -24,7 +26,7 @@ export class ImageShader {
|
|
|
24
26
|
*
|
|
25
27
|
* @returns {ShaderDescriptor}
|
|
26
28
|
*/
|
|
27
|
-
get descriptor(): ShaderDescriptor;
|
|
29
|
+
get descriptor(): import("./ShaderDescriptor.js").ShaderDescriptor;
|
|
28
30
|
/**
|
|
29
31
|
* Optional clear values for each target
|
|
30
32
|
* @type {number[][]}
|
|
@@ -62,16 +64,26 @@ export class ImageShader {
|
|
|
62
64
|
/**
|
|
63
65
|
* Note the absence of depth target, image shader is a full-screen pass, so depth is not used.
|
|
64
66
|
*
|
|
65
|
-
* @param {
|
|
66
|
-
* @param {
|
|
67
|
-
* @param {
|
|
68
|
-
* @param {
|
|
69
|
-
* @param {
|
|
70
|
-
* @param {
|
|
67
|
+
* @param {Object} options
|
|
68
|
+
* @param {ShadeGPUCommandContext} options.encoder
|
|
69
|
+
* @param {Object} [options.bindings] data bindings. It's optional, but in 99.99% of use cases you will want to specify this.
|
|
70
|
+
* @param {GPURenderPassColorAttachment[]} [options.colorAttachments] where to draw, these are fragment shader outputs.
|
|
71
|
+
* @param {GPURenderPassDepthStencilAttachment} [options.depthStencilAttachment]
|
|
72
|
+
* @param {GPUTextureFormat[]} [options.color_formats] optional, if specified will be used to rewrite the pipeline for compatibility
|
|
73
|
+
* @param {number[]} [options.viewport] [x0, y0, width, height ]
|
|
71
74
|
*/
|
|
72
|
-
draw({ encoder, bindings, colorAttachments, depthStencilAttachment, color_formats, viewport }:
|
|
75
|
+
draw({ encoder, bindings, colorAttachments, depthStencilAttachment, color_formats, viewport }: {
|
|
76
|
+
encoder: ShadeGPUCommandContext;
|
|
77
|
+
bindings?: any;
|
|
78
|
+
colorAttachments?: GPURenderPassColorAttachment[];
|
|
79
|
+
depthStencilAttachment?: GPURenderPassDepthStencilAttachment;
|
|
80
|
+
color_formats?: GPUTextureFormat[];
|
|
81
|
+
viewport?: number[];
|
|
82
|
+
}): void;
|
|
73
83
|
#private;
|
|
74
84
|
}
|
|
75
85
|
export type RenderPipelineDescriptor = import("../../descriptor/pipeline/render/RenderPipelineDescriptor.js").RenderPipelineDescriptor;
|
|
86
|
+
export type ShadeGPUCommandContext = import("../../device/ShadeGPUCommandContext.js").ShadeGPUCommandContext;
|
|
76
87
|
export type ShaderSwitchSet = import("./compiler/ShaderSwitchSet.js").ShaderSwitchSet;
|
|
88
|
+
export type ShaderDescriptor = import("./ShaderDescriptor.js").ShaderDescriptor;
|
|
77
89
|
//# sourceMappingURL=ImageShader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageShader.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/shader/ImageShader.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ImageShader.d.ts","sourceRoot":"","sources":["../../../../../src/shade/renderer/shader/ImageShader.js"],"names":[],"mappings":"AAeA;;GAEG;AACH;IAiLI;;;;;;;OAOG;IACH;QALqC,UAAU,EAApC,gBAAgB;QACwC,OAAO,EAA/D,CAAC,sBAAoB;YAAC,UAAU,CAAC,EAAC,MAAM,EAAE,CAAA;SAAC,CAAC,EAAE;QACf,YAAY;QACzC,WAAW,CAavB;IA9ED;;;;OAwDC;IAxKD;;;OAGG;IACH,mEAEC;IAED;;;OAGG;IACH,cAFU,MAAM,EAAE,EAAE,CAEF;IAelB;;;OAGG;IACH,gHAEC;IAED;;;;;;;;OAQG;IACH,4BAHW,kBAAkB,GAChB,wBAAwB,CAIpC;IAED;;;OAGG;IACH,6BAEC;IAoBD;;;;;;;OAOG;IACH,aAHW,eAAe,GACb,WAAW,CA8BvB;IAkFD;;;;;;;;;;OAUG;IACH;QAP2C,OAAO,EAAvC,sBAAsB;QACL,QAAQ;QACgB,gBAAgB,GAAzD,8BAA8B;QACgB,sBAAsB;QACvC,aAAa,GAA1C,kBAAkB;QACC,QAAQ,GAA3B,MAAM,EAAE;aA4ElB;;CACJ;uCAvSY,OAAO,8DAA8D,EAAE,wBAAwB;qCAC/F,OAAO,wCAAwC,EAAE,sBAAsB;8BACvE,OAAO,+BAA+B,EAAE,eAAe;+BACvD,OAAO,uBAAuB,EAAE,gBAAgB"}
|
|
@@ -6,7 +6,9 @@ import { create_full_quad_pipeline_descriptor } from "./fullscreen/create_full_q
|
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* @typedef {import("../../descriptor/pipeline/render/RenderPipelineDescriptor.js").RenderPipelineDescriptor} RenderPipelineDescriptor
|
|
9
|
+
* @typedef {import("../../device/ShadeGPUCommandContext.js").ShadeGPUCommandContext} ShadeGPUCommandContext
|
|
9
10
|
* @typedef {import("./compiler/ShaderSwitchSet.js").ShaderSwitchSet} ShaderSwitchSet
|
|
11
|
+
* @typedef {import("./ShaderDescriptor.js").ShaderDescriptor} ShaderDescriptor
|
|
10
12
|
*/
|
|
11
13
|
|
|
12
14
|
const VALIDATION_ENABLED = true;
|
|
@@ -195,8 +197,8 @@ export class ImageShader {
|
|
|
195
197
|
* Utility constructor, matching general Shade API
|
|
196
198
|
* @param {Object} options
|
|
197
199
|
* @param {ShaderDescriptor} options.descriptor
|
|
198
|
-
* @param {
|
|
199
|
-
* @param {
|
|
200
|
+
* @param {(GPUColorTargetState|{clearValue?:number[]})[]} options.targets
|
|
201
|
+
* @param {GPUDepthStencilState} [options.depthStencil]
|
|
200
202
|
* @returns {ImageShader}
|
|
201
203
|
*/
|
|
202
204
|
static from({
|
|
@@ -215,12 +217,13 @@ export class ImageShader {
|
|
|
215
217
|
/**
|
|
216
218
|
* Note the absence of depth target, image shader is a full-screen pass, so depth is not used.
|
|
217
219
|
*
|
|
218
|
-
* @param {
|
|
219
|
-
* @param {
|
|
220
|
-
* @param {
|
|
221
|
-
* @param {
|
|
222
|
-
* @param {
|
|
223
|
-
* @param {
|
|
220
|
+
* @param {Object} options
|
|
221
|
+
* @param {ShadeGPUCommandContext} options.encoder
|
|
222
|
+
* @param {Object} [options.bindings] data bindings. It's optional, but in 99.99% of use cases you will want to specify this.
|
|
223
|
+
* @param {GPURenderPassColorAttachment[]} [options.colorAttachments] where to draw, these are fragment shader outputs.
|
|
224
|
+
* @param {GPURenderPassDepthStencilAttachment} [options.depthStencilAttachment]
|
|
225
|
+
* @param {GPUTextureFormat[]} [options.color_formats] optional, if specified will be used to rewrite the pipeline for compatibility
|
|
226
|
+
* @param {number[]} [options.viewport] [x0, y0, width, height ]
|
|
224
227
|
*/
|
|
225
228
|
draw({
|
|
226
229
|
encoder,
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Default Earth atmosphere shell thickness above `PLANET_RADIUS` in GPU atmosphere units
|
|
3
|
+
* ($\text{km}$), derived from physical metres via {@link ATMOSPHERE_UNIT_SCALE_DECLARATION}.
|
|
4
|
+
*
|
|
3
5
|
* @type {CodeChunk}
|
|
4
6
|
*/
|
|
5
7
|
export const ATMOSPHERE_HEIGHT_DECLARATION: CodeChunk;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ATMOSPHERE_HEIGHT_DECLARATION.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_HEIGHT_DECLARATION.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ATMOSPHERE_HEIGHT_DECLARATION.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_HEIGHT_DECLARATION.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,4CAFU,SAAS,CAUjB;0BAhBwB,6BAA6B"}
|
|
@@ -1,10 +1,18 @@
|
|
|
1
|
+
import { ATMOSPHERE_UNIT_SCALE_DECLARATION } from "../../../atmosphere/ATMOSPHERE_UNIT_SCALE.js";
|
|
1
2
|
import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
*
|
|
5
|
+
* Default Earth atmosphere shell thickness above `PLANET_RADIUS` in GPU atmosphere units
|
|
6
|
+
* ($\text{km}$), derived from physical metres via {@link ATMOSPHERE_UNIT_SCALE_DECLARATION}.
|
|
7
|
+
*
|
|
5
8
|
* @type {CodeChunk}
|
|
6
9
|
*/
|
|
7
10
|
export const ATMOSPHERE_HEIGHT_DECLARATION = CodeChunk.from(
|
|
8
|
-
//language=WGSL
|
|
9
|
-
`
|
|
11
|
+
//language=WGSL
|
|
12
|
+
`
|
|
13
|
+
const ATMOSPHERE_HEIGHT_METERS: f32 = 100000.0;
|
|
14
|
+
const ATMOSPHERE_HEIGHT: f32 = ATMOSPHERE_HEIGHT_METERS * METERS_TO_ATMOSPHERE_UNITS;
|
|
15
|
+
`, [
|
|
16
|
+
ATMOSPHERE_UNIT_SCALE_DECLARATION,
|
|
17
|
+
]
|
|
10
18
|
);
|
|
@@ -1,15 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* The two sphere radii the atmosphere
|
|
3
|
-
*
|
|
4
|
-
* `PLANET_RADIUS` and `ATMOSPHERE_HEIGHT` carry no type suffix, so they are AbstractInt.
|
|
5
|
-
* That converts silently wherever it is used directly in an f32 expression, but binding one
|
|
6
|
-
* to an un-annotated `let` materialises it to i32 — which then neither mixes with f32 nor
|
|
7
|
-
* holds the square of a planetary radius, since 6478000^2 is four orders of magnitude past
|
|
8
|
-
* what an i32 can represent. Anything that needs a radius as a value rather than as a term
|
|
9
|
-
* takes it from here.
|
|
10
|
-
*
|
|
11
|
-
* The squares are what the ray/sphere quadratics actually want, and as module-scope consts
|
|
12
|
-
* they are folded once rather than recomputed per invocation.
|
|
2
|
+
* The two concentric sphere radii bounding the default Earth atmosphere, in GPU atmosphere units
|
|
3
|
+
* ($\text{km}$, see `ATMOSPHERE_UNIT_SCALE_DECLARATION`).
|
|
13
4
|
*
|
|
14
5
|
* @type {CodeChunk}
|
|
15
6
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ATMOSPHERE_RADII_DECLARATION.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_RADII_DECLARATION.js"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"ATMOSPHERE_RADII_DECLARATION.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/atmosphere/ATMOSPHERE_RADII_DECLARATION.js"],"names":[],"mappings":"AAIA;;;;;GAKG;AACH,2CAFU,SAAS,CAcjB;0BAtBwB,6BAA6B"}
|
|
@@ -1,32 +1,23 @@
|
|
|
1
|
-
import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
2
|
-
import { ATMOSPHERE_HEIGHT_DECLARATION } from "./ATMOSPHERE_HEIGHT_DECLARATION.js";
|
|
3
|
-
import { PLANET_RADIUS_DECLARATION } from "./PLANET_RADIUS_DECLARATION.js";
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* The two sphere radii the atmosphere
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
const ATMOSPHERE_TOP_RADIUS = f32(PLANET_RADIUS) + f32(ATMOSPHERE_HEIGHT);
|
|
25
|
-
|
|
26
|
-
const ATMOSPHERE_GROUND_RADIUS_SQUARED = ATMOSPHERE_GROUND_RADIUS * ATMOSPHERE_GROUND_RADIUS;
|
|
27
|
-
const ATMOSPHERE_TOP_RADIUS_SQUARED = ATMOSPHERE_TOP_RADIUS * ATMOSPHERE_TOP_RADIUS;
|
|
28
|
-
`, [
|
|
29
|
-
PLANET_RADIUS_DECLARATION,
|
|
30
|
-
ATMOSPHERE_HEIGHT_DECLARATION,
|
|
31
|
-
]
|
|
32
|
-
);
|
|
1
|
+
import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
2
|
+
import { ATMOSPHERE_HEIGHT_DECLARATION } from "./ATMOSPHERE_HEIGHT_DECLARATION.js";
|
|
3
|
+
import { PLANET_RADIUS_DECLARATION } from "./PLANET_RADIUS_DECLARATION.js";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* The two concentric sphere radii bounding the default Earth atmosphere, in GPU atmosphere units
|
|
7
|
+
* ($\text{km}$, see `ATMOSPHERE_UNIT_SCALE_DECLARATION`).
|
|
8
|
+
*
|
|
9
|
+
* @type {CodeChunk}
|
|
10
|
+
*/
|
|
11
|
+
export const ATMOSPHERE_RADII_DECLARATION = CodeChunk.from(
|
|
12
|
+
//language=WGSL
|
|
13
|
+
`
|
|
14
|
+
const ATMOSPHERE_GROUND_RADIUS: f32 = PLANET_RADIUS;
|
|
15
|
+
const ATMOSPHERE_TOP_RADIUS: f32 = PLANET_RADIUS + ATMOSPHERE_HEIGHT;
|
|
16
|
+
|
|
17
|
+
const ATMOSPHERE_GROUND_RADIUS_SQUARED: f32 = ATMOSPHERE_GROUND_RADIUS * ATMOSPHERE_GROUND_RADIUS;
|
|
18
|
+
const ATMOSPHERE_TOP_RADIUS_SQUARED: f32 = ATMOSPHERE_TOP_RADIUS * ATMOSPHERE_TOP_RADIUS;
|
|
19
|
+
`, [
|
|
20
|
+
PLANET_RADIUS_DECLARATION,
|
|
21
|
+
ATMOSPHERE_HEIGHT_DECLARATION,
|
|
22
|
+
]
|
|
23
|
+
);
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Default Earth radius in GPU atmosphere units ($\text{km}$), derived from the physical metre
|
|
3
|
+
* radius via {@link ATMOSPHERE_UNIT_SCALE_DECLARATION}.
|
|
4
|
+
*
|
|
5
|
+
* @type {CodeChunk}
|
|
6
|
+
*/
|
|
1
7
|
export const PLANET_RADIUS_DECLARATION: CodeChunk;
|
|
2
8
|
import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
3
9
|
//# sourceMappingURL=PLANET_RADIUS_DECLARATION.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PLANET_RADIUS_DECLARATION.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/atmosphere/PLANET_RADIUS_DECLARATION.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PLANET_RADIUS_DECLARATION.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/atmosphere/PLANET_RADIUS_DECLARATION.js"],"names":[],"mappings":"AAGA;;;;;GAKG;AACH,wCAFU,SAAS,CAUjB;0BAhBwB,6BAA6B"}
|
|
@@ -1,6 +1,18 @@
|
|
|
1
|
+
import { ATMOSPHERE_UNIT_SCALE_DECLARATION } from "../../../atmosphere/ATMOSPHERE_UNIT_SCALE.js";
|
|
1
2
|
import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
2
3
|
|
|
4
|
+
/**
|
|
5
|
+
* Default Earth radius in GPU atmosphere units ($\text{km}$), derived from the physical metre
|
|
6
|
+
* radius via {@link ATMOSPHERE_UNIT_SCALE_DECLARATION}.
|
|
7
|
+
*
|
|
8
|
+
* @type {CodeChunk}
|
|
9
|
+
*/
|
|
3
10
|
export const PLANET_RADIUS_DECLARATION = CodeChunk.from(
|
|
4
|
-
//language=WGSL
|
|
5
|
-
`
|
|
11
|
+
//language=WGSL
|
|
12
|
+
`
|
|
13
|
+
const PLANET_RADIUS_METERS: f32 = 6378000.0;
|
|
14
|
+
const PLANET_RADIUS: f32 = PLANET_RADIUS_METERS * METERS_TO_ATMOSPHERE_UNITS;
|
|
15
|
+
`, [
|
|
16
|
+
ATMOSPHERE_UNIT_SCALE_DECLARATION,
|
|
17
|
+
]
|
|
6
18
|
);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_atmosphere_height.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/atmosphere/chunk_atmosphere_height.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_atmosphere_height.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/atmosphere/chunk_atmosphere_height.js"],"names":[],"mappings":"AAKA,gDAaE;0BAjBwB,6BAA6B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ATMOSPHERE_UNIT_SCALE_DECLARATION } from "../../../atmosphere/ATMOSPHERE_UNIT_SCALE.js";
|
|
1
2
|
import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
2
3
|
import { PLANET_CENTER_DECLARATION } from "./PLANET_CENTER_DECLARATION.js";
|
|
3
4
|
import { PLANET_RADIUS_DECLARATION } from "./PLANET_RADIUS_DECLARATION.js";
|
|
@@ -5,12 +6,13 @@ import { PLANET_RADIUS_DECLARATION } from "./PLANET_RADIUS_DECLARATION.js";
|
|
|
5
6
|
export const chunk_atmosphere_height = CodeChunk.from(
|
|
6
7
|
//language=WGSL
|
|
7
8
|
`
|
|
8
|
-
fn atmosphere_height(
|
|
9
|
+
fn atmosphere_height(position_ws: vec3<f32>) -> f32
|
|
9
10
|
{
|
|
10
|
-
|
|
11
|
+
return (distance(position_ws * METERS_TO_ATMOSPHERE_UNITS, PLANET_CENTER) - PLANET_RADIUS) * ATMOSPHERE_UNIT_METERS;
|
|
11
12
|
}
|
|
12
13
|
`,
|
|
13
14
|
[
|
|
15
|
+
ATMOSPHERE_UNIT_SCALE_DECLARATION,
|
|
14
16
|
PLANET_RADIUS_DECLARATION,
|
|
15
17
|
PLANET_CENTER_DECLARATION
|
|
16
18
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chunk_atmosphere_intersection.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/atmosphere/chunk_atmosphere_intersection.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chunk_atmosphere_intersection.d.ts","sourceRoot":"","sources":["../../../../../../../src/shade/renderer/shader/chunk/atmosphere/chunk_atmosphere_intersection.js"],"names":[],"mappings":"AAOA,sDAqBO;0BA3BmB,6BAA6B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ATMOSPHERE_UNIT_SCALE_DECLARATION } from "../../../atmosphere/ATMOSPHERE_UNIT_SCALE.js";
|
|
1
2
|
import { CodeChunk } from "../../compiler/CodeChunk.js";
|
|
2
3
|
import { ATMOSPHERE_HEIGHT_DECLARATION } from "./ATMOSPHERE_HEIGHT_DECLARATION.js";
|
|
3
4
|
import { chunk_sphere_intersection } from "./chunk_sphere_intersection.js";
|
|
@@ -8,12 +9,19 @@ export const chunk_atmosphere_intersection = CodeChunk.from(
|
|
|
8
9
|
//language=WGSL
|
|
9
10
|
`
|
|
10
11
|
fn atmosphere_intersection (
|
|
11
|
-
rayStart:vec3<f32>,
|
|
12
|
-
rayDir:vec3<f32>
|
|
12
|
+
rayStart: vec3<f32>,
|
|
13
|
+
rayDir: vec3<f32>
|
|
13
14
|
) -> vec2<f32> {
|
|
14
|
-
|
|
15
|
+
let hits = sphere_intersection(
|
|
16
|
+
rayStart * METERS_TO_ATMOSPHERE_UNITS,
|
|
17
|
+
rayDir,
|
|
18
|
+
PLANET_CENTER,
|
|
19
|
+
PLANET_RADIUS + ATMOSPHERE_HEIGHT
|
|
20
|
+
);
|
|
21
|
+
return select(hits, hits * ATMOSPHERE_UNIT_METERS, hits >= vec2<f32>(0.0));
|
|
15
22
|
}
|
|
16
23
|
`, [
|
|
24
|
+
ATMOSPHERE_UNIT_SCALE_DECLARATION,
|
|
17
25
|
chunk_sphere_intersection,
|
|
18
26
|
PLANET_CENTER_DECLARATION,
|
|
19
27
|
PLANET_RADIUS_DECLARATION,
|