@zephyr3d/scene 0.9.26 → 0.10.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/README.md +60 -27
- package/dist/animation/animation_bank.js +634 -0
- package/dist/animation/animation_bank.js.map +1 -0
- package/dist/animation/animation_bank_gpu.js +256 -0
- package/dist/animation/animation_bank_gpu.js.map +1 -0
- package/dist/animation/animationset.js +146 -30
- package/dist/animation/animationset.js.map +1 -1
- package/dist/animation/cloth/gpu_cloth_component.js +406 -0
- package/dist/animation/cloth/gpu_cloth_component.js.map +1 -0
- package/dist/animation/cloth/gpu_cloth_system.js +332 -202
- package/dist/animation/cloth/gpu_cloth_system.js.map +1 -1
- package/dist/animation/gpu_animation_driver.js +289 -0
- package/dist/animation/gpu_animation_driver.js.map +1 -0
- package/dist/animation/joint_dynamics/collision.js +112 -1
- package/dist/animation/joint_dynamics/collision.js.map +1 -1
- package/dist/animation/joint_dynamics/controller.js +6 -0
- package/dist/animation/joint_dynamics/controller.js.map +1 -1
- package/dist/animation/joint_dynamics/joint_dynamics_system.js +11 -0
- package/dist/animation/joint_dynamics/joint_dynamics_system.js.map +1 -1
- package/dist/animation/joint_dynamics/solver.js +50 -12
- package/dist/animation/joint_dynamics/solver.js.map +1 -1
- package/dist/animation/joint_dynamics/types.js.map +1 -1
- package/dist/animation/skeleton.js +300 -56
- package/dist/animation/skeleton.js.map +1 -1
- package/dist/animation/skin_palette_atlas.js +252 -0
- package/dist/animation/skin_palette_atlas.js.map +1 -0
- package/dist/animation/spring/multi_chain_spring_system.js +298 -38
- package/dist/animation/spring/multi_chain_spring_system.js.map +1 -1
- package/dist/animation/spring/spring_chain.js +2 -0
- package/dist/animation/spring/spring_chain.js.map +1 -1
- package/dist/animation/spring/spring_collider.js +159 -21
- package/dist/animation/spring/spring_collider.js.map +1 -1
- package/dist/animation/spring/spring_particle.js +1 -0
- package/dist/animation/spring/spring_particle.js.map +1 -1
- package/dist/animation/spring/spring_solver.js +173 -0
- package/dist/animation/spring/spring_solver.js.map +1 -0
- package/dist/animation/spring/spring_system.js +249 -24
- package/dist/animation/spring/spring_system.js.map +1 -1
- package/dist/animation/spring_modifier.js +32 -1
- package/dist/animation/spring_modifier.js.map +1 -1
- package/dist/app/app.js +26 -0
- package/dist/app/app.js.map +1 -1
- package/dist/app/engine.js +86 -15
- package/dist/app/engine.js.map +1 -1
- package/dist/app/gamepad.js +191 -0
- package/dist/app/gamepad.js.map +1 -0
- package/dist/app/inputactions.js +271 -0
- package/dist/app/inputactions.js.map +1 -0
- package/dist/app/inputmgr.js +331 -22
- package/dist/app/inputmgr.js.map +1 -1
- package/dist/app/loading.js +138 -0
- package/dist/app/loading.js.map +1 -0
- package/dist/app/pipelinecache.js +209 -0
- package/dist/app/pipelinecache.js.map +1 -0
- package/dist/app/runtimescript.js +25 -0
- package/dist/app/runtimescript.js.map +1 -1
- package/dist/app/scriptingsystem.js +54 -0
- package/dist/app/scriptingsystem.js.map +1 -1
- package/dist/app/scriptregistry.js +7 -2
- package/dist/app/scriptregistry.js.map +1 -1
- package/dist/asset/asset_manifest.js +59 -0
- package/dist/asset/asset_manifest.js.map +1 -0
- package/dist/asset/asset_preload.js +258 -0
- package/dist/asset/asset_preload.js.map +1 -0
- package/dist/asset/assetmanager.js +117 -65
- package/dist/asset/assetmanager.js.map +1 -1
- package/dist/asset/loaders/ktx2/basis/LICENSE +201 -0
- package/dist/asset/loaders/ktx2/basis/basis_transcoder.js +2 -0
- package/dist/asset/loaders/ktx2/basis/basis_transcoder.wasm +0 -0
- package/dist/asset/loaders/ktx2/basis_location.js +17 -0
- package/dist/asset/loaders/ktx2/basis_location.js.map +1 -0
- package/dist/asset/loaders/ktx2/ktx2_loader.js +88 -0
- package/dist/asset/loaders/ktx2/ktx2_loader.js.map +1 -0
- package/dist/asset/loaders/ktx2/ktx2_targets.js +118 -0
- package/dist/asset/loaders/ktx2/ktx2_targets.js.map +1 -0
- package/dist/asset/loaders/ktx2/transcoder_pool.js +259 -0
- package/dist/asset/loaders/ktx2/transcoder_pool.js.map +1 -0
- package/dist/asset/mesh_lod_builder.js +104 -0
- package/dist/asset/mesh_lod_builder.js.map +1 -0
- package/dist/asset/mesh_settings.js +111 -0
- package/dist/asset/mesh_settings.js.map +1 -0
- package/dist/asset/meshopt_decoder.js +18 -0
- package/dist/asset/meshopt_decoder.js.map +1 -0
- package/dist/asset/meshopt_simplifier.js +26 -0
- package/dist/asset/meshopt_simplifier.js.map +1 -0
- package/dist/asset/model.js +177 -3
- package/dist/asset/model.js.map +1 -1
- package/dist/asset/texture_settings.js +231 -0
- package/dist/asset/texture_settings.js.map +1 -0
- package/dist/asset/zmsh_binary.js +131 -0
- package/dist/asset/zmsh_binary.js.map +1 -0
- package/dist/asset/zsdf_binary.js +111 -0
- package/dist/asset/zsdf_binary.js.map +1 -0
- package/dist/blitter/bilateralblur.js +1 -2
- package/dist/blitter/bilateralblur.js.map +1 -1
- package/dist/blitter/gaussianblur.js +1 -6
- package/dist/blitter/gaussianblur.js.map +1 -1
- package/dist/camera/base.js +31 -10
- package/dist/camera/base.js.map +1 -1
- package/dist/camera/camera.js +178 -200
- package/dist/camera/camera.js.map +1 -1
- package/dist/camera/follow.js +342 -0
- package/dist/camera/follow.js.map +1 -0
- package/dist/camera/fps.js +9 -7
- package/dist/camera/fps.js.map +1 -1
- package/dist/camera/orbit.js +46 -19
- package/dist/camera/orbit.js.map +1 -1
- package/dist/index.d.ts +30475 -19865
- package/dist/index.js +67 -12
- package/dist/index.js.map +1 -1
- package/dist/material/blinn.js +3 -0
- package/dist/material/blinn.js.map +1 -1
- package/dist/material/eye.js +1 -1
- package/dist/material/eye.js.map +1 -1
- package/dist/material/hair.js +2 -3
- package/dist/material/hair.js.map +1 -1
- package/dist/material/hairstrand.js +235 -235
- package/dist/material/hairstrand.js.map +1 -1
- package/dist/material/lambert.js +4 -1
- package/dist/material/lambert.js.map +1 -1
- package/dist/material/material.js +362 -300
- package/dist/material/material.js.map +1 -1
- package/dist/material/meshmaterial.js +118 -45
- package/dist/material/meshmaterial.js.map +1 -1
- package/dist/material/mixins/lightmodel/blinnphong.js +1 -1
- package/dist/material/mixins/lightmodel/blinnphong.js.map +1 -1
- package/dist/material/mixins/lightmodel/lambert.js +1 -1
- package/dist/material/mixins/lightmodel/lambert.js.map +1 -1
- package/dist/material/mixins/lightmodel/pbrblueprintmixin.js +34 -61
- package/dist/material/mixins/lightmodel/pbrblueprintmixin.js.map +1 -1
- package/dist/material/mixins/lightmodel/pbrmetallicroughness.js +16 -2
- package/dist/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -1
- package/dist/material/mixins/lightmodel/pbrspecularglossness.js +2 -1
- package/dist/material/mixins/lightmodel/pbrspecularglossness.js.map +1 -1
- package/dist/material/mixins/lit.js +223 -83
- package/dist/material/mixins/lit.js.map +1 -1
- package/dist/material/mixins/pbr/common.js +31 -206
- package/dist/material/mixins/pbr/common.js.map +1 -1
- package/dist/material/mtoon.js +1 -1
- package/dist/material/mtoon.js.map +1 -1
- package/dist/material/pbrmr.js +3 -0
- package/dist/material/pbrmr.js.map +1 -1
- package/dist/material/pbrsg.js +3 -0
- package/dist/material/pbrsg.js.map +1 -1
- package/dist/material/sdf_debug.js +78 -0
- package/dist/material/sdf_debug.js.map +1 -0
- package/dist/material/shader/helper.js +733 -190
- package/dist/material/shader/helper.js.map +1 -1
- package/dist/material/shader/terrain_blend.js +204 -43
- package/dist/material/shader/terrain_blend.js.map +1 -1
- package/dist/material/skin.js +331 -297
- package/dist/material/skin.js.map +1 -1
- package/dist/material/skinprofile.js +1058 -0
- package/dist/material/skinprofile.js.map +1 -0
- package/dist/material/sss.js +353 -0
- package/dist/material/sss.js.map +1 -0
- package/dist/material/sss_kernel.js +265 -0
- package/dist/material/sss_kernel.js.map +1 -0
- package/dist/material/sssprofile.js +879 -0
- package/dist/material/sssprofile.js.map +1 -0
- package/dist/material/subsurfaceprofile.js +4 -8
- package/dist/material/subsurfaceprofile.js.map +1 -1
- package/dist/material/terrain-cm.js +464 -188
- package/dist/material/terrain-cm.js.map +1 -1
- package/dist/material/unlit.js +3 -0
- package/dist/material/unlit.js.map +1 -1
- package/dist/material/water.js +2009 -201
- package/dist/material/water.js.map +1 -1
- package/dist/node_modules/meshoptimizer/LICENSE +21 -0
- package/dist/node_modules/meshoptimizer/meshopt_decoder.js +197 -0
- package/dist/node_modules/meshoptimizer/meshopt_decoder.js.map +1 -0
- package/dist/node_modules/meshoptimizer/meshopt_simplifier.js +677 -0
- package/dist/node_modules/meshoptimizer/meshopt_simplifier.js.map +1 -0
- package/dist/physics/character.js +226 -0
- package/dist/physics/character.js.map +1 -0
- package/dist/physics/collider.js +209 -0
- package/dist/physics/collider.js.map +1 -0
- package/dist/physics/events.js +79 -0
- package/dist/physics/events.js.map +1 -0
- package/dist/physics/joint.js +272 -0
- package/dist/physics/joint.js.map +1 -0
- package/dist/physics/node_physics.js +234 -0
- package/dist/physics/node_physics.js.map +1 -0
- package/dist/physics/part.js +91 -0
- package/dist/physics/part.js.map +1 -0
- package/dist/physics/rigid_body.js +379 -0
- package/dist/physics/rigid_body.js.map +1 -0
- package/dist/physics/vehicle.js +335 -0
- package/dist/physics/vehicle.js.map +1 -0
- package/dist/physics/world.js +25 -0
- package/dist/physics/world.js.map +1 -0
- package/dist/posteffect/bloom.js +49 -14
- package/dist/posteffect/bloom.js.map +1 -1
- package/dist/posteffect/motionblur.js +668 -63
- package/dist/posteffect/motionblur.js.map +1 -1
- package/dist/posteffect/posteffect.js +12 -1
- package/dist/posteffect/posteffect.js.map +1 -1
- package/dist/posteffect/postsss.js +572 -0
- package/dist/posteffect/postsss.js.map +1 -0
- package/dist/posteffect/sao.js +48 -50
- package/dist/posteffect/sao.js.map +1 -1
- package/dist/posteffect/skinsss.js +605 -355
- package/dist/posteffect/skinsss.js.map +1 -1
- package/dist/posteffect/ssgi.js +91 -162
- package/dist/posteffect/ssgi.js.map +1 -1
- package/dist/posteffect/ssr.js +3 -11
- package/dist/posteffect/ssr.js.map +1 -1
- package/dist/posteffect/sss.js +34 -15
- package/dist/posteffect/sss.js.map +1 -1
- package/dist/posteffect/taa.js +1 -0
- package/dist/posteffect/taa.js.map +1 -1
- package/dist/render/abuffer_oit.js +40 -39
- package/dist/render/abuffer_oit.js.map +1 -1
- package/dist/render/clipmap.js +328 -62
- package/dist/render/clipmap.js.map +1 -1
- package/dist/render/cluster_light.js +958 -224
- package/dist/render/cluster_light.js.map +1 -1
- package/dist/render/cull_visitor.js +26 -5
- package/dist/render/cull_visitor.js.map +1 -1
- package/dist/render/debug_views.js +37 -0
- package/dist/render/debug_views.js.map +1 -0
- package/dist/render/depthpass.js +5 -1
- package/dist/render/depthpass.js.map +1 -1
- package/dist/render/drawable_mixin.js +53 -6
- package/dist/render/drawable_mixin.js.map +1 -1
- package/dist/render/dualdepthpeeling_oit.js +53 -53
- package/dist/render/dualdepthpeeling_oit.js.map +1 -1
- package/dist/render/envlight.js +196 -113
- package/dist/render/envlight.js.map +1 -1
- package/dist/render/fbm_wavegenerator.js +8 -13
- package/dist/render/fbm_wavegenerator.js.map +1 -1
- package/dist/render/fft_wavegenerator.js +268 -136
- package/dist/render/fft_wavegenerator.js.map +1 -1
- package/dist/render/gerstner_wavegenerator.js +113 -28
- package/dist/render/gerstner_wavegenerator.js.map +1 -1
- package/dist/render/gi/probe_volume.js +1334 -0
- package/dist/render/gi/probe_volume.js.map +1 -0
- package/dist/render/gi/scene_gi.js +282 -0
- package/dist/render/gi/scene_gi.js.map +1 -0
- package/dist/render/gi/voxel_atlas.js +198 -0
- package/dist/render/gi/voxel_atlas.js.map +1 -0
- package/dist/render/gi/voxel_lighting.js +652 -0
- package/dist/render/gi/voxel_lighting.js.map +1 -0
- package/dist/render/gi/voxel_scene.js +642 -0
- package/dist/render/gi/voxel_scene.js.map +1 -0
- package/dist/render/gi/voxelize_pass.js +223 -0
- package/dist/render/gi/voxelize_pass.js.map +1 -0
- package/dist/render/globalbindgroup_allocator.js +3 -2
- package/dist/render/globalbindgroup_allocator.js.map +1 -1
- package/dist/render/gpu_picking.js +9 -36
- package/dist/render/gpu_picking.js.map +1 -1
- package/dist/render/hzb.js +80 -22
- package/dist/render/hzb.js.map +1 -1
- package/dist/render/instance_culling.js +499 -0
- package/dist/render/instance_culling.js.map +1 -0
- package/dist/render/lightpass.js +23 -9
- package/dist/render/lightpass.js.map +1 -1
- package/dist/render/lod.js +46 -0
- package/dist/render/lod.js.map +1 -0
- package/dist/render/oit.js +11 -11
- package/dist/render/oit.js.map +1 -1
- package/dist/render/primitive.js +301 -9
- package/dist/render/primitive.js.map +1 -1
- package/dist/render/primitive_readback.js +209 -0
- package/dist/render/primitive_readback.js.map +1 -0
- package/dist/render/render_queue.js +198 -11
- package/dist/render/render_queue.js.map +1 -1
- package/dist/render/renderer.js +14 -7
- package/dist/render/renderer.js.map +1 -1
- package/dist/render/rendergraph/blackboard.js +15 -1
- package/dist/render/rendergraph/blackboard.js.map +1 -1
- package/dist/render/rendergraph/executor.js +136 -0
- package/dist/render/rendergraph/executor.js.map +1 -1
- package/dist/render/rendergraph/forward_plus_builder.js +585 -59
- package/dist/render/rendergraph/forward_plus_builder.js.map +1 -1
- package/dist/render/rendergraph/frame_resource_requirements.js +1 -0
- package/dist/render/rendergraph/frame_resource_requirements.js.map +1 -1
- package/dist/render/rendergraph/history_resources.js +8 -1
- package/dist/render/rendergraph/history_resources.js.map +1 -1
- package/dist/render/rendergraph/scene_render_context.js +31 -2
- package/dist/render/rendergraph/scene_render_context.js.map +1 -1
- package/dist/render/rendergraph/types.js.map +1 -1
- package/dist/render/renderpass.js +28 -5
- package/dist/render/renderpass.js.map +1 -1
- package/dist/render/sdf/box_allocator.js +98 -0
- package/dist/render/sdf/box_allocator.js.map +1 -0
- package/dist/render/sdf/global_sdf.js +865 -0
- package/dist/render/sdf/global_sdf.js.map +1 -0
- package/dist/render/sdf/scene_sdf.js +562 -0
- package/dist/render/sdf/scene_sdf.js.map +1 -0
- package/dist/render/sdf/sdf_atlas.js +227 -0
- package/dist/render/sdf/sdf_atlas.js.map +1 -0
- package/dist/render/sdf/sdf_programs.js +42 -0
- package/dist/render/sdf/sdf_programs.js.map +1 -0
- package/dist/render/sdf/sdf_view.js +199 -0
- package/dist/render/sdf/sdf_view.js.map +1 -0
- package/dist/render/sdf/waterline.js +610 -0
- package/dist/render/sdf/waterline.js.map +1 -0
- package/dist/render/shadow_mask_pass.js +142 -25
- package/dist/render/shadow_mask_pass.js.map +1 -1
- package/dist/render/shore_wave_generator.js +1193 -0
- package/dist/render/shore_wave_generator.js.map +1 -0
- package/dist/render/sky.js +516 -86
- package/dist/render/sky.js.map +1 -1
- package/dist/render/transmission_thickness_pass.js +477 -0
- package/dist/render/transmission_thickness_pass.js.map +1 -0
- package/dist/render/underwater.js +524 -0
- package/dist/render/underwater.js.map +1 -0
- package/dist/render/virtualtexture/virtual_texture.js +1214 -0
- package/dist/render/virtualtexture/virtual_texture.js.map +1 -0
- package/dist/render/volumetric_cloud/cloud_common.js +472 -0
- package/dist/render/volumetric_cloud/cloud_common.js.map +1 -0
- package/dist/render/volumetric_cloud/cloud_noise.js +189 -0
- package/dist/render/volumetric_cloud/cloud_noise.js.map +1 -0
- package/dist/render/volumetric_cloud/debug_view.js +131 -0
- package/dist/render/volumetric_cloud/debug_view.js.map +1 -0
- package/dist/render/volumetric_cloud/resources.js +380 -0
- package/dist/render/volumetric_cloud/resources.js.map +1 -0
- package/dist/render/volumetric_cloud/sky_cache.js +380 -0
- package/dist/render/volumetric_cloud/sky_cache.js.map +1 -0
- package/dist/render/volumetric_cloud/volumetric_cloud.js +318 -0
- package/dist/render/volumetric_cloud/volumetric_cloud.js.map +1 -0
- package/dist/render/water_caustics.js +1195 -0
- package/dist/render/water_caustics.js.map +1 -0
- package/dist/render/water_foam.js +627 -0
- package/dist/render/water_foam.js.map +1 -0
- package/dist/render/water_interaction.js +1795 -0
- package/dist/render/water_interaction.js.map +1 -0
- package/dist/render/weightedblended_oit.js +36 -36
- package/dist/render/weightedblended_oit.js.map +1 -1
- package/dist/scene/basesprite.js +9 -4
- package/dist/scene/basesprite.js.map +1 -1
- package/dist/scene/batchgroup.js +108 -12
- package/dist/scene/batchgroup.js.map +1 -1
- package/dist/scene/environment.js +28 -7
- package/dist/scene/environment.js.map +1 -1
- package/dist/scene/foliage.js +1020 -0
- package/dist/scene/foliage.js.map +1 -0
- package/dist/scene/foliage_buckets.js +147 -0
- package/dist/scene/foliage_buckets.js.map +1 -0
- package/dist/scene/foliage_mask.js +358 -0
- package/dist/scene/foliage_mask.js.map +1 -0
- package/dist/scene/hair.js +15 -4
- package/dist/scene/hair.js.map +1 -1
- package/dist/scene/light.js +179 -13
- package/dist/scene/light.js.map +1 -1
- package/dist/scene/mesh.js +327 -45
- package/dist/scene/mesh.js.map +1 -1
- package/dist/scene/meshdrawable.js +6 -0
- package/dist/scene/meshdrawable.js.map +1 -1
- package/dist/scene/msdftext.js +9 -3
- package/dist/scene/msdftext.js.map +1 -1
- package/dist/scene/msdftextsprite.js +9 -3
- package/dist/scene/msdftextsprite.js.map +1 -1
- package/dist/scene/particlesys.js +8 -2
- package/dist/scene/particlesys.js.map +1 -1
- package/dist/scene/physics_settings.js +157 -0
- package/dist/scene/physics_settings.js.map +1 -0
- package/dist/scene/scene.js +190 -44
- package/dist/scene/scene.js.map +1 -1
- package/dist/scene/scene_node.js +147 -6
- package/dist/scene/scene_node.js.map +1 -1
- package/dist/scene/terrain-cm/bladegrassmaterial.js +735 -0
- package/dist/scene/terrain-cm/bladegrassmaterial.js.map +1 -0
- package/dist/scene/terrain-cm/grass.js +881 -42
- package/dist/scene/terrain-cm/grass.js.map +1 -1
- package/dist/scene/terrain-cm/grass_gpu.js +929 -0
- package/dist/scene/terrain-cm/grass_gpu.js.map +1 -0
- package/dist/scene/terrain-cm/grassmaterial.js +180 -9
- package/dist/scene/terrain-cm/grassmaterial.js.map +1 -1
- package/dist/scene/terrain-cm/terrain-cm.js +465 -36
- package/dist/scene/terrain-cm/terrain-cm.js.map +1 -1
- package/dist/scene/terrain-cm/terrain_gi_albedo.js +257 -0
- package/dist/scene/terrain-cm/terrain_gi_albedo.js.map +1 -0
- package/dist/scene/terrain-cm/terrain_rvt.js +395 -0
- package/dist/scene/terrain-cm/terrain_rvt.js.map +1 -0
- package/dist/scene/update_queue.js +54 -0
- package/dist/scene/update_queue.js.map +1 -0
- package/dist/scene/water.js +997 -96
- package/dist/scene/water.js.map +1 -1
- package/dist/scene/water_surface_sampler.js +324 -0
- package/dist/scene/water_surface_sampler.js.map +1 -0
- package/dist/scene/wind.js +317 -0
- package/dist/scene/wind.js.map +1 -0
- package/dist/shaders/atmosphere.js +388 -166
- package/dist/shaders/atmosphere.js.map +1 -1
- package/dist/shaders/fog.js +100 -32
- package/dist/shaders/fog.js.map +1 -1
- package/dist/shaders/gi.js +365 -0
- package/dist/shaders/gi.js.map +1 -0
- package/dist/shaders/ltc_rect.js +202 -0
- package/dist/shaders/ltc_rect.js.map +1 -0
- package/dist/shaders/misc.js +1 -10
- package/dist/shaders/misc.js.map +1 -1
- package/dist/shaders/noise.js +5 -1
- package/dist/shaders/noise.js.map +1 -1
- package/dist/shaders/probes.js +309 -0
- package/dist/shaders/probes.js.map +1 -0
- package/dist/shaders/sdf.js +537 -0
- package/dist/shaders/sdf.js.map +1 -0
- package/dist/shaders/shadow.js +104 -70
- package/dist/shaders/shadow.js.map +1 -1
- package/dist/shaders/skin_brdf.js +243 -0
- package/dist/shaders/skin_brdf.js.map +1 -0
- package/dist/shaders/ssr.js +6 -159
- package/dist/shaders/ssr.js.map +1 -1
- package/dist/shaders/temporal.js +38 -27
- package/dist/shaders/temporal.js.map +1 -1
- package/dist/shaders/water.js +40 -87
- package/dist/shaders/water.js.map +1 -1
- package/dist/shaders/water_medium.js +42 -0
- package/dist/shaders/water_medium.js.map +1 -0
- package/dist/shadow/dom.js +110 -19
- package/dist/shadow/dom.js.map +1 -1
- package/dist/shadow/esm.js +3 -3
- package/dist/shadow/esm.js.map +1 -1
- package/dist/shadow/pcf_opt.js +15 -48
- package/dist/shadow/pcf_opt.js.map +1 -1
- package/dist/shadow/pcf_pd.js +15 -53
- package/dist/shadow/pcf_pd.js.map +1 -1
- package/dist/shadow/pcss.js +34 -9
- package/dist/shadow/pcss.js.map +1 -1
- package/dist/shadow/shadow_impl.js +3 -8
- package/dist/shadow/shadow_impl.js.map +1 -1
- package/dist/shadow/shadow_region.js +87 -49
- package/dist/shadow/shadow_region.js.map +1 -1
- package/dist/shadow/shadowmapper.js +93 -53
- package/dist/shadow/shadowmapper.js.map +1 -1
- package/dist/shadow/ssm.js +18 -72
- package/dist/shadow/ssm.js.map +1 -1
- package/dist/shadow/vsm.js +3 -3
- package/dist/shadow/vsm.js.map +1 -1
- package/dist/shapes/shape.js +44 -1
- package/dist/shapes/shape.js.map +1 -1
- package/dist/utility/buoyancy.js +287 -0
- package/dist/utility/buoyancy.js.map +1 -0
- package/dist/utility/physical.js +10 -1
- package/dist/utility/physical.js.map +1 -1
- package/dist/utility/pmrem.js +17 -43
- package/dist/utility/pmrem.js.map +1 -1
- package/dist/utility/sdf/bake.js +435 -0
- package/dist/utility/sdf/bake.js.map +1 -0
- package/dist/utility/sdf/bvh.js +576 -0
- package/dist/utility/sdf/bvh.js.map +1 -0
- package/dist/utility/serialization/manager.js +36 -6
- package/dist/utility/serialization/manager.js.map +1 -1
- package/dist/utility/serialization/scene/animation.js +77 -7
- package/dist/utility/serialization/scene/animation.js.map +1 -1
- package/dist/utility/serialization/scene/batch.js +11 -4
- package/dist/utility/serialization/scene/batch.js.map +1 -1
- package/dist/utility/serialization/scene/camera.js +140 -279
- package/dist/utility/serialization/scene/camera.js.map +1 -1
- package/dist/utility/serialization/scene/cloth.js +25 -0
- package/dist/utility/serialization/scene/cloth.js.map +1 -0
- package/dist/utility/serialization/scene/common.js +14 -6
- package/dist/utility/serialization/scene/common.js.map +1 -1
- package/dist/utility/serialization/scene/foliage.js +821 -0
- package/dist/utility/serialization/scene/foliage.js.map +1 -0
- package/dist/utility/serialization/scene/hair.js +11 -4
- package/dist/utility/serialization/scene/hair.js.map +1 -1
- package/dist/utility/serialization/scene/light.js +115 -7
- package/dist/utility/serialization/scene/light.js.map +1 -1
- package/dist/utility/serialization/scene/material.js +388 -220
- package/dist/utility/serialization/scene/material.js.map +1 -1
- package/dist/utility/serialization/scene/mesh.js +69 -4
- package/dist/utility/serialization/scene/mesh.js.map +1 -1
- package/dist/utility/serialization/scene/node.js +140 -5
- package/dist/utility/serialization/scene/node.js.map +1 -1
- package/dist/utility/serialization/scene/node_physics.js +1318 -0
- package/dist/utility/serialization/scene/node_physics.js.map +1 -0
- package/dist/utility/serialization/scene/particle.js +11 -4
- package/dist/utility/serialization/scene/particle.js.map +1 -1
- package/dist/utility/serialization/scene/physics.js +120 -0
- package/dist/utility/serialization/scene/physics.js.map +1 -0
- package/dist/utility/serialization/scene/primitive.js +124 -10
- package/dist/utility/serialization/scene/primitive.js.map +1 -1
- package/dist/utility/serialization/scene/scene.js +1687 -51
- package/dist/utility/serialization/scene/scene.js.map +1 -1
- package/dist/utility/serialization/scene/sprite.js +11 -4
- package/dist/utility/serialization/scene/sprite.js.map +1 -1
- package/dist/utility/serialization/scene/terrain.js +163 -33
- package/dist/utility/serialization/scene/terrain.js.map +1 -1
- package/dist/utility/serialization/scene/text.js +11 -4
- package/dist/utility/serialization/scene/text.js.map +1 -1
- package/dist/utility/serialization/scene/water.js +2473 -114
- package/dist/utility/serialization/scene/water.js.map +1 -1
- package/dist/utility/serialization/types.js.map +1 -1
- package/dist/utility/shprojector.js +97 -109
- package/dist/utility/shprojector.js.map +1 -1
- package/dist/utility/textures/foam.js +170 -0
- package/dist/utility/textures/foam.js.map +1 -0
- package/dist/utility/textures/ggxlut.js +17 -43
- package/dist/utility/textures/ggxlut.js.map +1 -1
- package/dist/utility/textures/ltcdata.js +4 -4
- package/dist/utility/textures/ltcdata.js.map +1 -1
- package/dist/utility/textures/ltclut.js +16 -6
- package/dist/utility/textures/ltclut.js.map +1 -1
- package/dist/utility/unsupported.js +24 -0
- package/dist/utility/unsupported.js.map +1 -0
- package/dist/values.js +13 -1
- package/dist/values.js.map +1 -1
- package/package.json +25 -12
- package/src/asset/loaders/ktx2/basis/LICENSE +201 -0
- package/src/asset/loaders/ktx2/basis/basis_transcoder.js +2 -0
- package/src/asset/loaders/ktx2/basis/basis_transcoder.wasm +0 -0
- package/src/asset/meshoptimizer/LICENSE +21 -0
package/dist/camera/camera.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
|
-
import { halton23, Matrix4x4, Vector4, DEPTH_CLEAR_VALUE, DRef, Vector2, REVERSE_Z, Vector3, Ray, Frustum } from '@zephyr3d/base';
|
|
1
|
+
import { halton23, Matrix4x4, Vector4, DEPTH_CLEAR_VALUE, DRef, Vector2, DEBUG_VIEWS, REVERSE_Z, Vector3, Ray, Frustum } from '@zephyr3d/base';
|
|
2
2
|
import { SceneNode } from '../scene/scene_node.js';
|
|
3
3
|
import { Compositor } from '../posteffect/compositor.js';
|
|
4
4
|
import { TAA } from '../posteffect/taa.js';
|
|
5
5
|
import { SSGI } from '../posteffect/ssgi.js';
|
|
6
6
|
import { SSR } from '../posteffect/ssr.js';
|
|
7
7
|
import { SSS } from '../posteffect/sss.js';
|
|
8
|
-
import {
|
|
9
|
-
import { SubsurfaceProfile } from '../material/subsurfaceprofile.js';
|
|
8
|
+
import { PostSSS } from '../posteffect/postsss.js';
|
|
10
9
|
import { Tonemap } from '../posteffect/tonemap.js';
|
|
11
10
|
import { FXAA } from '../posteffect/fxaa.js';
|
|
12
11
|
import { Bloom } from '../posteffect/bloom.js';
|
|
@@ -20,6 +19,7 @@ import { WeightedBlendedOIT } from '../render/weightedblended_oit.js';
|
|
|
20
19
|
import { DualDepthPeelingOIT } from '../render/dualdepthpeeling_oit.js';
|
|
21
20
|
import { RGHistoryResources } from '../render/rendergraph/history_resources.js';
|
|
22
21
|
import { calculateEV100, calculatePhysicalExposure } from '../utility/physical.js';
|
|
22
|
+
import { checkDebugViews } from '../render/debug_views.js';
|
|
23
23
|
|
|
24
24
|
const SSGI_QUALITY_PRESET_SETTINGS = {
|
|
25
25
|
quality: {
|
|
@@ -123,8 +123,13 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
123
123
|
/** @internal Whether to perform a depth pre-pass. */ _depthPrePass;
|
|
124
124
|
/** @internal Render path selection for scene renderer. */ _renderPath;
|
|
125
125
|
/** @internal Whether command buffers may be reused for optimization. */ _commandBufferReuse;
|
|
126
|
+
/** @internal Scale of mesh level of detail screen sizes. */ _lodDistanceScale;
|
|
127
|
+
/** @internal Whether meshes are drawn as wireframes in this view. */ _wireframe;
|
|
128
|
+
/** @internal Whether meshes are colored by their level of detail in this view. */ _lodColoration;
|
|
126
129
|
/** @internal Hi-Z acceleration enable (primarily for SSR). */ _HiZ;
|
|
130
|
+
_HiZNearest;
|
|
127
131
|
/** @internal Screen-space shadow mask enable (Forward+ deferred shadows). */ _screenSpaceShadowMask;
|
|
132
|
+
/** @internal */ _contactShadows;
|
|
128
133
|
/** @internal If true, a float point backbuffer will be used. The default value is true */ _HDR;
|
|
129
134
|
/** @internal Tonemap enable flag (via post effect). */ _toneMap;
|
|
130
135
|
/** @internal Tonemap post effect reference. */ _postEffectTonemap;
|
|
@@ -137,6 +142,8 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
137
142
|
/** @internal Motion blur enable flag (via post effect). */ _motionBlur;
|
|
138
143
|
/** @internal Motion blur post effect reference. */ _postEffectMotionBlur;
|
|
139
144
|
/** @internal Motion blur strength. */ _motionBlurStrength;
|
|
145
|
+
/** @internal Motion blur shutter bias. */ _motionBlurShutterBias;
|
|
146
|
+
/** @internal Motion blur maximum streak length in pixels. */ _motionBlurMaxLength;
|
|
140
147
|
/** @internal Bloom enable flag (via post effect). */ _bloom;
|
|
141
148
|
/** @internal Bloom post effect reference. */ _postEffectBloom;
|
|
142
149
|
/** @internal Bloom downsample level cap. */ _bloomMaxDownsampleLevels;
|
|
@@ -197,25 +204,13 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
197
204
|
/** @internal SSS multi-scatter energy compensation. */ _sssMultiScatter;
|
|
198
205
|
/** @internal Cached runtime SSS settings after applying the quality preset. */ _sssResolvedSettings;
|
|
199
206
|
/** @internal SSS debug visualization mode. */ _sssDebugView;
|
|
200
|
-
/** @internal Skin SSS
|
|
201
|
-
|
|
202
|
-
/** @internal Skin SSS final blend strength. */ _skinSSSStrength;
|
|
203
|
-
/** @internal Skin SSS mask opacity bias. */ _skinSSSOpacity;
|
|
204
|
-
/** @internal Skin SSS maximum blur tap spacing in pixels. */ _skinSSSSampleStep;
|
|
205
|
-
/** @internal Skin SSS world-space scatter radius. */ _skinSSSScatterRadius;
|
|
206
|
-
/** @internal Skin SSS smoothing ("beauty filter") amount. */ _skinSSSSmoothness;
|
|
207
|
-
/** @internal Skin SSS depth rejection scale. */ _skinSSSDepthScale;
|
|
208
|
-
/** @internal Skin SSS blurred multiplier boost. */ _skinSSSColorBoost;
|
|
209
|
-
_skinSSSGlow;
|
|
210
|
-
_skinSSSProfilePreset;
|
|
211
|
-
_skinSSSProfile;
|
|
212
|
-
_skinSSSScatterTint;
|
|
207
|
+
/** @internal Skin SSS post effect reference. */ _postEffectPostSSS;
|
|
208
|
+
_SSSDebugOutput;
|
|
213
209
|
/** @internal SSAO enable flag (via post effect). */ _SSAO;
|
|
214
210
|
/** @internal SSAO post effect reference. */ _postEffectSSAO;
|
|
215
|
-
/** @internal SSAO scale (sampling radius multiplier). */
|
|
211
|
+
/** @internal SSAO scale (sampling radius multiplier). */ _SSAOOcclusionRadius;
|
|
216
212
|
/** @internal SSAO bias (self-shadowing reduction). */ _SSAOBias;
|
|
217
|
-
/** @internal SSAO sample radius. */
|
|
218
|
-
/** @internal SSAO intensity. */ _SSAOIntensity;
|
|
213
|
+
/** @internal SSAO sample radius. */ /** @internal SSAO intensity. */ _SSAOIntensity;
|
|
219
214
|
/** @internal SSAO blur depth cutoff. */ _SSAOBlurDepthCutoff;
|
|
220
215
|
/** @internal Pending GPU-pick promise (one-shot). */ _pickResultPromise;
|
|
221
216
|
/** @internal Resolver for the pending pick promise. */ _pickResultResolve;
|
|
@@ -270,7 +265,9 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
270
265
|
this._screenAdapter = new ScreenAdapter();
|
|
271
266
|
this._adapted = false;
|
|
272
267
|
this._HiZ = false;
|
|
268
|
+
this._HiZNearest = false;
|
|
273
269
|
this._screenSpaceShadowMask = true;
|
|
270
|
+
this._contactShadows = true;
|
|
274
271
|
this._HDR = true;
|
|
275
272
|
this._toneMap = true;
|
|
276
273
|
this._postEffectTonemap = new DRef();
|
|
@@ -283,6 +280,8 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
283
280
|
this._motionBlur = false;
|
|
284
281
|
this._postEffectMotionBlur = new DRef();
|
|
285
282
|
this._motionBlurStrength = 1;
|
|
283
|
+
this._motionBlurShutterBias = 0.5;
|
|
284
|
+
this._motionBlurMaxLength = 40;
|
|
286
285
|
this._bloom = false;
|
|
287
286
|
this._postEffectBloom = new DRef();
|
|
288
287
|
this._bloomMaxDownsampleLevels = 4;
|
|
@@ -354,28 +353,19 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
354
353
|
};
|
|
355
354
|
this.updateSSSResolvedSettings();
|
|
356
355
|
this._sssDebugView = 'none';
|
|
357
|
-
this.
|
|
358
|
-
this.
|
|
359
|
-
this._skinSSSStrength = 1;
|
|
360
|
-
this._skinSSSOpacity = 0.18;
|
|
361
|
-
this._skinSSSSampleStep = 2;
|
|
362
|
-
this._skinSSSScatterRadius = 0.02;
|
|
363
|
-
this._skinSSSSmoothness = 0;
|
|
364
|
-
this._skinSSSDepthScale = 80;
|
|
365
|
-
this._skinSSSColorBoost = 1;
|
|
366
|
-
this._skinSSSGlow = 0;
|
|
367
|
-
this._skinSSSProfilePreset = 'skin_default';
|
|
368
|
-
this._skinSSSProfile = null;
|
|
369
|
-
this._skinSSSScatterTint = new Vector4(1, 1, 1, 1);
|
|
356
|
+
this._postEffectPostSSS = new DRef();
|
|
357
|
+
this._SSSDebugOutput = 'none';
|
|
370
358
|
this._SSAO = false;
|
|
371
359
|
this._postEffectSSAO = new DRef();
|
|
372
|
-
this.
|
|
373
|
-
this._SSAOBias =
|
|
374
|
-
this._SSAOIntensity =
|
|
375
|
-
this._SSAORadius = 100;
|
|
360
|
+
this._SSAOOcclusionRadius = 0.25;
|
|
361
|
+
this._SSAOBias = 0.05;
|
|
362
|
+
this._SSAOIntensity = 1;
|
|
376
363
|
this._SSAOBlurDepthCutoff = 2;
|
|
377
364
|
this._pickResult = null;
|
|
378
365
|
this._commandBufferReuse = true;
|
|
366
|
+
this._lodDistanceScale = 1;
|
|
367
|
+
this._wireframe = false;
|
|
368
|
+
this._lodColoration = false;
|
|
379
369
|
this._jitteredVPMatrix = new Matrix4x4();
|
|
380
370
|
this._jitteredInvVPMatrix = new Matrix4x4();
|
|
381
371
|
this._jitterValue = new Vector2(0, 0);
|
|
@@ -443,6 +433,24 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
443
433
|
this._HiZ = !!val;
|
|
444
434
|
}
|
|
445
435
|
/**
|
|
436
|
+
* Whether the Hi-Z pyramid carries its nearest-depth channel.
|
|
437
|
+
*
|
|
438
|
+
* The pyramid's own channel answers "what is the farthest thing in this screen
|
|
439
|
+
* region", which is what occlusion and ray marching want; this one answers
|
|
440
|
+
* "what is the nearest", which is what a proximity query wants. It doubles the
|
|
441
|
+
* pyramid's bandwidth, so it is off unless something asks for it.
|
|
442
|
+
*
|
|
443
|
+
* Materials that query it - water's shoreline foam - turn it on by themselves,
|
|
444
|
+
* the way a transmissive material turns on the scene colour copy, so this only
|
|
445
|
+
* has to be set to force the channel on for something the renderer cannot see
|
|
446
|
+
* coming.
|
|
447
|
+
*/ get HiZNearest() {
|
|
448
|
+
return this._HiZNearest;
|
|
449
|
+
}
|
|
450
|
+
set HiZNearest(val) {
|
|
451
|
+
this._HiZNearest = !!val;
|
|
452
|
+
}
|
|
453
|
+
/**
|
|
446
454
|
* Whether the screen-space shadow mask is enabled.
|
|
447
455
|
*
|
|
448
456
|
* When enabled, shadow-casting lights are lit through the clustered pass and
|
|
@@ -456,6 +464,18 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
456
464
|
this._screenSpaceShadowMask = !!val;
|
|
457
465
|
}
|
|
458
466
|
/**
|
|
467
|
+
* Whether lights with a non-zero {@link PunctualLight.contactShadowLength}
|
|
468
|
+
* trace contact shadows.
|
|
469
|
+
*
|
|
470
|
+
* Contact shadows are traced inside the screen-space shadow mask, so they
|
|
471
|
+
* also require {@link Camera.screenSpaceShadowMask}.
|
|
472
|
+
*/ get contactShadows() {
|
|
473
|
+
return this._contactShadows;
|
|
474
|
+
}
|
|
475
|
+
set contactShadows(val) {
|
|
476
|
+
this._contactShadows = !!val;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
459
479
|
* Render path used by the scene renderer.
|
|
460
480
|
*/ get renderPath() {
|
|
461
481
|
return this._renderPath;
|
|
@@ -499,6 +519,38 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
499
519
|
}
|
|
500
520
|
}
|
|
501
521
|
/**
|
|
522
|
+
* How much of the motion blur streak lies ahead of where an object is now,
|
|
523
|
+
* as a fraction of its length. 0 trails the streak fully behind the object,
|
|
524
|
+
* 0.5 (the default) centres it. See {@link MotionBlur.shutterBias}.
|
|
525
|
+
*/ get motionBlurShutterBias() {
|
|
526
|
+
return this._motionBlurShutterBias;
|
|
527
|
+
}
|
|
528
|
+
set motionBlurShutterBias(val) {
|
|
529
|
+
this._motionBlurShutterBias = val;
|
|
530
|
+
if (this._postEffectMotionBlur.get()) {
|
|
531
|
+
this._postEffectMotionBlur.get().shutterBias = val;
|
|
532
|
+
// The effect clamps; read it back so the camera and the effect cannot
|
|
533
|
+
// disagree about what was actually applied.
|
|
534
|
+
this._motionBlurShutterBias = this._postEffectMotionBlur.get().shutterBias;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
/**
|
|
538
|
+
* Longest motion blur streak, in pixels at render resolution. This is the
|
|
539
|
+
* ceiling {@link Camera.motionBlurStrength} runs into; raising it costs
|
|
540
|
+
* samples in proportion. See {@link MotionBlur.maxBlurLength}.
|
|
541
|
+
*/ get motionBlurMaxLength() {
|
|
542
|
+
return this._motionBlurMaxLength;
|
|
543
|
+
}
|
|
544
|
+
set motionBlurMaxLength(val) {
|
|
545
|
+
this._motionBlurMaxLength = val;
|
|
546
|
+
if (this._postEffectMotionBlur.get()) {
|
|
547
|
+
this._postEffectMotionBlur.get().maxBlurLength = val;
|
|
548
|
+
// The effect clamps; read it back so the camera and the effect cannot
|
|
549
|
+
// disagree about what was actually applied.
|
|
550
|
+
this._motionBlurMaxLength = this._postEffectMotionBlur.get().maxBlurLength;
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
/**
|
|
502
554
|
* Gets whether Bloom is enabled.
|
|
503
555
|
*/ get bloom() {
|
|
504
556
|
return this._postEffectBloom.get().enabled;
|
|
@@ -581,7 +633,8 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
581
633
|
*
|
|
582
634
|
* @remarks
|
|
583
635
|
* See {@link Bloom.karisAverage}. On by default; costs a little halo reach in exchange for
|
|
584
|
-
* stability on high-frequency speculars.
|
|
636
|
+
* stability on high-frequency speculars. Legacy lighting only: physical lighting always averages
|
|
637
|
+
* linearly.
|
|
585
638
|
*/ get bloomKarisAverage() {
|
|
586
639
|
return this._bloomKarisAverage;
|
|
587
640
|
}
|
|
@@ -866,7 +919,7 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
866
919
|
this.invalidateSSGIHistory();
|
|
867
920
|
}
|
|
868
921
|
}
|
|
869
|
-
/** Pixel stride
|
|
922
|
+
/** Pixel stride of the linear ray marcher, used when no Hi-Z pyramid is available. */ get ssgiStride() {
|
|
870
923
|
return this._ssgiStride;
|
|
871
924
|
}
|
|
872
925
|
set ssgiStride(val) {
|
|
@@ -886,7 +939,7 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
886
939
|
this.invalidateSSGIHistory();
|
|
887
940
|
}
|
|
888
941
|
}
|
|
889
|
-
/** Whether SSGI temporal accumulation is enabled.
|
|
942
|
+
/** Whether SSGI temporal accumulation is enabled. */ get ssgiTemporal() {
|
|
890
943
|
return this._ssgiTemporal;
|
|
891
944
|
}
|
|
892
945
|
set ssgiTemporal(val) {
|
|
@@ -1092,143 +1145,34 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
1092
1145
|
set sssDebugView(val) {
|
|
1093
1146
|
this._sssDebugView = val ?? 'none';
|
|
1094
1147
|
}
|
|
1095
|
-
/** Gets whether the dedicated Skin SSS post effect is enabled. */ get skinSSS() {
|
|
1096
|
-
return this._postEffectSkinSSS.get().enabled;
|
|
1097
|
-
}
|
|
1098
|
-
set skinSSS(val) {
|
|
1099
|
-
this._postEffectSkinSSS.get().enabled = !!val;
|
|
1100
|
-
}
|
|
1101
|
-
/** Final blend strength for the dedicated Skin SSS post effect. */ get skinSSSStrength() {
|
|
1102
|
-
return this._skinSSSStrength;
|
|
1103
|
-
}
|
|
1104
|
-
set skinSSSStrength(val) {
|
|
1105
|
-
this._skinSSSStrength = Math.max(0, val ?? 0);
|
|
1106
|
-
if (this._postEffectSkinSSS.get()) {
|
|
1107
|
-
this._postEffectSkinSSS.get().strength = this._skinSSSStrength;
|
|
1108
|
-
}
|
|
1109
|
-
}
|
|
1110
|
-
/** Bias subtracted from the blurred skin mask before compositing. */ get skinSSSOpacity() {
|
|
1111
|
-
return this._skinSSSOpacity;
|
|
1112
|
-
}
|
|
1113
|
-
set skinSSSOpacity(val) {
|
|
1114
|
-
this._skinSSSOpacity = Math.max(0, Math.min(1, val ?? 0));
|
|
1115
|
-
if (this._postEffectSkinSSS.get()) {
|
|
1116
|
-
this._postEffectSkinSSS.get().opacity = this._skinSSSOpacity;
|
|
1117
|
-
}
|
|
1118
|
-
}
|
|
1119
|
-
/** Maximum pixel spacing between blur taps. Caps the projected scatter radius for close-ups. */ get skinSSSSampleStep() {
|
|
1120
|
-
return this._skinSSSSampleStep;
|
|
1121
|
-
}
|
|
1122
|
-
set skinSSSSampleStep(val) {
|
|
1123
|
-
this._skinSSSSampleStep = Math.max(0.25, val ?? 0.25);
|
|
1124
|
-
if (this._postEffectSkinSSS.get()) {
|
|
1125
|
-
this._postEffectSkinSSS.get().sampleStep = this._skinSSSSampleStep;
|
|
1126
|
-
}
|
|
1127
|
-
}
|
|
1128
|
-
/** World-space scatter radius. The blur width shrinks with distance to keep this constant. */ get skinSSSScatterRadius() {
|
|
1129
|
-
return this._skinSSSScatterRadius;
|
|
1130
|
-
}
|
|
1131
|
-
set skinSSSScatterRadius(val) {
|
|
1132
|
-
this._skinSSSScatterRadius = Math.max(0, val ?? 0);
|
|
1133
|
-
if (this._postEffectSkinSSS.get()) {
|
|
1134
|
-
this._postEffectSkinSSS.get().scatterRadius = this._skinSSSScatterRadius;
|
|
1135
|
-
}
|
|
1136
|
-
}
|
|
1137
|
-
/** Skin smoothing ("beauty filter") amount for the dedicated Skin SSS post effect. */ get skinSSSSmoothness() {
|
|
1138
|
-
return this._skinSSSSmoothness;
|
|
1139
|
-
}
|
|
1140
|
-
set skinSSSSmoothness(val) {
|
|
1141
|
-
this._skinSSSSmoothness = Math.max(0, Math.min(1, val ?? 0));
|
|
1142
|
-
if (this._postEffectSkinSSS.get()) {
|
|
1143
|
-
this._postEffectSkinSSS.get().smoothness = this._skinSSSSmoothness;
|
|
1144
|
-
}
|
|
1145
|
-
}
|
|
1146
|
-
/** Depth rejection scale. The reference shader uses 80. */ get skinSSSDepthScale() {
|
|
1147
|
-
return this._skinSSSDepthScale;
|
|
1148
|
-
}
|
|
1149
|
-
set skinSSSDepthScale(val) {
|
|
1150
|
-
this._skinSSSDepthScale = Math.max(0, val ?? 0);
|
|
1151
|
-
if (this._postEffectSkinSSS.get()) {
|
|
1152
|
-
this._postEffectSkinSSS.get().depthScale = this._skinSSSDepthScale;
|
|
1153
|
-
}
|
|
1154
|
-
}
|
|
1155
|
-
/** Multiplier applied to the blurred skin lighting multiplier before compositing. */ get skinSSSColorBoost() {
|
|
1156
|
-
return this._skinSSSColorBoost;
|
|
1157
|
-
}
|
|
1158
|
-
set skinSSSColorBoost(val) {
|
|
1159
|
-
this._skinSSSColorBoost = Math.max(0, val ?? 0);
|
|
1160
|
-
if (this._postEffectSkinSSS.get()) {
|
|
1161
|
-
this._postEffectSkinSSS.get().colorBoost = this._skinSSSColorBoost;
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
1148
|
/**
|
|
1165
|
-
*
|
|
1149
|
+
* Switches the skin diffusion on or off for the coming frame.
|
|
1166
1150
|
*
|
|
1167
1151
|
* @remarks
|
|
1168
|
-
*
|
|
1169
|
-
*
|
|
1170
|
-
*
|
|
1171
|
-
* lit from within; around 1 approximates the look the effect had before it
|
|
1172
|
-
* conserved energy.
|
|
1173
|
-
*/ get skinSSSGlow() {
|
|
1174
|
-
return this._skinSSSGlow;
|
|
1175
|
-
}
|
|
1176
|
-
set skinSSSGlow(val) {
|
|
1177
|
-
this._skinSSSGlow = Math.max(0, val ?? 0);
|
|
1178
|
-
if (this._postEffectSkinSSS.get()) {
|
|
1179
|
-
this._postEffectSkinSSS.get().glow = this._skinSSSGlow;
|
|
1180
|
-
}
|
|
1181
|
-
}
|
|
1182
|
-
/**
|
|
1183
|
-
* Subsurface profile preset driving the Skin SSS per-channel scatter radii.
|
|
1152
|
+
* Driven by the render graph from whether the frame actually draws a skin
|
|
1153
|
+
* material, not by the application: an effect with nothing to scatter would
|
|
1154
|
+
* only cost a blit.
|
|
1184
1155
|
*
|
|
1185
|
-
* @remarks
|
|
1186
|
-
* The ratio between the red, green and blue radii is what gives a scattering
|
|
1187
|
-
* surface its character - red travels furthest in skin, which is the
|
|
1188
|
-
* red-to-yellow gradient at the terminator. Switching presets changes that
|
|
1189
|
-
* ratio, so `wax` and `jade` are the same code path rather than special cases;
|
|
1190
|
-
* {@link Camera.skinSSSScatterRadius} still sets how far the light reaches.
|
|
1191
|
-
*
|
|
1192
|
-
* Applies to the whole pass. Per-material profiles need the profile-slot path
|
|
1193
|
-
* used by {@link SSS} instead.
|
|
1194
|
-
*/ get skinSSSProfilePreset() {
|
|
1195
|
-
return this._skinSSSProfilePreset;
|
|
1196
|
-
}
|
|
1197
|
-
set skinSSSProfilePreset(val) {
|
|
1198
|
-
this._skinSSSProfilePreset = val ?? 'skin_default';
|
|
1199
|
-
if (this._skinSSSProfile) {
|
|
1200
|
-
this._skinSSSProfile.preset = this._skinSSSProfilePreset;
|
|
1201
|
-
}
|
|
1202
|
-
if (this._postEffectSkinSSS.get()) {
|
|
1203
|
-
this._postEffectSkinSSS.get().profile = this.getSkinSSSProfile();
|
|
1204
|
-
}
|
|
1205
|
-
}
|
|
1206
|
-
/**
|
|
1207
|
-
* The profile object backing {@link Camera.skinSSSProfilePreset}, created on
|
|
1208
|
-
* first use so that cameras which never enable Skin SSS do not consume one of
|
|
1209
|
-
* the 255 global profile slots.
|
|
1210
1156
|
* @internal
|
|
1211
|
-
*/
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1157
|
+
*/ setPostSSSActive(active) {
|
|
1158
|
+
const effect = this._postEffectPostSSS.get();
|
|
1159
|
+
if (effect) {
|
|
1160
|
+
effect.enabled = active;
|
|
1215
1161
|
}
|
|
1216
|
-
return this._skinSSSProfile;
|
|
1217
1162
|
}
|
|
1218
1163
|
/**
|
|
1219
|
-
*
|
|
1164
|
+
* Intermediate Skin SSS quantity to visualize instead of the shaded result.
|
|
1220
1165
|
*
|
|
1221
1166
|
* @remarks
|
|
1222
|
-
*
|
|
1223
|
-
*
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
return this._skinSSSScatterTint;
|
|
1167
|
+
* `'none'` renders normally. Use this to tell an input problem from a kernel
|
|
1168
|
+
* problem when the diffusion does not look right.
|
|
1169
|
+
*/ get SSSDebugOutput() {
|
|
1170
|
+
return this._SSSDebugOutput;
|
|
1227
1171
|
}
|
|
1228
|
-
set
|
|
1229
|
-
this.
|
|
1230
|
-
if (this.
|
|
1231
|
-
this.
|
|
1172
|
+
set SSSDebugOutput(val) {
|
|
1173
|
+
this._SSSDebugOutput = val ?? 'none';
|
|
1174
|
+
if (this._postEffectPostSSS.get()) {
|
|
1175
|
+
this._postEffectPostSSS.get().debugOutput = this._SSSDebugOutput;
|
|
1232
1176
|
}
|
|
1233
1177
|
}
|
|
1234
1178
|
/** @internal */ get ssrParams() {
|
|
@@ -1242,13 +1186,19 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
1242
1186
|
set SSAO(val) {
|
|
1243
1187
|
this._postEffectSSAO.get().enabled = !!val;
|
|
1244
1188
|
}
|
|
1245
|
-
/**
|
|
1246
|
-
|
|
1189
|
+
/**
|
|
1190
|
+
* SSAO occlusion radius, in world units (metres).
|
|
1191
|
+
*
|
|
1192
|
+
* @remarks
|
|
1193
|
+
* Replaces the old `SSAOScale`, which was a far-plane-relative multiplier and
|
|
1194
|
+
* carried no physical meaning.
|
|
1195
|
+
*/ get SSAOOcclusionRadius() {
|
|
1196
|
+
return this._SSAOOcclusionRadius;
|
|
1247
1197
|
}
|
|
1248
|
-
set
|
|
1249
|
-
this.
|
|
1198
|
+
set SSAOOcclusionRadius(val) {
|
|
1199
|
+
this._SSAOOcclusionRadius = val;
|
|
1250
1200
|
if (this._postEffectSSAO.get()) {
|
|
1251
|
-
this._postEffectSSAO.get().
|
|
1201
|
+
this._postEffectSSAO.get().occlusionRadius = val;
|
|
1252
1202
|
}
|
|
1253
1203
|
}
|
|
1254
1204
|
/** SSAO bias */ get SSAOBias() {
|
|
@@ -1260,15 +1210,6 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
1260
1210
|
this._postEffectSSAO.get().bias = val;
|
|
1261
1211
|
}
|
|
1262
1212
|
}
|
|
1263
|
-
/** SSAO radius */ get SSAORadius() {
|
|
1264
|
-
return this._SSAORadius;
|
|
1265
|
-
}
|
|
1266
|
-
set SSAORadius(val) {
|
|
1267
|
-
this._SSAORadius = val;
|
|
1268
|
-
if (this._postEffectSSAO.get()) {
|
|
1269
|
-
this._postEffectSSAO.get().radius = val;
|
|
1270
|
-
}
|
|
1271
|
-
}
|
|
1272
1213
|
/** SSAO intensity */ get SSAOIntensity() {
|
|
1273
1214
|
return this._SSAOIntensity;
|
|
1274
1215
|
}
|
|
@@ -1299,6 +1240,41 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
1299
1240
|
set commandBufferReuse(val) {
|
|
1300
1241
|
this._commandBufferReuse = !!val;
|
|
1301
1242
|
}
|
|
1243
|
+
/**
|
|
1244
|
+
* Scale of the mesh level of detail switch sizes in this view: above 1 meshes switch to
|
|
1245
|
+
* coarser levels closer to the camera, below 1 farther away. Default 1.
|
|
1246
|
+
*/ get lodDistanceScale() {
|
|
1247
|
+
return this._lodDistanceScale;
|
|
1248
|
+
}
|
|
1249
|
+
set lodDistanceScale(val) {
|
|
1250
|
+
this._lodDistanceScale = Math.max(0, Number(val) || 0);
|
|
1251
|
+
}
|
|
1252
|
+
/**
|
|
1253
|
+
* Whether everything in this view is drawn as the edges of its triangles, at the level of detail
|
|
1254
|
+
* in use, to inspect geometry; shadows and picking keep the triangles. A debug view, see
|
|
1255
|
+
* DEBUG_VIEWS, not saved with the camera. Default false.
|
|
1256
|
+
*/ get wireframe() {
|
|
1257
|
+
return DEBUG_VIEWS && this._wireframe;
|
|
1258
|
+
}
|
|
1259
|
+
set wireframe(val) {
|
|
1260
|
+
if (val) {
|
|
1261
|
+
checkDebugViews('Camera.wireframe');
|
|
1262
|
+
}
|
|
1263
|
+
this._wireframe = !!val;
|
|
1264
|
+
}
|
|
1265
|
+
/**
|
|
1266
|
+
* Whether every mesh of this view is shaded in the color of the level of detail it is drawn at,
|
|
1267
|
+
* white, red, green, blue, yellow, fuchsia, cyan and purple for levels 0 to 7. A debug view, not
|
|
1268
|
+
* saved with the camera; meshes are not batched while it is on. Default false.
|
|
1269
|
+
*/ get lodColoration() {
|
|
1270
|
+
return DEBUG_VIEWS && this._lodColoration;
|
|
1271
|
+
}
|
|
1272
|
+
set lodColoration(val) {
|
|
1273
|
+
if (val) {
|
|
1274
|
+
checkDebugViews('Camera.lodColoration');
|
|
1275
|
+
}
|
|
1276
|
+
this._lodColoration = !!val;
|
|
1277
|
+
}
|
|
1302
1278
|
/** Whether this camera is adapted to screen settins */ get adapted() {
|
|
1303
1279
|
return this._adapted;
|
|
1304
1280
|
}
|
|
@@ -1689,28 +1665,18 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
1689
1665
|
this._postEffectSSS.set(sss);
|
|
1690
1666
|
this._compositor.appendPostEffect(sss);
|
|
1691
1667
|
}
|
|
1692
|
-
if (!this.
|
|
1693
|
-
const
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
skinSSS.scatterRadius = this._skinSSSScatterRadius;
|
|
1699
|
-
skinSSS.smoothness = this._skinSSSSmoothness;
|
|
1700
|
-
skinSSS.depthScale = this._skinSSSDepthScale;
|
|
1701
|
-
skinSSS.colorBoost = this._skinSSSColorBoost;
|
|
1702
|
-
skinSSS.glow = this._skinSSSGlow;
|
|
1703
|
-
skinSSS.profile = this.getSkinSSSProfile();
|
|
1704
|
-
skinSSS.scatterTint = this._skinSSSScatterTint;
|
|
1705
|
-
this._postEffectSkinSSS.set(skinSSS);
|
|
1706
|
-
this._compositor.appendPostEffect(skinSSS);
|
|
1668
|
+
if (!this._postEffectPostSSS.get()) {
|
|
1669
|
+
const postSSS = new PostSSS();
|
|
1670
|
+
postSSS.enabled = false;
|
|
1671
|
+
postSSS.debugOutput = this._SSSDebugOutput;
|
|
1672
|
+
this._postEffectPostSSS.set(postSSS);
|
|
1673
|
+
this._compositor.appendPostEffect(postSSS);
|
|
1707
1674
|
}
|
|
1708
1675
|
if (!this._postEffectSSAO.get()) {
|
|
1709
1676
|
const ssao = new SAO();
|
|
1710
1677
|
ssao.enabled = false;
|
|
1711
|
-
ssao.
|
|
1678
|
+
ssao.occlusionRadius = this._SSAOOcclusionRadius;
|
|
1712
1679
|
ssao.bias = this._SSAOBias;
|
|
1713
|
-
ssao.radius = this._SSAORadius;
|
|
1714
1680
|
ssao.intensity = this._SSAOIntensity;
|
|
1715
1681
|
ssao.blurDepthCutoff = this._SSAOBlurDepthCutoff;
|
|
1716
1682
|
this._postEffectSSAO.set(ssao);
|
|
@@ -1742,6 +1708,8 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
1742
1708
|
const motionBlur = new MotionBlur();
|
|
1743
1709
|
motionBlur.enabled = false;
|
|
1744
1710
|
motionBlur.strength = this._motionBlurStrength;
|
|
1711
|
+
motionBlur.shutterBias = this._motionBlurShutterBias;
|
|
1712
|
+
motionBlur.maxBlurLength = this._motionBlurMaxLength;
|
|
1745
1713
|
this._postEffectMotionBlur.set(motionBlur);
|
|
1746
1714
|
this._compositor.appendPostEffect(motionBlur);
|
|
1747
1715
|
}
|
|
@@ -1925,9 +1893,19 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
1925
1893
|
return this._pickPosY;
|
|
1926
1894
|
}
|
|
1927
1895
|
/**
|
|
1928
|
-
* Updates the controller state
|
|
1929
|
-
|
|
1930
|
-
|
|
1896
|
+
* Updates the controller state.
|
|
1897
|
+
*
|
|
1898
|
+
* The scene calls this for its main camera twice per frame, once per phase;
|
|
1899
|
+
* the controller is updated only in the phase it declares. Called without a
|
|
1900
|
+
* phase, the controller is updated unconditionally.
|
|
1901
|
+
*
|
|
1902
|
+
* @param deltaTime - Time since the last frame in seconds; defaults to the device's frame time.
|
|
1903
|
+
* @param phase - Only update a controller whose `updatePhase` is this.
|
|
1904
|
+
*/ updateController(deltaTime, phase) {
|
|
1905
|
+
const controller = this._controller;
|
|
1906
|
+
if (controller && (!phase || controller.updatePhase === phase)) {
|
|
1907
|
+
controller.update(deltaTime);
|
|
1908
|
+
}
|
|
1931
1909
|
}
|
|
1932
1910
|
/**
|
|
1933
1911
|
* Reset the controller
|
|
@@ -2025,7 +2003,7 @@ const SSS_QUALITY_PRESET_SETTINGS = {
|
|
|
2025
2003
|
this._postEffectMotionBlur.dispose();
|
|
2026
2004
|
this._postEffectSSAO.dispose();
|
|
2027
2005
|
this._postEffectSSS.dispose();
|
|
2028
|
-
this.
|
|
2006
|
+
this._postEffectPostSSS.dispose();
|
|
2029
2007
|
this._postEffectSSGI.dispose();
|
|
2030
2008
|
this._postEffectSSR.dispose();
|
|
2031
2009
|
this._postEffectTAA.dispose();
|