@zephyr3d/scene 0.7.1 → 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/animation.js +0 -18
- package/dist/animation/animation.js.map +1 -1
- package/dist/animation/animationset.js +200 -3
- package/dist/animation/animationset.js.map +1 -1
- package/dist/animation/ik/ccd_solver.js +371 -0
- package/dist/animation/ik/ccd_solver.js.map +1 -0
- package/dist/animation/ik/fabrik_solver.js +398 -0
- package/dist/animation/ik/fabrik_solver.js.map +1 -0
- package/dist/animation/ik/ik_angle_constraint.js +181 -0
- package/dist/animation/ik/ik_angle_constraint.js.map +1 -0
- package/dist/animation/ik/ik_chain.js +163 -0
- package/dist/animation/ik/ik_chain.js.map +1 -0
- package/dist/animation/ik/ik_constraint.js +25 -0
- package/dist/animation/ik/ik_constraint.js.map +1 -0
- package/dist/animation/ik/ik_pole_constraint.js +128 -0
- package/dist/animation/ik/ik_pole_constraint.js.map +1 -0
- package/dist/animation/ik/ik_solver.js +48 -0
- package/dist/animation/ik/ik_solver.js.map +1 -0
- package/dist/animation/ik/ik_track.js +96 -0
- package/dist/animation/ik/ik_track.js.map +1 -0
- package/dist/animation/ik/ik_utils.js +191 -0
- package/dist/animation/ik/ik_utils.js.map +1 -0
- package/dist/animation/ik/two_bone_ik_solver.js +331 -0
- package/dist/animation/ik/two_bone_ik_solver.js.map +1 -0
- package/dist/animation/ik_modifier.js +61 -0
- package/dist/animation/ik_modifier.js.map +1 -0
- package/dist/animation/ik_postprocessor.js +71 -0
- package/dist/animation/ik_postprocessor.js.map +1 -0
- package/dist/animation/manual_transform_processor.js +156 -0
- package/dist/animation/manual_transform_processor.js.map +1 -0
- package/dist/animation/skeleton.js +55 -51
- package/dist/animation/skeleton.js.map +1 -1
- package/dist/animation/skeleton_modifier.js +38 -0
- package/dist/animation/skeleton_modifier.js.map +1 -0
- package/dist/animation/skeleton_postprocessor.js +50 -0
- package/dist/animation/skeleton_postprocessor.js.map +1 -0
- package/dist/animation/spring/multi_chain_spring_system.js +503 -0
- package/dist/animation/spring/multi_chain_spring_system.js.map +1 -0
- 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/animation/spring/spring_chain.js +103 -0
- package/dist/animation/spring/spring_chain.js.map +1 -0
- package/dist/animation/spring/spring_collider.js +247 -0
- package/dist/animation/spring/spring_collider.js.map +1 -0
- package/dist/animation/spring/spring_constraint.js +21 -0
- package/dist/animation/spring/spring_constraint.js.map +1 -0
- package/dist/animation/spring/spring_particle.js +20 -0
- package/dist/animation/spring/spring_particle.js.map +1 -0
- package/dist/animation/spring/spring_system.js +526 -0
- package/dist/animation/spring/spring_system.js.map +1 -0
- package/dist/animation/spring_modifier.js +45 -0
- package/dist/animation/spring_modifier.js.map +1 -0
- package/dist/animation/spring_postprocessor.js +54 -0
- package/dist/animation/spring_postprocessor.js.map +1 -0
- package/dist/app/screen.js +1 -1
- package/dist/app/screen.js.map +1 -1
- package/dist/asset/model.js +10 -6
- package/dist/asset/model.js.map +1 -1
- package/dist/camera/perspectivecamera.js +3 -3
- package/dist/camera/perspectivecamera.js.map +1 -1
- package/dist/index.d.ts +1400 -4
- package/dist/index.js +16 -0
- package/dist/index.js.map +1 -1
- package/dist/material/mixins/lightmodel/blinnphong.js +66 -4
- package/dist/material/mixins/lightmodel/blinnphong.js.map +1 -1
- package/dist/material/mixins/pbr/common.js +20 -17
- package/dist/material/mixins/pbr/common.js.map +1 -1
- package/dist/material/shader/helper.js +5 -3
- package/dist/material/shader/helper.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/scene/mesh.js +15 -23
- package/dist/scene/mesh.js.map +1 -1
- package/dist/utility/serialization/scene/animation.js +24 -23
- package/dist/utility/serialization/scene/animation.js.map +1 -1
- package/dist/utility/serialization/scene/material.js +62 -0
- package/dist/utility/serialization/scene/material.js.map +1 -1
- package/dist/utility/serialization/scene/node.js +1 -1
- package/package.json +3 -3
- 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,1111 +0,0 @@
|
|
|
1
|
-
import '../../../material/shader/helper.js';
|
|
2
|
-
import { LambertMaterial } from '../../../material/lambert.js';
|
|
3
|
-
import { BlinnMaterial } from '../../../material/blinn.js';
|
|
4
|
-
import { UnlitMaterial } from '../../../material/unlit.js';
|
|
5
|
-
import { ParticleMaterial } from '../../../material/particle.js';
|
|
6
|
-
import { Material } from '../../../material/material.js';
|
|
7
|
-
import { MeshMaterial } from '../../../material/meshmaterial.js';
|
|
8
|
-
import '../../../material/grassmaterial.js';
|
|
9
|
-
import '../../../material/terrainmaterial.js';
|
|
10
|
-
import '../../../material/terrain-cm.js';
|
|
11
|
-
import { PBRMetallicRoughnessMaterial } from '../../../material/pbrmr.js';
|
|
12
|
-
import { PBRSpecularGlossinessMaterial } from '../../../material/pbrsg.js';
|
|
13
|
-
import { Vector4, Vector3 } from '@zephyr3d/base';
|
|
14
|
-
import '../../../values.js';
|
|
15
|
-
import { getTextureProps } from './common.js';
|
|
16
|
-
|
|
17
|
-
function getPBRCommonProps(manager) {
|
|
18
|
-
return [
|
|
19
|
-
{
|
|
20
|
-
name: 'IOR',
|
|
21
|
-
type: 'float',
|
|
22
|
-
default: 1.5,
|
|
23
|
-
options: {
|
|
24
|
-
animatable: true
|
|
25
|
-
},
|
|
26
|
-
get (value) {
|
|
27
|
-
value.num[0] = this.ior;
|
|
28
|
-
},
|
|
29
|
-
set (value) {
|
|
30
|
-
this.ior = value.num[0];
|
|
31
|
-
},
|
|
32
|
-
isValid () {
|
|
33
|
-
return !this.$isInstance;
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
{
|
|
37
|
-
name: 'OcclusionStrength',
|
|
38
|
-
type: 'float',
|
|
39
|
-
phase: 2,
|
|
40
|
-
default: 1,
|
|
41
|
-
options: {
|
|
42
|
-
animatable: true,
|
|
43
|
-
minValue: 0,
|
|
44
|
-
maxValue: 1
|
|
45
|
-
},
|
|
46
|
-
get (value) {
|
|
47
|
-
value.num[0] = this.occlusionStrength;
|
|
48
|
-
},
|
|
49
|
-
set (value) {
|
|
50
|
-
this.occlusionStrength = value.num[0];
|
|
51
|
-
},
|
|
52
|
-
isValid () {
|
|
53
|
-
return !this.$isInstance && !!this.occlusionTexture;
|
|
54
|
-
}
|
|
55
|
-
},
|
|
56
|
-
...getTextureProps(manager, 'occlusionTexture', '2D', 0),
|
|
57
|
-
{
|
|
58
|
-
name: 'EmissiveColor',
|
|
59
|
-
type: 'rgb',
|
|
60
|
-
options: {
|
|
61
|
-
animatable: true
|
|
62
|
-
},
|
|
63
|
-
get (value) {
|
|
64
|
-
value.num[0] = this.emissiveColor.x;
|
|
65
|
-
value.num[1] = this.emissiveColor.y;
|
|
66
|
-
value.num[2] = this.emissiveColor.z;
|
|
67
|
-
},
|
|
68
|
-
set (value) {
|
|
69
|
-
this.emissiveColor = new Vector3(value.num[0], value.num[1], value.num[2]);
|
|
70
|
-
},
|
|
71
|
-
getDefaultValue () {
|
|
72
|
-
return this.$isInstance ? this.coreMaterial.emissiveColor : [
|
|
73
|
-
0,
|
|
74
|
-
0,
|
|
75
|
-
0
|
|
76
|
-
];
|
|
77
|
-
}
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: 'EmissiveStrength',
|
|
81
|
-
type: 'float',
|
|
82
|
-
options: {
|
|
83
|
-
animatable: true,
|
|
84
|
-
minValue: 0,
|
|
85
|
-
maxValue: 1
|
|
86
|
-
},
|
|
87
|
-
get (value) {
|
|
88
|
-
value.num[0] = this.emissiveStrength;
|
|
89
|
-
},
|
|
90
|
-
set (value) {
|
|
91
|
-
this.emissiveStrength = value.num[0];
|
|
92
|
-
},
|
|
93
|
-
getDefaultValue () {
|
|
94
|
-
return this.$isInstance ? this.coreMaterial.emissiveStrength : 1;
|
|
95
|
-
}
|
|
96
|
-
},
|
|
97
|
-
...getTextureProps(manager, 'emissiveTexture', '2D', 0),
|
|
98
|
-
...getTextureProps(manager, 'specularTexture', '2D', 0),
|
|
99
|
-
{
|
|
100
|
-
name: 'Transmission',
|
|
101
|
-
type: 'bool',
|
|
102
|
-
phase: 0,
|
|
103
|
-
default: false,
|
|
104
|
-
get (value) {
|
|
105
|
-
value.bool[0] = this.transmission;
|
|
106
|
-
},
|
|
107
|
-
set (value) {
|
|
108
|
-
this.transmission = value.bool[0];
|
|
109
|
-
},
|
|
110
|
-
isValid () {
|
|
111
|
-
return !this.$isInstance;
|
|
112
|
-
}
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
name: 'TransmissionFactor',
|
|
116
|
-
type: 'float',
|
|
117
|
-
phase: 1,
|
|
118
|
-
default: 0,
|
|
119
|
-
options: {
|
|
120
|
-
animatable: true,
|
|
121
|
-
minValue: 0,
|
|
122
|
-
maxValue: 1
|
|
123
|
-
},
|
|
124
|
-
get (value) {
|
|
125
|
-
value.num[0] = this.transmissionFactor;
|
|
126
|
-
},
|
|
127
|
-
set (value) {
|
|
128
|
-
this.transmissionFactor = value.num[0];
|
|
129
|
-
},
|
|
130
|
-
isValid () {
|
|
131
|
-
return !this.$isInstance && !!this.transmission;
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
...getTextureProps(manager, 'transmissionTexture', '2D', 1, function() {
|
|
135
|
-
return this.transmission;
|
|
136
|
-
}),
|
|
137
|
-
{
|
|
138
|
-
name: 'ThicknessFactor',
|
|
139
|
-
type: 'float',
|
|
140
|
-
phase: 1,
|
|
141
|
-
default: 0,
|
|
142
|
-
options: {
|
|
143
|
-
animatable: true,
|
|
144
|
-
minValue: 0,
|
|
145
|
-
maxValue: 99999
|
|
146
|
-
},
|
|
147
|
-
get (value) {
|
|
148
|
-
value.num[0] = this.thicknessFactor;
|
|
149
|
-
},
|
|
150
|
-
set (value) {
|
|
151
|
-
this.thicknessFactor = value.num[0];
|
|
152
|
-
},
|
|
153
|
-
isValid () {
|
|
154
|
-
return !this.$isInstance && !!this.transmission;
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
...getTextureProps(manager, 'thicknessTexture', '2D', 1, function() {
|
|
158
|
-
return this.transmission;
|
|
159
|
-
}),
|
|
160
|
-
{
|
|
161
|
-
name: 'AttenuationColor',
|
|
162
|
-
type: 'rgb',
|
|
163
|
-
phase: 1,
|
|
164
|
-
default: [
|
|
165
|
-
1,
|
|
166
|
-
1,
|
|
167
|
-
1
|
|
168
|
-
],
|
|
169
|
-
options: {
|
|
170
|
-
animatable: true
|
|
171
|
-
},
|
|
172
|
-
get (value) {
|
|
173
|
-
value.num[0] = this.attenuationColor.x;
|
|
174
|
-
value.num[1] = this.attenuationColor.y;
|
|
175
|
-
value.num[2] = this.attenuationColor.z;
|
|
176
|
-
},
|
|
177
|
-
set (value) {
|
|
178
|
-
this.attenuationColor = new Vector3(value.num[0], value.num[1], value.num[2]);
|
|
179
|
-
},
|
|
180
|
-
isValid () {
|
|
181
|
-
return !this.$isInstance && !!this.transmission;
|
|
182
|
-
}
|
|
183
|
-
},
|
|
184
|
-
{
|
|
185
|
-
name: 'AttenuationDistance',
|
|
186
|
-
type: 'float',
|
|
187
|
-
phase: 1,
|
|
188
|
-
default: 99999,
|
|
189
|
-
options: {
|
|
190
|
-
animatable: true,
|
|
191
|
-
minValue: 0,
|
|
192
|
-
maxValue: 99999
|
|
193
|
-
},
|
|
194
|
-
get (value) {
|
|
195
|
-
value.num[0] = this.attenuationDistance;
|
|
196
|
-
},
|
|
197
|
-
set (value) {
|
|
198
|
-
this.attenuationDistance = value.num[0];
|
|
199
|
-
},
|
|
200
|
-
isValid () {
|
|
201
|
-
return !this.$isInstance && !!this.transmission;
|
|
202
|
-
}
|
|
203
|
-
},
|
|
204
|
-
{
|
|
205
|
-
name: 'Iridescence',
|
|
206
|
-
type: 'bool',
|
|
207
|
-
phase: 0,
|
|
208
|
-
default: false,
|
|
209
|
-
get (value) {
|
|
210
|
-
value.bool[0] = this.iridescence;
|
|
211
|
-
},
|
|
212
|
-
set (value) {
|
|
213
|
-
this.iridescence = value.bool[0];
|
|
214
|
-
},
|
|
215
|
-
isValid () {
|
|
216
|
-
return !this.$isInstance;
|
|
217
|
-
}
|
|
218
|
-
},
|
|
219
|
-
{
|
|
220
|
-
name: 'IridescenceFactor',
|
|
221
|
-
type: 'float',
|
|
222
|
-
phase: 1,
|
|
223
|
-
default: 0,
|
|
224
|
-
options: {
|
|
225
|
-
animatable: true,
|
|
226
|
-
minValue: 0,
|
|
227
|
-
maxValue: 1
|
|
228
|
-
},
|
|
229
|
-
get (value) {
|
|
230
|
-
value.num[0] = this.iridescenceFactor;
|
|
231
|
-
},
|
|
232
|
-
set (value) {
|
|
233
|
-
this.iridescenceFactor = value.num[0];
|
|
234
|
-
},
|
|
235
|
-
isValid () {
|
|
236
|
-
return !this.$isInstance && !!this.iridescence;
|
|
237
|
-
}
|
|
238
|
-
},
|
|
239
|
-
...getTextureProps(manager, 'iridescenceTexture', '2D', 1, function() {
|
|
240
|
-
return this.iridescence;
|
|
241
|
-
}),
|
|
242
|
-
{
|
|
243
|
-
name: 'IridescenceIOR',
|
|
244
|
-
type: 'float',
|
|
245
|
-
phase: 1,
|
|
246
|
-
default: 1.3,
|
|
247
|
-
options: {
|
|
248
|
-
animatable: true
|
|
249
|
-
},
|
|
250
|
-
get (value) {
|
|
251
|
-
value.num[0] = this.iridescenceIor;
|
|
252
|
-
},
|
|
253
|
-
set (value) {
|
|
254
|
-
this.iridescenceIor = value.num[0];
|
|
255
|
-
},
|
|
256
|
-
isValid () {
|
|
257
|
-
return !this.$isInstance && !!this.iridescence;
|
|
258
|
-
}
|
|
259
|
-
},
|
|
260
|
-
{
|
|
261
|
-
name: 'IridescenceThicknessMin',
|
|
262
|
-
type: 'float',
|
|
263
|
-
phase: 1,
|
|
264
|
-
default: 100,
|
|
265
|
-
options: {
|
|
266
|
-
animatable: true,
|
|
267
|
-
minValue: 0,
|
|
268
|
-
maxValue: 1000
|
|
269
|
-
},
|
|
270
|
-
get (value) {
|
|
271
|
-
value.num[0] = this.iridescenceThicknessMin;
|
|
272
|
-
},
|
|
273
|
-
set (value) {
|
|
274
|
-
this.iridescenceThicknessMin = value.num[0];
|
|
275
|
-
},
|
|
276
|
-
isValid () {
|
|
277
|
-
return !this.$isInstance && !!this.iridescence;
|
|
278
|
-
}
|
|
279
|
-
},
|
|
280
|
-
{
|
|
281
|
-
name: 'IridescenceThicknessMax',
|
|
282
|
-
type: 'float',
|
|
283
|
-
phase: 1,
|
|
284
|
-
default: 400,
|
|
285
|
-
options: {
|
|
286
|
-
animatable: true,
|
|
287
|
-
minValue: 0,
|
|
288
|
-
maxValue: 1000
|
|
289
|
-
},
|
|
290
|
-
get (value) {
|
|
291
|
-
value.num[0] = this.iridescenceThicknessMax;
|
|
292
|
-
},
|
|
293
|
-
set (value) {
|
|
294
|
-
this.iridescenceThicknessMax = value.num[0];
|
|
295
|
-
},
|
|
296
|
-
isValid () {
|
|
297
|
-
return !this.$isInstance && !!this.iridescence;
|
|
298
|
-
}
|
|
299
|
-
},
|
|
300
|
-
...getTextureProps(manager, 'iridescenceThicknessTexture', '2D', 1, function() {
|
|
301
|
-
return this.iridescence;
|
|
302
|
-
}),
|
|
303
|
-
{
|
|
304
|
-
name: 'ClearCoat',
|
|
305
|
-
type: 'bool',
|
|
306
|
-
phase: 0,
|
|
307
|
-
default: false,
|
|
308
|
-
get (value) {
|
|
309
|
-
value.bool[0] = this.clearcoat;
|
|
310
|
-
},
|
|
311
|
-
set (value) {
|
|
312
|
-
this.clearcoat = value.bool[0];
|
|
313
|
-
},
|
|
314
|
-
isValid () {
|
|
315
|
-
return !this.$isInstance;
|
|
316
|
-
}
|
|
317
|
-
},
|
|
318
|
-
{
|
|
319
|
-
name: 'ClearCoatIntensity',
|
|
320
|
-
type: 'float',
|
|
321
|
-
phase: 1,
|
|
322
|
-
default: 0,
|
|
323
|
-
options: {
|
|
324
|
-
animatable: true,
|
|
325
|
-
minValue: 0,
|
|
326
|
-
maxValue: 1
|
|
327
|
-
},
|
|
328
|
-
get (value) {
|
|
329
|
-
value.num[0] = this.clearcoatIntensity;
|
|
330
|
-
},
|
|
331
|
-
set (value) {
|
|
332
|
-
this.clearcoatIntensity = value.num[0];
|
|
333
|
-
},
|
|
334
|
-
isValid () {
|
|
335
|
-
return !this.$isInstance && !!this.clearcoat;
|
|
336
|
-
}
|
|
337
|
-
},
|
|
338
|
-
...getTextureProps(manager, 'clearcoatIntensityTexture', '2D', 1, function() {
|
|
339
|
-
return this.clearcoat;
|
|
340
|
-
}),
|
|
341
|
-
{
|
|
342
|
-
name: 'ClearCoatRoughnessFactor',
|
|
343
|
-
type: 'float',
|
|
344
|
-
phase: 1,
|
|
345
|
-
default: 0,
|
|
346
|
-
options: {
|
|
347
|
-
animatable: true,
|
|
348
|
-
minValue: 0,
|
|
349
|
-
maxValue: 1
|
|
350
|
-
},
|
|
351
|
-
get (value) {
|
|
352
|
-
value.num[0] = this.clearcoatRoughnessFactor;
|
|
353
|
-
},
|
|
354
|
-
set (value) {
|
|
355
|
-
this.clearcoatRoughnessFactor = value.num[0];
|
|
356
|
-
},
|
|
357
|
-
isValid () {
|
|
358
|
-
return !this.$isInstance && !!this.clearcoat;
|
|
359
|
-
}
|
|
360
|
-
},
|
|
361
|
-
...getTextureProps(manager, 'clearcoatRoughnessTexture', '2D', 1, function() {
|
|
362
|
-
return this.clearcoat;
|
|
363
|
-
}),
|
|
364
|
-
...getTextureProps(manager, 'clearcoatNormalTexture', '2D', 1, function() {
|
|
365
|
-
return this.clearcoat;
|
|
366
|
-
}),
|
|
367
|
-
{
|
|
368
|
-
name: 'Sheen',
|
|
369
|
-
type: 'bool',
|
|
370
|
-
phase: 0,
|
|
371
|
-
default: false,
|
|
372
|
-
get (value) {
|
|
373
|
-
value.bool[0] = this.sheen;
|
|
374
|
-
},
|
|
375
|
-
set (value) {
|
|
376
|
-
this.sheen = value.bool[0];
|
|
377
|
-
},
|
|
378
|
-
isValid () {
|
|
379
|
-
return !this.$isInstance;
|
|
380
|
-
}
|
|
381
|
-
},
|
|
382
|
-
{
|
|
383
|
-
name: 'SheenColorFactor',
|
|
384
|
-
type: 'rgb',
|
|
385
|
-
phase: 1,
|
|
386
|
-
default: [
|
|
387
|
-
0,
|
|
388
|
-
0,
|
|
389
|
-
0
|
|
390
|
-
],
|
|
391
|
-
options: {
|
|
392
|
-
animatable: true
|
|
393
|
-
},
|
|
394
|
-
get (value) {
|
|
395
|
-
value.num[0] = this.sheenColorFactor.x;
|
|
396
|
-
value.num[1] = this.sheenColorFactor.y;
|
|
397
|
-
value.num[2] = this.sheenColorFactor.z;
|
|
398
|
-
},
|
|
399
|
-
set (value) {
|
|
400
|
-
this.sheenColorFactor = new Vector3(value.num[0], value.num[1], value.num[2]);
|
|
401
|
-
},
|
|
402
|
-
isValid () {
|
|
403
|
-
return !this.$isInstance && !!this.sheen;
|
|
404
|
-
}
|
|
405
|
-
},
|
|
406
|
-
...getTextureProps(manager, 'sheenColorTexture', '2D', 1, function() {
|
|
407
|
-
return this.sheen;
|
|
408
|
-
}),
|
|
409
|
-
{
|
|
410
|
-
name: 'SheenRoughnessFactor',
|
|
411
|
-
type: 'float',
|
|
412
|
-
phase: 1,
|
|
413
|
-
default: 0,
|
|
414
|
-
options: {
|
|
415
|
-
animatable: true,
|
|
416
|
-
minValue: 0,
|
|
417
|
-
maxValue: 1
|
|
418
|
-
},
|
|
419
|
-
get (value) {
|
|
420
|
-
value.num[0] = this.sheenRoughnessFactor;
|
|
421
|
-
},
|
|
422
|
-
set (value) {
|
|
423
|
-
this.sheenRoughnessFactor = value.num[0];
|
|
424
|
-
},
|
|
425
|
-
isValid () {
|
|
426
|
-
return !this.$isInstance && !!this.sheen;
|
|
427
|
-
}
|
|
428
|
-
},
|
|
429
|
-
...getTextureProps(manager, 'sheenRoughnessTexture', '2D', 1, function() {
|
|
430
|
-
return this.sheen;
|
|
431
|
-
}),
|
|
432
|
-
...getLitMaterialProps(manager)
|
|
433
|
-
];
|
|
434
|
-
}
|
|
435
|
-
function getLitMaterialProps(manager) {
|
|
436
|
-
return [
|
|
437
|
-
...getUnlitMaterialProps(manager),
|
|
438
|
-
{
|
|
439
|
-
name: 'vertexNormal',
|
|
440
|
-
type: 'bool',
|
|
441
|
-
default: true,
|
|
442
|
-
get (value) {
|
|
443
|
-
value.bool[0] = this.vertexNormal;
|
|
444
|
-
},
|
|
445
|
-
set (value) {
|
|
446
|
-
this.vertexNormal = value.bool[0];
|
|
447
|
-
},
|
|
448
|
-
isValid () {
|
|
449
|
-
return !this.$isInstance;
|
|
450
|
-
}
|
|
451
|
-
},
|
|
452
|
-
{
|
|
453
|
-
name: 'vertexTangent',
|
|
454
|
-
type: 'bool',
|
|
455
|
-
default: false,
|
|
456
|
-
get (value) {
|
|
457
|
-
value.bool[0] = this.vertexTangent;
|
|
458
|
-
},
|
|
459
|
-
set (value) {
|
|
460
|
-
this.vertexTangent = value.bool[0];
|
|
461
|
-
},
|
|
462
|
-
isValid () {
|
|
463
|
-
return !this.$isInstance && !!this.vertexNormal;
|
|
464
|
-
}
|
|
465
|
-
},
|
|
466
|
-
...getTextureProps(manager, 'normalTexture', '2D', 0)
|
|
467
|
-
];
|
|
468
|
-
}
|
|
469
|
-
function getUnlitMaterialProps(manager) {
|
|
470
|
-
return [
|
|
471
|
-
{
|
|
472
|
-
name: 'vertexColor',
|
|
473
|
-
type: 'bool',
|
|
474
|
-
default: false,
|
|
475
|
-
get (value) {
|
|
476
|
-
value.bool[0] = this.vertexColor;
|
|
477
|
-
},
|
|
478
|
-
set (value) {
|
|
479
|
-
this.vertexColor = value.bool[0];
|
|
480
|
-
},
|
|
481
|
-
isValid () {
|
|
482
|
-
return !this.$isInstance;
|
|
483
|
-
}
|
|
484
|
-
},
|
|
485
|
-
{
|
|
486
|
-
name: 'AlbedoColor',
|
|
487
|
-
type: 'rgba',
|
|
488
|
-
options: {
|
|
489
|
-
animatable: true
|
|
490
|
-
},
|
|
491
|
-
get (value) {
|
|
492
|
-
const color = this.albedoColor;
|
|
493
|
-
value.num[0] = color.x;
|
|
494
|
-
value.num[1] = color.y;
|
|
495
|
-
value.num[2] = color.z;
|
|
496
|
-
value.num[3] = color.w;
|
|
497
|
-
},
|
|
498
|
-
set (value) {
|
|
499
|
-
this.albedoColor = new Vector4(value.num[0], value.num[1], value.num[2], value.num[3]);
|
|
500
|
-
},
|
|
501
|
-
getDefaultValue () {
|
|
502
|
-
return this.$isInstance ? this.coreMaterial.albedoColor : [
|
|
503
|
-
1,
|
|
504
|
-
1,
|
|
505
|
-
1,
|
|
506
|
-
1
|
|
507
|
-
];
|
|
508
|
-
}
|
|
509
|
-
},
|
|
510
|
-
...getTextureProps(manager, 'albedoTexture', '2D', 0)
|
|
511
|
-
];
|
|
512
|
-
}
|
|
513
|
-
/** @internal */ function getMeshMaterialClass() {
|
|
514
|
-
return {
|
|
515
|
-
ctor: MeshMaterial,
|
|
516
|
-
name: 'MeshMaterial',
|
|
517
|
-
createFunc (ctx, initParams) {
|
|
518
|
-
let mat = Material.findMaterialById(initParams.persistentId);
|
|
519
|
-
if (mat) {
|
|
520
|
-
return {
|
|
521
|
-
obj: mat,
|
|
522
|
-
loadProps: false
|
|
523
|
-
};
|
|
524
|
-
} else if (initParams.persistentId === initParams.corePersistentId) {
|
|
525
|
-
mat = new MeshMaterial();
|
|
526
|
-
mat.persistentId = initParams.persistentId;
|
|
527
|
-
return {
|
|
528
|
-
obj: mat,
|
|
529
|
-
loadProps: true
|
|
530
|
-
};
|
|
531
|
-
} else {
|
|
532
|
-
const coreMaterial = Material.findMaterialById(initParams.corePersistentId);
|
|
533
|
-
if (!coreMaterial) {
|
|
534
|
-
throw new Error('Load material failed: core material not found');
|
|
535
|
-
}
|
|
536
|
-
mat = coreMaterial.createInstance();
|
|
537
|
-
mat.persistentId = initParams.persistentId;
|
|
538
|
-
return {
|
|
539
|
-
obj: mat,
|
|
540
|
-
loadProps: true
|
|
541
|
-
};
|
|
542
|
-
}
|
|
543
|
-
},
|
|
544
|
-
getInitParams (obj) {
|
|
545
|
-
return {
|
|
546
|
-
persistentId: obj.persistentId,
|
|
547
|
-
corePersistentId: obj.coreMaterial.persistentId
|
|
548
|
-
};
|
|
549
|
-
},
|
|
550
|
-
getProps () {
|
|
551
|
-
return [
|
|
552
|
-
{
|
|
553
|
-
name: 'AlphaCutoff',
|
|
554
|
-
type: 'float',
|
|
555
|
-
default: 0,
|
|
556
|
-
options: {
|
|
557
|
-
animatable: true,
|
|
558
|
-
minValue: 0,
|
|
559
|
-
maxValue: 1
|
|
560
|
-
},
|
|
561
|
-
get (value) {
|
|
562
|
-
value.num[0] = this.alphaCutoff;
|
|
563
|
-
},
|
|
564
|
-
set (value) {
|
|
565
|
-
this.alphaCutoff = value.num[0];
|
|
566
|
-
},
|
|
567
|
-
isValid () {
|
|
568
|
-
return !this.$isInstance;
|
|
569
|
-
}
|
|
570
|
-
},
|
|
571
|
-
{
|
|
572
|
-
name: 'AlphaToCoverage',
|
|
573
|
-
type: 'bool',
|
|
574
|
-
default: false,
|
|
575
|
-
get (value) {
|
|
576
|
-
value.bool[0] = this.alphaToCoverage;
|
|
577
|
-
},
|
|
578
|
-
set (value) {
|
|
579
|
-
this.alphaToCoverage = value.bool[0];
|
|
580
|
-
},
|
|
581
|
-
isValid () {
|
|
582
|
-
return !this.$isInstance;
|
|
583
|
-
}
|
|
584
|
-
},
|
|
585
|
-
{
|
|
586
|
-
name: 'BlendMode',
|
|
587
|
-
type: 'string',
|
|
588
|
-
options: {
|
|
589
|
-
enum: {
|
|
590
|
-
labels: [
|
|
591
|
-
'None',
|
|
592
|
-
'Blend',
|
|
593
|
-
'Additive'
|
|
594
|
-
],
|
|
595
|
-
values: [
|
|
596
|
-
'none',
|
|
597
|
-
'blend',
|
|
598
|
-
'additive'
|
|
599
|
-
]
|
|
600
|
-
}
|
|
601
|
-
},
|
|
602
|
-
default: 'none',
|
|
603
|
-
get (value) {
|
|
604
|
-
value.str[0] = this.blendMode;
|
|
605
|
-
},
|
|
606
|
-
set (value) {
|
|
607
|
-
this.blendMode = value.str[0];
|
|
608
|
-
},
|
|
609
|
-
isValid () {
|
|
610
|
-
return !this.$isInstance;
|
|
611
|
-
}
|
|
612
|
-
},
|
|
613
|
-
{
|
|
614
|
-
name: 'CullMode',
|
|
615
|
-
type: 'string',
|
|
616
|
-
options: {
|
|
617
|
-
enum: {
|
|
618
|
-
labels: [
|
|
619
|
-
'None',
|
|
620
|
-
'Front',
|
|
621
|
-
'Back'
|
|
622
|
-
],
|
|
623
|
-
values: [
|
|
624
|
-
'none',
|
|
625
|
-
'front',
|
|
626
|
-
'back'
|
|
627
|
-
]
|
|
628
|
-
}
|
|
629
|
-
},
|
|
630
|
-
default: 'back',
|
|
631
|
-
get (value) {
|
|
632
|
-
value.str[0] = this.cullMode;
|
|
633
|
-
},
|
|
634
|
-
set (value) {
|
|
635
|
-
this.cullMode = value.str[0];
|
|
636
|
-
},
|
|
637
|
-
isValid () {
|
|
638
|
-
return !this.$isInstance;
|
|
639
|
-
}
|
|
640
|
-
},
|
|
641
|
-
{
|
|
642
|
-
name: 'Opacity',
|
|
643
|
-
type: 'float',
|
|
644
|
-
options: {
|
|
645
|
-
animatable: true,
|
|
646
|
-
minValue: 0,
|
|
647
|
-
maxValue: 1
|
|
648
|
-
},
|
|
649
|
-
default: 1,
|
|
650
|
-
get (value) {
|
|
651
|
-
value.num[0] = this.opacity;
|
|
652
|
-
},
|
|
653
|
-
set (value) {
|
|
654
|
-
this.opacity = value.num[0];
|
|
655
|
-
},
|
|
656
|
-
getDefaultValue () {
|
|
657
|
-
return this.$isInstance ? this.coreMaterial.opacity : 1;
|
|
658
|
-
}
|
|
659
|
-
},
|
|
660
|
-
{
|
|
661
|
-
name: 'TAAStrength',
|
|
662
|
-
type: 'float',
|
|
663
|
-
options: {
|
|
664
|
-
minValue: 0,
|
|
665
|
-
maxValue: 1
|
|
666
|
-
},
|
|
667
|
-
default: 15 / 16,
|
|
668
|
-
get (value) {
|
|
669
|
-
value.num[0] = this.TAAStrength;
|
|
670
|
-
},
|
|
671
|
-
set (value) {
|
|
672
|
-
this.TAAStrength = value.num[0];
|
|
673
|
-
},
|
|
674
|
-
isValid () {
|
|
675
|
-
return !this.$isInstance;
|
|
676
|
-
}
|
|
677
|
-
}
|
|
678
|
-
];
|
|
679
|
-
}
|
|
680
|
-
};
|
|
681
|
-
}
|
|
682
|
-
/** @internal */ function getParticleMaterialClass(manager) {
|
|
683
|
-
return {
|
|
684
|
-
ctor: ParticleMaterial,
|
|
685
|
-
name: 'ParticleMaterial',
|
|
686
|
-
parent: MeshMaterial,
|
|
687
|
-
createFunc (ctx, initParams) {
|
|
688
|
-
let mat = Material.findMaterialById(initParams.persistentId);
|
|
689
|
-
if (mat) {
|
|
690
|
-
return {
|
|
691
|
-
obj: mat,
|
|
692
|
-
loadProps: false
|
|
693
|
-
};
|
|
694
|
-
} else {
|
|
695
|
-
mat = new ParticleMaterial();
|
|
696
|
-
mat.persistentId = initParams.persistentId;
|
|
697
|
-
return {
|
|
698
|
-
obj: mat,
|
|
699
|
-
loadProps: true
|
|
700
|
-
};
|
|
701
|
-
}
|
|
702
|
-
},
|
|
703
|
-
getInitParams (obj) {
|
|
704
|
-
return {
|
|
705
|
-
persistentId: obj.persistentId
|
|
706
|
-
};
|
|
707
|
-
},
|
|
708
|
-
getProps () {
|
|
709
|
-
return [
|
|
710
|
-
{
|
|
711
|
-
name: 'AlphaMap',
|
|
712
|
-
type: 'object',
|
|
713
|
-
default: '',
|
|
714
|
-
isNullable () {
|
|
715
|
-
return true;
|
|
716
|
-
},
|
|
717
|
-
get (value) {
|
|
718
|
-
value.str[0] = manager.getAssetId(this.alphaMap) ?? '';
|
|
719
|
-
},
|
|
720
|
-
async set (value) {
|
|
721
|
-
if (value.str[0]) {
|
|
722
|
-
const assetId = value.str[0];
|
|
723
|
-
let tex;
|
|
724
|
-
try {
|
|
725
|
-
tex = await manager.fetchTexture(assetId);
|
|
726
|
-
} catch (err) {
|
|
727
|
-
console.error(`Load asset failed: ${value.str[0]}: ${err}`);
|
|
728
|
-
}
|
|
729
|
-
if (tex?.isTexture2D()) {
|
|
730
|
-
this.alphaMap = tex;
|
|
731
|
-
} else {
|
|
732
|
-
console.error('Invalid albedo texture');
|
|
733
|
-
}
|
|
734
|
-
}
|
|
735
|
-
}
|
|
736
|
-
},
|
|
737
|
-
{
|
|
738
|
-
name: 'RampMap',
|
|
739
|
-
type: 'object',
|
|
740
|
-
default: '',
|
|
741
|
-
isNullable () {
|
|
742
|
-
return true;
|
|
743
|
-
},
|
|
744
|
-
get (value) {
|
|
745
|
-
value.str[0] = manager.getAssetId(this.rampMap) ?? '';
|
|
746
|
-
},
|
|
747
|
-
async set (value) {
|
|
748
|
-
if (value.str[0]) {
|
|
749
|
-
const assetId = value.str[0];
|
|
750
|
-
let tex;
|
|
751
|
-
try {
|
|
752
|
-
tex = await manager.fetchTexture(assetId);
|
|
753
|
-
} catch (err) {
|
|
754
|
-
console.error(`Load asset failed: ${value.str[0]}: ${err}`);
|
|
755
|
-
}
|
|
756
|
-
if (tex?.isTexture2D()) {
|
|
757
|
-
this.rampMap = tex;
|
|
758
|
-
} else {
|
|
759
|
-
console.error('Invalid albedo texture');
|
|
760
|
-
}
|
|
761
|
-
}
|
|
762
|
-
}
|
|
763
|
-
}
|
|
764
|
-
];
|
|
765
|
-
}
|
|
766
|
-
};
|
|
767
|
-
}
|
|
768
|
-
/** @internal */ function getUnlitMaterialClass(manager) {
|
|
769
|
-
return {
|
|
770
|
-
ctor: UnlitMaterial,
|
|
771
|
-
parent: MeshMaterial,
|
|
772
|
-
name: 'UnlitMaterial',
|
|
773
|
-
createFunc (ctx, initParams) {
|
|
774
|
-
let mat = Material.findMaterialById(initParams.persistentId);
|
|
775
|
-
if (mat) {
|
|
776
|
-
return {
|
|
777
|
-
obj: mat,
|
|
778
|
-
loadProps: false
|
|
779
|
-
};
|
|
780
|
-
} else if (initParams.persistentId === initParams.corePersistentId) {
|
|
781
|
-
mat = new UnlitMaterial();
|
|
782
|
-
mat.persistentId = initParams.persistentId;
|
|
783
|
-
return {
|
|
784
|
-
obj: mat,
|
|
785
|
-
loadProps: true
|
|
786
|
-
};
|
|
787
|
-
} else {
|
|
788
|
-
const coreMaterial = Material.findMaterialById(initParams.corePersistentId);
|
|
789
|
-
if (!coreMaterial) {
|
|
790
|
-
throw new Error('Load material failed: core material not found');
|
|
791
|
-
}
|
|
792
|
-
mat = coreMaterial.createInstance();
|
|
793
|
-
mat.persistentId = initParams.persistentId;
|
|
794
|
-
return {
|
|
795
|
-
obj: mat,
|
|
796
|
-
loadProps: true
|
|
797
|
-
};
|
|
798
|
-
}
|
|
799
|
-
},
|
|
800
|
-
getInitParams (obj) {
|
|
801
|
-
return {
|
|
802
|
-
persistentId: obj.persistentId,
|
|
803
|
-
corePersistentId: obj.coreMaterial.persistentId
|
|
804
|
-
};
|
|
805
|
-
},
|
|
806
|
-
getProps () {
|
|
807
|
-
return getUnlitMaterialProps(manager);
|
|
808
|
-
}
|
|
809
|
-
};
|
|
810
|
-
}
|
|
811
|
-
/** @internal */ function getLambertMaterialClass(manager) {
|
|
812
|
-
return {
|
|
813
|
-
ctor: LambertMaterial,
|
|
814
|
-
parent: MeshMaterial,
|
|
815
|
-
name: 'LambertMaterial',
|
|
816
|
-
createFunc (ctx, initParams) {
|
|
817
|
-
let mat = Material.findMaterialById(initParams.persistentId);
|
|
818
|
-
if (mat) {
|
|
819
|
-
return {
|
|
820
|
-
obj: mat,
|
|
821
|
-
loadProps: false
|
|
822
|
-
};
|
|
823
|
-
} else if (initParams.persistentId === initParams.corePersistentId) {
|
|
824
|
-
mat = new LambertMaterial();
|
|
825
|
-
mat.persistentId = initParams.persistentId;
|
|
826
|
-
return {
|
|
827
|
-
obj: mat,
|
|
828
|
-
loadProps: true
|
|
829
|
-
};
|
|
830
|
-
} else {
|
|
831
|
-
const coreMaterial = Material.findMaterialById(initParams.corePersistentId);
|
|
832
|
-
if (!coreMaterial) {
|
|
833
|
-
throw new Error('Load material failed: core material not found');
|
|
834
|
-
}
|
|
835
|
-
mat = coreMaterial.createInstance();
|
|
836
|
-
mat.persistentId = initParams.persistentId;
|
|
837
|
-
return {
|
|
838
|
-
obj: mat,
|
|
839
|
-
loadProps: true
|
|
840
|
-
};
|
|
841
|
-
}
|
|
842
|
-
},
|
|
843
|
-
getInitParams (obj) {
|
|
844
|
-
return {
|
|
845
|
-
persistentId: obj.persistentId,
|
|
846
|
-
corePersistentId: obj.coreMaterial.persistentId
|
|
847
|
-
};
|
|
848
|
-
},
|
|
849
|
-
getProps () {
|
|
850
|
-
return getLitMaterialProps(manager);
|
|
851
|
-
}
|
|
852
|
-
};
|
|
853
|
-
}
|
|
854
|
-
/** @internal */ function getBlinnMaterialClass(manager) {
|
|
855
|
-
return {
|
|
856
|
-
ctor: BlinnMaterial,
|
|
857
|
-
parent: MeshMaterial,
|
|
858
|
-
name: 'BlinnMaterial',
|
|
859
|
-
createFunc (ctx, initParams) {
|
|
860
|
-
let mat = Material.findMaterialById(initParams.persistentId);
|
|
861
|
-
if (mat) {
|
|
862
|
-
return {
|
|
863
|
-
obj: mat,
|
|
864
|
-
loadProps: false
|
|
865
|
-
};
|
|
866
|
-
} else if (initParams.persistentId === initParams.corePersistentId) {
|
|
867
|
-
mat = new BlinnMaterial();
|
|
868
|
-
mat.persistentId = initParams.persistentId;
|
|
869
|
-
return {
|
|
870
|
-
obj: mat,
|
|
871
|
-
loadProps: true
|
|
872
|
-
};
|
|
873
|
-
} else {
|
|
874
|
-
const coreMaterial = Material.findMaterialById(initParams.corePersistentId);
|
|
875
|
-
if (!coreMaterial) {
|
|
876
|
-
throw new Error('Load material failed: core material not found');
|
|
877
|
-
}
|
|
878
|
-
mat = coreMaterial.createInstance();
|
|
879
|
-
mat.persistentId = initParams.persistentId;
|
|
880
|
-
return {
|
|
881
|
-
obj: mat,
|
|
882
|
-
loadProps: true
|
|
883
|
-
};
|
|
884
|
-
}
|
|
885
|
-
},
|
|
886
|
-
getInitParams (obj) {
|
|
887
|
-
return {
|
|
888
|
-
persistentId: obj.persistentId,
|
|
889
|
-
corePersistentId: obj.coreMaterial.persistentId
|
|
890
|
-
};
|
|
891
|
-
},
|
|
892
|
-
getProps () {
|
|
893
|
-
return [
|
|
894
|
-
{
|
|
895
|
-
name: 'Shininess',
|
|
896
|
-
type: 'float',
|
|
897
|
-
options: {
|
|
898
|
-
animatable: true,
|
|
899
|
-
minValue: 0,
|
|
900
|
-
maxValue: 2048
|
|
901
|
-
},
|
|
902
|
-
get (value) {
|
|
903
|
-
value.num[0] = this.shininess;
|
|
904
|
-
},
|
|
905
|
-
set (value) {
|
|
906
|
-
this.shininess = value.num[0];
|
|
907
|
-
},
|
|
908
|
-
getDefaultValue () {
|
|
909
|
-
return this.$isInstance ? this.coreMaterial.shininess : 32;
|
|
910
|
-
}
|
|
911
|
-
},
|
|
912
|
-
...getLitMaterialProps(manager)
|
|
913
|
-
];
|
|
914
|
-
}
|
|
915
|
-
};
|
|
916
|
-
}
|
|
917
|
-
/** @internal */ function getPBRMetallicRoughnessMaterialClass(manager) {
|
|
918
|
-
return {
|
|
919
|
-
ctor: PBRMetallicRoughnessMaterial,
|
|
920
|
-
parent: MeshMaterial,
|
|
921
|
-
name: 'PBRMetallicRoughnessMaterial',
|
|
922
|
-
createFunc (ctx, initParams) {
|
|
923
|
-
let mat = Material.findMaterialById(initParams.persistentId);
|
|
924
|
-
if (mat) {
|
|
925
|
-
return {
|
|
926
|
-
obj: mat,
|
|
927
|
-
loadProps: false
|
|
928
|
-
};
|
|
929
|
-
} else if (initParams.persistentId === initParams.corePersistentId) {
|
|
930
|
-
mat = new PBRMetallicRoughnessMaterial();
|
|
931
|
-
mat.persistentId = initParams.persistentId;
|
|
932
|
-
return {
|
|
933
|
-
obj: mat,
|
|
934
|
-
loadProps: true
|
|
935
|
-
};
|
|
936
|
-
} else {
|
|
937
|
-
const coreMaterial = Material.findMaterialById(initParams.corePersistentId);
|
|
938
|
-
if (!coreMaterial) {
|
|
939
|
-
throw new Error('Load material failed: core material not found');
|
|
940
|
-
}
|
|
941
|
-
mat = coreMaterial.createInstance();
|
|
942
|
-
mat.persistentId = initParams.persistentId;
|
|
943
|
-
return {
|
|
944
|
-
obj: mat,
|
|
945
|
-
loadProps: true
|
|
946
|
-
};
|
|
947
|
-
}
|
|
948
|
-
},
|
|
949
|
-
getInitParams (obj) {
|
|
950
|
-
return {
|
|
951
|
-
persistentId: obj.persistentId,
|
|
952
|
-
corePersistentId: obj.coreMaterial.persistentId
|
|
953
|
-
};
|
|
954
|
-
},
|
|
955
|
-
getProps () {
|
|
956
|
-
return [
|
|
957
|
-
{
|
|
958
|
-
name: 'Metallic',
|
|
959
|
-
type: 'float',
|
|
960
|
-
options: {
|
|
961
|
-
animatable: true,
|
|
962
|
-
minValue: 0,
|
|
963
|
-
maxValue: 1
|
|
964
|
-
},
|
|
965
|
-
get (value) {
|
|
966
|
-
value.num[0] = this.metallic;
|
|
967
|
-
},
|
|
968
|
-
set (value) {
|
|
969
|
-
this.metallic = value.num[0];
|
|
970
|
-
},
|
|
971
|
-
getDefaultValue () {
|
|
972
|
-
return this.$isInstance ? this.coreMaterial.metallic : 1;
|
|
973
|
-
}
|
|
974
|
-
},
|
|
975
|
-
{
|
|
976
|
-
name: 'Roughness',
|
|
977
|
-
type: 'float',
|
|
978
|
-
options: {
|
|
979
|
-
animatable: true,
|
|
980
|
-
minValue: 0,
|
|
981
|
-
maxValue: 1
|
|
982
|
-
},
|
|
983
|
-
get (value) {
|
|
984
|
-
value.num[0] = this.roughness;
|
|
985
|
-
},
|
|
986
|
-
set (value) {
|
|
987
|
-
this.roughness = value.num[0];
|
|
988
|
-
},
|
|
989
|
-
getDefaultValue () {
|
|
990
|
-
return this.$isInstance ? this.coreMaterial.roughness : 1;
|
|
991
|
-
}
|
|
992
|
-
},
|
|
993
|
-
{
|
|
994
|
-
name: 'SpecularFactor',
|
|
995
|
-
type: 'rgba',
|
|
996
|
-
options: {
|
|
997
|
-
animatable: true
|
|
998
|
-
},
|
|
999
|
-
get (value) {
|
|
1000
|
-
value.num[0] = this.specularFactor.x;
|
|
1001
|
-
value.num[1] = this.specularFactor.y;
|
|
1002
|
-
value.num[2] = this.specularFactor.z;
|
|
1003
|
-
value.num[3] = this.specularFactor.w;
|
|
1004
|
-
},
|
|
1005
|
-
set (value) {
|
|
1006
|
-
this.specularFactor = new Vector4(value.num[0], value.num[1], value.num[2], value.num[3]);
|
|
1007
|
-
},
|
|
1008
|
-
getDefaultValue () {
|
|
1009
|
-
return this.$isInstance ? this.coreMaterial.specularFactor : [
|
|
1010
|
-
1,
|
|
1011
|
-
1,
|
|
1012
|
-
1,
|
|
1013
|
-
1
|
|
1014
|
-
];
|
|
1015
|
-
}
|
|
1016
|
-
},
|
|
1017
|
-
...getTextureProps(manager, 'metallicRoughnessTexture', '2D', 0),
|
|
1018
|
-
...getTextureProps(manager, 'specularColorTexture', '2D', 0),
|
|
1019
|
-
...getPBRCommonProps(manager)
|
|
1020
|
-
];
|
|
1021
|
-
}
|
|
1022
|
-
};
|
|
1023
|
-
}
|
|
1024
|
-
/** @internal */ function getPBRSpecularGlossinessMaterialClass(manager) {
|
|
1025
|
-
return {
|
|
1026
|
-
ctor: PBRSpecularGlossinessMaterial,
|
|
1027
|
-
name: 'PBRSpecularGlossinessMaterial',
|
|
1028
|
-
parent: MeshMaterial,
|
|
1029
|
-
createFunc (ctx, initParams) {
|
|
1030
|
-
let mat = Material.findMaterialById(initParams.persistentId);
|
|
1031
|
-
if (mat) {
|
|
1032
|
-
return {
|
|
1033
|
-
obj: mat,
|
|
1034
|
-
loadProps: false
|
|
1035
|
-
};
|
|
1036
|
-
} else if (initParams.persistentId === initParams.corePersistentId) {
|
|
1037
|
-
mat = new PBRSpecularGlossinessMaterial();
|
|
1038
|
-
mat.persistentId = initParams.persistentId;
|
|
1039
|
-
return {
|
|
1040
|
-
obj: mat,
|
|
1041
|
-
loadProps: true
|
|
1042
|
-
};
|
|
1043
|
-
} else {
|
|
1044
|
-
const coreMaterial = Material.findMaterialById(initParams.corePersistentId);
|
|
1045
|
-
if (!coreMaterial) {
|
|
1046
|
-
throw new Error('Load material failed: core material not found');
|
|
1047
|
-
}
|
|
1048
|
-
mat = coreMaterial.createInstance();
|
|
1049
|
-
mat.persistentId = initParams.persistentId;
|
|
1050
|
-
return {
|
|
1051
|
-
obj: mat,
|
|
1052
|
-
loadProps: true
|
|
1053
|
-
};
|
|
1054
|
-
}
|
|
1055
|
-
},
|
|
1056
|
-
getInitParams (obj) {
|
|
1057
|
-
return {
|
|
1058
|
-
persistentId: obj.persistentId,
|
|
1059
|
-
corePersistentId: obj.coreMaterial.persistentId
|
|
1060
|
-
};
|
|
1061
|
-
},
|
|
1062
|
-
getProps () {
|
|
1063
|
-
return [
|
|
1064
|
-
{
|
|
1065
|
-
name: 'SpecularFactor',
|
|
1066
|
-
type: 'rgb',
|
|
1067
|
-
options: {
|
|
1068
|
-
animatable: true
|
|
1069
|
-
},
|
|
1070
|
-
get (value) {
|
|
1071
|
-
value.num[0] = this.specularFactor.x;
|
|
1072
|
-
value.num[1] = this.specularFactor.y;
|
|
1073
|
-
value.num[2] = this.specularFactor.z;
|
|
1074
|
-
},
|
|
1075
|
-
set (value) {
|
|
1076
|
-
this.specularFactor = new Vector3(value.num[0], value.num[1], value.num[2]);
|
|
1077
|
-
},
|
|
1078
|
-
getDefaultValue () {
|
|
1079
|
-
return this.$isInstance ? this.coreMaterial.specularFactor : [
|
|
1080
|
-
1,
|
|
1081
|
-
1,
|
|
1082
|
-
1
|
|
1083
|
-
];
|
|
1084
|
-
}
|
|
1085
|
-
},
|
|
1086
|
-
{
|
|
1087
|
-
name: 'GlossnessFactor',
|
|
1088
|
-
type: 'float',
|
|
1089
|
-
options: {
|
|
1090
|
-
animatable: true,
|
|
1091
|
-
minValue: 0,
|
|
1092
|
-
maxValue: 1
|
|
1093
|
-
},
|
|
1094
|
-
get (value) {
|
|
1095
|
-
value.num[0] = this.glossinessFactor;
|
|
1096
|
-
},
|
|
1097
|
-
set (value) {
|
|
1098
|
-
this.glossinessFactor = value.num[0];
|
|
1099
|
-
},
|
|
1100
|
-
getDefaultValue () {
|
|
1101
|
-
return this.$isInstance ? this.coreMaterial.glossinessFactor : 1;
|
|
1102
|
-
}
|
|
1103
|
-
},
|
|
1104
|
-
...getPBRCommonProps(manager)
|
|
1105
|
-
];
|
|
1106
|
-
}
|
|
1107
|
-
};
|
|
1108
|
-
}
|
|
1109
|
-
|
|
1110
|
-
export { getBlinnMaterialClass, getLambertMaterialClass, getMeshMaterialClass, getPBRMetallicRoughnessMaterialClass, getPBRSpecularGlossinessMaterialClass, getParticleMaterialClass, getUnlitMaterialClass };
|
|
1111
|
-
//# sourceMappingURL=material.js.map
|