@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 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"gltf_loader.js","sources":["../../../../../src/asset/loaders/gltf/gltf_loader.ts"],"sourcesContent":["import type { DecoderModule } from 'draco3d';\r\nimport type { InterpolationMode, TypedArray, VFS } from '@zephyr3d/base';\r\nimport { Vector3, Vector4, Matrix4x4, Quaternion, Interpolator, DRef } from '@zephyr3d/base';\r\nimport type {\r\n AssetHierarchyNode,\r\n AssetMeshData,\r\n AssetAnimationData,\r\n AssetSubMeshData,\r\n AssetMaterial,\r\n AssetUnlitMaterial,\r\n AssetPBRMaterialMR,\r\n AssetPBRMaterialSG,\r\n AssetMaterialCommon,\r\n MaterialTextureInfo,\r\n AssetPBRMaterialCommon,\r\n AssetAnimationTrack\r\n} from '../../model';\r\nimport { SharedModel, AssetSkeleton, AssetScene } from '../../model';\r\nimport { BoundingBox } from '../../../utility/bounding_volume';\r\nimport { Primitive } from '../../../render/primitive';\r\nimport type { MeshMaterial as M } from '../../../material/meshmaterial';\r\nimport { UnlitMaterial } from '../../../material';\r\nimport { ComponentType, GLTFAccessor } from './helpers';\r\nimport { AbstractModelLoader } from '../loader';\r\nimport type {\r\n PrimitiveType,\r\n VertexSemantic,\r\n GPUDataBuffer,\r\n Texture2D,\r\n IndexBuffer,\r\n StructuredBuffer,\r\n TextureAddressMode,\r\n TextureFilterMode,\r\n AbstractDevice\r\n} from '@zephyr3d/device';\r\nimport type { AssetManager } from '../../assetmanager';\r\nimport type { AnimationChannel, AnimationSampler, GlTf, Material, TextureInfo } from './gltf';\r\nimport { Application } from '../../../app/app';\r\nimport { PBRMetallicRoughnessMaterial } from '../../../material/pbrmr';\r\nimport { PBRSpecularGlossinessMaterial } from '../../../material/pbrsg';\r\nimport { DracoMeshDecoder } from '../../../utility/draco/decoder';\r\nimport {\r\n MORPH_TARGET_COLOR,\r\n MORPH_TARGET_NORMAL,\r\n MORPH_TARGET_POSITION,\r\n MORPH_TARGET_TANGENT,\r\n MORPH_TARGET_TEX0,\r\n MORPH_TARGET_TEX1,\r\n MORPH_TARGET_TEX2,\r\n MORPH_TARGET_TEX3\r\n} from '../../../values';\r\n/** @internal */\r\nexport interface GLTFContent extends GlTf {\r\n _manager: AssetManager;\r\n _vfs: VFS;\r\n _loadedBuffers: ArrayBuffer[];\r\n _accessors: GLTFAccessor[];\r\n _bufferCache: Record<string, GPUDataBuffer>;\r\n _textureCache: Record<string, Texture2D>;\r\n _materialCache: Record<string, M>;\r\n _nodes: AssetHierarchyNode[];\r\n _meshes: AssetMeshData[];\r\n _device: AbstractDevice;\r\n _dracoModule?: DecoderModule;\r\n}\r\n\r\n/**\r\n * The GLTF/GLB model loader\r\n * @internal\r\n */\r\nexport class GLTFLoader extends AbstractModelLoader {\r\n supportMIMEType(mimeType: string): boolean {\r\n return mimeType === 'model/gltf+json' || mimeType === 'model/gltf-binary';\r\n }\r\n async load(\r\n assetManager: AssetManager,\r\n url: string,\r\n mimeType: string,\r\n data: Blob,\r\n decoderModule?: DecoderModule\r\n ) {\r\n const buffer = await data.arrayBuffer();\r\n if (this.isGLB(buffer)) {\r\n return this.loadBinary(assetManager, url, buffer, assetManager.vfs, decoderModule);\r\n }\r\n const gltf = (await new Response(data).json()) as GLTFContent;\r\n gltf._manager = assetManager;\r\n gltf._device = Application.instance.device;\r\n gltf._vfs = assetManager.vfs;\r\n gltf._loadedBuffers = null;\r\n return this.loadJson(url, gltf, decoderModule);\r\n }\r\n async loadBinary(\r\n assetManager: AssetManager,\r\n url: string,\r\n buffer: ArrayBuffer,\r\n vfs: VFS,\r\n decoderModule?: DecoderModule\r\n ): Promise<SharedModel> {\r\n const jsonChunkType = 0x4e4f534a;\r\n const binaryChunkType = 0x004e4942;\r\n let gltf: GLTFContent = null;\r\n const buffers: ArrayBuffer[] = [];\r\n const chunkInfos = this.getGLBChunkInfos(buffer);\r\n for (const info of chunkInfos) {\r\n if (info.type === jsonChunkType && !gltf) {\r\n const jsonSlice = new Uint8Array(buffer, 20, info.length);\r\n const stringBuffer = new TextDecoder('utf-8').decode(jsonSlice);\r\n gltf = JSON.parse(stringBuffer);\r\n } else if (info.type === binaryChunkType) {\r\n buffers.push(buffer.slice(info.start, info.start + info.length));\r\n }\r\n }\r\n if (gltf) {\r\n gltf._manager = assetManager;\r\n gltf._device = Application.instance.device;\r\n gltf._vfs = vfs;\r\n gltf._loadedBuffers = buffers;\r\n return this.loadJson(url, gltf, decoderModule);\r\n }\r\n return null;\r\n }\r\n async loadJson(url: string, gltf: GLTFContent, dracoDecoderModule?: DecoderModule): Promise<SharedModel> {\r\n // check extensions\r\n if (\r\n !dracoDecoderModule &&\r\n gltf.extensionsRequired &&\r\n gltf.extensionsRequired.indexOf('KHR_draco_mesh_compression') >= 0\r\n ) {\r\n console.error('Draco3d is required for loading model');\r\n return null;\r\n }\r\n gltf._dracoModule = dracoDecoderModule;\r\n gltf._accessors = [];\r\n gltf._bufferCache = {};\r\n gltf._textureCache = {};\r\n gltf._materialCache = {};\r\n gltf._nodes = [];\r\n gltf._meshes = [];\r\n // check asset property\r\n const asset = gltf.asset;\r\n if (asset) {\r\n const gltfVersion = asset.version;\r\n if (gltfVersion !== '2.0') {\r\n console.error(`Invalid GLTF version: ${gltfVersion}`);\r\n return null;\r\n }\r\n }\r\n gltf._baseURI = url.substring(0, url.lastIndexOf('/') + 1);\r\n if (!gltf._loadedBuffers) {\r\n gltf._loadedBuffers = [];\r\n const buffers = gltf.buffers;\r\n if (buffers) {\r\n for (const buffer of buffers) {\r\n const uri = this._normalizeURI(gltf._baseURI, buffer.uri);\r\n const buf = await gltf._manager.fetchBinaryData(uri, null);\r\n if (buffer.byteLength !== buf.byteLength) {\r\n console.error(`Invalid GLTF: buffer byte length error.`);\r\n return null;\r\n }\r\n gltf._loadedBuffers.push(buf);\r\n }\r\n }\r\n }\r\n const accessors = gltf.accessors;\r\n if (accessors) {\r\n for (const accessor of gltf.accessors) {\r\n gltf._accessors.push(new GLTFAccessor(accessor));\r\n }\r\n }\r\n const scenes = gltf.scenes;\r\n if (scenes) {\r\n const sharedModel = new SharedModel();\r\n await this._loadMeshes(gltf);\r\n this._loadNodes(gltf, sharedModel);\r\n this._loadSkins(gltf, sharedModel);\r\n for (let i = 0; i < gltf.nodes?.length; i++) {\r\n if (typeof gltf.nodes[i].skin === 'number' && gltf.nodes[i].skin >= 0) {\r\n gltf._nodes[i].skeleton = sharedModel.skeletons[gltf.nodes[i].skin];\r\n }\r\n }\r\n this._loadAnimations(gltf, sharedModel);\r\n for (const scene of scenes) {\r\n const assetScene = new AssetScene(scene.name);\r\n for (const node of scene.nodes) {\r\n assetScene.rootNodes.push(gltf._nodes[node]);\r\n }\r\n sharedModel.scenes.push(assetScene);\r\n }\r\n if (typeof gltf.scene === 'number') {\r\n sharedModel.activeScene = gltf.scene;\r\n }\r\n return sharedModel;\r\n }\r\n return null;\r\n }\r\n /** @internal */\r\n private _normalizeURI(baseURI: string, uri: string) {\r\n const s = uri.toLowerCase();\r\n if (\r\n s.startsWith('http://') ||\r\n s.startsWith('https://') ||\r\n s.startsWith('blob:') ||\r\n s.startsWith('data:')\r\n ) {\r\n // absolute path\r\n return encodeURI(uri);\r\n }\r\n uri = uri.replace(/\\.\\//g, '');\r\n uri = decodeURIComponent(uri);\r\n if (uri[0] === '/') {\r\n uri = uri.slice(1);\r\n }\r\n uri = uri\r\n .split('/')\r\n .map((val) => encodeURIComponent(val))\r\n .join('/');\r\n return baseURI + uri;\r\n }\r\n /** @internal */\r\n private _loadNodes(gltf: GLTFContent, model: SharedModel) {\r\n if (gltf.nodes) {\r\n for (let i = 0; i < gltf.nodes.length; i++) {\r\n this._loadNode(gltf, i, null, model);\r\n }\r\n for (const node of gltf._nodes) {\r\n if (!node.parent) {\r\n node.computeTransforms(null);\r\n }\r\n }\r\n }\r\n }\r\n /** @internal */\r\n private _loadSkins(gltf: GLTFContent, model: SharedModel) {\r\n if (gltf.skins) {\r\n for (let i = 0; i < gltf.skins.length; i++) {\r\n const skinInfo = gltf.skins[i];\r\n const skeleton = new AssetSkeleton(skinInfo.name);\r\n if (typeof skinInfo.skeleton === 'number') {\r\n skeleton.pivot = gltf._nodes[skinInfo.skeleton];\r\n }\r\n const accessor = gltf._accessors[skinInfo.inverseBindMatrices];\r\n if (!accessor || accessor.type !== 'MAT4' || accessor.componentType !== ComponentType.FLOAT) {\r\n throw new Error('Invalid GLTF inverse bind matricies accessor');\r\n }\r\n const matrices =\r\n typeof skinInfo.inverseBindMatrices === 'number'\r\n ? (accessor.getDeinterlacedView(gltf) as Float32Array)\r\n : null;\r\n skinInfo.joints.forEach((joint, index) => {\r\n const m = index * 16;\r\n skeleton.addJoint(\r\n gltf._nodes[joint],\r\n matrices ? new Matrix4x4(matrices.subarray(m, m + 16)) : Matrix4x4.identity()\r\n );\r\n });\r\n model.addSkeleton(skeleton);\r\n }\r\n }\r\n }\r\n /** @internal */\r\n private _loadAnimations(gltf: GLTFContent, model: SharedModel) {\r\n if (gltf.animations) {\r\n for (let i = 0; i < gltf.animations.length; i++) {\r\n const animation = this._loadAnimation(gltf, i);\r\n model.addAnimation(animation);\r\n }\r\n }\r\n }\r\n /** @internal */\r\n private collectNodes(gltf: GLTFContent): Map<\r\n AssetHierarchyNode,\r\n {\r\n translate: Vector3;\r\n scale: Vector3;\r\n rotation: Quaternion;\r\n worldTransform: Matrix4x4;\r\n }\r\n > {\r\n const collect: Map<\r\n AssetHierarchyNode,\r\n {\r\n translate: Vector3;\r\n scale: Vector3;\r\n rotation: Quaternion;\r\n worldTransform: Matrix4x4;\r\n }\r\n > = new Map();\r\n for (const node of gltf._nodes) {\r\n collect.set(node, {\r\n translate: node.position || Vector3.zero(),\r\n rotation: node.rotation || Quaternion.identity(),\r\n scale: node.scaling || Vector3.one(),\r\n worldTransform: null\r\n });\r\n }\r\n return collect;\r\n }\r\n /** @internal */\r\n private getAnimationInfo(\r\n gltf: GLTFContent,\r\n index: number\r\n ): {\r\n name: string;\r\n channels: AnimationChannel[];\r\n samplers: AnimationSampler[];\r\n interpolatorTypes: ('translation' | 'scale' | 'rotation' | 'weights')[];\r\n interpolators: Interpolator[];\r\n maxTime: number;\r\n nodes: Map<\r\n AssetHierarchyNode,\r\n {\r\n translate: Vector3;\r\n scale: Vector3;\r\n rotation: Quaternion;\r\n worldTransform: Matrix4x4;\r\n }\r\n >;\r\n } {\r\n const animationInfo = gltf.animations[index];\r\n const name = animationInfo.name || null;\r\n const channels = animationInfo.channels;\r\n const samplers = animationInfo.samplers;\r\n const interpolators = [] as Interpolator[];\r\n const interpolatorTypes = [] as ('translation' | 'scale' | 'rotation' | 'weights')[];\r\n const nodes = this.collectNodes(gltf);\r\n let maxTime = 0;\r\n for (let i = 0; i < channels.length; i++) {\r\n const channel = channels[i];\r\n const sampler = samplers[channel.sampler];\r\n const input = gltf._accessors[sampler.input].getNormalizedDeinterlacedView(gltf);\r\n const output = gltf._accessors[sampler.output].getNormalizedDeinterlacedView(gltf);\r\n if (!(input instanceof Float32Array) || !(output instanceof Float32Array)) {\r\n console.error('Input/output channel of animation must be Float32Array');\r\n continue;\r\n }\r\n const mode: InterpolationMode =\r\n sampler.interpolation === 'STEP'\r\n ? 'step'\r\n : sampler.interpolation === 'CUBICSPLINE'\r\n ? 'cubicspline'\r\n : 'linear';\r\n if (channel.target.path === 'rotation') {\r\n interpolators.push(new Interpolator(mode, 'quat', input, output));\r\n interpolatorTypes.push('rotation');\r\n } else if (channel.target.path === 'translation') {\r\n interpolators.push(new Interpolator(mode, 'vec3', input, output));\r\n interpolatorTypes.push('translation');\r\n } else if (channel.target.path === 'scale') {\r\n interpolators.push(new Interpolator(mode, 'vec3', input, output));\r\n interpolatorTypes.push('scale');\r\n } else if (channel.target.path === 'weights') {\r\n interpolators.push(new Interpolator(mode, null, input, output));\r\n interpolatorTypes.push('weights');\r\n } else {\r\n continue;\r\n }\r\n const max = input[input.length - 1];\r\n if (max > maxTime) {\r\n maxTime = max;\r\n }\r\n }\r\n return { name, channels, samplers, interpolators, interpolatorTypes, maxTime, nodes };\r\n }\r\n /** @internal */\r\n private _loadAnimation(gltf: GLTFContent, index: number): AssetAnimationData {\r\n const animationInfo = this.getAnimationInfo(gltf, index);\r\n const animationData: AssetAnimationData = {\r\n name: animationInfo.name,\r\n tracks: [],\r\n skeletons: [],\r\n nodes: []\r\n };\r\n for (let i = 0; i < animationInfo.channels.length; i++) {\r\n const targetNode = gltf._nodes[animationInfo.channels[i].target.node];\r\n const track: AssetAnimationTrack = {\r\n node: targetNode,\r\n type: animationInfo.interpolatorTypes[i],\r\n interpolator: animationInfo.interpolators[i]\r\n };\r\n if (track.type === 'weights') {\r\n track.defaultMorphWeights = targetNode.weights;\r\n }\r\n animationData.tracks.push(track);\r\n if (animationData.nodes.indexOf(targetNode) < 0) {\r\n animationData.nodes.push(targetNode);\r\n }\r\n if (targetNode.skeletonAttached) {\r\n for (const skeleton of targetNode.skeletonAttached) {\r\n if (animationData.skeletons.indexOf(skeleton) < 0) {\r\n animationData.skeletons.push(skeleton);\r\n }\r\n }\r\n }\r\n }\r\n return animationData;\r\n }\r\n /** @internal */\r\n private _loadNode(\r\n gltf: GLTFContent,\r\n nodeIndex: number,\r\n parent: AssetHierarchyNode,\r\n model: SharedModel\r\n ): AssetHierarchyNode {\r\n let node: AssetHierarchyNode = gltf._nodes[nodeIndex];\r\n if (node) {\r\n if (parent) {\r\n if (node.parent) {\r\n throw new Error('invalid node hierarchy');\r\n }\r\n parent.addChild(node);\r\n }\r\n return node;\r\n }\r\n const nodeInfo = gltf.nodes?.[nodeIndex];\r\n if (nodeInfo) {\r\n node = model.addNode(parent, nodeIndex, nodeInfo.name);\r\n if (typeof nodeInfo.mesh === 'number') {\r\n node.mesh = gltf._meshes[nodeInfo.mesh];\r\n if (node.weights) {\r\n node.mesh.morphWeights = node.weights;\r\n }\r\n const instancing = nodeInfo.extensions?.['EXT_mesh_gpu_instancing'];\r\n if (instancing) {\r\n const attributes = instancing.attributes;\r\n if (attributes) {\r\n const accessorTranslation =\r\n typeof attributes.TRANSLATION === 'number' ? gltf._accessors[attributes.TRANSLATION] : null;\r\n const accessorScale =\r\n typeof attributes.SCALE === 'number' ? gltf._accessors[attributes.SCALE] : null;\r\n const accessorRotation =\r\n typeof attributes.ROTATION === 'number' ? gltf._accessors[attributes.ROTATION] : null;\r\n const count = accessorTranslation?.count ?? accessorScale?.count ?? accessorRotation.count ?? 0;\r\n const translationValues = accessorTranslation?.getNormalizedDeinterlacedView(\r\n gltf\r\n ) as Float32Array;\r\n const scaleValues = accessorScale?.getNormalizedDeinterlacedView(gltf) as Float32Array;\r\n const rotationValues = accessorRotation?.getNormalizedDeinterlacedView(gltf) as Float32Array;\r\n for (let i = 0; i < count; i++) {\r\n const t = translationValues\r\n ? new Vector3(\r\n translationValues[i * 3],\r\n translationValues[i * 3 + 1],\r\n translationValues[i * 3 + 2]\r\n )\r\n : Vector3.zero();\r\n const s = scaleValues\r\n ? new Vector3(scaleValues[i * 3], scaleValues[i * 3 + 1], scaleValues[i * 3 + 2])\r\n : Vector3.one();\r\n const r = rotationValues\r\n ? new Quaternion(\r\n rotationValues[i * 4],\r\n rotationValues[i * 4 + 1],\r\n rotationValues[i * 4 + 2],\r\n rotationValues[i * 4 + 3]\r\n )\r\n : Quaternion.identity();\r\n node.instances.push({ t, s, r });\r\n }\r\n }\r\n } else {\r\n node.instances.push({ t: Vector3.zero(), s: Vector3.one(), r: Quaternion.identity() });\r\n }\r\n }\r\n if (!(typeof nodeInfo.skin === 'number') || nodeInfo.skin < 0) {\r\n // GLTF spec: Only the joint transforms are applied to the skinned mesh; the transform of the skinned mesh node MUST be ignored.\r\n if (nodeInfo.matrix) {\r\n const matrix = new Matrix4x4(nodeInfo.matrix);\r\n matrix.decompose(node.scaling, node.rotation, node.position);\r\n } else {\r\n if (nodeInfo.rotation) {\r\n node.rotation.set(nodeInfo.rotation);\r\n }\r\n if (nodeInfo.scale) {\r\n node.scaling.set(nodeInfo.scale);\r\n }\r\n if (nodeInfo.translation) {\r\n node.position.set(nodeInfo.translation);\r\n }\r\n }\r\n }\r\n gltf._nodes[nodeIndex] = node;\r\n if (nodeInfo.children) {\r\n for (const childIndex of nodeInfo.children) {\r\n this._loadNode(gltf, childIndex, node, model);\r\n }\r\n }\r\n } else {\r\n throw new Error(`invalid GLTF node: ${nodeIndex}`);\r\n }\r\n return node;\r\n }\r\n /** @internal */\r\n private async _loadMeshes(gltf: GLTFContent) {\r\n if (gltf.meshes) {\r\n for (let i = 0; i < gltf.meshes.length; i++) {\r\n gltf._meshes[i] = await this._loadMesh(gltf, i);\r\n }\r\n }\r\n }\r\n /** @internal */\r\n private async _loadMesh(gltf: GLTFContent, meshIndex: number): Promise<AssetMeshData> {\r\n const meshInfo = gltf.meshes && gltf.meshes[meshIndex];\r\n let mesh: AssetMeshData = null;\r\n if (meshInfo) {\r\n mesh = {\r\n morphWeights: meshInfo.weights ?? null,\r\n subMeshes: []\r\n };\r\n const primitives = meshInfo.primitives;\r\n const meshName = meshInfo.name || null;\r\n if (primitives) {\r\n for (let i = 0; i < primitives.length; i++) {\r\n const p = primitives[i];\r\n const subMeshData: AssetSubMeshData = {\r\n name: `${meshName}-${i}`,\r\n primitive: new DRef(),\r\n material: new DRef(),\r\n rawPositions: null,\r\n rawBlendIndices: null,\r\n rawJointWeights: null,\r\n numTargets: 0\r\n };\r\n const primitive = new Primitive();\r\n const attributes = p.attributes;\r\n const dracoExtension = gltf._dracoModule ? p.extensions?.['KHR_draco_mesh_compression'] : null;\r\n let dracoMeshDecoder: DracoMeshDecoder = null;\r\n if (dracoExtension) {\r\n const bufferView = gltf.bufferViews && gltf.bufferViews[dracoExtension.bufferView];\r\n if (!bufferView) {\r\n throw new Error('Draco buffer view not set');\r\n }\r\n const arrayBuffer = gltf._loadedBuffers && gltf._loadedBuffers[bufferView.buffer];\r\n if (!arrayBuffer) {\r\n throw new Error('Draco buffer view does not point to a valid ArrayBuffer');\r\n }\r\n dracoMeshDecoder = new DracoMeshDecoder(\r\n new Int8Array(arrayBuffer, bufferView.byteOffset ?? 0, bufferView.byteLength),\r\n gltf._dracoModule\r\n );\r\n }\r\n for (const attrib in attributes) {\r\n this._loadVertexBuffer(\r\n gltf,\r\n attrib,\r\n attributes[attrib],\r\n primitive,\r\n subMeshData,\r\n dracoExtension,\r\n dracoMeshDecoder\r\n );\r\n }\r\n if (p.targets) {\r\n if (Application.instance.device.type === 'webgl') {\r\n // Emulate vertexID for WebGL1 device\r\n if (attributes['TEXCOORD_7'] !== undefined) {\r\n console.error(`Could not load morph target animation`);\r\n p.targets = null;\r\n } else {\r\n const vertexIndices = new Float32Array(primitive.getNumVertices());\r\n for (let i = 0; i < vertexIndices.length; i++) {\r\n vertexIndices[i] = i;\r\n }\r\n primitive.createAndSetVertexBuffer('tex7_f32', vertexIndices);\r\n }\r\n }\r\n }\r\n if (p.targets) {\r\n const targets: AssetSubMeshData['targets'] = {};\r\n const targetBox: AssetSubMeshData['targetBox'] = [];\r\n const targetMap = {\r\n POSITION: MORPH_TARGET_POSITION,\r\n NORMAL: MORPH_TARGET_NORMAL,\r\n TANGENT: MORPH_TARGET_TANGENT,\r\n TEXCOORD_0: MORPH_TARGET_TEX0,\r\n TEXCOORD_1: MORPH_TARGET_TEX1,\r\n TEXCOORD_2: MORPH_TARGET_TEX2,\r\n TEXCOORD_3: MORPH_TARGET_TEX3,\r\n COLOR_0: MORPH_TARGET_COLOR\r\n };\r\n const morphAttribSet = new Set<number>();\r\n for (const target of p.targets) {\r\n for (const k in target) {\r\n const t = targetMap[k];\r\n if (t !== undefined) {\r\n targets[t] = targets[t] ?? { numComponents: 0, data: [] };\r\n const accessorIndex = target[k] as number;\r\n const accessor = gltf._accessors[accessorIndex];\r\n targets[t].numComponents = accessor.getComponentCount(accessor.type);\r\n targets[t].data.push(accessor.getNormalizedDeinterlacedView(gltf) as Float32Array);\r\n if (k === 'POSITION') {\r\n const min = accessor.min\r\n ? new Vector3(accessor.min[0], accessor.min[1], accessor.min[2])\r\n : Vector3.zero();\r\n const max = accessor.max\r\n ? new Vector3(accessor.max[0], accessor.max[1], accessor.max[2])\r\n : Vector3.zero();\r\n targetBox.push(new BoundingBox(min, max));\r\n }\r\n morphAttribSet.add(t);\r\n }\r\n }\r\n }\r\n subMeshData.numTargets = p.targets.length;\r\n subMeshData.targets = targets;\r\n subMeshData.targetBox = targetBox;\r\n subMeshData.morphAttribCount = morphAttribSet.size;\r\n }\r\n const indices = p.indices;\r\n if (typeof indices === 'number') {\r\n this._loadIndexBuffer(gltf, indices, primitive, subMeshData, dracoExtension, dracoMeshDecoder);\r\n }\r\n let primitiveType = p.mode;\r\n if (typeof primitiveType !== 'number') {\r\n primitiveType = 4;\r\n }\r\n primitive.primitiveType = this._primitiveType(primitiveType);\r\n const hasVertexNormal = !!primitive.getVertexBuffer('normal');\r\n const hasVertexColor = !!primitive.getVertexBuffer('diffuse');\r\n const hasVertexTangent = !!primitive.getVertexBuffer('tangent');\r\n const materialHash = `${p.material}.${Number(hasVertexNormal)}.${Number(hasVertexColor)}.${Number(\r\n hasVertexTangent\r\n )}`;\r\n let material = gltf._materialCache[materialHash];\r\n if (!material) {\r\n const materialInfo = p.material !== undefined ? gltf.materials[p.material] : null;\r\n material = await this._loadMaterial(\r\n gltf,\r\n materialInfo,\r\n hasVertexColor,\r\n hasVertexNormal,\r\n hasVertexTangent\r\n );\r\n gltf._materialCache[materialHash] = material;\r\n }\r\n subMeshData.primitive.set(primitive);\r\n subMeshData.material.set(material);\r\n mesh.subMeshes.push(subMeshData);\r\n }\r\n }\r\n }\r\n return mesh;\r\n }\r\n private async _createMaterial(assetMaterial: AssetMaterial): Promise<M> {\r\n if (assetMaterial.type === 'unlit') {\r\n const unlitAssetMaterial = assetMaterial as AssetUnlitMaterial;\r\n const unlitMaterial = new UnlitMaterial();\r\n unlitMaterial.albedoColor = unlitAssetMaterial.diffuse ?? Vector4.one();\r\n if (unlitAssetMaterial.diffuseMap) {\r\n unlitMaterial.albedoTexture = unlitAssetMaterial.diffuseMap.texture;\r\n unlitMaterial.albedoTextureSampler = unlitAssetMaterial.diffuseMap.sampler;\r\n unlitMaterial.albedoTexCoordIndex = unlitAssetMaterial.diffuseMap.texCoord;\r\n unlitMaterial.albedoTexCoordMatrix = unlitAssetMaterial.diffuseMap.transform;\r\n }\r\n unlitMaterial.vertexColor = unlitAssetMaterial.common.vertexColor;\r\n if (assetMaterial.common.alphaMode === 'blend') {\r\n unlitMaterial.blendMode = 'blend';\r\n } else if (assetMaterial.common.alphaMode === 'mask') {\r\n unlitMaterial.alphaCutoff = assetMaterial.common.alphaCutoff;\r\n }\r\n if (assetMaterial.common.doubleSided) {\r\n unlitMaterial.cullMode = 'none';\r\n }\r\n return unlitMaterial;\r\n } else if (assetMaterial.type === 'pbrSpecularGlossiness') {\r\n const assetPBRMaterial = assetMaterial as AssetPBRMaterialSG;\r\n const pbrMaterial = new PBRSpecularGlossinessMaterial();\r\n pbrMaterial.ior = assetPBRMaterial.ior;\r\n pbrMaterial.albedoColor = assetPBRMaterial.diffuse;\r\n pbrMaterial.specularFactor = new Vector3(\r\n assetPBRMaterial.specular.x,\r\n assetPBRMaterial.specular.y,\r\n assetPBRMaterial.specular.z\r\n );\r\n pbrMaterial.glossinessFactor = assetPBRMaterial.glossness;\r\n if (assetPBRMaterial.diffuseMap) {\r\n pbrMaterial.albedoTexture = assetPBRMaterial.diffuseMap.texture;\r\n pbrMaterial.albedoTextureSampler = assetPBRMaterial.diffuseMap.sampler;\r\n pbrMaterial.albedoTexCoordIndex = assetPBRMaterial.diffuseMap.texCoord;\r\n pbrMaterial.albedoTexCoordMatrix = assetPBRMaterial.diffuseMap.transform;\r\n }\r\n if (assetPBRMaterial.common.normalMap) {\r\n pbrMaterial.normalTexture = assetPBRMaterial.common.normalMap.texture;\r\n pbrMaterial.normalTextureSampler = assetPBRMaterial.common.normalMap.sampler;\r\n pbrMaterial.normalTexCoordIndex = assetPBRMaterial.common.normalMap.texCoord;\r\n pbrMaterial.normalTexCoordMatrix = assetPBRMaterial.common.normalMap.transform;\r\n }\r\n pbrMaterial.normalScale = assetPBRMaterial.common.bumpScale;\r\n if (assetPBRMaterial.common.emissiveMap) {\r\n pbrMaterial.emissiveTexture = assetPBRMaterial.common.emissiveMap.texture;\r\n pbrMaterial.emissiveTextureSampler = assetPBRMaterial.common.emissiveMap.sampler;\r\n pbrMaterial.emissiveTexCoordIndex = assetPBRMaterial.common.emissiveMap.texCoord;\r\n pbrMaterial.emissiveTexCoordMatrix = assetPBRMaterial.common.emissiveMap.transform;\r\n }\r\n pbrMaterial.emissiveColor = assetPBRMaterial.common.emissiveColor;\r\n pbrMaterial.emissiveStrength = assetPBRMaterial.common.emissiveStrength;\r\n if (assetPBRMaterial.common.occlusionMap) {\r\n pbrMaterial.occlusionTexture = assetPBRMaterial.common.occlusionMap.texture;\r\n pbrMaterial.occlusionTextureSampler = assetPBRMaterial.common.occlusionMap.sampler;\r\n pbrMaterial.occlusionTexCoordIndex = assetPBRMaterial.common.occlusionMap.texCoord;\r\n pbrMaterial.occlusionTexCoordMatrix = assetPBRMaterial.common.occlusionMap.transform;\r\n }\r\n pbrMaterial.occlusionStrength = assetPBRMaterial.common.occlusionStrength;\r\n if (assetPBRMaterial.specularGlossnessMap) {\r\n pbrMaterial.specularTexture = assetPBRMaterial.specularGlossnessMap.texture;\r\n pbrMaterial.specularTextureSampler = assetPBRMaterial.specularGlossnessMap.sampler;\r\n pbrMaterial.specularTexCoordIndex = assetPBRMaterial.specularGlossnessMap.texCoord;\r\n pbrMaterial.specularTexCoordMatrix = assetPBRMaterial.specularGlossnessMap.transform;\r\n }\r\n pbrMaterial.vertexTangent = assetPBRMaterial.common.useTangent;\r\n pbrMaterial.vertexColor = assetPBRMaterial.common.vertexColor;\r\n if (assetPBRMaterial.common.alphaMode === 'blend') {\r\n pbrMaterial.blendMode = 'blend';\r\n } else if (assetPBRMaterial.common.alphaMode === 'mask') {\r\n pbrMaterial.alphaCutoff = assetPBRMaterial.common.alphaCutoff;\r\n }\r\n if (assetPBRMaterial.common.doubleSided) {\r\n pbrMaterial.cullMode = 'none';\r\n }\r\n pbrMaterial.vertexNormal = !!assetMaterial.common.vertexNormal;\r\n return pbrMaterial;\r\n } else if (assetMaterial.type === 'pbrMetallicRoughness') {\r\n const assetPBRMaterial = assetMaterial as AssetPBRMaterialMR;\r\n const pbrMaterial = new PBRMetallicRoughnessMaterial();\r\n pbrMaterial.ior = assetPBRMaterial.ior;\r\n pbrMaterial.albedoColor = assetPBRMaterial.diffuse;\r\n pbrMaterial.metallic = assetPBRMaterial.metallic;\r\n pbrMaterial.roughness = assetPBRMaterial.roughness;\r\n if (assetPBRMaterial.diffuseMap) {\r\n pbrMaterial.albedoTexture = assetPBRMaterial.diffuseMap.texture;\r\n pbrMaterial.albedoTextureSampler = assetPBRMaterial.diffuseMap.sampler;\r\n pbrMaterial.albedoTexCoordIndex = assetPBRMaterial.diffuseMap.texCoord;\r\n pbrMaterial.albedoTexCoordMatrix = assetPBRMaterial.diffuseMap.transform;\r\n }\r\n if (assetPBRMaterial.common.normalMap) {\r\n pbrMaterial.normalTexture = assetPBRMaterial.common.normalMap.texture;\r\n pbrMaterial.normalTextureSampler = assetPBRMaterial.common.normalMap.sampler;\r\n pbrMaterial.normalTexCoordIndex = assetPBRMaterial.common.normalMap.texCoord;\r\n pbrMaterial.normalTexCoordMatrix = assetPBRMaterial.common.normalMap.transform;\r\n }\r\n pbrMaterial.normalScale = assetPBRMaterial.common.bumpScale;\r\n if (assetPBRMaterial.common.emissiveMap) {\r\n pbrMaterial.emissiveTexture = assetPBRMaterial.common.emissiveMap.texture;\r\n pbrMaterial.emissiveTextureSampler = assetPBRMaterial.common.emissiveMap.sampler;\r\n pbrMaterial.emissiveTexCoordIndex = assetPBRMaterial.common.emissiveMap.texCoord;\r\n pbrMaterial.emissiveTexCoordMatrix = assetPBRMaterial.common.emissiveMap.transform;\r\n }\r\n pbrMaterial.emissiveColor = assetPBRMaterial.common.emissiveColor;\r\n pbrMaterial.emissiveStrength = assetPBRMaterial.common.emissiveStrength;\r\n if (assetPBRMaterial.common.occlusionMap) {\r\n pbrMaterial.occlusionTexture = assetPBRMaterial.common.occlusionMap.texture;\r\n pbrMaterial.occlusionTextureSampler = assetPBRMaterial.common.occlusionMap.sampler;\r\n pbrMaterial.occlusionTexCoordIndex = assetPBRMaterial.common.occlusionMap.texCoord;\r\n pbrMaterial.occlusionTexCoordMatrix = assetPBRMaterial.common.occlusionMap.transform;\r\n pbrMaterial.occlusionStrength = assetPBRMaterial.common.occlusionStrength;\r\n }\r\n if (assetPBRMaterial.metallicMap) {\r\n pbrMaterial.metallicRoughnessTexture = assetPBRMaterial.metallicMap.texture;\r\n pbrMaterial.metallicRoughnessTextureSampler = assetPBRMaterial.metallicMap.sampler;\r\n pbrMaterial.metallicRoughnessTexCoordIndex = assetPBRMaterial.metallicMap.texCoord;\r\n pbrMaterial.metallicRoughnessTexCoordMatrix = assetPBRMaterial.metallicMap.transform;\r\n }\r\n pbrMaterial.specularFactor = assetPBRMaterial.specularFactor;\r\n if (assetPBRMaterial.specularMap) {\r\n pbrMaterial.specularTexture = assetPBRMaterial.specularMap.texture;\r\n pbrMaterial.specularTextureSampler = assetPBRMaterial.specularMap.sampler;\r\n pbrMaterial.specularTexCoordIndex = assetPBRMaterial.specularMap.texCoord;\r\n pbrMaterial.specularTexCoordMatrix = assetPBRMaterial.specularMap.transform;\r\n }\r\n if (assetPBRMaterial.specularColorMap) {\r\n pbrMaterial.specularColorTexture = assetPBRMaterial.specularColorMap.texture;\r\n pbrMaterial.specularColorTextureSampler = assetPBRMaterial.specularColorMap.sampler;\r\n pbrMaterial.specularColorTexCoordIndex = assetPBRMaterial.specularColorMap.texCoord;\r\n pbrMaterial.specularColorTexCoordMatrix = assetPBRMaterial.specularColorMap.transform;\r\n }\r\n if (assetPBRMaterial.sheen) {\r\n const sheen = assetPBRMaterial.sheen;\r\n pbrMaterial.sheen = true;\r\n pbrMaterial.sheenColorFactor = sheen.sheenColorFactor;\r\n pbrMaterial.sheenRoughnessFactor = sheen.sheenRoughnessFactor;\r\n if (sheen.sheenColorMap) {\r\n pbrMaterial.sheenColorTexture = sheen.sheenColorMap.texture;\r\n pbrMaterial.sheenColorTextureSampler = sheen.sheenColorMap.sampler;\r\n pbrMaterial.sheenColorTexCoordIndex = sheen.sheenColorMap.texCoord;\r\n pbrMaterial.sheenColorTexCoordMatrix = sheen.sheenColorMap.transform;\r\n }\r\n if (sheen.sheenRoughnessMap) {\r\n pbrMaterial.sheenRoughnessTexture = sheen.sheenRoughnessMap.texture;\r\n pbrMaterial.sheenRoughnessTextureSampler = sheen.sheenRoughnessMap.sampler;\r\n pbrMaterial.sheenRoughnessTexCoordIndex = sheen.sheenRoughnessMap.texCoord;\r\n pbrMaterial.sheenRoughnessTexCoordMatrix = sheen.sheenRoughnessMap.transform;\r\n }\r\n }\r\n if (assetPBRMaterial.iridescence) {\r\n const iridescence = assetPBRMaterial.iridescence;\r\n pbrMaterial.iridescence = true;\r\n pbrMaterial.iridescenceFactor = iridescence.iridescenceFactor;\r\n pbrMaterial.iridescenceIor = iridescence.iridescenceIor;\r\n if (iridescence.iridescenceMap) {\r\n pbrMaterial.iridescenceTexture = iridescence.iridescenceMap.texture;\r\n pbrMaterial.iridescenceTextureSampler = iridescence.iridescenceMap.sampler;\r\n pbrMaterial.iridescenceTexCoordIndex = iridescence.iridescenceMap.texCoord;\r\n pbrMaterial.iridescenceTexCoordMatrix = iridescence.iridescenceMap.transform;\r\n }\r\n pbrMaterial.iridescenceThicknessMin = iridescence.iridescenceThicknessMinimum;\r\n pbrMaterial.iridescenceThicknessMax = iridescence.iridescenceThicknessMaximum;\r\n if (iridescence.iridescenceThicknessMap) {\r\n pbrMaterial.iridescenceThicknessTexture = iridescence.iridescenceThicknessMap.texture;\r\n pbrMaterial.iridescenceThicknessTextureSampler = iridescence.iridescenceThicknessMap.sampler;\r\n pbrMaterial.iridescenceThicknessTexCoordIndex = iridescence.iridescenceThicknessMap.texCoord;\r\n pbrMaterial.iridescenceThicknessTexCoordMatrix = iridescence.iridescenceThicknessMap.transform;\r\n }\r\n }\r\n if (assetPBRMaterial.transmission) {\r\n const transmission = assetPBRMaterial.transmission;\r\n pbrMaterial.transmission = true;\r\n pbrMaterial.transmissionFactor = transmission.transmissionFactor;\r\n if (transmission.transmissionMap) {\r\n pbrMaterial.transmissionTexture = transmission.transmissionMap.texture;\r\n pbrMaterial.transmissionTextureSampler = transmission.transmissionMap.sampler;\r\n pbrMaterial.transmissionTexCoordIndex = transmission.transmissionMap.texCoord;\r\n pbrMaterial.transmissionTexCoordMatrix = transmission.transmissionMap.transform;\r\n }\r\n pbrMaterial.thicknessFactor = transmission.thicknessFactor;\r\n if (transmission.thicknessMap) {\r\n pbrMaterial.thicknessTexture = transmission.thicknessMap.texture;\r\n pbrMaterial.thicknessTextureSampler = transmission.thicknessMap.sampler;\r\n pbrMaterial.thicknessTexCoordIndex = transmission.thicknessMap.texCoord;\r\n pbrMaterial.thicknessTexCoordMatrix = transmission.thicknessMap.transform;\r\n }\r\n pbrMaterial.attenuationDistance = transmission.attenuationDistance;\r\n pbrMaterial.attenuationColor = transmission.attenuationColor;\r\n }\r\n if (assetPBRMaterial.clearcoat) {\r\n const cc = assetPBRMaterial.clearcoat;\r\n pbrMaterial.clearcoat = true;\r\n pbrMaterial.clearcoatIntensity = cc.clearCoatFactor;\r\n pbrMaterial.clearcoatRoughnessFactor = cc.clearCoatRoughnessFactor;\r\n if (cc.clearCoatIntensityMap) {\r\n pbrMaterial.clearcoatIntensityTexture = cc.clearCoatIntensityMap.texture;\r\n pbrMaterial.clearcoatIntensityTextureSampler = cc.clearCoatIntensityMap.sampler;\r\n pbrMaterial.clearcoatIntensityTexCoordIndex = cc.clearCoatIntensityMap.texCoord;\r\n pbrMaterial.clearcoatIntensityTexCoordMatrix = cc.clearCoatIntensityMap.transform;\r\n }\r\n if (cc.clearCoatRoughnessMap) {\r\n pbrMaterial.clearcoatRoughnessTexture = cc.clearCoatRoughnessMap.texture;\r\n pbrMaterial.clearcoatRoughnessTextureSampler = cc.clearCoatRoughnessMap.sampler;\r\n pbrMaterial.clearcoatRoughnessTexCoordIndex = cc.clearCoatRoughnessMap.texCoord;\r\n pbrMaterial.clearcoatRoughnessTexCoordMatrix = cc.clearCoatRoughnessMap.transform;\r\n }\r\n if (cc.clearCoatNormalMap) {\r\n pbrMaterial.clearcoatNormalTexture = cc.clearCoatNormalMap.texture;\r\n pbrMaterial.clearcoatNormalTextureSampler = cc.clearCoatNormalMap.sampler;\r\n pbrMaterial.clearcoatNormalTexCoordIndex = cc.clearCoatNormalMap.texCoord;\r\n pbrMaterial.clearcoatNormalTexCoordMatrix = cc.clearCoatNormalMap.transform;\r\n }\r\n }\r\n pbrMaterial.vertexTangent = assetPBRMaterial.common.useTangent;\r\n pbrMaterial.vertexColor = assetPBRMaterial.common.vertexColor;\r\n if (assetPBRMaterial.common.alphaMode === 'blend') {\r\n pbrMaterial.blendMode = 'blend';\r\n } else if (assetPBRMaterial.common.alphaMode === 'mask') {\r\n pbrMaterial.alphaCutoff = assetPBRMaterial.common.alphaCutoff;\r\n }\r\n if (assetPBRMaterial.common.doubleSided) {\r\n pbrMaterial.cullMode = 'none';\r\n }\r\n pbrMaterial.vertexNormal = !!assetMaterial.common.vertexNormal;\r\n return pbrMaterial;\r\n }\r\n }\r\n /** @internal */\r\n private async _loadMaterial(\r\n gltf: GLTFContent,\r\n materialInfo: Material,\r\n vertexColor: boolean,\r\n vertexNormal: boolean,\r\n useTangent: boolean\r\n ): Promise<M> {\r\n let assetMaterial: AssetMaterial = null;\r\n let pbrMetallicRoughness: AssetPBRMaterialMR = null;\r\n let pbrSpecularGlossness: AssetPBRMaterialSG = null;\r\n const pbrCommon: AssetMaterialCommon = {\r\n useTangent,\r\n vertexColor,\r\n vertexNormal,\r\n bumpScale: 1,\r\n emissiveColor: Vector3.zero(),\r\n emissiveStrength: 1,\r\n occlusionStrength: 1\r\n };\r\n switch (materialInfo?.alphaMode) {\r\n case 'BLEND': {\r\n pbrCommon.alphaMode = 'blend';\r\n break;\r\n }\r\n case 'MASK': {\r\n pbrCommon.alphaMode = 'mask';\r\n pbrCommon.alphaCutoff = materialInfo.alphaCutoff ?? 0.5;\r\n break;\r\n }\r\n }\r\n if (materialInfo?.doubleSided) {\r\n pbrCommon.doubleSided = true;\r\n }\r\n if (materialInfo?.pbrMetallicRoughness || materialInfo?.extensions?.KHR_materials_pbrSpecularGlossiness) {\r\n pbrCommon.normalMap = materialInfo.normalTexture\r\n ? await this._loadTexture(gltf, materialInfo.normalTexture, false)\r\n : null;\r\n pbrCommon.bumpScale = materialInfo.normalTexture?.scale ?? 1;\r\n pbrCommon.occlusionMap = materialInfo.occlusionTexture\r\n ? await this._loadTexture(gltf, materialInfo.occlusionTexture, false)\r\n : null;\r\n pbrCommon.occlusionStrength = materialInfo.occlusionTexture?.strength ?? 1;\r\n pbrCommon.emissiveMap = materialInfo.emissiveTexture\r\n ? await this._loadTexture(gltf, materialInfo.emissiveTexture, false)\r\n : null;\r\n pbrCommon.emissiveStrength =\r\n materialInfo?.extensions?.KHR_materials_emissive_strength?.emissiveStrength ?? 1;\r\n pbrCommon.emissiveColor = materialInfo.emissiveFactor\r\n ? new Vector3(materialInfo.emissiveFactor)\r\n : Vector3.zero();\r\n }\r\n if (materialInfo?.pbrMetallicRoughness) {\r\n pbrMetallicRoughness = {\r\n type: 'pbrMetallicRoughness',\r\n ior: 1.5,\r\n common: pbrCommon\r\n };\r\n pbrMetallicRoughness.diffuse = new Vector4(\r\n materialInfo.pbrMetallicRoughness.baseColorFactor ?? [1, 1, 1, 1]\r\n );\r\n pbrMetallicRoughness.metallic = materialInfo.pbrMetallicRoughness.metallicFactor ?? 1;\r\n pbrMetallicRoughness.roughness = materialInfo.pbrMetallicRoughness.roughnessFactor ?? 1;\r\n pbrMetallicRoughness.diffuseMap = materialInfo.pbrMetallicRoughness.baseColorTexture\r\n ? await this._loadTexture(gltf, materialInfo.pbrMetallicRoughness.baseColorTexture, true)\r\n : null;\r\n pbrMetallicRoughness.metallicMap = materialInfo.pbrMetallicRoughness.metallicRoughnessTexture\r\n ? await this._loadTexture(gltf, materialInfo.pbrMetallicRoughness.metallicRoughnessTexture, false)\r\n : null;\r\n pbrMetallicRoughness.metallicIndex = 2;\r\n pbrMetallicRoughness.roughnessIndex = 1;\r\n }\r\n if (materialInfo?.extensions?.KHR_materials_pbrSpecularGlossiness) {\r\n const sg = materialInfo.extensions?.KHR_materials_pbrSpecularGlossiness;\r\n pbrSpecularGlossness = {\r\n type: 'pbrSpecularGlossiness',\r\n ior: 1.5,\r\n common: pbrCommon\r\n };\r\n pbrSpecularGlossness.diffuse = new Vector4(sg.diffuseFactor ?? [1, 1, 1, 1]);\r\n pbrSpecularGlossness.specular = new Vector3(sg.specularFactor ?? [1, 1, 1]);\r\n pbrSpecularGlossness.glossness = sg.glossnessFactor ?? 1;\r\n pbrSpecularGlossness.diffuseMap = sg.diffuseTexture\r\n ? await this._loadTexture(gltf, sg.diffuseTexture, true)\r\n : null;\r\n pbrSpecularGlossness.specularGlossnessMap = sg.specularGlossinessTexture\r\n ? await this._loadTexture(gltf, sg.specularGlossinessTexture, true)\r\n : null;\r\n }\r\n assetMaterial = pbrSpecularGlossness || pbrMetallicRoughness;\r\n if (!assetMaterial || materialInfo?.extensions?.KHR_materials_unlit) {\r\n if (materialInfo?.extensions?.KHR_materials_unlit) {\r\n assetMaterial = {\r\n type: 'unlit',\r\n common: pbrCommon,\r\n diffuse: pbrMetallicRoughness?.diffuse ?? Vector4.one(),\r\n diffuseMap: pbrMetallicRoughness?.diffuseMap ?? null\r\n } as AssetUnlitMaterial;\r\n } else {\r\n assetMaterial = {\r\n type: 'pbrMetallicRoughness',\r\n common: pbrCommon,\r\n diffuse: Vector4.one(),\r\n metallic: 1,\r\n roughness: 1,\r\n diffuseMap: null,\r\n metallicMap: null,\r\n metallicIndex: 2,\r\n roughnessIndex: 1\r\n } as AssetPBRMaterialMR;\r\n }\r\n }\r\n if (assetMaterial.type !== 'unlit' && materialInfo?.extensions?.KHR_materials_ior) {\r\n (assetMaterial as AssetPBRMaterialCommon).ior = materialInfo.extensions.KHR_materials_ior.ior ?? 1.5;\r\n }\r\n if (assetMaterial.type === 'pbrMetallicRoughness') {\r\n pbrMetallicRoughness = assetMaterial;\r\n // KHR_materials_specular extension\r\n const specularColorFactor = (materialInfo?.extensions?.KHR_materials_specular?.specularColorFactor ?? [\r\n 1, 1, 1\r\n ]) as [number, number, number];\r\n pbrMetallicRoughness.specularFactor = new Vector4(\r\n ...specularColorFactor,\r\n materialInfo?.extensions?.KHR_materials_specular?.specularFactor ?? 1\r\n );\r\n pbrMetallicRoughness.specularMap = materialInfo?.extensions?.KHR_materials_specular?.specularTexture\r\n ? await this._loadTexture(gltf, materialInfo.extensions.KHR_materials_specular.specularTexture, false)\r\n : null;\r\n pbrMetallicRoughness.specularColorMap = materialInfo?.extensions?.KHR_materials_specular\r\n ?.specularColorTexture\r\n ? await this._loadTexture(\r\n gltf,\r\n materialInfo.extensions.KHR_materials_specular.specularColorTexture,\r\n true\r\n )\r\n : null;\r\n // KHR_materials_iridescence\r\n const iridescence = materialInfo?.extensions?.KHR_materials_iridescence;\r\n if (iridescence) {\r\n pbrMetallicRoughness.iridescence = {\r\n iridescenceFactor: iridescence.iridescenceFactor ?? 0,\r\n iridescenceMap: iridescence.iridescenceTexture\r\n ? await this._loadTexture(gltf, iridescence.iridescenceTexture, false)\r\n : null,\r\n iridescenceIor: iridescence.iridescenceIor ?? 1.3,\r\n iridescenceThicknessMinimum: iridescence.iridescenceThicknessMinimum ?? 100,\r\n iridescenceThicknessMaximum: iridescence.iridescenceThicknessMaximum ?? 400,\r\n iridescenceThicknessMap: iridescence.iridescenceThicknessTexture\r\n ? await this._loadTexture(gltf, iridescence.iridescenceThicknessTexture, false)\r\n : null\r\n };\r\n }\r\n // KHR_materials_transmission\r\n const transmission = materialInfo?.extensions?.KHR_materials_transmission;\r\n if (transmission) {\r\n pbrMetallicRoughness.transmission = {\r\n transmissionFactor: transmission.transmissionFactor ?? 0,\r\n transmissionMap: transmission.transmissionTexture\r\n ? await this._loadTexture(gltf, transmission.transmissionTexture, false)\r\n : null,\r\n thicknessFactor: 0,\r\n thicknessMap: null,\r\n attenuationDistance: 99999,\r\n attenuationColor: Vector3.one()\r\n };\r\n const volume = materialInfo?.extensions?.KHR_materials_volume;\r\n if (volume) {\r\n pbrMetallicRoughness.transmission.thicknessFactor = volume.thicknessFactor ?? 0;\r\n pbrMetallicRoughness.transmission.thicknessMap = volume.thicknessTexture\r\n ? await this._loadTexture(gltf, volume.thicknessTexture, false)\r\n : null;\r\n pbrMetallicRoughness.transmission.attenuationDistance = volume.attenuationDistance ?? 99999;\r\n const attenuationColor = (volume.attenuationColor ?? [1, 1, 1]) as [number, number, number];\r\n pbrMetallicRoughness.transmission.attenuationColor = new Vector3(...attenuationColor);\r\n }\r\n }\r\n // KHR_materials_sheen\r\n const sheen = materialInfo?.extensions?.KHR_materials_sheen;\r\n if (sheen) {\r\n pbrMetallicRoughness.sheen = {\r\n sheenColorFactor: new Vector3(sheen.sheenColorFactor ?? [0, 0, 0]),\r\n sheenColorMap: sheen.sheenColorTexture\r\n ? await this._loadTexture(gltf, sheen.sheenColorTexture, true)\r\n : null,\r\n sheenRoughnessFactor: sheen.sheenRoughnessFactor ?? 0,\r\n sheenRoughnessMap: sheen.sheenRoughnessTexture\r\n ? await this._loadTexture(gltf, sheen.sheenRoughnessTexture, true)\r\n : null\r\n };\r\n }\r\n // KHR_materials_clearcoat\r\n const cc = materialInfo?.extensions?.KHR_materials_clearcoat;\r\n if (cc) {\r\n pbrMetallicRoughness.clearcoat = {\r\n clearCoatFactor: cc.clearcoatFactor ?? 0,\r\n clearCoatIntensityMap: cc.clearcoatTexture\r\n ? await this._loadTexture(gltf, cc.clearcoatTexture, false)\r\n : null,\r\n clearCoatRoughnessFactor: cc.clearcoatRoughnessFactor ?? 0,\r\n clearCoatRoughnessMap: cc.clearcoatRoughnessTexture\r\n ? await this._loadTexture(gltf, cc.clearcoatRoughnessTexture, false)\r\n : null,\r\n clearCoatNormalMap: cc.clearcoatNormalTexture\r\n ? await this._loadTexture(gltf, cc.clearcoatNormalTexture, false)\r\n : null\r\n };\r\n }\r\n }\r\n return await this._createMaterial(assetMaterial);\r\n }\r\n /** @internal */\r\n private async _loadTexture(\r\n gltf: GLTFContent,\r\n info: Partial<TextureInfo>,\r\n sRGB: boolean\r\n ): Promise<MaterialTextureInfo> {\r\n const mt: MaterialTextureInfo = {\r\n texture: null,\r\n sampler: null,\r\n texCoord: info.texCoord ?? 0,\r\n transform: null\r\n };\r\n const textureInfo = gltf.textures[info.index];\r\n if (textureInfo) {\r\n if (info.extensions?.KHR_texture_transform) {\r\n const uvTransform = info.extensions.KHR_texture_transform;\r\n if (uvTransform.texCoord !== undefined) {\r\n mt.texCoord = uvTransform.texCoord;\r\n }\r\n const rotation =\r\n uvTransform.rotation !== undefined\r\n ? Matrix4x4.rotationZ(-uvTransform.rotation)\r\n : Matrix4x4.identity();\r\n const scale =\r\n uvTransform.scale !== undefined\r\n ? new Vector3(uvTransform.scale[0], uvTransform.scale[1], 1)\r\n : Vector3.one();\r\n const translation =\r\n uvTransform.offset !== undefined\r\n ? new Vector3(uvTransform.offset[0], uvTransform.offset[1], 0)\r\n : Vector3.zero();\r\n mt.transform = Matrix4x4.scaling(scale).multiplyLeft(rotation).translateLeft(translation);\r\n }\r\n let wrapS: TextureAddressMode = 'repeat';\r\n let wrapT: TextureAddressMode = 'repeat';\r\n let magFilter: TextureFilterMode = 'linear';\r\n let minFilter: TextureFilterMode = 'linear';\r\n let mipFilter: TextureFilterMode = 'linear';\r\n const samplerIndex: number = textureInfo.sampler;\r\n const sampler = gltf.samplers && gltf.samplers[samplerIndex];\r\n if (sampler) {\r\n switch (sampler.wrapS) {\r\n case 0x2901: // gl.REPEAT\r\n wrapS = 'repeat';\r\n break;\r\n case 0x8370: // gl.MIRRORED_REPEAT\r\n wrapS = 'mirrored-repeat';\r\n break;\r\n case 0x812f: // gl.CLAMP_TO_EDGE\r\n wrapS = 'clamp';\r\n break;\r\n }\r\n switch (sampler.wrapT) {\r\n case 0x2901: // gl.REPEAT\r\n wrapT = 'repeat';\r\n break;\r\n case 0x8370: // gl.MIRRORED_REPEAT\r\n wrapT = 'mirrored-repeat';\r\n break;\r\n case 0x812f: // gl.CLAMP_TO_EDGE\r\n wrapT = 'clamp';\r\n break;\r\n }\r\n switch (sampler.magFilter) {\r\n case 0x2600: // gl.NEAREST\r\n magFilter = 'nearest';\r\n break;\r\n case 0x2601: // gl.LINEAR\r\n magFilter = 'linear';\r\n break;\r\n }\r\n switch (sampler.minFilter) {\r\n case 0x2600: // gl.NEAREST\r\n minFilter = 'nearest';\r\n mipFilter = 'none';\r\n break;\r\n case 0x2601: // gl.LINEAR\r\n minFilter = 'linear';\r\n mipFilter = 'none';\r\n break;\r\n case 0x2700: // gl.NEAREST_MIPMAP_NEAREST\r\n minFilter = 'nearest';\r\n mipFilter = 'nearest';\r\n break;\r\n case 0x2701: // gl.LINEAR_MIPMAP_NEAREST\r\n minFilter = 'linear';\r\n mipFilter = 'nearest';\r\n break;\r\n case 0x2702: // gl.NEAREST_MIPMAP_LINEAR\r\n minFilter = 'nearest';\r\n mipFilter = 'linear';\r\n break;\r\n case 0x2703: // gl.LINEAR_MIPMAP_LINEAR\r\n minFilter = 'linear';\r\n mipFilter = 'linear';\r\n break;\r\n }\r\n }\r\n const imageIndex: number = textureInfo.source;\r\n const hash = `${imageIndex}:${!!sRGB}:${wrapS}:${wrapT}:${minFilter}:${magFilter}:${mipFilter}`;\r\n mt.texture = gltf._textureCache[hash];\r\n if (!mt.texture) {\r\n const image = gltf.images[imageIndex];\r\n if (image) {\r\n if (image.uri) {\r\n const imageUrl = this._normalizeURI(gltf._baseURI, image.uri);\r\n mt.texture = await gltf._manager.fetchTexture(imageUrl, { linearColorSpace: !sRGB });\r\n mt.texture.name = imageUrl;\r\n } else if (typeof image.bufferView === 'number' && image.mimeType) {\r\n const bufferView = gltf.bufferViews && gltf.bufferViews[image.bufferView];\r\n if (bufferView) {\r\n const arrayBuffer = gltf._loadedBuffers && gltf._loadedBuffers[bufferView.buffer];\r\n if (arrayBuffer) {\r\n const view = new Uint8Array(arrayBuffer, bufferView.byteOffset || 0, bufferView.byteLength);\r\n const mimeType = image.mimeType;\r\n mt.texture = await gltf._manager.loadTextureFromBuffer<Texture2D>(view, mimeType, sRGB);\r\n }\r\n }\r\n }\r\n }\r\n if (mt.texture) {\r\n gltf._textureCache[hash] = mt.texture;\r\n }\r\n }\r\n if (mt.texture) {\r\n mt.sampler = Application.instance.device.createSampler({\r\n addressU: wrapS,\r\n addressV: wrapT,\r\n magFilter: magFilter,\r\n minFilter: minFilter,\r\n mipFilter: mipFilter\r\n });\r\n }\r\n }\r\n return mt;\r\n }\r\n /** @internal */\r\n private _primitiveType(type: number): PrimitiveType {\r\n switch (type) {\r\n case 0: // GL_POINTS\r\n return 'point-list';\r\n case 1: // GL_LINES\r\n return 'line-list';\r\n /* FIXME:\r\n case 2: // GL_LINE_LOOP\r\n return PrimitiveType.LineLoop;\r\n */\r\n case 3: // GL_LINE_STRIP\r\n return 'line-strip';\r\n case 4: // GL_TRIANGLES\r\n return 'triangle-list';\r\n case 5: // GL_TRIANGLE_STRIP\r\n return 'triangle-strip';\r\n case 6: // GL_TRIANGLE_FAN\r\n return 'triangle-fan';\r\n default:\r\n return null;\r\n }\r\n }\r\n /** @internal */\r\n private _loadIndexBuffer(\r\n gltf: GLTFContent,\r\n accessorIndex: number,\r\n primitive: Primitive,\r\n meshData: AssetSubMeshData,\r\n dracoExtension?: any,\r\n dracoMeshDecoder?: DracoMeshDecoder\r\n ) {\r\n const accessor = gltf._accessors[accessorIndex];\r\n if (dracoMeshDecoder) {\r\n const indices = dracoMeshDecoder.getIndexBuffer();\r\n if (!indices || indices.length !== accessor.count) {\r\n throw new Error(`Decode index buffer failed`);\r\n }\r\n if (indices.length !== accessor.count) {\r\n throw new Error(`Decode index buffer failed`);\r\n }\r\n gltf._loadedBuffers.push(indices.buffer);\r\n if (!gltf.bufferViews) {\r\n gltf.bufferViews = [];\r\n }\r\n gltf.bufferViews.push({\r\n buffer: gltf._loadedBuffers.length - 1,\r\n byteOffset: 0,\r\n byteLength: indices.byteLength\r\n });\r\n accessor.componentType = ComponentType.UINT;\r\n accessor.bufferView = gltf.bufferViews.length - 1;\r\n }\r\n this._setBuffer(gltf, accessorIndex, primitive, null, meshData);\r\n }\r\n /** @internal */\r\n private _loadVertexBuffer(\r\n gltf: GLTFContent,\r\n attribName: string,\r\n accessorIndex: number,\r\n primitive: Primitive,\r\n subMeshData: AssetSubMeshData,\r\n dracoExtension?: any,\r\n dracoMeshDecoder?: DracoMeshDecoder\r\n ) {\r\n const dracoId = dracoExtension?.attributes?.[attribName];\r\n if (dracoId !== undefined) {\r\n const accessor = gltf._accessors[accessorIndex];\r\n let buffer: TypedArray = null;\r\n const numElements = accessor.count * accessor.getComponentCount(accessor.type);\r\n switch (accessor.componentType) {\r\n case ComponentType.FLOAT:\r\n buffer = new Float32Array(numElements);\r\n break;\r\n case ComponentType.BYTE:\r\n buffer = new Int8Array(numElements);\r\n break;\r\n case ComponentType.SHORT:\r\n buffer = new Int16Array(numElements);\r\n break;\r\n case ComponentType.INT:\r\n buffer = new Int32Array(numElements);\r\n break;\r\n case ComponentType.UBYTE:\r\n buffer = new Uint8Array(numElements);\r\n break;\r\n case ComponentType.USHORT:\r\n buffer = new Uint16Array(numElements);\r\n break;\r\n case ComponentType.UINT:\r\n buffer = new Uint32Array(numElements);\r\n break;\r\n default:\r\n throw new Error(`Invalid component type: ${accessor.componentType}`);\r\n }\r\n if (!dracoMeshDecoder.getAttributeBuffer(dracoId, buffer)) {\r\n throw new Error(`Decode draco mesh failed`);\r\n }\r\n gltf._loadedBuffers.push(buffer.buffer);\r\n if (!gltf.bufferViews) {\r\n gltf.bufferViews = [];\r\n }\r\n gltf.bufferViews.push({\r\n buffer: gltf._loadedBuffers.length - 1,\r\n byteOffset: 0,\r\n byteLength: buffer.byteLength\r\n });\r\n accessor.bufferView = gltf.bufferViews.length - 1;\r\n }\r\n let semantic: VertexSemantic = null;\r\n switch (attribName) {\r\n case 'POSITION':\r\n semantic = 'position';\r\n break;\r\n case 'NORMAL':\r\n semantic = 'normal';\r\n break;\r\n case 'TANGENT':\r\n semantic = 'tangent';\r\n break;\r\n case 'TEXCOORD_0':\r\n semantic = 'texCoord0';\r\n break;\r\n case 'TEXCOORD_1':\r\n semantic = 'texCoord1';\r\n break;\r\n case 'TEXCOORD_2':\r\n semantic = 'texCoord2';\r\n break;\r\n case 'TEXCOORD_3':\r\n semantic = 'texCoord3';\r\n break;\r\n case 'TEXCOORD_4':\r\n semantic = 'texCoord4';\r\n break;\r\n case 'TEXCOORD_5':\r\n semantic = 'texCoord5';\r\n break;\r\n case 'TEXCOORD_6':\r\n semantic = 'texCoord6';\r\n break;\r\n case 'TEXCOORD_7':\r\n semantic = 'texCoord7';\r\n break;\r\n case 'COLOR_0':\r\n semantic = 'diffuse';\r\n break;\r\n case 'JOINTS_0':\r\n semantic = 'blendIndices';\r\n break;\r\n case 'WEIGHTS_0':\r\n semantic = 'blendWeights';\r\n break;\r\n default:\r\n return;\r\n }\r\n\r\n this._setBuffer(gltf, accessorIndex, primitive, semantic, subMeshData);\r\n }\r\n /** @internal */\r\n private _setBuffer(\r\n gltf: GLTFContent,\r\n accessorIndex: number,\r\n primitive: Primitive,\r\n semantic: VertexSemantic,\r\n subMeshData: AssetSubMeshData\r\n ) {\r\n const device = Application.instance.device;\r\n const accessor = gltf._accessors[accessorIndex];\r\n const componentCount = accessor.getComponentCount(accessor.type);\r\n const normalized = !!accessor.normalized;\r\n const hash = `${accessorIndex}:${semantic || ''}:${Number(normalized)}`;\r\n let buffer = gltf._bufferCache[hash];\r\n if (!buffer) {\r\n let data = accessor.getNormalizedDeinterlacedView(gltf);\r\n if (semantic && !(data instanceof Float32Array)) {\r\n const floatData = new Float32Array(data.length);\r\n floatData.set(data);\r\n data = floatData;\r\n }\r\n if (!semantic) {\r\n if (\r\n !(data instanceof Uint8Array) &&\r\n !(data instanceof Uint16Array) &&\r\n !(data instanceof Uint32Array)\r\n ) {\r\n console.error('Invalid index buffer component type');\r\n return;\r\n }\r\n if (data instanceof Uint32Array && !device.getDeviceCaps().miscCaps.support32BitIndex) {\r\n console.error('Device does not support 32bit vertex index');\r\n return;\r\n }\r\n if (data instanceof Uint8Array) {\r\n const uint16Data = new Uint16Array(data.length);\r\n uint16Data.set(data);\r\n data = uint16Data;\r\n }\r\n }\r\n if (!semantic) {\r\n buffer = gltf._device.createIndexBuffer(data as Uint16Array<ArrayBuffer> | Uint32Array<ArrayBuffer>, {\r\n managed: true\r\n });\r\n } else {\r\n const attribFormat = device.getVertexAttribFormat(semantic, 'f32', componentCount);\r\n buffer = gltf._device.createVertexBuffer(attribFormat, data);\r\n }\r\n gltf._bufferCache[hash] = buffer;\r\n }\r\n if (buffer) {\r\n if (!semantic) {\r\n primitive.setIndexBuffer(buffer as IndexBuffer);\r\n primitive.indexCount = (buffer as IndexBuffer).length;\r\n } else {\r\n primitive.setVertexBuffer(buffer as StructuredBuffer);\r\n if (semantic === 'position') {\r\n if (!primitive.getIndexBuffer()) {\r\n primitive.indexCount = Math.floor(buffer.byteLength / 12);\r\n }\r\n const data = accessor.getNormalizedDeinterlacedView(gltf);\r\n subMeshData.rawPositions = data as Float32Array;\r\n const min = accessor.min;\r\n const max = accessor.max;\r\n if (min && max) {\r\n primitive.setBoundingVolume(new BoundingBox(new Vector3(min), new Vector3(max)));\r\n } else {\r\n const bbox = new BoundingBox();\r\n bbox.beginExtend();\r\n for (let i = 0; i < data.length; i++) {\r\n const v = new Vector3(\r\n data[i * componentCount],\r\n data[i * componentCount + 1],\r\n data[i * componentCount + 2]\r\n );\r\n bbox.extend(v);\r\n }\r\n if (bbox.isValid()) {\r\n primitive.setBoundingVolume(bbox);\r\n }\r\n }\r\n } else if (semantic === 'blendIndices') {\r\n subMeshData.rawBlendIndices = accessor.getNormalizedDeinterlacedView(gltf);\r\n } else if (semantic === 'blendWeights') {\r\n subMeshData.rawJointWeights = accessor.getNormalizedDeinterlacedView(gltf);\r\n }\r\n }\r\n }\r\n return buffer;\r\n }\r\n /** @internal */\r\n private isGLB(data: ArrayBuffer): boolean {\r\n if (data.byteLength > 12) {\r\n const p = new Uint32Array(data, 0, 3);\r\n if (p[0] === 0x46546c67 && p[1] === 2 && p[2] === data.byteLength) {\r\n return true;\r\n }\r\n }\r\n return false;\r\n }\r\n /** @internal */\r\n private getGLBChunkInfo(\r\n data: ArrayBuffer,\r\n offset: number\r\n ): { start: number; length: number; type: number } {\r\n const header = new Uint32Array(data, offset, 2);\r\n const start = offset + 8;\r\n const length = header[0];\r\n const type = header[1];\r\n return { start, length, type };\r\n }\r\n /** @internal */\r\n private getGLBChunkInfos(data: ArrayBuffer): { start: number; length: number; type: number }[] {\r\n const infos: { start: number; length: number; type: number }[] = [];\r\n let offset = 12;\r\n while (offset < data.byteLength) {\r\n const info = this.getGLBChunkInfo(data, offset);\r\n infos.push(info);\r\n offset += info.length + 8;\r\n }\r\n return infos;\r\n }\r\n}\r\n"],"names":["GLTFLoader","AbstractModelLoader","supportMIMEType","mimeType","load","assetManager","url","data","decoderModule","buffer","arrayBuffer","isGLB","loadBinary","vfs","gltf","Response","json","_manager","_device","Application","instance","device","_vfs","_loadedBuffers","loadJson","jsonChunkType","binaryChunkType","buffers","chunkInfos","getGLBChunkInfos","info","type","jsonSlice","Uint8Array","length","stringBuffer","TextDecoder","decode","JSON","parse","push","slice","start","dracoDecoderModule","extensionsRequired","indexOf","console","error","_dracoModule","_accessors","_bufferCache","_textureCache","_materialCache","_nodes","_meshes","asset","gltfVersion","version","_baseURI","substring","lastIndexOf","uri","_normalizeURI","buf","fetchBinaryData","byteLength","accessors","accessor","GLTFAccessor","scenes","sharedModel","SharedModel","_loadMeshes","_loadNodes","_loadSkins","i","nodes","skin","skeleton","skeletons","_loadAnimations","scene","assetScene","AssetScene","name","node","rootNodes","activeScene","baseURI","s","toLowerCase","startsWith","encodeURI","replace","decodeURIComponent","split","map","val","encodeURIComponent","join","model","_loadNode","parent","computeTransforms","skins","skinInfo","AssetSkeleton","pivot","inverseBindMatrices","componentType","ComponentType","FLOAT","Error","matrices","getDeinterlacedView","joints","forEach","joint","index","m","addJoint","Matrix4x4","subarray","identity","addSkeleton","animations","animation","_loadAnimation","addAnimation","collectNodes","collect","Map","set","translate","position","Vector3","zero","rotation","Quaternion","scale","scaling","one","worldTransform","getAnimationInfo","animationInfo","channels","samplers","interpolators","interpolatorTypes","maxTime","channel","sampler","input","getNormalizedDeinterlacedView","output","Float32Array","mode","interpolation","target","path","Interpolator","max","animationData","tracks","targetNode","track","interpolator","defaultMorphWeights","weights","skeletonAttached","nodeIndex","addChild","nodeInfo","addNode","mesh","morphWeights","instancing","extensions","attributes","accessorTranslation","TRANSLATION","accessorScale","SCALE","accessorRotation","ROTATION","count","translationValues","scaleValues","rotationValues","t","r","instances","matrix","decompose","translation","children","childIndex","meshes","_loadMesh","meshIndex","meshInfo","subMeshes","primitives","meshName","p","subMeshData","primitive","DRef","material","rawPositions","rawBlendIndices","rawJointWeights","numTargets","Primitive","dracoExtension","dracoMeshDecoder","bufferView","bufferViews","DracoMeshDecoder","Int8Array","byteOffset","attrib","_loadVertexBuffer","targets","undefined","vertexIndices","getNumVertices","createAndSetVertexBuffer","targetBox","targetMap","POSITION","MORPH_TARGET_POSITION","NORMAL","MORPH_TARGET_NORMAL","TANGENT","MORPH_TARGET_TANGENT","TEXCOORD_0","MORPH_TARGET_TEX0","TEXCOORD_1","MORPH_TARGET_TEX1","TEXCOORD_2","MORPH_TARGET_TEX2","TEXCOORD_3","MORPH_TARGET_TEX3","COLOR_0","MORPH_TARGET_COLOR","morphAttribSet","Set","k","numComponents","accessorIndex","getComponentCount","min","BoundingBox","add","morphAttribCount","size","indices","_loadIndexBuffer","primitiveType","_primitiveType","hasVertexNormal","getVertexBuffer","hasVertexColor","hasVertexTangent","materialHash","Number","materialInfo","materials","_loadMaterial","_createMaterial","assetMaterial","unlitAssetMaterial","unlitMaterial","UnlitMaterial","albedoColor","diffuse","Vector4","diffuseMap","albedoTexture","texture","albedoTextureSampler","albedoTexCoordIndex","texCoord","albedoTexCoordMatrix","transform","vertexColor","common","alphaMode","blendMode","alphaCutoff","doubleSided","cullMode","assetPBRMaterial","pbrMaterial","PBRSpecularGlossinessMaterial","ior","specularFactor","specular","x","y","z","glossinessFactor","glossness","normalMap","normalTexture","normalTextureSampler","normalTexCoordIndex","normalTexCoordMatrix","normalScale","bumpScale","emissiveMap","emissiveTexture","emissiveTextureSampler","emissiveTexCoordIndex","emissiveTexCoordMatrix","emissiveColor","emissiveStrength","occlusionMap","occlusionTexture","occlusionTextureSampler","occlusionTexCoordIndex","occlusionTexCoordMatrix","occlusionStrength","specularGlossnessMap","specularTexture","specularTextureSampler","specularTexCoordIndex","specularTexCoordMatrix","vertexTangent","useTangent","vertexNormal","PBRMetallicRoughnessMaterial","metallic","roughness","metallicMap","metallicRoughnessTexture","metallicRoughnessTextureSampler","metallicRoughnessTexCoordIndex","metallicRoughnessTexCoordMatrix","specularMap","specularColorMap","specularColorTexture","specularColorTextureSampler","specularColorTexCoordIndex","specularColorTexCoordMatrix","sheen","sheenColorFactor","sheenRoughnessFactor","sheenColorMap","sheenColorTexture","sheenColorTextureSampler","sheenColorTexCoordIndex","sheenColorTexCoordMatrix","sheenRoughnessMap","sheenRoughnessTexture","sheenRoughnessTextureSampler","sheenRoughnessTexCoordIndex","sheenRoughnessTexCoordMatrix","iridescence","iridescenceFactor","iridescenceIor","iridescenceMap","iridescenceTexture","iridescenceTextureSampler","iridescenceTexCoordIndex","iridescenceTexCoordMatrix","iridescenceThicknessMin","iridescenceThicknessMinimum","iridescenceThicknessMax","iridescenceThicknessMaximum","iridescenceThicknessMap","iridescenceThicknessTexture","iridescenceThicknessTextureSampler","iridescenceThicknessTexCoordIndex","iridescenceThicknessTexCoordMatrix","transmission","transmissionFactor","transmissionMap","transmissionTexture","transmissionTextureSampler","transmissionTexCoordIndex","transmissionTexCoordMatrix","thicknessFactor","thicknessMap","thicknessTexture","thicknessTextureSampler","thicknessTexCoordIndex","thicknessTexCoordMatrix","attenuationDistance","attenuationColor","clearcoat","cc","clearcoatIntensity","clearCoatFactor","clearcoatRoughnessFactor","clearCoatRoughnessFactor","clearCoatIntensityMap","clearcoatIntensityTexture","clearcoatIntensityTextureSampler","clearcoatIntensityTexCoordIndex","clearcoatIntensityTexCoordMatrix","clearCoatRoughnessMap","clearcoatRoughnessTexture","clearcoatRoughnessTextureSampler","clearcoatRoughnessTexCoordIndex","clearcoatRoughnessTexCoordMatrix","clearCoatNormalMap","clearcoatNormalTexture","clearcoatNormalTextureSampler","clearcoatNormalTexCoordIndex","clearcoatNormalTexCoordMatrix","pbrMetallicRoughness","pbrSpecularGlossness","pbrCommon","KHR_materials_pbrSpecularGlossiness","_loadTexture","strength","KHR_materials_emissive_strength","emissiveFactor","baseColorFactor","metallicFactor","roughnessFactor","baseColorTexture","metallicIndex","roughnessIndex","sg","diffuseFactor","glossnessFactor","diffuseTexture","specularGlossinessTexture","KHR_materials_unlit","KHR_materials_ior","specularColorFactor","KHR_materials_specular","KHR_materials_iridescence","KHR_materials_transmission","volume","KHR_materials_volume","KHR_materials_sheen","KHR_materials_clearcoat","clearcoatFactor","clearcoatTexture","sRGB","mt","textureInfo","textures","KHR_texture_transform","uvTransform","rotationZ","offset","multiplyLeft","translateLeft","wrapS","wrapT","magFilter","minFilter","mipFilter","samplerIndex","imageIndex","source","hash","image","images","imageUrl","fetchTexture","linearColorSpace","view","loadTextureFromBuffer","createSampler","addressU","addressV","meshData","getIndexBuffer","UINT","_setBuffer","attribName","dracoId","numElements","BYTE","SHORT","Int16Array","INT","Int32Array","UBYTE","USHORT","Uint16Array","Uint32Array","getAttributeBuffer","semantic","componentCount","normalized","floatData","getDeviceCaps","miscCaps","support32BitIndex","uint16Data","createIndexBuffer","managed","attribFormat","getVertexAttribFormat","createVertexBuffer","setIndexBuffer","indexCount","setVertexBuffer","Math","floor","setBoundingVolume","bbox","beginExtend","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C,CAAC,CAAA,CAAE,KAAK,UAAA,IAAcA,CAAC,CAAC,CAAA,CAAE,KAAK,CAAA,IAAKA,CAAC,CAAC,CAAA,CAAE,KAAKrM,IAAAA,CAAK0D,UAAU,EAAE;gBACjE,OAAO,IAAA;AACT;AACF;QACA,OAAO,KAAA;AACT;AACA,qBACA,eAAQgc,CACN1f,IAAiB,EACjB2b,MAAc,EACmC;AACjD,QAAA,MAAMgE,MAAS,GAAA,IAAI3B,WAAYhe,CAAAA,IAAAA,EAAM2b,MAAQ,EAAA,CAAA,CAAA;AAC7C,QAAA,MAAMxZ,QAAQwZ,MAAS,GAAA,CAAA;QACvB,MAAMha,MAAAA,GAASge,MAAM,CAAC,CAAE,CAAA;QACxB,MAAMne,IAAAA,GAAOme,MAAM,CAAC,CAAE,CAAA;QACtB,OAAO;AAAExd,YAAAA,KAAAA;AAAOR,YAAAA,MAAAA;AAAQH,YAAAA;AAAK,SAAA;AAC/B;AACA,qBACQF,gBAAiBtB,CAAAA,IAAiB,EAAqD;AAC7F,QAAA,MAAM4f,QAA2D,EAAE;AACnE,QAAA,IAAIjE,MAAS,GAAA,EAAA;QACb,MAAOA,MAAAA,GAAS3b,IAAK0D,CAAAA,UAAU,CAAE;AAC/B,YAAA,MAAMnC,IAAO,GAAA,IAAI,CAACme,eAAe,CAAC1f,IAAM2b,EAAAA,MAAAA,CAAAA;AACxCiE,YAAAA,KAAAA,CAAM3d,IAAI,CAACV,IAAAA,CAAAA;YACXoa,MAAUpa,IAAAA,IAAAA,CAAKI,MAAM,GAAG,CAAA;AAC1B;QACA,OAAOie,KAAAA;AACT;AACF;;;;"}
|
|
@@ -1,327 +0,0 @@
|
|
|
1
|
-
/** @internal */ var ComponentType = /*#__PURE__*/ function(ComponentType) {
|
|
2
|
-
ComponentType[ComponentType["UNKNOWN"] = 0] = "UNKNOWN";
|
|
3
|
-
ComponentType[ComponentType["BYTE"] = 5120] = "BYTE";
|
|
4
|
-
ComponentType[ComponentType["UBYTE"] = 5121] = "UBYTE";
|
|
5
|
-
ComponentType[ComponentType["SHORT"] = 5122] = "SHORT";
|
|
6
|
-
ComponentType[ComponentType["USHORT"] = 5123] = "USHORT";
|
|
7
|
-
ComponentType[ComponentType["INT"] = 5124] = "INT";
|
|
8
|
-
ComponentType[ComponentType["UINT"] = 5125] = "UINT";
|
|
9
|
-
ComponentType[ComponentType["FLOAT"] = 5126] = "FLOAT"; // GL.FLOAT
|
|
10
|
-
return ComponentType;
|
|
11
|
-
}({});
|
|
12
|
-
/** @internal */ class GLTFAccessor {
|
|
13
|
-
bufferView;
|
|
14
|
-
byteOffset;
|
|
15
|
-
componentType;
|
|
16
|
-
normalized;
|
|
17
|
-
count;
|
|
18
|
-
type;
|
|
19
|
-
max;
|
|
20
|
-
min;
|
|
21
|
-
sparse;
|
|
22
|
-
name;
|
|
23
|
-
_typedView;
|
|
24
|
-
_filteredView;
|
|
25
|
-
_normalizedFilteredView;
|
|
26
|
-
_normalizedTypedView;
|
|
27
|
-
constructor(accessorInfo){
|
|
28
|
-
this.bufferView = accessorInfo.bufferView;
|
|
29
|
-
this.byteOffset = accessorInfo.byteOffset ?? 0;
|
|
30
|
-
this.componentType = accessorInfo.componentType;
|
|
31
|
-
this.normalized = !!accessorInfo.normalized;
|
|
32
|
-
this.count = accessorInfo.count;
|
|
33
|
-
this.type = accessorInfo.type;
|
|
34
|
-
this.max = accessorInfo.max;
|
|
35
|
-
this.min = accessorInfo.min;
|
|
36
|
-
this.sparse = accessorInfo.sparse;
|
|
37
|
-
this.name = accessorInfo.name;
|
|
38
|
-
this._typedView = null;
|
|
39
|
-
this._filteredView = null;
|
|
40
|
-
this._normalizedFilteredView = null;
|
|
41
|
-
this._normalizedTypedView = null;
|
|
42
|
-
}
|
|
43
|
-
getTypedView(gltf) {
|
|
44
|
-
if (this._typedView) {
|
|
45
|
-
return this._typedView;
|
|
46
|
-
}
|
|
47
|
-
if (this.bufferView !== undefined) {
|
|
48
|
-
const bufferView = gltf.bufferViews[this.bufferView];
|
|
49
|
-
const buffer = gltf._loadedBuffers[bufferView.buffer];
|
|
50
|
-
const byteOffset = this.byteOffset + (bufferView.byteOffset ?? 0);
|
|
51
|
-
const componentSize = this.getComponentSize(this.componentType);
|
|
52
|
-
const componentCount = this.getComponentCount(this.type);
|
|
53
|
-
let arrayLength = 0;
|
|
54
|
-
if (bufferView.byteStride !== undefined && bufferView.byteStride !== 0) {
|
|
55
|
-
if (componentSize !== 0) {
|
|
56
|
-
arrayLength = bufferView.byteStride / componentSize * (this.count - 1) + componentCount;
|
|
57
|
-
} else {
|
|
58
|
-
console.warn("Invalid component type in accessor '" + (this.name ? this.name : '') + "'");
|
|
59
|
-
}
|
|
60
|
-
} else {
|
|
61
|
-
arrayLength = this.count * componentCount;
|
|
62
|
-
}
|
|
63
|
-
if (arrayLength * componentSize > buffer.byteLength - byteOffset) {
|
|
64
|
-
arrayLength = (buffer.byteLength - byteOffset) / componentSize;
|
|
65
|
-
console.warn("Count in accessor '" + (this.name ? this.name : '') + "' is too large.");
|
|
66
|
-
}
|
|
67
|
-
switch(this.componentType){
|
|
68
|
-
case 5120:
|
|
69
|
-
this._typedView = new Int8Array(buffer, byteOffset, arrayLength);
|
|
70
|
-
break;
|
|
71
|
-
case 5121:
|
|
72
|
-
this._typedView = new Uint8Array(buffer, byteOffset, arrayLength);
|
|
73
|
-
break;
|
|
74
|
-
case 5122:
|
|
75
|
-
this._typedView = new Int16Array(buffer, byteOffset, arrayLength);
|
|
76
|
-
break;
|
|
77
|
-
case 5123:
|
|
78
|
-
this._typedView = new Uint16Array(buffer, byteOffset, arrayLength);
|
|
79
|
-
break;
|
|
80
|
-
case 5124:
|
|
81
|
-
this._typedView = new Int32Array(buffer, byteOffset, arrayLength);
|
|
82
|
-
break;
|
|
83
|
-
case 5125:
|
|
84
|
-
this._typedView = new Uint32Array(buffer, byteOffset, arrayLength);
|
|
85
|
-
break;
|
|
86
|
-
case 5126:
|
|
87
|
-
this._typedView = new Float32Array(buffer, byteOffset, arrayLength);
|
|
88
|
-
break;
|
|
89
|
-
}
|
|
90
|
-
} else if (this.sparse !== undefined) {
|
|
91
|
-
this._typedView = this.createView();
|
|
92
|
-
}
|
|
93
|
-
if (!this._typedView) {
|
|
94
|
-
console.warn('Failed to convert buffer view to typed view!: ' + this.bufferView);
|
|
95
|
-
} else if (this.sparse !== undefined) {
|
|
96
|
-
this.applySparse(gltf, this._typedView);
|
|
97
|
-
}
|
|
98
|
-
return this._typedView;
|
|
99
|
-
}
|
|
100
|
-
// getNormalizedTypedView provides an alternative view to the accessors data,
|
|
101
|
-
// where quantized data is already normalized. This is useful if the data is not passed
|
|
102
|
-
// to vertexAttribPointer but used immediately (like e.g. animations)
|
|
103
|
-
getNormalizedTypedView(gltf) {
|
|
104
|
-
if (this._normalizedTypedView) {
|
|
105
|
-
return this._normalizedTypedView;
|
|
106
|
-
}
|
|
107
|
-
const typedView = this.getTypedView(gltf);
|
|
108
|
-
this._normalizedTypedView = this.normalized ? GLTFAccessor.dequantize(typedView, this.componentType) : typedView;
|
|
109
|
-
return this._normalizedTypedView;
|
|
110
|
-
}
|
|
111
|
-
// getDeinterlacedView provides a view to the accessors data in form of
|
|
112
|
-
// a TypedArray. In contrast to getTypedView, getDeinterlacedView deinterlaces
|
|
113
|
-
// data, i.e. stripping padding and unrelated components from the array. It then
|
|
114
|
-
// only contains the data of the accessor
|
|
115
|
-
getDeinterlacedView(gltf) {
|
|
116
|
-
if (this._filteredView) {
|
|
117
|
-
return this._filteredView;
|
|
118
|
-
}
|
|
119
|
-
const componentSize = this.getComponentSize(this.componentType);
|
|
120
|
-
const componentCount = this.getComponentCount(this.type);
|
|
121
|
-
const arrayLength = this.count * componentCount;
|
|
122
|
-
let func = 'getFloat32';
|
|
123
|
-
switch(this.componentType){
|
|
124
|
-
case 5120:
|
|
125
|
-
this._filteredView = new Int8Array(arrayLength);
|
|
126
|
-
func = 'getInt8';
|
|
127
|
-
break;
|
|
128
|
-
case 5121:
|
|
129
|
-
this._filteredView = new Uint8Array(arrayLength);
|
|
130
|
-
func = 'getUint8';
|
|
131
|
-
break;
|
|
132
|
-
case 5122:
|
|
133
|
-
this._filteredView = new Int16Array(arrayLength);
|
|
134
|
-
func = 'getInt16';
|
|
135
|
-
break;
|
|
136
|
-
case 5123:
|
|
137
|
-
this._filteredView = new Uint16Array(arrayLength);
|
|
138
|
-
func = 'getUint16';
|
|
139
|
-
break;
|
|
140
|
-
case 5124:
|
|
141
|
-
this._filteredView = new Int32Array(arrayLength);
|
|
142
|
-
func = 'getInt32';
|
|
143
|
-
break;
|
|
144
|
-
case 5125:
|
|
145
|
-
this._filteredView = new Uint32Array(arrayLength);
|
|
146
|
-
func = 'getUint32';
|
|
147
|
-
break;
|
|
148
|
-
case 5126:
|
|
149
|
-
this._filteredView = new Float32Array(arrayLength);
|
|
150
|
-
func = 'getFloat32';
|
|
151
|
-
break;
|
|
152
|
-
default:
|
|
153
|
-
return;
|
|
154
|
-
}
|
|
155
|
-
if (this.bufferView !== undefined) {
|
|
156
|
-
const bufferView = gltf.bufferViews[this.bufferView];
|
|
157
|
-
const buffer = gltf._loadedBuffers[bufferView.buffer];
|
|
158
|
-
const byteOffset = this.byteOffset + (bufferView.byteOffset ?? 0);
|
|
159
|
-
const stride = bufferView.byteStride !== undefined && bufferView.byteStride !== 0 ? bufferView.byteStride : componentCount * componentSize;
|
|
160
|
-
const dataView = new DataView(buffer, byteOffset, this.count * stride);
|
|
161
|
-
for(let i = 0; i < arrayLength; ++i){
|
|
162
|
-
const offset = Math.floor(i / componentCount) * stride + i % componentCount * componentSize;
|
|
163
|
-
this._filteredView[i] = dataView[func](offset, true);
|
|
164
|
-
}
|
|
165
|
-
} else if (this.sparse !== undefined) {
|
|
166
|
-
this._filteredView = this.createView();
|
|
167
|
-
}
|
|
168
|
-
if (this.sparse !== undefined) {
|
|
169
|
-
this.applySparse(gltf, this._filteredView);
|
|
170
|
-
}
|
|
171
|
-
return this._filteredView;
|
|
172
|
-
}
|
|
173
|
-
createView() {
|
|
174
|
-
const size = this.count * this.getComponentCount(this.type);
|
|
175
|
-
if (this.componentType == 5120) {
|
|
176
|
-
return new Int8Array(size);
|
|
177
|
-
}
|
|
178
|
-
if (this.componentType == 5121) {
|
|
179
|
-
return new Uint8Array(size);
|
|
180
|
-
}
|
|
181
|
-
if (this.componentType == 5122) {
|
|
182
|
-
return new Int16Array(size);
|
|
183
|
-
}
|
|
184
|
-
if (this.componentType == 5123) {
|
|
185
|
-
return new Uint16Array(size);
|
|
186
|
-
}
|
|
187
|
-
if (this.componentType == 5124) {
|
|
188
|
-
return new Int32Array(size);
|
|
189
|
-
}
|
|
190
|
-
if (this.componentType == 5125) {
|
|
191
|
-
return new Uint32Array(size);
|
|
192
|
-
}
|
|
193
|
-
if (this.componentType == 5126) {
|
|
194
|
-
return new Float32Array(size);
|
|
195
|
-
}
|
|
196
|
-
return undefined;
|
|
197
|
-
}
|
|
198
|
-
// getNormalizedDeinterlacedView provides an alternative view to the accessors data,
|
|
199
|
-
// where quantized data is already normalized. This is useful if the data is not passed
|
|
200
|
-
// to vertexAttribPointer but used immediately (like e.g. animations)
|
|
201
|
-
getNormalizedDeinterlacedView(gltf) {
|
|
202
|
-
if (this._normalizedFilteredView) {
|
|
203
|
-
return this._normalizedFilteredView;
|
|
204
|
-
}
|
|
205
|
-
const filteredView = this.getDeinterlacedView(gltf);
|
|
206
|
-
this._normalizedFilteredView = this.normalized ? GLTFAccessor.dequantize(filteredView, this.componentType) : filteredView;
|
|
207
|
-
return this._normalizedFilteredView;
|
|
208
|
-
}
|
|
209
|
-
applySparse(gltf, view) {
|
|
210
|
-
// Gather indices.
|
|
211
|
-
const indicesBufferView = gltf.bufferViews[this.sparse.indices.bufferView];
|
|
212
|
-
const indicesBuffer = gltf._loadedBuffers[indicesBufferView.buffer];
|
|
213
|
-
const indicesByteOffset = this.sparse.indices.byteOffset + (indicesBufferView.byteOffset ?? 0);
|
|
214
|
-
const indicesComponentSize = this.getComponentSize(this.sparse.indices.componentType);
|
|
215
|
-
let indicesComponentCount = 1;
|
|
216
|
-
if (indicesBufferView.byteStride !== undefined && indicesBufferView.byteStride !== 0) {
|
|
217
|
-
indicesComponentCount = indicesBufferView.byteStride / indicesComponentSize;
|
|
218
|
-
}
|
|
219
|
-
const indicesArrayLength = this.sparse.count * indicesComponentCount;
|
|
220
|
-
let indicesTypedView;
|
|
221
|
-
switch(this.sparse.indices.componentType){
|
|
222
|
-
case 5121:
|
|
223
|
-
indicesTypedView = new Uint8Array(indicesBuffer, indicesByteOffset, indicesArrayLength);
|
|
224
|
-
break;
|
|
225
|
-
case 5123:
|
|
226
|
-
indicesTypedView = new Uint16Array(indicesBuffer, indicesByteOffset, indicesArrayLength);
|
|
227
|
-
break;
|
|
228
|
-
case 5125:
|
|
229
|
-
indicesTypedView = new Uint32Array(indicesBuffer, indicesByteOffset, indicesArrayLength);
|
|
230
|
-
break;
|
|
231
|
-
}
|
|
232
|
-
// Gather values.
|
|
233
|
-
const valuesBufferView = gltf.bufferViews[this.sparse.values.bufferView];
|
|
234
|
-
const valuesBuffer = gltf._loadedBuffers[valuesBufferView.buffer];
|
|
235
|
-
const valuesByteOffset = this.sparse.values.byteOffset + (valuesBufferView.byteOffset ?? 0);
|
|
236
|
-
const valuesComponentSize = this.getComponentSize(this.componentType);
|
|
237
|
-
let valuesComponentCount = this.getComponentCount(this.type);
|
|
238
|
-
if (valuesBufferView.byteStride !== undefined && valuesBufferView.byteStride !== 0) {
|
|
239
|
-
valuesComponentCount = valuesBufferView.byteStride / valuesComponentSize;
|
|
240
|
-
}
|
|
241
|
-
const valuesArrayLength = this.sparse.count * valuesComponentCount;
|
|
242
|
-
let valuesTypedView;
|
|
243
|
-
switch(this.componentType){
|
|
244
|
-
case 5120:
|
|
245
|
-
valuesTypedView = new Int8Array(valuesBuffer, valuesByteOffset, valuesArrayLength);
|
|
246
|
-
break;
|
|
247
|
-
case 5121:
|
|
248
|
-
valuesTypedView = new Uint8Array(valuesBuffer, valuesByteOffset, valuesArrayLength);
|
|
249
|
-
break;
|
|
250
|
-
case 5122:
|
|
251
|
-
valuesTypedView = new Int16Array(valuesBuffer, valuesByteOffset, valuesArrayLength);
|
|
252
|
-
break;
|
|
253
|
-
case 5123:
|
|
254
|
-
valuesTypedView = new Uint16Array(valuesBuffer, valuesByteOffset, valuesArrayLength);
|
|
255
|
-
break;
|
|
256
|
-
case 5124:
|
|
257
|
-
valuesTypedView = new Int32Array(valuesBuffer, valuesByteOffset, valuesArrayLength);
|
|
258
|
-
break;
|
|
259
|
-
case 5125:
|
|
260
|
-
valuesTypedView = new Uint32Array(valuesBuffer, valuesByteOffset, valuesArrayLength);
|
|
261
|
-
break;
|
|
262
|
-
case 5126:
|
|
263
|
-
valuesTypedView = new Float32Array(valuesBuffer, valuesByteOffset, valuesArrayLength);
|
|
264
|
-
break;
|
|
265
|
-
}
|
|
266
|
-
// Overwrite values.
|
|
267
|
-
for(let i = 0; i < this.sparse.count; ++i){
|
|
268
|
-
for(let k = 0; k < valuesComponentCount; ++k){
|
|
269
|
-
view[indicesTypedView[i] * valuesComponentCount + k] = valuesTypedView[i * valuesComponentCount + k];
|
|
270
|
-
}
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
// dequantize can be used to perform the normalization from WebGL2 vertexAttribPointer explicitly
|
|
274
|
-
static dequantize(typedArray, componentType) {
|
|
275
|
-
switch(componentType){
|
|
276
|
-
case 5120:
|
|
277
|
-
return new Float32Array(typedArray).map((c)=>Math.max(c / 127.0, -1));
|
|
278
|
-
case 5121:
|
|
279
|
-
return new Float32Array(typedArray).map((c)=>c / 255.0);
|
|
280
|
-
case 5122:
|
|
281
|
-
return new Float32Array(typedArray).map((c)=>Math.max(c / 32767.0, -1));
|
|
282
|
-
case 5123:
|
|
283
|
-
return new Float32Array(typedArray).map((c)=>c / 65535.0);
|
|
284
|
-
default:
|
|
285
|
-
return typedArray;
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
getComponentCount(type) {
|
|
289
|
-
switch(type){
|
|
290
|
-
case 'SCALAR':
|
|
291
|
-
return 1;
|
|
292
|
-
case 'VEC2':
|
|
293
|
-
return 2;
|
|
294
|
-
case 'VEC3':
|
|
295
|
-
return 3;
|
|
296
|
-
case 'VEC4':
|
|
297
|
-
return 4;
|
|
298
|
-
case 'MAT2':
|
|
299
|
-
return 4;
|
|
300
|
-
case 'MAT3':
|
|
301
|
-
return 9;
|
|
302
|
-
case 'MAT4':
|
|
303
|
-
return 16;
|
|
304
|
-
default:
|
|
305
|
-
return 0;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
getComponentSize(componentType) {
|
|
309
|
-
switch(componentType){
|
|
310
|
-
case 5120:
|
|
311
|
-
case 5121:
|
|
312
|
-
return 1;
|
|
313
|
-
case 5122:
|
|
314
|
-
case 5123:
|
|
315
|
-
return 2;
|
|
316
|
-
case 5124:
|
|
317
|
-
case 5125:
|
|
318
|
-
case 5126:
|
|
319
|
-
return 4;
|
|
320
|
-
default:
|
|
321
|
-
return 0;
|
|
322
|
-
}
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
export { ComponentType, GLTFAccessor };
|
|
327
|
-
//# sourceMappingURL=helpers.js.map
|