@zephyr3d/scene 0.8.0 → 0.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/animation/animationset.js +198 -1
- package/dist/animation/animationset.js.map +1 -1
- package/dist/animation/ik/ccd_solver.js +3 -4
- package/dist/animation/ik/ccd_solver.js.map +1 -1
- package/dist/animation/ik/fabrik_solver.js +3 -4
- package/dist/animation/ik/fabrik_solver.js.map +1 -1
- package/dist/animation/ik/ik_pole_constraint.js +7 -2
- package/dist/animation/ik/ik_pole_constraint.js.map +1 -1
- package/dist/animation/ik/ik_utils.js +0 -79
- package/dist/animation/ik/ik_utils.js.map +1 -1
- package/dist/animation/ik/two_bone_ik_solver.js +3 -4
- package/dist/animation/ik/two_bone_ik_solver.js.map +1 -1
- package/dist/animation/spring/spring_bone.js +240 -0
- package/dist/animation/spring/spring_bone.js.map +1 -0
- package/dist/animation/spring/spring_bone_collider.js +198 -0
- package/dist/animation/spring/spring_bone_collider.js.map +1 -0
- package/dist/animation/spring/spring_bone_constraint.js +170 -0
- package/dist/animation/spring/spring_bone_constraint.js.map +1 -0
- package/dist/animation/spring/spring_bone_system.js +328 -0
- package/dist/animation/spring/spring_bone_system.js.map +1 -0
- package/dist/asset/model.js +2 -2
- package/dist/index.d.ts +15 -0
- package/dist/material/mixins/pbr/common.js +20 -17
- package/dist/material/mixins/pbr/common.js.map +1 -1
- package/dist/render/gpu_picking.js +100 -0
- package/dist/render/gpu_picking.js.map +1 -0
- package/dist/render/rendergraph/device_pool_allocator.js +41 -0
- package/dist/render/rendergraph/device_pool_allocator.js.map +1 -0
- package/dist/render/rendergraph/executor.js +146 -0
- package/dist/render/rendergraph/executor.js.map +1 -0
- package/dist/render/rendergraph/forward_plus_builder.js +414 -0
- package/dist/render/rendergraph/forward_plus_builder.js.map +1 -0
- package/dist/render/rendergraph/rendergraph.js +306 -0
- package/dist/render/rendergraph/rendergraph.js.map +1 -0
- package/dist/render/rendergraph/types.js +57 -0
- package/dist/render/rendergraph/types.js.map +1 -0
- package/dist/render/sky_motion_vector.js +85 -0
- package/dist/render/sky_motion_vector.js.map +1 -0
- package/dist/utility/serialization/scene/animation.js +3 -3
- package/dist/utility/serialization/scene/node.js +1 -1
- package/package.json +2 -2
- package/dist/animation/ik/ik_chain_builder.js +0 -68
- package/dist/animation/ik/ik_chain_builder.js.map +0 -1
- package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js +0 -38
- package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimemgr.js.map +0 -1
- package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js +0 -10
- package/dist/node_modules/@zephyr3d/runtime/dist/runtime/runtimescript.js.map +0 -1
- package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js +0 -127
- package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptingsystem.js.map +0 -1
- package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js +0 -263
- package/dist/node_modules/@zephyr3d/runtime/dist/runtime/scriptregistry.js.map +0 -1
- package/dist/src/animation/animation.js +0 -127
- package/dist/src/animation/animation.js.map +0 -1
- package/dist/src/animation/animationset.js +0 -255
- package/dist/src/animation/animationset.js.map +0 -1
- package/dist/src/animation/animationtrack.js +0 -34
- package/dist/src/animation/animationtrack.js.map +0 -1
- package/dist/src/animation/eulerrotationtrack.js +0 -52
- package/dist/src/animation/eulerrotationtrack.js.map +0 -1
- package/dist/src/animation/morphtarget.js +0 -93
- package/dist/src/animation/morphtarget.js.map +0 -1
- package/dist/src/animation/morphtrack.js +0 -70
- package/dist/src/animation/morphtrack.js.map +0 -1
- package/dist/src/animation/proptrack.js +0 -161
- package/dist/src/animation/proptrack.js.map +0 -1
- package/dist/src/animation/rotationtrack.js +0 -51
- package/dist/src/animation/rotationtrack.js.map +0 -1
- package/dist/src/animation/scaletrack.js +0 -50
- package/dist/src/animation/scaletrack.js.map +0 -1
- package/dist/src/animation/skeleton.js +0 -204
- package/dist/src/animation/skeleton.js.map +0 -1
- package/dist/src/animation/translationtrack.js +0 -50
- package/dist/src/animation/translationtrack.js.map +0 -1
- package/dist/src/app/app.js +0 -129
- package/dist/src/app/app.js.map +0 -1
- package/dist/src/app/inputmgr.js +0 -267
- package/dist/src/app/inputmgr.js.map +0 -1
- package/dist/src/asset/assetmanager.js +0 -404
- package/dist/src/asset/assetmanager.js.map +0 -1
- package/dist/src/asset/builtin.js +0 -337
- package/dist/src/asset/builtin.js.map +0 -1
- package/dist/src/asset/loaders/dds/dds.js +0 -470
- package/dist/src/asset/loaders/dds/dds.js.map +0 -1
- package/dist/src/asset/loaders/dds/dds_loader.js +0 -28
- package/dist/src/asset/loaders/dds/dds_loader.js.map +0 -1
- package/dist/src/asset/loaders/gltf/gltf_loader.js +0 -1265
- package/dist/src/asset/loaders/gltf/gltf_loader.js.map +0 -1
- package/dist/src/asset/loaders/gltf/helpers.js +0 -327
- package/dist/src/asset/loaders/gltf/helpers.js.map +0 -1
- package/dist/src/asset/loaders/hdr/hdr.js +0 -180
- package/dist/src/asset/loaders/hdr/hdr.js.map +0 -1
- package/dist/src/asset/loaders/image/tga_Loader.js +0 -116
- package/dist/src/asset/loaders/image/tga_Loader.js.map +0 -1
- package/dist/src/asset/loaders/image/webimage_loader.js +0 -63
- package/dist/src/asset/loaders/image/webimage_loader.js.map +0 -1
- package/dist/src/asset/loaders/loader.js +0 -45
- package/dist/src/asset/loaders/loader.js.map +0 -1
- package/dist/src/asset/model.js +0 -414
- package/dist/src/asset/model.js.map +0 -1
- package/dist/src/blitter/bilateralblur.js +0 -221
- package/dist/src/blitter/bilateralblur.js.map +0 -1
- package/dist/src/blitter/blitter.js +0 -390
- package/dist/src/blitter/blitter.js.map +0 -1
- package/dist/src/blitter/box.js +0 -118
- package/dist/src/blitter/box.js.map +0 -1
- package/dist/src/blitter/copy.js +0 -22
- package/dist/src/blitter/copy.js.map +0 -1
- package/dist/src/blitter/gaussianblur.js +0 -228
- package/dist/src/blitter/gaussianblur.js.map +0 -1
- package/dist/src/camera/base.js +0 -92
- package/dist/src/camera/base.js.map +0 -1
- package/dist/src/camera/camera.js +0 -1005
- package/dist/src/camera/camera.js.map +0 -1
- package/dist/src/camera/fps.js +0 -238
- package/dist/src/camera/fps.js.map +0 -1
- package/dist/src/camera/orbit.js +0 -245
- package/dist/src/camera/orbit.js.map +0 -1
- package/dist/src/camera/orthocamera.js +0 -167
- package/dist/src/camera/orthocamera.js.map +0 -1
- package/dist/src/camera/perspectivecamera.js +0 -141
- package/dist/src/camera/perspectivecamera.js.map +0 -1
- package/dist/src/index.js +0 -120
- package/dist/src/index.js.map +0 -1
- package/dist/src/material/blinn.js +0 -81
- package/dist/src/material/blinn.js.map +0 -1
- package/dist/src/material/grassmaterial.js +0 -113
- package/dist/src/material/grassmaterial.js.map +0 -1
- package/dist/src/material/lambert.js +0 -92
- package/dist/src/material/lambert.js.map +0 -1
- package/dist/src/material/material.js +0 -301
- package/dist/src/material/material.js.map +0 -1
- package/dist/src/material/meshmaterial.js +0 -704
- package/dist/src/material/meshmaterial.js.map +0 -1
- package/dist/src/material/mixins/albedocolor.js +0 -76
- package/dist/src/material/mixins/albedocolor.js.map +0 -1
- package/dist/src/material/mixins/foliage.js +0 -47
- package/dist/src/material/mixins/foliage.js.map +0 -1
- package/dist/src/material/mixins/lightmodel/blinnphong.js +0 -112
- package/dist/src/material/mixins/lightmodel/blinnphong.js.map +0 -1
- package/dist/src/material/mixins/lightmodel/lambert.js +0 -58
- package/dist/src/material/mixins/lightmodel/lambert.js.map +0 -1
- package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js +0 -178
- package/dist/src/material/mixins/lightmodel/pbrmetallicroughness.js.map +0 -1
- package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js +0 -139
- package/dist/src/material/mixins/lightmodel/pbrspecularglossness.js.map +0 -1
- package/dist/src/material/mixins/lit.js +0 -476
- package/dist/src/material/mixins/lit.js.map +0 -1
- package/dist/src/material/mixins/pbr/common.js +0 -918
- package/dist/src/material/mixins/pbr/common.js.map +0 -1
- package/dist/src/material/mixins/texture.js +0 -172
- package/dist/src/material/mixins/texture.js.map +0 -1
- package/dist/src/material/mixins/vertexcolor.js +0 -56
- package/dist/src/material/mixins/vertexcolor.js.map +0 -1
- package/dist/src/material/particle.js +0 -178
- package/dist/src/material/particle.js.map +0 -1
- package/dist/src/material/pbrmr.js +0 -97
- package/dist/src/material/pbrmr.js.map +0 -1
- package/dist/src/material/pbrsg.js +0 -97
- package/dist/src/material/pbrsg.js.map +0 -1
- package/dist/src/material/shader/helper.js +0 -1209
- package/dist/src/material/shader/helper.js.map +0 -1
- package/dist/src/material/terrain-cm.js +0 -606
- package/dist/src/material/terrain-cm.js.map +0 -1
- package/dist/src/material/terrainmaterial.js +0 -375
- package/dist/src/material/terrainmaterial.js.map +0 -1
- package/dist/src/material/unlit.js +0 -41
- package/dist/src/material/unlit.js.map +0 -1
- package/dist/src/material/water.js +0 -417
- package/dist/src/material/water.js.map +0 -1
- package/dist/src/posteffect/bloom.js +0 -361
- package/dist/src/posteffect/bloom.js.map +0 -1
- package/dist/src/posteffect/compositor.js +0 -226
- package/dist/src/posteffect/compositor.js.map +0 -1
- package/dist/src/posteffect/fxaa.js +0 -273
- package/dist/src/posteffect/fxaa.js.map +0 -1
- package/dist/src/posteffect/grayscale.js +0 -69
- package/dist/src/posteffect/grayscale.js.map +0 -1
- package/dist/src/posteffect/motionblur.js +0 -96
- package/dist/src/posteffect/motionblur.js.map +0 -1
- package/dist/src/posteffect/posteffect.js +0 -126
- package/dist/src/posteffect/posteffect.js.map +0 -1
- package/dist/src/posteffect/sao.js +0 -324
- package/dist/src/posteffect/sao.js.map +0 -1
- package/dist/src/posteffect/ssr.js +0 -489
- package/dist/src/posteffect/ssr.js.map +0 -1
- package/dist/src/posteffect/taa.js +0 -172
- package/dist/src/posteffect/taa.js.map +0 -1
- package/dist/src/posteffect/tonemap.js +0 -94
- package/dist/src/posteffect/tonemap.js.map +0 -1
- package/dist/src/render/abuffer_oit.js +0 -361
- package/dist/src/render/abuffer_oit.js.map +0 -1
- package/dist/src/render/clipmap.js +0 -851
- package/dist/src/render/clipmap.js.map +0 -1
- package/dist/src/render/cluster_light.js +0 -333
- package/dist/src/render/cluster_light.js.map +0 -1
- package/dist/src/render/cull_visitor.js +0 -187
- package/dist/src/render/cull_visitor.js.map +0 -1
- package/dist/src/render/depthpass.js +0 -68
- package/dist/src/render/depthpass.js.map +0 -1
- package/dist/src/render/drawable_mixin.js +0 -227
- package/dist/src/render/drawable_mixin.js.map +0 -1
- package/dist/src/render/envlight.js +0 -463
- package/dist/src/render/envlight.js.map +0 -1
- package/dist/src/render/fbm_wavegenerator.js +0 -251
- package/dist/src/render/fbm_wavegenerator.js.map +0 -1
- package/dist/src/render/fft_wavegenerator.js +0 -1006
- package/dist/src/render/fft_wavegenerator.js.map +0 -1
- package/dist/src/render/fullscreenquad.js +0 -38
- package/dist/src/render/fullscreenquad.js.map +0 -1
- package/dist/src/render/gerstner_wavegenerator.js +0 -314
- package/dist/src/render/gerstner_wavegenerator.js.map +0 -1
- package/dist/src/render/globalbindgroup_allocator.js +0 -60
- package/dist/src/render/globalbindgroup_allocator.js.map +0 -1
- package/dist/src/render/hzb.js +0 -273
- package/dist/src/render/hzb.js.map +0 -1
- package/dist/src/render/lightpass.js +0 -172
- package/dist/src/render/lightpass.js.map +0 -1
- package/dist/src/render/objectcolorpass.js +0 -51
- package/dist/src/render/objectcolorpass.js.map +0 -1
- package/dist/src/render/primitive.js +0 -364
- package/dist/src/render/primitive.js.map +0 -1
- package/dist/src/render/render_queue.js +0 -467
- package/dist/src/render/render_queue.js.map +0 -1
- package/dist/src/render/renderbundle_wrapper.js +0 -152
- package/dist/src/render/renderbundle_wrapper.js.map +0 -1
- package/dist/src/render/renderer.js +0 -455
- package/dist/src/render/renderer.js.map +0 -1
- package/dist/src/render/renderpass.js +0 -200
- package/dist/src/render/renderpass.js.map +0 -1
- package/dist/src/render/shadowmap_pass.js +0 -56
- package/dist/src/render/shadowmap_pass.js.map +0 -1
- package/dist/src/render/sky.js +0 -1103
- package/dist/src/render/sky.js.map +0 -1
- package/dist/src/render/weightedblended_oit.js +0 -168
- package/dist/src/render/weightedblended_oit.js.map +0 -1
- package/dist/src/scene/batchgroup.js +0 -162
- package/dist/src/scene/batchgroup.js.map +0 -1
- package/dist/src/scene/environment.js +0 -209
- package/dist/src/scene/environment.js.map +0 -1
- package/dist/src/scene/graph_node.js +0 -72
- package/dist/src/scene/graph_node.js.map +0 -1
- package/dist/src/scene/light.js +0 -416
- package/dist/src/scene/light.js.map +0 -1
- package/dist/src/scene/mesh.js +0 -341
- package/dist/src/scene/mesh.js.map +0 -1
- package/dist/src/scene/octree.js +0 -649
- package/dist/src/scene/octree.js.map +0 -1
- package/dist/src/scene/particlesys.js +0 -738
- package/dist/src/scene/particlesys.js.map +0 -1
- package/dist/src/scene/raycast_visitor.js +0 -103
- package/dist/src/scene/raycast_visitor.js.map +0 -1
- package/dist/src/scene/scene.js +0 -284
- package/dist/src/scene/scene.js.map +0 -1
- package/dist/src/scene/scene_node.js +0 -732
- package/dist/src/scene/scene_node.js.map +0 -1
- package/dist/src/scene/terrain/grass.js +0 -278
- package/dist/src/scene/terrain/grass.js.map +0 -1
- package/dist/src/scene/terrain/heightfield.js +0 -475
- package/dist/src/scene/terrain/heightfield.js.map +0 -1
- package/dist/src/scene/terrain/patch.js +0 -530
- package/dist/src/scene/terrain/patch.js.map +0 -1
- package/dist/src/scene/terrain/quadtree.js +0 -461
- package/dist/src/scene/terrain/quadtree.js.map +0 -1
- package/dist/src/scene/terrain/terrain.js +0 -246
- package/dist/src/scene/terrain/terrain.js.map +0 -1
- package/dist/src/scene/terrain-cm/grass.js +0 -594
- package/dist/src/scene/terrain-cm/grass.js.map +0 -1
- package/dist/src/scene/terrain-cm/grassmaterial.js +0 -159
- package/dist/src/scene/terrain-cm/grassmaterial.js.map +0 -1
- package/dist/src/scene/terrain-cm/terrain-cm.js +0 -538
- package/dist/src/scene/terrain-cm/terrain-cm.js.map +0 -1
- package/dist/src/scene/water.js +0 -374
- package/dist/src/scene/water.js.map +0 -1
- package/dist/src/shaders/atmosphere.js +0 -957
- package/dist/src/shaders/atmosphere.js.map +0 -1
- package/dist/src/shaders/fog.js +0 -112
- package/dist/src/shaders/fog.js.map +0 -1
- package/dist/src/shaders/misc.js +0 -266
- package/dist/src/shaders/misc.js.map +0 -1
- package/dist/src/shaders/noise.js +0 -222
- package/dist/src/shaders/noise.js.map +0 -1
- package/dist/src/shaders/pbr.js +0 -51
- package/dist/src/shaders/pbr.js.map +0 -1
- package/dist/src/shaders/shadow.js +0 -636
- package/dist/src/shaders/shadow.js.map +0 -1
- package/dist/src/shaders/ssr.js +0 -490
- package/dist/src/shaders/ssr.js.map +0 -1
- package/dist/src/shaders/temporal.js +0 -215
- package/dist/src/shaders/temporal.js.map +0 -1
- package/dist/src/shaders/water.js +0 -756
- package/dist/src/shaders/water.js.map +0 -1
- package/dist/src/shadow/esm.js +0 -237
- package/dist/src/shadow/esm.js.map +0 -1
- package/dist/src/shadow/pcf_opt.js +0 -181
- package/dist/src/shadow/pcf_opt.js.map +0 -1
- package/dist/src/shadow/pcf_pd.js +0 -189
- package/dist/src/shadow/pcf_pd.js.map +0 -1
- package/dist/src/shadow/shader.js +0 -37
- package/dist/src/shadow/shader.js.map +0 -1
- package/dist/src/shadow/shadow_impl.js +0 -15
- package/dist/src/shadow/shadow_impl.js.map +0 -1
- package/dist/src/shadow/shadowmapper.js +0 -790
- package/dist/src/shadow/shadowmapper.js.map +0 -1
- package/dist/src/shadow/ssm.js +0 -159
- package/dist/src/shadow/ssm.js.map +0 -1
- package/dist/src/shadow/vsm.js +0 -297
- package/dist/src/shadow/vsm.js.map +0 -1
- package/dist/src/shapes/box.js +0 -386
- package/dist/src/shapes/box.js.map +0 -1
- package/dist/src/shapes/cylinder.js +0 -125
- package/dist/src/shapes/cylinder.js.map +0 -1
- package/dist/src/shapes/plane.js +0 -88
- package/dist/src/shapes/plane.js.map +0 -1
- package/dist/src/shapes/shape.js +0 -87
- package/dist/src/shapes/shape.js.map +0 -1
- package/dist/src/shapes/sphere.js +0 -114
- package/dist/src/shapes/sphere.js.map +0 -1
- package/dist/src/shapes/tetrahedron.js +0 -188
- package/dist/src/shapes/tetrahedron.js.map +0 -1
- package/dist/src/shapes/torus.js +0 -111
- package/dist/src/shapes/torus.js.map +0 -1
- package/dist/src/utility/aabbtree.js +0 -400
- package/dist/src/utility/aabbtree.js.map +0 -1
- package/dist/src/utility/bounding_volume.js +0 -29
- package/dist/src/utility/bounding_volume.js.map +0 -1
- package/dist/src/utility/debug.js +0 -28
- package/dist/src/utility/debug.js.map +0 -1
- package/dist/src/utility/draco/decoder.js +0 -116
- package/dist/src/utility/draco/decoder.js.map +0 -1
- package/dist/src/utility/misc.js +0 -105
- package/dist/src/utility/misc.js.map +0 -1
- package/dist/src/utility/panorama.js +0 -163
- package/dist/src/utility/panorama.js.map +0 -1
- package/dist/src/utility/pmrem.js +0 -354
- package/dist/src/utility/pmrem.js.map +0 -1
- package/dist/src/utility/rendermipmap.js +0 -115
- package/dist/src/utility/rendermipmap.js.map +0 -1
- package/dist/src/utility/serialization/json.js +0 -402
- package/dist/src/utility/serialization/json.js.map +0 -1
- package/dist/src/utility/serialization/manager.js +0 -623
- package/dist/src/utility/serialization/manager.js.map +0 -1
- package/dist/src/utility/serialization/scene/animation.js +0 -248
- package/dist/src/utility/serialization/scene/animation.js.map +0 -1
- package/dist/src/utility/serialization/scene/batch.js +0 -59
- package/dist/src/utility/serialization/scene/batch.js.map +0 -1
- package/dist/src/utility/serialization/scene/camera.js +0 -790
- package/dist/src/utility/serialization/scene/camera.js.map +0 -1
- package/dist/src/utility/serialization/scene/common.js +0 -222
- package/dist/src/utility/serialization/scene/common.js.map +0 -1
- package/dist/src/utility/serialization/scene/light.js +0 -575
- package/dist/src/utility/serialization/scene/light.js.map +0 -1
- package/dist/src/utility/serialization/scene/material.js +0 -1111
- package/dist/src/utility/serialization/scene/material.js.map +0 -1
- package/dist/src/utility/serialization/scene/mesh.js +0 -148
- package/dist/src/utility/serialization/scene/mesh.js.map +0 -1
- package/dist/src/utility/serialization/scene/misc.js +0 -39
- package/dist/src/utility/serialization/scene/misc.js.map +0 -1
- package/dist/src/utility/serialization/scene/node.js +0 -451
- package/dist/src/utility/serialization/scene/node.js.map +0 -1
- package/dist/src/utility/serialization/scene/particle.js +0 -425
- package/dist/src/utility/serialization/scene/particle.js.map +0 -1
- package/dist/src/utility/serialization/scene/primitive.js +0 -692
- package/dist/src/utility/serialization/scene/primitive.js.map +0 -1
- package/dist/src/utility/serialization/scene/scene.js +0 -704
- package/dist/src/utility/serialization/scene/scene.js.map +0 -1
- package/dist/src/utility/serialization/scene/terrain.js +0 -488
- package/dist/src/utility/serialization/scene/terrain.js.map +0 -1
- package/dist/src/utility/serialization/scene/water.js +0 -465
- package/dist/src/utility/serialization/scene/water.js.map +0 -1
- package/dist/src/utility/shprojector.js +0 -297
- package/dist/src/utility/shprojector.js.map +0 -1
- package/dist/src/utility/textures/ggxlut.js +0 -213
- package/dist/src/utility/textures/ggxlut.js.map +0 -1
- package/dist/src/utility/textures/gradientnoise.js +0 -62
- package/dist/src/utility/textures/gradientnoise.js.map +0 -1
- package/dist/src/utility/textures/randomnoise.js +0 -41
- package/dist/src/utility/textures/randomnoise.js.map +0 -1
- package/dist/src/values.js +0 -162
- package/dist/src/values.js.map +0 -1
- package/dist/utility/blueprint/material/common.js +0 -7
- package/dist/utility/blueprint/material/common.js.map +0 -1
- package/dist/utility/serialization/blueprint/constants.js +0 -255
- package/dist/utility/serialization/blueprint/constants.js.map +0 -1
- package/dist/utility/serialization/blueprint/material/constants.js +0 -203
- package/dist/utility/serialization/blueprint/material/constants.js.map +0 -1
- package/dist/utility/serialization/blueprint/material/texture.js +0 -165
- package/dist/utility/serialization/blueprint/material/texture.js.map +0 -1
|
@@ -1,221 +0,0 @@
|
|
|
1
|
-
import { Blitter } from './blitter.js';
|
|
2
|
-
import { decodeNormalizedFloatFromRGBA } from '../shaders/misc.js';
|
|
3
|
-
import { Vector2 } from '@zephyr3d/base';
|
|
4
|
-
import { fetchSampler } from '../utility/misc.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Bilateral blur blitter
|
|
8
|
-
* @public
|
|
9
|
-
*/ class BilateralBlurBlitter extends Blitter {
|
|
10
|
-
_depthTex;
|
|
11
|
-
_sampler;
|
|
12
|
-
_blurSizeTex;
|
|
13
|
-
_blurSizeScale;
|
|
14
|
-
_blurSizeIndex;
|
|
15
|
-
_kernelRadius;
|
|
16
|
-
_cameraNearFar;
|
|
17
|
-
_depthCutoff;
|
|
18
|
-
_stepSize;
|
|
19
|
-
_uvStep;
|
|
20
|
-
_size;
|
|
21
|
-
_stdDev;
|
|
22
|
-
_offsetsAndWeights;
|
|
23
|
-
_finalPhase;
|
|
24
|
-
constructor(finalPhase){
|
|
25
|
-
super();
|
|
26
|
-
this._depthTex = null;
|
|
27
|
-
this._depthCutoff = 2;
|
|
28
|
-
this._blurSizeTex = null;
|
|
29
|
-
this._blurSizeScale = 1;
|
|
30
|
-
this._blurSizeIndex = 0;
|
|
31
|
-
this._sampler = null;
|
|
32
|
-
this._blurSizeTex = null;
|
|
33
|
-
this._kernelRadius = 8;
|
|
34
|
-
this._cameraNearFar = Vector2.zero();
|
|
35
|
-
this._size = Vector2.zero();
|
|
36
|
-
this._stdDev = 2;
|
|
37
|
-
this._offsetsAndWeights = new Float32Array(4 * (this._kernelRadius + 1));
|
|
38
|
-
this._finalPhase = !!finalPhase;
|
|
39
|
-
this._stepSize = 1;
|
|
40
|
-
this._uvStep = this._finalPhase ? new Vector2(1, 0) : new Vector2(0, 1);
|
|
41
|
-
this.calcGaussion();
|
|
42
|
-
}
|
|
43
|
-
get depthTex() {
|
|
44
|
-
return this._depthTex;
|
|
45
|
-
}
|
|
46
|
-
set depthTex(tex) {
|
|
47
|
-
this._depthTex = tex;
|
|
48
|
-
}
|
|
49
|
-
get blurSizeTex() {
|
|
50
|
-
return this._blurSizeTex;
|
|
51
|
-
}
|
|
52
|
-
set blurSizeTex(tex) {
|
|
53
|
-
this._blurSizeTex = tex;
|
|
54
|
-
}
|
|
55
|
-
get blurSizeIndex() {
|
|
56
|
-
return this._blurSizeIndex;
|
|
57
|
-
}
|
|
58
|
-
set blurSizeIndex(val) {
|
|
59
|
-
this._blurSizeIndex = val;
|
|
60
|
-
}
|
|
61
|
-
get blurSizeScale() {
|
|
62
|
-
return this._blurSizeScale;
|
|
63
|
-
}
|
|
64
|
-
set blurSizeScale(val) {
|
|
65
|
-
this._blurSizeScale = val;
|
|
66
|
-
}
|
|
67
|
-
get sampler() {
|
|
68
|
-
return this._sampler;
|
|
69
|
-
}
|
|
70
|
-
set sampler(sampler) {
|
|
71
|
-
this._sampler = sampler;
|
|
72
|
-
}
|
|
73
|
-
get cameraNearFar() {
|
|
74
|
-
return this._cameraNearFar;
|
|
75
|
-
}
|
|
76
|
-
set cameraNearFar(v) {
|
|
77
|
-
this._cameraNearFar.set(v);
|
|
78
|
-
}
|
|
79
|
-
get depthCutoff() {
|
|
80
|
-
return this._depthCutoff;
|
|
81
|
-
}
|
|
82
|
-
set depthCutoff(val) {
|
|
83
|
-
this._depthCutoff = val;
|
|
84
|
-
}
|
|
85
|
-
get size() {
|
|
86
|
-
return this._size;
|
|
87
|
-
}
|
|
88
|
-
set size(val) {
|
|
89
|
-
this._size.set(val);
|
|
90
|
-
}
|
|
91
|
-
get stepSize() {
|
|
92
|
-
return this._stepSize;
|
|
93
|
-
}
|
|
94
|
-
set stepSize(val) {
|
|
95
|
-
if (val !== this._stepSize) {
|
|
96
|
-
this._stepSize = val;
|
|
97
|
-
this.calcGaussion();
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
get stdDev() {
|
|
101
|
-
return this._stdDev;
|
|
102
|
-
}
|
|
103
|
-
set stdDev(val) {
|
|
104
|
-
if (val !== this._stdDev) {
|
|
105
|
-
this._stdDev = val;
|
|
106
|
-
this.calcGaussion();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
get kernelRadius() {
|
|
110
|
-
return this._kernelRadius;
|
|
111
|
-
}
|
|
112
|
-
set kernelRadius(val) {
|
|
113
|
-
val = Math.max(val, 0) >> 0;
|
|
114
|
-
if (val !== this._kernelRadius) {
|
|
115
|
-
this._kernelRadius = val;
|
|
116
|
-
this._offsetsAndWeights = new Float32Array(4 * (this._kernelRadius + 1));
|
|
117
|
-
this.calcGaussion();
|
|
118
|
-
this.invalidateHash();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
calcHash() {
|
|
122
|
-
return `${Number(!!this._blurSizeTex)}:${this._blurSizeIndex}:${this._kernelRadius}:${this._finalPhase}`;
|
|
123
|
-
}
|
|
124
|
-
calcGaussion() {
|
|
125
|
-
const kernel = [];
|
|
126
|
-
const size = this.kernelRadius * 2 + 1;
|
|
127
|
-
let sum = 0;
|
|
128
|
-
for(let x = 0; x < size; x++){
|
|
129
|
-
const value = 1 / (Math.sqrt(2 * Math.PI) * this._stdDev) * Math.exp(-((x - this.kernelRadius) ** 2) / (2 * this._stdDev ** 2));
|
|
130
|
-
kernel.push(value);
|
|
131
|
-
sum += value;
|
|
132
|
-
}
|
|
133
|
-
for(let i = 0; i <= this.kernelRadius; i++){
|
|
134
|
-
this._offsetsAndWeights[i * 4] = this._uvStep.x * i;
|
|
135
|
-
this._offsetsAndWeights[i * 4 + 1] = this._uvStep.y * i;
|
|
136
|
-
this._offsetsAndWeights[i * 4 + 2] = kernel[this.kernelRadius - i] / sum;
|
|
137
|
-
this._offsetsAndWeights[i * 4 + 3] = this._stepSize;
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
|
-
setup(scope, type) {
|
|
141
|
-
super.setup(scope, type);
|
|
142
|
-
const pb = scope.$builder;
|
|
143
|
-
if (pb.shaderKind === 'fragment') {
|
|
144
|
-
scope.depthTex = pb.tex2D().uniform(0);
|
|
145
|
-
if (this._blurSizeTex) {
|
|
146
|
-
scope.blurSizeTex = pb.tex2D().uniform(0);
|
|
147
|
-
scope.blurSizeScale = pb.float().uniform(0);
|
|
148
|
-
}
|
|
149
|
-
scope.depthCutoff = pb.float().uniform(0);
|
|
150
|
-
scope.offsetsAndWeights = pb.vec4[this._kernelRadius + 1]().uniform(0);
|
|
151
|
-
scope.cameraNearFar = pb.vec2().uniform(0);
|
|
152
|
-
scope.size = pb.vec2().uniform(0);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
setUniforms(bindGroup, sourceTex) {
|
|
156
|
-
super.setUniforms(bindGroup, sourceTex);
|
|
157
|
-
bindGroup.setTexture('depthTex', this._depthTex, this._sampler ?? fetchSampler('clamp_nearest_nomip'));
|
|
158
|
-
if (this._blurSizeTex) {
|
|
159
|
-
bindGroup.setTexture('blurSizeTex', this._blurSizeTex, fetchSampler('clamp_linear_nomip'));
|
|
160
|
-
bindGroup.setValue('blurSizeScale', this._blurSizeScale);
|
|
161
|
-
}
|
|
162
|
-
bindGroup.setValue('depthCutoff', this._depthCutoff);
|
|
163
|
-
bindGroup.setValue('offsetsAndWeights', this._offsetsAndWeights);
|
|
164
|
-
bindGroup.setValue('cameraNearFar', this._cameraNearFar);
|
|
165
|
-
bindGroup.setValue('size', this._size);
|
|
166
|
-
}
|
|
167
|
-
filter(scope, type, srcTex, srcUV, srcLayer, sampleType) {
|
|
168
|
-
const that = this;
|
|
169
|
-
const pb = scope.$builder;
|
|
170
|
-
pb.func('getLinearDepth', [
|
|
171
|
-
pb.vec2('uv')
|
|
172
|
-
], function() {
|
|
173
|
-
this.$l.depthValue = pb.textureSample(this.depthTex, this.uv);
|
|
174
|
-
this.$l.depth01 = pb.getDevice().type === 'webgl' ? decodeNormalizedFloatFromRGBA(this, this.depthValue) : this.depthValue.r;
|
|
175
|
-
this.$return(pb.mul(this.depth01, this.cameraNearFar.y));
|
|
176
|
-
});
|
|
177
|
-
pb.func('getLogDepth', [
|
|
178
|
-
pb.float('linearDepth')
|
|
179
|
-
], function() {
|
|
180
|
-
this.$return(pb.log(pb.add(this.linearDepth, 1)));
|
|
181
|
-
});
|
|
182
|
-
scope.centerDepth = scope.getLogDepth(scope.getLinearDepth(srcUV));
|
|
183
|
-
scope.depthDiff = pb.div(scope.depthCutoff, pb.sub(scope.getLogDepth(scope.cameraNearFar.y), scope.getLogDepth(scope.cameraNearFar.x)));
|
|
184
|
-
scope.weightSum = scope.offsetsAndWeights[0].z;
|
|
185
|
-
scope.srcTexel = that.readTexel(scope, type, srcTex, srcUV, srcLayer, sampleType);
|
|
186
|
-
scope.colorSum = pb.mul(scope.srcTexel, scope.weightSum);
|
|
187
|
-
if (that._blurSizeTex) {
|
|
188
|
-
scope.blurSize = pb.textureSample(scope.blurSizeTex, srcUV)['rgba'[this._blurSizeIndex]];
|
|
189
|
-
}
|
|
190
|
-
scope.$for(pb.int('i'), 0, that._kernelRadius, function() {
|
|
191
|
-
this.$l.offsetAndWeight = this.offsetsAndWeights.at(pb.add(this.i, 1));
|
|
192
|
-
this.$l.weight = this.offsetAndWeight.z;
|
|
193
|
-
this.$l.offset = this.offsetAndWeight.xy;
|
|
194
|
-
if (that._blurSizeTex) {
|
|
195
|
-
this.offset = pb.mul(this.offset, this.blurSize, this.blurSizeScale);
|
|
196
|
-
}
|
|
197
|
-
this.$l.offset = pb.div(this.offset, this.size);
|
|
198
|
-
this.$l.uvRight = pb.add(srcUV, this.offset);
|
|
199
|
-
this.$l.depthRight = this.getLogDepth(this.getLinearDepth(this.uvRight));
|
|
200
|
-
this.$if(pb.lessThan(pb.abs(pb.sub(this.depthRight, this.centerDepth)), this.depthDiff), function() {
|
|
201
|
-
this.$l.srcTexelRight = that.readTexel(this, type, srcTex, this.uvRight, srcLayer, sampleType);
|
|
202
|
-
this.$l.colorWeight = pb.mul(this.weight, pb.exp(pb.neg(pb.distance(this.srcTexelRight.rgb, this.srcTexel.rgb))));
|
|
203
|
-
this.colorSum = pb.add(this.colorSum, pb.mul(this.srcTexelRight, this.colorWeight));
|
|
204
|
-
this.weightSum = pb.add(this.weightSum, this.colorWeight);
|
|
205
|
-
});
|
|
206
|
-
this.$l.uvLeft = pb.sub(srcUV, this.offset);
|
|
207
|
-
this.$l.depthLeft = this.getLogDepth(this.getLinearDepth(this.uvLeft));
|
|
208
|
-
this.$if(pb.lessThan(pb.abs(pb.sub(this.depthLeft, this.centerDepth)), this.depthDiff), function() {
|
|
209
|
-
this.$l.srcTexelLeft = that.readTexel(this, type, srcTex, this.uvLeft, srcLayer, sampleType);
|
|
210
|
-
this.$l.colorWeight = pb.mul(this.weight, pb.exp(pb.neg(pb.distance(this.srcTexelLeft.rgb, this.srcTexel.rgb))));
|
|
211
|
-
this.colorSum = pb.add(this.colorSum, pb.mul(this.srcTexelLeft, this.colorWeight));
|
|
212
|
-
this.weightSum = pb.add(this.weightSum, this.colorWeight);
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
scope.colorSum = pb.div(scope.colorSum, scope.weightSum);
|
|
216
|
-
return scope.colorSum;
|
|
217
|
-
}
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
export { BilateralBlurBlitter };
|
|
221
|
-
//# sourceMappingURL=bilateralblur.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bilateralblur.js","sources":["../../../src/blitter/bilateralblur.ts"],"sourcesContent":["import type {\n BindGroup,\n PBShaderExp,\n PBInsideFunctionScope,\n PBGlobalScope,\n Texture2D,\n TextureSampler,\n BaseTexture\n} from '@zephyr3d/device';\nimport type { BlitType } from './blitter';\nimport { Blitter } from './blitter';\nimport { decodeNormalizedFloatFromRGBA } from '../shaders/misc';\nimport { Vector2 } from '@zephyr3d/base';\nimport { fetchSampler } from '../utility/misc';\n\n/**\n * Bilateral blur blitter\n * @public\n */\nexport class BilateralBlurBlitter extends Blitter {\n protected _depthTex: Texture2D;\n protected _sampler: TextureSampler;\n protected _blurSizeTex: Texture2D;\n protected _blurSizeScale: number;\n protected _blurSizeIndex: number;\n protected _kernelRadius: number;\n protected _cameraNearFar: Vector2;\n protected _depthCutoff: number;\n protected _stepSize: number;\n protected _uvStep: Vector2;\n protected _size: Vector2;\n protected _stdDev: number;\n protected _offsetsAndWeights: Float32Array<ArrayBuffer>;\n protected _finalPhase: boolean;\n constructor(finalPhase: boolean) {\n super();\n this._depthTex = null;\n this._depthCutoff = 2;\n this._blurSizeTex = null;\n this._blurSizeScale = 1;\n this._blurSizeIndex = 0;\n this._sampler = null;\n this._blurSizeTex = null;\n this._kernelRadius = 8;\n this._cameraNearFar = Vector2.zero();\n this._size = Vector2.zero();\n this._stdDev = 2;\n this._offsetsAndWeights = new Float32Array(4 * (this._kernelRadius + 1));\n this._finalPhase = !!finalPhase;\n this._stepSize = 1;\n this._uvStep = this._finalPhase ? new Vector2(1, 0) : new Vector2(0, 1);\n this.calcGaussion();\n }\n get depthTex(): Texture2D {\n return this._depthTex;\n }\n set depthTex(tex: Texture2D) {\n this._depthTex = tex;\n }\n get blurSizeTex(): Texture2D {\n return this._blurSizeTex;\n }\n set blurSizeTex(tex: Texture2D) {\n this._blurSizeTex = tex;\n }\n get blurSizeIndex(): number {\n return this._blurSizeIndex;\n }\n set blurSizeIndex(val: number) {\n this._blurSizeIndex = val;\n }\n get blurSizeScale(): number {\n return this._blurSizeScale;\n }\n set blurSizeScale(val: number) {\n this._blurSizeScale = val;\n }\n get sampler(): TextureSampler {\n return this._sampler;\n }\n set sampler(sampler: TextureSampler) {\n this._sampler = sampler;\n }\n get cameraNearFar(): Vector2 {\n return this._cameraNearFar;\n }\n set cameraNearFar(v: Vector2) {\n this._cameraNearFar.set(v);\n }\n get depthCutoff(): number {\n return this._depthCutoff;\n }\n set depthCutoff(val: number) {\n this._depthCutoff = val;\n }\n get size(): Vector2 {\n return this._size;\n }\n set size(val: Vector2) {\n this._size.set(val);\n }\n get stepSize(): number {\n return this._stepSize;\n }\n set stepSize(val: number) {\n if (val !== this._stepSize) {\n this._stepSize = val;\n this.calcGaussion();\n }\n }\n get stdDev(): number {\n return this._stdDev;\n }\n set stdDev(val: number) {\n if (val !== this._stdDev) {\n this._stdDev = val;\n this.calcGaussion();\n }\n }\n get kernelRadius(): number {\n return this._kernelRadius;\n }\n set kernelRadius(val: number) {\n val = Math.max(val, 0) >> 0;\n if (val !== this._kernelRadius) {\n this._kernelRadius = val;\n this._offsetsAndWeights = new Float32Array(4 * (this._kernelRadius + 1));\n this.calcGaussion();\n this.invalidateHash();\n }\n }\n protected calcHash(): string {\n return `${Number(!!this._blurSizeTex)}:${this._blurSizeIndex}:${this._kernelRadius}:${this._finalPhase}`;\n }\n private calcGaussion() {\n const kernel: number[] = [];\n const size = this.kernelRadius * 2 + 1;\n let sum = 0;\n for (let x = 0; x < size; x++) {\n const value =\n (1 / (Math.sqrt(2 * Math.PI) * this._stdDev)) *\n Math.exp(-((x - this.kernelRadius) ** 2) / (2 * this._stdDev ** 2));\n kernel.push(value);\n sum += value;\n }\n for (let i = 0; i <= this.kernelRadius; i++) {\n this._offsetsAndWeights[i * 4] = this._uvStep.x * i;\n this._offsetsAndWeights[i * 4 + 1] = this._uvStep.y * i;\n this._offsetsAndWeights[i * 4 + 2] = kernel[this.kernelRadius - i] / sum;\n this._offsetsAndWeights[i * 4 + 3] = this._stepSize;\n }\n }\n setup(scope: PBGlobalScope, type: BlitType) {\n super.setup(scope, type);\n const pb = scope.$builder;\n if (pb.shaderKind === 'fragment') {\n scope.depthTex = pb.tex2D().uniform(0);\n if (this._blurSizeTex) {\n scope.blurSizeTex = pb.tex2D().uniform(0);\n scope.blurSizeScale = pb.float().uniform(0);\n }\n scope.depthCutoff = pb.float().uniform(0);\n scope.offsetsAndWeights = pb.vec4[this._kernelRadius + 1]().uniform(0);\n scope.cameraNearFar = pb.vec2().uniform(0);\n scope.size = pb.vec2().uniform(0);\n }\n }\n setUniforms(bindGroup: BindGroup, sourceTex: BaseTexture) {\n super.setUniforms(bindGroup, sourceTex);\n bindGroup.setTexture('depthTex', this._depthTex, this._sampler ?? fetchSampler('clamp_nearest_nomip'));\n if (this._blurSizeTex) {\n bindGroup.setTexture('blurSizeTex', this._blurSizeTex, fetchSampler('clamp_linear_nomip'));\n bindGroup.setValue('blurSizeScale', this._blurSizeScale);\n }\n bindGroup.setValue('depthCutoff', this._depthCutoff);\n bindGroup.setValue('offsetsAndWeights', this._offsetsAndWeights);\n bindGroup.setValue('cameraNearFar', this._cameraNearFar);\n bindGroup.setValue('size', this._size);\n }\n filter(\n scope: PBInsideFunctionScope,\n type: BlitType,\n srcTex: PBShaderExp,\n srcUV: PBShaderExp,\n srcLayer: PBShaderExp,\n sampleType: 'float' | 'int' | 'uint'\n ): PBShaderExp {\n const that = this;\n const pb = scope.$builder;\n pb.func('getLinearDepth', [pb.vec2('uv')], function () {\n this.$l.depthValue = pb.textureSample(this.depthTex, this.uv);\n this.$l.depth01 =\n pb.getDevice().type === 'webgl'\n ? decodeNormalizedFloatFromRGBA(this, this.depthValue)\n : this.depthValue.r;\n this.$return(pb.mul(this.depth01, this.cameraNearFar.y));\n });\n pb.func('getLogDepth', [pb.float('linearDepth')], function () {\n this.$return(pb.log(pb.add(this.linearDepth, 1)));\n });\n scope.centerDepth = scope.getLogDepth(scope.getLinearDepth(srcUV));\n scope.depthDiff = pb.div(\n scope.depthCutoff,\n pb.sub(scope.getLogDepth(scope.cameraNearFar.y), scope.getLogDepth(scope.cameraNearFar.x))\n );\n scope.weightSum = scope.offsetsAndWeights[0].z;\n scope.srcTexel = that.readTexel(scope, type, srcTex, srcUV, srcLayer, sampleType);\n scope.colorSum = pb.mul(scope.srcTexel, scope.weightSum);\n if (that._blurSizeTex) {\n scope.blurSize = pb.textureSample(scope.blurSizeTex, srcUV)['rgba'[this._blurSizeIndex]];\n }\n scope.$for(pb.int('i'), 0, that._kernelRadius, function () {\n this.$l.offsetAndWeight = this.offsetsAndWeights.at(pb.add(this.i, 1));\n this.$l.weight = this.offsetAndWeight.z;\n this.$l.offset = this.offsetAndWeight.xy;\n if (that._blurSizeTex) {\n this.offset = pb.mul(this.offset, this.blurSize, this.blurSizeScale);\n }\n this.$l.offset = pb.div(this.offset, this.size);\n this.$l.uvRight = pb.add(srcUV, this.offset);\n this.$l.depthRight = this.getLogDepth(this.getLinearDepth(this.uvRight));\n this.$if(pb.lessThan(pb.abs(pb.sub(this.depthRight, this.centerDepth)), this.depthDiff), function () {\n this.$l.srcTexelRight = that.readTexel(this, type, srcTex, this.uvRight, srcLayer, sampleType);\n this.$l.colorWeight = pb.mul(\n this.weight,\n pb.exp(pb.neg(pb.distance(this.srcTexelRight.rgb, this.srcTexel.rgb)))\n );\n this.colorSum = pb.add(this.colorSum, pb.mul(this.srcTexelRight, this.colorWeight));\n this.weightSum = pb.add(this.weightSum, this.colorWeight);\n });\n this.$l.uvLeft = pb.sub(srcUV, this.offset);\n this.$l.depthLeft = this.getLogDepth(this.getLinearDepth(this.uvLeft));\n this.$if(pb.lessThan(pb.abs(pb.sub(this.depthLeft, this.centerDepth)), this.depthDiff), function () {\n this.$l.srcTexelLeft = that.readTexel(this, type, srcTex, this.uvLeft, srcLayer, sampleType);\n this.$l.colorWeight = pb.mul(\n this.weight,\n pb.exp(pb.neg(pb.distance(this.srcTexelLeft.rgb, this.srcTexel.rgb)))\n );\n this.colorSum = pb.add(this.colorSum, pb.mul(this.srcTexelLeft, this.colorWeight));\n this.weightSum = pb.add(this.weightSum, this.colorWeight);\n });\n });\n scope.colorSum = pb.div(scope.colorSum, scope.weightSum);\n return scope.colorSum;\n }\n}\n"],"names":["BilateralBlurBlitter","Blitter","_depthTex","_sampler","_blurSizeTex","_blurSizeScale","_blurSizeIndex","_kernelRadius","_cameraNearFar","_depthCutoff","_stepSize","_uvStep","_size","_stdDev","_offsetsAndWeights","_finalPhase","finalPhase","Vector2","zero","Float32Array","calcGaussion","depthTex","tex","blurSizeTex","blurSizeIndex","val","blurSizeScale","sampler","cameraNearFar","v","set","depthCutoff","size","stepSize","stdDev","kernelRadius","Math","max","invalidateHash","calcHash","Number","kernel","sum","x","value","sqrt","PI","exp","push","i","y","setup","scope","type","pb","$builder","shaderKind","tex2D","uniform","float","offsetsAndWeights","vec4","vec2","setUniforms","bindGroup","sourceTex","setTexture","fetchSampler","setValue","filter","srcTex","srcUV","srcLayer","sampleType","that","func","$l","depthValue","textureSample","uv","depth01","getDevice","decodeNormalizedFloatFromRGBA","r","$return","mul","log","add","linearDepth","centerDepth","getLogDepth","getLinearDepth","depthDiff","div","sub","weightSum","z","srcTexel","readTexel","colorSum","blurSize","$for","int","offsetAndWeight","at","weight","offset","xy","uvRight","depthRight","$if","lessThan","abs","srcTexelRight","colorWeight","neg","distance","rgb","uvLeft","depthLeft","srcTexelLeft"],"mappings":";;;;;AAeA;;;IAIO,MAAMA,oBAA6BC,SAAAA,OAAAA,CAAAA;IAC9BC,SAAqB;IACrBC,QAAyB;IACzBC,YAAwB;IACxBC,cAAuB;IACvBC,cAAuB;IACvBC,aAAsB;IACtBC,cAAwB;IACxBC,YAAqB;IACrBC,SAAkB;IAClBC,OAAiB;IACjBC,KAAe;IACfC,OAAgB;IAChBC,kBAA8C;IAC9CC,WAAqB;AAC/B,IAAA,WAAA,CAAYC,UAAmB,CAAE;QAC/B,KAAK,EAAA;QACL,IAAI,CAACd,SAAS,GAAG,IAAA;QACjB,IAAI,CAACO,YAAY,GAAG,CAAA;QACpB,IAAI,CAACL,YAAY,GAAG,IAAA;QACpB,IAAI,CAACC,cAAc,GAAG,CAAA;QACtB,IAAI,CAACC,cAAc,GAAG,CAAA;QACtB,IAAI,CAACH,QAAQ,GAAG,IAAA;QAChB,IAAI,CAACC,YAAY,GAAG,IAAA;QACpB,IAAI,CAACG,aAAa,GAAG,CAAA;AACrB,QAAA,IAAI,CAACC,cAAc,GAAGS,OAAAA,CAAQC,IAAI,EAAA;AAClC,QAAA,IAAI,CAACN,KAAK,GAAGK,OAAAA,CAAQC,IAAI,EAAA;QACzB,IAAI,CAACL,OAAO,GAAG,CAAA;QACf,IAAI,CAAC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F,gBAAA,IAAI,CAACnB,SAAS,GAAGzC,EAAAA,CAAGiC,GAAG,CAAC,IAAI,CAACQ,SAAS,EAAE,IAAI,CAACmB,WAAW,CAAA;AAC1D,aAAA,CAAA;AACF,SAAA,CAAA;QACA9D,KAAM+C,CAAAA,QAAQ,GAAG7C,EAAGuC,CAAAA,GAAG,CAACzC,KAAM+C,CAAAA,QAAQ,EAAE/C,KAAAA,CAAM2C,SAAS,CAAA;AACvD,QAAA,OAAO3C,MAAM+C,QAAQ;AACvB;AACF;;;;"}
|
|
@@ -1,390 +0,0 @@
|
|
|
1
|
-
import { Vector4 } from '@zephyr3d/base';
|
|
2
|
-
import { Application } from '../app/app.js';
|
|
3
|
-
import { Primitive } from '../render/primitive.js';
|
|
4
|
-
import { linearToGamma } from '../shaders/misc.js';
|
|
5
|
-
|
|
6
|
-
/**
|
|
7
|
-
* Base class for any kind of blitters
|
|
8
|
-
* @public
|
|
9
|
-
*/ class Blitter {
|
|
10
|
-
/** @internal */ _hash;
|
|
11
|
-
/** @internal */ _renderStates;
|
|
12
|
-
/** @internal */ _srgbOut;
|
|
13
|
-
/** @internal */ _flip;
|
|
14
|
-
/** @internal */ _viewport;
|
|
15
|
-
/** @internal */ _scissor;
|
|
16
|
-
/** @internal */ _destRect;
|
|
17
|
-
/** @internal */ _offsetParams;
|
|
18
|
-
/**
|
|
19
|
-
* Creates an instance of Blitter
|
|
20
|
-
*/ constructor(){
|
|
21
|
-
this._hash = null;
|
|
22
|
-
this._renderStates = null;
|
|
23
|
-
this._srgbOut = false;
|
|
24
|
-
this._flip = false;
|
|
25
|
-
this._viewport = null;
|
|
26
|
-
this._scissor = null;
|
|
27
|
-
this._destRect = null;
|
|
28
|
-
this._offsetParams = new Vector4();
|
|
29
|
-
}
|
|
30
|
-
/** Viewport */ get viewport() {
|
|
31
|
-
return this._viewport;
|
|
32
|
-
}
|
|
33
|
-
set viewport(val) {
|
|
34
|
-
this._viewport = val ?? null;
|
|
35
|
-
}
|
|
36
|
-
/** Scissor rect */ get scissor() {
|
|
37
|
-
return this._scissor;
|
|
38
|
-
}
|
|
39
|
-
set scissor(val) {
|
|
40
|
-
this._scissor = val ?? null;
|
|
41
|
-
}
|
|
42
|
-
/** Destination rectangle */ get destRect() {
|
|
43
|
-
return this._destRect;
|
|
44
|
-
}
|
|
45
|
-
set destRect(val) {
|
|
46
|
-
if (!!this._destRect !== !!val) {
|
|
47
|
-
this.invalidateHash();
|
|
48
|
-
}
|
|
49
|
-
this._destRect = val ?? null;
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* Whether output color value in gamma color space
|
|
53
|
-
*/ get srgbOut() {
|
|
54
|
-
return this._srgbOut;
|
|
55
|
-
}
|
|
56
|
-
set srgbOut(val) {
|
|
57
|
-
if (this._srgbOut !== !!val) {
|
|
58
|
-
this._srgbOut = !!val;
|
|
59
|
-
this.invalidateHash();
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Render states used to do the blitting
|
|
64
|
-
*/ get renderStates() {
|
|
65
|
-
return this._renderStates;
|
|
66
|
-
}
|
|
67
|
-
set renderStates(rs) {
|
|
68
|
-
this._renderStates = rs;
|
|
69
|
-
}
|
|
70
|
-
/**
|
|
71
|
-
* Program hash code
|
|
72
|
-
*/ get hash() {
|
|
73
|
-
if (!this._hash) {
|
|
74
|
-
this._hash = `${this.constructor.name}:${this._srgbOut ? 1 : 0}:${this._flip ? 1 : 0}:${this._destRect ? 1 : 0}:${this.calcHash()}`;
|
|
75
|
-
}
|
|
76
|
-
return this._hash;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Force the hash code to be regenerated
|
|
80
|
-
*/ invalidateHash() {
|
|
81
|
-
this._hash = null;
|
|
82
|
-
}
|
|
83
|
-
/**
|
|
84
|
-
* Reads a texel from the source texture
|
|
85
|
-
* @param scope - The shader scope
|
|
86
|
-
* @param type - The blit type
|
|
87
|
-
* @param srcTex - The source texture
|
|
88
|
-
* @param uv - The texture coordinate from where the texel will be read
|
|
89
|
-
* @param srcLayer - The layer of the source texture
|
|
90
|
-
* @returns The read texel
|
|
91
|
-
*/ readTexel(scope, type, srcTex, uv, srcLayer, sampleType) {
|
|
92
|
-
const pb = scope.$builder;
|
|
93
|
-
if (sampleType === 'float' || sampleType === 'depth') {
|
|
94
|
-
switch(type){
|
|
95
|
-
case '2d':
|
|
96
|
-
case 'cube':
|
|
97
|
-
return Application.instance.device.getDeviceCaps().shaderCaps.supportShaderTextureLod ? pb.textureSampleLevel(srcTex, uv, 0) : pb.textureSample(srcTex, uv);
|
|
98
|
-
case '2d-array':
|
|
99
|
-
return pb.textureArraySampleLevel(srcTex, uv, srcLayer, 0);
|
|
100
|
-
default:
|
|
101
|
-
return null;
|
|
102
|
-
}
|
|
103
|
-
} else {
|
|
104
|
-
switch(type){
|
|
105
|
-
case '2d':
|
|
106
|
-
return pb.textureLoad(srcTex, pb.ivec2(pb.mul(pb.vec2(pb.textureDimensions(srcTex, 0)), uv)), 0);
|
|
107
|
-
case 'cube':
|
|
108
|
-
throw new Error('Integer format cube texture not supported');
|
|
109
|
-
case '2d-array':
|
|
110
|
-
return pb.textureArrayLoad(srcTex, pb.ivec2(pb.mul(pb.vec2(pb.textureDimensions(srcTex, 0)), uv)), srcLayer, 0);
|
|
111
|
-
default:
|
|
112
|
-
return null;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
/**
|
|
117
|
-
* Writes a texel to destination texture
|
|
118
|
-
* @param scope - The shader scope
|
|
119
|
-
* @param type - The blit type
|
|
120
|
-
* @param uv - The texture coordinate to where the texel will be written
|
|
121
|
-
* @param texel - The texel to be written
|
|
122
|
-
* @returns The written texel
|
|
123
|
-
*/ writeTexel(scope, type, uv, texel) {
|
|
124
|
-
return texel;
|
|
125
|
-
}
|
|
126
|
-
/**
|
|
127
|
-
* Initialize uniforms of the blit program
|
|
128
|
-
* @param _scope - The shader scope
|
|
129
|
-
* @param _type - The blit type
|
|
130
|
-
*/ setup(_scope, _type) {}
|
|
131
|
-
/**
|
|
132
|
-
* Update uniforms of the bind group
|
|
133
|
-
* @param bindGroup - The bind group to be updated
|
|
134
|
-
*/ setUniforms(_bindGroup, _sourceTex) {}
|
|
135
|
-
/** @internal */ blit2D(source, dest, sampler) {
|
|
136
|
-
const device = Application.instance.device;
|
|
137
|
-
const flip = !dest && device.type === 'webgpu';
|
|
138
|
-
const bilinearFiltering = sampler ? sampler.magFilter === 'linear' || sampler.minFilter === 'linear' || sampler.mipFilter === 'linear' : source.isFilterable();
|
|
139
|
-
const programInfo = getBlitProgram('2d', this, bilinearFiltering, source.isIntegerFormat() ? source.isSignedFormat() ? 'int' : 'uint' : 'float', flip);
|
|
140
|
-
programInfo.bindGroup.setTexture('srcTex', source, sampler);
|
|
141
|
-
if (this._destRect) {
|
|
142
|
-
const destWidth = this._viewport?.[2] ?? dest?.getWidth() ?? device.getBackBufferWidth();
|
|
143
|
-
const destHeight = this._viewport?.[3] ?? dest?.getHeight() ?? device.getBackBufferHeight();
|
|
144
|
-
this._offsetParams.setXYZW(this._destRect[2] / destWidth, this._destRect[3] / destHeight, (this._destRect[2] + 2 * this._destRect[0]) / destWidth - 1, (this._destRect[3] + 2 * this._destRect[1]) / destHeight - 1);
|
|
145
|
-
programInfo.bindGroup.setValue('scaleBias', this._offsetParams);
|
|
146
|
-
}
|
|
147
|
-
this.setUniforms(programInfo.bindGroup, source);
|
|
148
|
-
device.setFramebuffer(dest ?? null);
|
|
149
|
-
device.setViewport(this._viewport);
|
|
150
|
-
device.setScissor(this._scissor);
|
|
151
|
-
device.setProgram(programInfo.program);
|
|
152
|
-
device.setBindGroup(0, programInfo.bindGroup);
|
|
153
|
-
device.setRenderStates(this._renderStates ?? getBlitRenderStateSet());
|
|
154
|
-
getBlitPrimitive2D().draw();
|
|
155
|
-
}
|
|
156
|
-
/** @internal */ blit2DArray(source, dest, layer, sampler) {
|
|
157
|
-
const device = Application.instance.device;
|
|
158
|
-
const flip = !dest && device.type === 'webgpu';
|
|
159
|
-
const bilinearFiltering = sampler ? sampler.magFilter === 'linear' || sampler.minFilter === 'linear' || sampler.mipFilter === 'linear' : source.isFilterable();
|
|
160
|
-
const programInfo = getBlitProgram('2d-array', this, bilinearFiltering, source.isIntegerFormat() ? source.isSignedFormat() ? 'int' : 'uint' : 'float', flip);
|
|
161
|
-
programInfo.bindGroup.setTexture('srcTex', source, sampler);
|
|
162
|
-
programInfo.bindGroup.setValue('srcLayer', layer);
|
|
163
|
-
this.setUniforms(programInfo.bindGroup, source);
|
|
164
|
-
device.setFramebuffer(dest ?? null);
|
|
165
|
-
device.setViewport(this._viewport);
|
|
166
|
-
device.setScissor(this._scissor);
|
|
167
|
-
device.setProgram(programInfo.program);
|
|
168
|
-
device.setBindGroup(0, programInfo.bindGroup);
|
|
169
|
-
device.setRenderStates(this._renderStates ?? getBlitRenderStateSet());
|
|
170
|
-
getBlitPrimitive2D().draw();
|
|
171
|
-
}
|
|
172
|
-
/** @internal */ blitCubeMap(source, dest, face, sampler) {
|
|
173
|
-
const device = Application.instance.device;
|
|
174
|
-
const flip = !dest && device.type === 'webgpu';
|
|
175
|
-
const bilinearFiltering = sampler ? sampler.magFilter === 'linear' || sampler.minFilter === 'linear' || sampler.mipFilter === 'linear' : source.isFilterable();
|
|
176
|
-
const programInfo = getBlitProgram('cube', this, bilinearFiltering, source.isIntegerFormat() ? source.isSignedFormat() ? 'int' : 'uint' : 'float', flip);
|
|
177
|
-
programInfo.bindGroup.setTexture('srcTex', source, sampler);
|
|
178
|
-
programInfo.bindGroup.setValue('texelSize', 1 / source.width);
|
|
179
|
-
programInfo.bindGroup.setValue('cubeFace', face);
|
|
180
|
-
this.setUniforms(programInfo.bindGroup, source);
|
|
181
|
-
device.setFramebuffer(dest ?? null);
|
|
182
|
-
device.setViewport(this._viewport);
|
|
183
|
-
device.setScissor(this._scissor);
|
|
184
|
-
device.setProgram(programInfo.program);
|
|
185
|
-
device.setBindGroup(0, programInfo.bindGroup);
|
|
186
|
-
device.setRenderStates(this._renderStates ?? getBlitRenderStateSet());
|
|
187
|
-
getBlitPrimitive2D().draw();
|
|
188
|
-
}
|
|
189
|
-
blit(source, dest, layer, sampler) {
|
|
190
|
-
const device = Application.instance.device;
|
|
191
|
-
device.pushDeviceStates();
|
|
192
|
-
if (!dest) {
|
|
193
|
-
if (source.isTexture2D()) {
|
|
194
|
-
this.blit2D(source, null, sampler);
|
|
195
|
-
} else if (source.isTexture2DArray()) {
|
|
196
|
-
this.blit2DArray(source, null, layer || 0, sampler);
|
|
197
|
-
} else if (source.isTextureCube()) {
|
|
198
|
-
this.blitCubeMap(source, null, layer || 0, sampler);
|
|
199
|
-
} else {
|
|
200
|
-
throw new Error('Blitter.blit() failed: invalid texture type');
|
|
201
|
-
}
|
|
202
|
-
} else {
|
|
203
|
-
const framebuffer = dest.isFramebuffer() ? dest : device.pool.createTemporalFramebuffer(false, [
|
|
204
|
-
dest
|
|
205
|
-
], null);
|
|
206
|
-
const destTexture = dest.isFramebuffer() ? dest.getColorAttachments()?.[0] : dest;
|
|
207
|
-
if (source.isTexture2D()) {
|
|
208
|
-
if (!destTexture?.isTexture2D() && !destTexture?.isTexture2DArray()) {
|
|
209
|
-
throw new Error('Blitter.blit() failed: invalid destination texture type');
|
|
210
|
-
}
|
|
211
|
-
if (destTexture.isTexture2DArray()) {
|
|
212
|
-
framebuffer.setColorAttachmentLayer(0, layer || 0);
|
|
213
|
-
}
|
|
214
|
-
this.blit2D(source, framebuffer, sampler);
|
|
215
|
-
} else if (source.isTexture2DArray()) {
|
|
216
|
-
if (!destTexture?.isTexture2D() && !destTexture.isTexture2DArray()) {
|
|
217
|
-
throw new Error('Blitter.blit() failed: invalid destination texture type');
|
|
218
|
-
}
|
|
219
|
-
if (destTexture.isTexture2D()) {
|
|
220
|
-
this.blit2DArray(source, framebuffer, layer || 0, sampler);
|
|
221
|
-
} else {
|
|
222
|
-
const n = Math.min(source.depth, destTexture.depth);
|
|
223
|
-
for(let i = 0; i < n; i++){
|
|
224
|
-
framebuffer.setColorAttachmentLayer(0, i);
|
|
225
|
-
this.blit2DArray(source, framebuffer, i, layer);
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
} else if (source.isTextureCube()) {
|
|
229
|
-
if (!destTexture.isTextureCube() && !destTexture.isTexture2D()) {
|
|
230
|
-
throw new Error('Blitter.blit() failed: invalid destination texture type');
|
|
231
|
-
}
|
|
232
|
-
if (destTexture.isTextureCube()) {
|
|
233
|
-
for(let i = 0; i < 6; i++){
|
|
234
|
-
framebuffer.setColorAttachmentCubeFace(0, i);
|
|
235
|
-
this.blitCubeMap(source, framebuffer, i, layer);
|
|
236
|
-
}
|
|
237
|
-
} else {
|
|
238
|
-
this.blitCubeMap(source, framebuffer, layer || 0, sampler);
|
|
239
|
-
}
|
|
240
|
-
} else {
|
|
241
|
-
throw new Error('Blitter.blit() failed: invalid texture type');
|
|
242
|
-
}
|
|
243
|
-
if (framebuffer && framebuffer !== dest) {
|
|
244
|
-
device.pool.releaseFrameBuffer(framebuffer);
|
|
245
|
-
}
|
|
246
|
-
}
|
|
247
|
-
device.popDeviceStates();
|
|
248
|
-
}
|
|
249
|
-
}
|
|
250
|
-
const blitProgramCache = {};
|
|
251
|
-
let blitPrimitive2D = null;
|
|
252
|
-
let blitRenderStates = null;
|
|
253
|
-
function getBlitPrimitive2D() {
|
|
254
|
-
if (!blitPrimitive2D) {
|
|
255
|
-
blitPrimitive2D = new Primitive();
|
|
256
|
-
blitPrimitive2D.createAndSetVertexBuffer('position_f32x2', new Float32Array([
|
|
257
|
-
-1,
|
|
258
|
-
-1,
|
|
259
|
-
1,
|
|
260
|
-
-1,
|
|
261
|
-
-1,
|
|
262
|
-
1,
|
|
263
|
-
1,
|
|
264
|
-
1
|
|
265
|
-
]));
|
|
266
|
-
blitPrimitive2D.indexCount = 4;
|
|
267
|
-
blitPrimitive2D.indexStart = 0;
|
|
268
|
-
blitPrimitive2D.primitiveType = 'triangle-strip';
|
|
269
|
-
}
|
|
270
|
-
return blitPrimitive2D;
|
|
271
|
-
}
|
|
272
|
-
function getBlitRenderStateSet() {
|
|
273
|
-
if (!blitRenderStates) {
|
|
274
|
-
blitRenderStates = Application.instance.device.createRenderStateSet();
|
|
275
|
-
blitRenderStates.useDepthState().enableTest(false).enableWrite(false);
|
|
276
|
-
blitRenderStates.useRasterizerState().setCullMode('none');
|
|
277
|
-
}
|
|
278
|
-
return blitRenderStates;
|
|
279
|
-
}
|
|
280
|
-
function getBlitProgram(type, filter, bilinearFiltering, sampleType, flip) {
|
|
281
|
-
const hash = `${type}:${filter.hash}:${bilinearFiltering}:${sampleType}:${flip ? 1 : 0}`;
|
|
282
|
-
let programInfo = blitProgramCache[hash];
|
|
283
|
-
if (programInfo === undefined) {
|
|
284
|
-
programInfo = createBlitProgram(type, filter, bilinearFiltering, sampleType, flip, !!filter.destRect) || null;
|
|
285
|
-
blitProgramCache[hash] = programInfo;
|
|
286
|
-
}
|
|
287
|
-
return programInfo;
|
|
288
|
-
}
|
|
289
|
-
function createBlitProgram(type, filter, bilinearFiltering, st, flip, scaleBias) {
|
|
290
|
-
const program = Application.instance.device.buildRenderProgram({
|
|
291
|
-
vertex (pb) {
|
|
292
|
-
this.$inputs.pos = pb.vec2().attrib('position');
|
|
293
|
-
this.$outputs.uv = pb.vec2();
|
|
294
|
-
if (scaleBias) {
|
|
295
|
-
this.scaleBias = pb.vec4().uniform(0);
|
|
296
|
-
}
|
|
297
|
-
filter.setup(this, type);
|
|
298
|
-
pb.main(function() {
|
|
299
|
-
this.$builtins.position = pb.vec4(this.$inputs.pos, 1, 1);
|
|
300
|
-
this.$outputs.uv = type === 'cube' ? pb.mul(pb.vec2(1, -1), this.$inputs.pos.xy) : pb.add(pb.mul(this.$inputs.pos.xy, 0.5), pb.vec2(0.5));
|
|
301
|
-
if (Application.instance.device.type === 'webgpu') {
|
|
302
|
-
this.$builtins.position.y = pb.neg(this.$builtins.position.y);
|
|
303
|
-
}
|
|
304
|
-
if (scaleBias) {
|
|
305
|
-
this.$l.xy = pb.add(pb.mul(this.$builtins.position.xy, this.scaleBias.xy), this.scaleBias.zw);
|
|
306
|
-
this.$builtins.position = pb.vec4(this.xy, 1, 1);
|
|
307
|
-
}
|
|
308
|
-
});
|
|
309
|
-
},
|
|
310
|
-
fragment (pb) {
|
|
311
|
-
switch(type){
|
|
312
|
-
case '2d':
|
|
313
|
-
if (st === 'int') {
|
|
314
|
-
this.srcTex = pb.itex2D().sampleType('sint').uniform(0);
|
|
315
|
-
} else if (st === 'uint') {
|
|
316
|
-
this.srcTex = pb.utex2D().sampleType('uint').uniform(0);
|
|
317
|
-
} else if (st === 'depth') {
|
|
318
|
-
this.srcTex = pb.tex2DShadow().uniform(0);
|
|
319
|
-
} else {
|
|
320
|
-
this.srcTex = pb.tex2D().sampleType(bilinearFiltering ? 'float' : 'unfilterable-float').uniform(0);
|
|
321
|
-
}
|
|
322
|
-
break;
|
|
323
|
-
case '2d-array':
|
|
324
|
-
if (st === 'int') {
|
|
325
|
-
this.srcTex = pb.itex2DArray().sampleType('sint').uniform(0);
|
|
326
|
-
} else if (st === 'uint') {
|
|
327
|
-
this.srcTex = pb.utex2DArray().sampleType('uint').uniform(0);
|
|
328
|
-
} else if (st === 'depth') {
|
|
329
|
-
this.srcTex = pb.tex2DArrayShadow().uniform(0);
|
|
330
|
-
} else {
|
|
331
|
-
this.srcTex = pb.tex2DArray().sampleType(bilinearFiltering ? 'float' : 'unfilterable-float').uniform(0);
|
|
332
|
-
}
|
|
333
|
-
this.srcLayer = pb.int().uniform(0);
|
|
334
|
-
break;
|
|
335
|
-
case 'cube':
|
|
336
|
-
if (st === 'int') {
|
|
337
|
-
this.srcTex = pb.itexCube().sampleType('sint').uniform(0);
|
|
338
|
-
} else if (st === 'uint') {
|
|
339
|
-
this.srcTex = pb.utexCube().sampleType('uint').uniform(0);
|
|
340
|
-
} else if (st === 'depth') {
|
|
341
|
-
this.srcTex = pb.texCubeShadow().uniform(0);
|
|
342
|
-
} else {
|
|
343
|
-
this.srcTex = pb.texCube().sampleType(bilinearFiltering ? 'float' : 'unfilterable-float').uniform(0);
|
|
344
|
-
}
|
|
345
|
-
this.texelSize = pb.float().uniform(0);
|
|
346
|
-
this.cubeFace = pb.int().uniform(0);
|
|
347
|
-
break;
|
|
348
|
-
default:
|
|
349
|
-
throw new Error(`invalid blit type: ${type}`);
|
|
350
|
-
}
|
|
351
|
-
this.$outputs.outColor = pb.vec4();
|
|
352
|
-
filter.setup(this, type);
|
|
353
|
-
pb.main(function() {
|
|
354
|
-
if (type === 'cube') {
|
|
355
|
-
this.uv = pb.vec3();
|
|
356
|
-
this.$if(pb.equal(this.cubeFace, 0), function() {
|
|
357
|
-
this.uv = pb.vec3(1, this.$inputs.uv.y, pb.neg(this.$inputs.uv.x));
|
|
358
|
-
}).$elseif(pb.equal(this.cubeFace, 1), function() {
|
|
359
|
-
this.uv = pb.vec3(-1, this.$inputs.uv.y, this.$inputs.uv.x);
|
|
360
|
-
}).$elseif(pb.equal(this.cubeFace, 2), function() {
|
|
361
|
-
this.uv = pb.vec3(this.$inputs.uv.x, 1, pb.neg(this.$inputs.uv.y));
|
|
362
|
-
}).$elseif(pb.equal(this.cubeFace, 3), function() {
|
|
363
|
-
this.uv = pb.vec3(this.$inputs.uv.x, -1, this.$inputs.uv.y);
|
|
364
|
-
}).$elseif(pb.equal(this.cubeFace, 4), function() {
|
|
365
|
-
this.uv = pb.vec3(this.$inputs.uv.x, this.$inputs.uv.y, 1);
|
|
366
|
-
}).$else(function() {
|
|
367
|
-
this.uv = pb.vec3(pb.neg(this.$inputs.uv.x), this.$inputs.uv.y, -1);
|
|
368
|
-
});
|
|
369
|
-
} else {
|
|
370
|
-
this.uv = this.$inputs.uv;
|
|
371
|
-
}
|
|
372
|
-
if (flip) {
|
|
373
|
-
this.uv.y = pb.sub(1, this.uv.y);
|
|
374
|
-
}
|
|
375
|
-
this.$l.outTexel = filter.filter(this, type, this.srcTex, this.uv, type === '2d' ? null : this.srcLayer, st);
|
|
376
|
-
this.$outputs.outColor = filter.writeTexel(this, type, this.$inputs.uv, this.outTexel);
|
|
377
|
-
if (filter.srgbOut) {
|
|
378
|
-
this.$outputs.outColor = pb.vec4(linearToGamma(this, this.$outputs.outColor.rgb), this.$outputs.outColor.a);
|
|
379
|
-
}
|
|
380
|
-
});
|
|
381
|
-
}
|
|
382
|
-
});
|
|
383
|
-
return program ? {
|
|
384
|
-
program,
|
|
385
|
-
bindGroup: Application.instance.device.createBindGroup(program.bindGroupLayouts[0])
|
|
386
|
-
} : null;
|
|
387
|
-
}
|
|
388
|
-
|
|
389
|
-
export { Blitter };
|
|
390
|
-
//# sourceMappingURL=blitter.js.map
|