@zephyr3d/scene 0.8.2 → 0.9.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 +473 -60
- package/dist/animation/animationset.js.map +1 -1
- package/dist/animation/cloth/gpu_cloth_system.js +2516 -0
- package/dist/animation/cloth/gpu_cloth_system.js.map +1 -0
- package/dist/animation/fixed_geometry_cache_track.js +138 -0
- package/dist/animation/fixed_geometry_cache_track.js.map +1 -0
- package/dist/animation/geometry_cache_utils.js +120 -0
- package/dist/animation/geometry_cache_utils.js.map +1 -0
- package/dist/animation/ik_modifier.js +9 -1
- package/dist/animation/ik_modifier.js.map +1 -1
- package/dist/animation/joint_dynamics/collision.js +469 -0
- package/dist/animation/joint_dynamics/collision.js.map +1 -0
- package/dist/animation/joint_dynamics/constraints.js +329 -0
- package/dist/animation/joint_dynamics/constraints.js.map +1 -0
- package/dist/animation/joint_dynamics/controller.js +699 -0
- package/dist/animation/joint_dynamics/controller.js.map +1 -0
- package/dist/animation/joint_dynamics/joint_dynamics_system.js +393 -0
- package/dist/animation/joint_dynamics/joint_dynamics_system.js.map +1 -0
- package/dist/animation/joint_dynamics/solver.js +794 -0
- package/dist/animation/joint_dynamics/solver.js.map +1 -0
- package/dist/animation/joint_dynamics/types.js +19 -0
- package/dist/animation/joint_dynamics/types.js.map +1 -0
- package/dist/animation/joint_dynamics/vrm_spring_bone.js +46 -0
- package/dist/animation/joint_dynamics/vrm_spring_bone.js.map +1 -0
- package/dist/animation/joint_dynamics_modifier.js +51 -0
- package/dist/animation/joint_dynamics_modifier.js.map +1 -0
- package/dist/animation/pca_geometry_cache_track.js +222 -0
- package/dist/animation/pca_geometry_cache_track.js.map +1 -0
- package/dist/animation/skeleton.js +2011 -139
- package/dist/animation/skeleton.js.map +1 -1
- package/dist/animation/skeleton_modifier.js +3 -5
- package/dist/animation/skeleton_modifier.js.map +1 -1
- package/dist/animation/spring/multi_chain_spring_system.js +2 -0
- package/dist/animation/spring/multi_chain_spring_system.js.map +1 -1
- package/dist/animation/spring/spring_chain.js +3 -2
- package/dist/animation/spring/spring_chain.js.map +1 -1
- package/dist/animation/spring/spring_collider.js +35 -5
- package/dist/animation/spring/spring_collider.js.map +1 -1
- package/dist/animation/spring/spring_particle.js +1 -0
- package/dist/animation/spring/spring_particle.js.map +1 -1
- package/dist/animation/spring/spring_system.js +325 -28
- package/dist/animation/spring/spring_system.js.map +1 -1
- package/dist/animation/spring2/collision.js +469 -0
- package/dist/animation/spring2/collision.js.map +1 -0
- package/dist/animation/spring2/constraints.js +329 -0
- package/dist/animation/spring2/constraints.js.map +1 -0
- package/dist/animation/spring2/controller.js +434 -0
- package/dist/animation/spring2/controller.js.map +1 -0
- package/dist/animation/spring2/math.js +16 -0
- package/dist/animation/spring2/math.js.map +1 -0
- package/dist/animation/spring2/solver.js +624 -0
- package/dist/animation/spring2/solver.js.map +1 -0
- package/dist/animation/spring2/spring_system.js +118 -0
- package/dist/animation/spring2/spring_system.js.map +1 -0
- package/dist/animation/spring2/types.js +19 -0
- package/dist/animation/spring2/types.js.map +1 -0
- package/dist/animation/spring_modifier.js +17 -1
- package/dist/animation/spring_modifier.js.map +1 -1
- package/dist/app/engine.js +42 -15
- package/dist/app/engine.js.map +1 -1
- package/dist/app/runtimescript.js +132 -1
- package/dist/app/runtimescript.js.map +1 -1
- package/dist/app/screen.js +3 -3
- package/dist/app/screen.js.map +1 -1
- package/dist/app/scriptingsystem.js +69 -37
- package/dist/app/scriptingsystem.js.map +1 -1
- package/dist/app/scriptregistry.js +14 -3
- package/dist/app/scriptregistry.js.map +1 -1
- package/dist/asset/assetmanager.js +2 -1
- package/dist/asset/assetmanager.js.map +1 -1
- package/dist/asset/loaders/zabc/zabc_loader.js +570 -0
- package/dist/asset/loaders/zabc/zabc_loader.js.map +1 -0
- package/dist/asset/model.js +192 -0
- package/dist/asset/model.js.map +1 -1
- package/dist/camera/base.js +26 -7
- package/dist/camera/base.js.map +1 -1
- package/dist/camera/camera.js +146 -24
- package/dist/camera/camera.js.map +1 -1
- package/dist/camera/fps.js +2 -2
- package/dist/camera/fps.js.map +1 -1
- package/dist/camera/orbit.js +2 -2
- package/dist/camera/orbit.js.map +1 -1
- package/dist/index.d.ts +11728 -8535
- package/dist/index.js +29 -8
- package/dist/index.js.map +1 -1
- package/dist/material/lambert.js +1 -1
- package/dist/material/lambert.js.map +1 -1
- package/dist/material/material.js +9 -3
- package/dist/material/material.js.map +1 -1
- package/dist/material/meshmaterial.js +54 -7
- package/dist/material/meshmaterial.js.map +1 -1
- package/dist/material/mixins/lightmodel/blinnphong.js +17 -7
- package/dist/material/mixins/lightmodel/blinnphong.js.map +1 -1
- package/dist/material/mixins/lightmodel/lambert.js +7 -2
- package/dist/material/mixins/lightmodel/lambert.js.map +1 -1
- package/dist/material/mixins/lightmodel/pbrblueprintmixin.js +108 -16
- package/dist/material/mixins/lightmodel/pbrblueprintmixin.js.map +1 -1
- package/dist/material/mixins/lightmodel/pbrmetallicroughness.js +209 -14
- package/dist/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -1
- package/dist/material/mixins/lightmodel/pbrspecularglossness.js +24 -12
- package/dist/material/mixins/lightmodel/pbrspecularglossness.js.map +1 -1
- package/dist/material/mixins/lit.js +11 -8
- package/dist/material/mixins/lit.js.map +1 -1
- package/dist/material/mixins/pbr/common.js +72 -5
- package/dist/material/mixins/pbr/common.js.map +1 -1
- package/dist/material/pbrblueprint.js +148 -1
- package/dist/material/pbrblueprint.js.map +1 -1
- package/dist/material/pbrmr.js +115 -2
- package/dist/material/pbrmr.js.map +1 -1
- package/dist/material/shader/helper.js +10 -4
- package/dist/material/shader/helper.js.map +1 -1
- package/dist/material/water.js +2 -2
- package/dist/material/water.js.map +1 -1
- package/dist/posteffect/coloradjust.js +145 -0
- package/dist/posteffect/coloradjust.js.map +1 -0
- package/dist/posteffect/taa.js +68 -32
- package/dist/posteffect/taa.js.map +1 -1
- package/dist/render/cluster_light.js +17 -12
- package/dist/render/cluster_light.js.map +1 -1
- package/dist/render/deferredlightpass.js +510 -0
- package/dist/render/deferredlightpass.js.map +1 -0
- package/dist/render/deferredshadowlightpass.js +428 -0
- package/dist/render/deferredshadowlightpass.js.map +1 -0
- package/dist/render/drawable.js.map +1 -1
- package/dist/render/drawable_mixin.js +21 -12
- package/dist/render/drawable_mixin.js.map +1 -1
- package/dist/render/envlight.js +20 -22
- package/dist/render/envlight.js.map +1 -1
- package/dist/render/gbufferpass.js +50 -0
- package/dist/render/gbufferpass.js.map +1 -0
- package/dist/render/lightpass.js +1 -2
- package/dist/render/lightpass.js.map +1 -1
- package/dist/render/primitive.js +1 -1
- package/dist/render/primitive.js.map +1 -1
- package/dist/render/render_queue.js +3 -2
- package/dist/render/render_queue.js.map +1 -1
- package/dist/render/renderer.js +5 -358
- package/dist/render/renderer.js.map +1 -1
- package/dist/render/rendergraph/executor.js +15 -12
- package/dist/render/rendergraph/executor.js.map +1 -1
- package/dist/render/rendergraph/forward_plus_builder.js +144 -88
- package/dist/render/rendergraph/forward_plus_builder.js.map +1 -1
- package/dist/render/rendergraph/history_resource_manager.js +178 -0
- package/dist/render/rendergraph/history_resource_manager.js.map +1 -0
- package/dist/render/rendergraph/rendergraph.js +12 -1
- package/dist/render/rendergraph/rendergraph.js.map +1 -1
- package/dist/render/rendergraph/types.js +2 -2
- package/dist/render/rendergraph/types.js.map +1 -1
- package/dist/render/sky.js +26 -9
- package/dist/render/sky.js.map +1 -1
- package/dist/scene/basesprite.js +4 -3
- package/dist/scene/basesprite.js.map +1 -1
- package/dist/scene/batchgroup.js +4 -4
- package/dist/scene/environment.js +7 -4
- package/dist/scene/environment.js.map +1 -1
- package/dist/scene/light.js +184 -18
- package/dist/scene/light.js.map +1 -1
- package/dist/scene/mesh.js +30 -0
- package/dist/scene/mesh.js.map +1 -1
- package/dist/scene/particlesys.js +3 -2
- package/dist/scene/particlesys.js.map +1 -1
- package/dist/scene/raycast_visitor.js +29 -3
- package/dist/scene/raycast_visitor.js.map +1 -1
- package/dist/scene/scene.js +86 -19
- package/dist/scene/scene.js.map +1 -1
- package/dist/scene/scene_node.js +87 -31
- package/dist/scene/scene_node.js.map +1 -1
- package/dist/scene/script_attachment.js +59 -0
- package/dist/scene/script_attachment.js.map +1 -0
- package/dist/scene/terrain-cm/grass.js +3 -2
- package/dist/scene/terrain-cm/grass.js.map +1 -1
- package/dist/scene/terrain-cm/terrain-cm.js +4 -3
- package/dist/scene/terrain-cm/terrain-cm.js.map +1 -1
- package/dist/scene/water.js +3 -2
- package/dist/scene/water.js.map +1 -1
- package/dist/shaders/shadow.js +2 -2
- package/dist/shaders/shadow.js.map +1 -1
- package/dist/shadow/shadowmapper.js +74 -4
- package/dist/shadow/shadowmapper.js.map +1 -1
- package/dist/shapes/box.js +163 -0
- package/dist/shapes/box.js.map +1 -1
- package/dist/shapes/capsule.js +216 -0
- package/dist/shapes/capsule.js.map +1 -0
- package/dist/shapes/cylinder.js +91 -0
- package/dist/shapes/cylinder.js.map +1 -1
- package/dist/shapes/plane.js +32 -0
- package/dist/shapes/plane.js.map +1 -1
- package/dist/shapes/tetrahedron.js +211 -0
- package/dist/shapes/tetrahedron.js.map +1 -1
- package/dist/shapes/torus.js +173 -0
- package/dist/shapes/torus.js.map +1 -1
- package/dist/utility/blueprint/common/math.js +111 -1
- package/dist/utility/blueprint/common/math.js.map +1 -1
- package/dist/utility/blueprint/material/inputs.js +235 -1
- package/dist/utility/blueprint/material/inputs.js.map +1 -1
- package/dist/utility/blueprint/material/ir.js +154 -10
- package/dist/utility/blueprint/material/ir.js.map +1 -1
- package/dist/utility/blueprint/material/texture.js +273 -19
- package/dist/utility/blueprint/material/texture.js.map +1 -1
- package/dist/utility/serialization/json.js +12 -2
- package/dist/utility/serialization/json.js.map +1 -1
- package/dist/utility/serialization/manager.js +30 -11
- package/dist/utility/serialization/manager.js.map +1 -1
- package/dist/utility/serialization/scene/animation.js +250 -7
- package/dist/utility/serialization/scene/animation.js.map +1 -1
- package/dist/utility/serialization/scene/batch.js +4 -2
- package/dist/utility/serialization/scene/batch.js.map +1 -1
- package/dist/utility/serialization/scene/camera.js +154 -2
- package/dist/utility/serialization/scene/camera.js.map +1 -1
- package/dist/utility/serialization/scene/cloth_script.js +834 -0
- package/dist/utility/serialization/scene/cloth_script.js.map +1 -0
- package/dist/utility/serialization/scene/common.js +7 -0
- package/dist/utility/serialization/scene/common.js.map +1 -1
- package/dist/utility/serialization/scene/light.js +120 -4
- package/dist/utility/serialization/scene/light.js.map +1 -1
- package/dist/utility/serialization/scene/material.js +453 -1
- package/dist/utility/serialization/scene/material.js.map +1 -1
- package/dist/utility/serialization/scene/mesh.js +4 -2
- package/dist/utility/serialization/scene/mesh.js.map +1 -1
- package/dist/utility/serialization/scene/node.js +298 -10
- package/dist/utility/serialization/scene/node.js.map +1 -1
- package/dist/utility/serialization/scene/particle.js +4 -2
- package/dist/utility/serialization/scene/particle.js.map +1 -1
- package/dist/utility/serialization/scene/primitive.js +100 -3
- package/dist/utility/serialization/scene/primitive.js.map +1 -1
- package/dist/utility/serialization/scene/scene.js +130 -3
- package/dist/utility/serialization/scene/scene.js.map +1 -1
- package/dist/utility/serialization/scene/script.js +66 -0
- package/dist/utility/serialization/scene/script.js.map +1 -0
- package/dist/utility/serialization/scene/spring_script.js +596 -0
- package/dist/utility/serialization/scene/spring_script.js.map +1 -0
- package/dist/utility/serialization/scene/sprite.js +5 -3
- package/dist/utility/serialization/scene/sprite.js.map +1 -1
- package/dist/utility/serialization/scene/terrain.js +4 -2
- package/dist/utility/serialization/scene/terrain.js.map +1 -1
- package/dist/utility/serialization/scene/water.js +4 -2
- package/dist/utility/serialization/scene/water.js.map +1 -1
- package/dist/utility/serialization/types.js.map +1 -1
- package/dist/values.js +5 -1
- package/dist/values.js.map +1 -1
- package/package.json +3 -3
|
@@ -5,7 +5,7 @@ import { UnlitMaterial } from '../../../material/unlit.js';
|
|
|
5
5
|
import { ParticleMaterial } from '../../../material/particle.js';
|
|
6
6
|
import '@zephyr3d/device';
|
|
7
7
|
import '../../../values.js';
|
|
8
|
-
import {
|
|
8
|
+
import { Vector3, Vector2, Vector4 } from '@zephyr3d/base';
|
|
9
9
|
import { MeshMaterial } from '../../../material/meshmaterial.js';
|
|
10
10
|
import '../../../material/grassmaterial.js';
|
|
11
11
|
import '../../../material/terrain-cm.js';
|
|
@@ -568,6 +568,20 @@ function getUnlitMaterialProps(manager) {
|
|
|
568
568
|
return !this.$isInstance;
|
|
569
569
|
}
|
|
570
570
|
},
|
|
571
|
+
{
|
|
572
|
+
name: 'AlphaDither',
|
|
573
|
+
type: 'bool',
|
|
574
|
+
default: false,
|
|
575
|
+
get (value) {
|
|
576
|
+
value.bool[0] = this.alphaDither;
|
|
577
|
+
},
|
|
578
|
+
set (value) {
|
|
579
|
+
this.alphaDither = value.bool[0];
|
|
580
|
+
},
|
|
581
|
+
isValid () {
|
|
582
|
+
return !this.$isInstance && this.alphaCutoff > 0;
|
|
583
|
+
}
|
|
584
|
+
},
|
|
571
585
|
{
|
|
572
586
|
name: 'BlendMode',
|
|
573
587
|
type: 'string',
|
|
@@ -854,6 +868,222 @@ function getUnlitMaterialProps(manager) {
|
|
|
854
868
|
set (value) {
|
|
855
869
|
this.doubleSidedLighting = value.bool[0];
|
|
856
870
|
}
|
|
871
|
+
},
|
|
872
|
+
{
|
|
873
|
+
name: 'Reflection',
|
|
874
|
+
type: 'string',
|
|
875
|
+
default: 'ggx',
|
|
876
|
+
options: {
|
|
877
|
+
enum: {
|
|
878
|
+
labels: [
|
|
879
|
+
'None',
|
|
880
|
+
'GGX',
|
|
881
|
+
'Anisotropic',
|
|
882
|
+
'Glint'
|
|
883
|
+
],
|
|
884
|
+
values: [
|
|
885
|
+
'none',
|
|
886
|
+
'ggx',
|
|
887
|
+
'anisotropic',
|
|
888
|
+
'glint'
|
|
889
|
+
]
|
|
890
|
+
}
|
|
891
|
+
},
|
|
892
|
+
get (value) {
|
|
893
|
+
value.str[0] = this.reflectionMode;
|
|
894
|
+
},
|
|
895
|
+
set (value) {
|
|
896
|
+
this.reflectionMode = value.str[0];
|
|
897
|
+
},
|
|
898
|
+
getDefaultValue () {
|
|
899
|
+
return this.$isInstance ? this.coreMaterial.reflectionMode : 'ggx';
|
|
900
|
+
}
|
|
901
|
+
},
|
|
902
|
+
{
|
|
903
|
+
name: 'SubsurfaceScattering',
|
|
904
|
+
type: 'bool',
|
|
905
|
+
phase: 0,
|
|
906
|
+
default: false,
|
|
907
|
+
get (value) {
|
|
908
|
+
value.bool[0] = this.subsurfaceScattering;
|
|
909
|
+
},
|
|
910
|
+
set (value) {
|
|
911
|
+
this.subsurfaceScattering = value.bool[0];
|
|
912
|
+
},
|
|
913
|
+
isValid () {
|
|
914
|
+
return !this.$isInstance;
|
|
915
|
+
}
|
|
916
|
+
},
|
|
917
|
+
{
|
|
918
|
+
name: 'SubsurfaceColor',
|
|
919
|
+
type: 'rgb',
|
|
920
|
+
phase: 1,
|
|
921
|
+
default: [
|
|
922
|
+
1,
|
|
923
|
+
0.3,
|
|
924
|
+
0.2
|
|
925
|
+
],
|
|
926
|
+
options: {
|
|
927
|
+
animatable: true
|
|
928
|
+
},
|
|
929
|
+
get (value) {
|
|
930
|
+
value.num[0] = this.subsurfaceColor.x;
|
|
931
|
+
value.num[1] = this.subsurfaceColor.y;
|
|
932
|
+
value.num[2] = this.subsurfaceColor.z;
|
|
933
|
+
},
|
|
934
|
+
set (value) {
|
|
935
|
+
this.subsurfaceColor = new Vector3(value.num[0], value.num[1], value.num[2]);
|
|
936
|
+
},
|
|
937
|
+
getDefaultValue () {
|
|
938
|
+
return this.$isInstance ? this.coreMaterial.subsurfaceColor : [
|
|
939
|
+
1,
|
|
940
|
+
0.3,
|
|
941
|
+
0.2
|
|
942
|
+
];
|
|
943
|
+
},
|
|
944
|
+
isValid () {
|
|
945
|
+
return this.subsurfaceScattering;
|
|
946
|
+
}
|
|
947
|
+
},
|
|
948
|
+
{
|
|
949
|
+
name: 'SubsurfaceScale',
|
|
950
|
+
type: 'float',
|
|
951
|
+
phase: 1,
|
|
952
|
+
default: 0.5,
|
|
953
|
+
options: {
|
|
954
|
+
animatable: true,
|
|
955
|
+
minValue: 0,
|
|
956
|
+
maxValue: 8
|
|
957
|
+
},
|
|
958
|
+
get (value) {
|
|
959
|
+
value.num[0] = this.subsurfaceScale;
|
|
960
|
+
},
|
|
961
|
+
set (value) {
|
|
962
|
+
this.subsurfaceScale = value.num[0];
|
|
963
|
+
},
|
|
964
|
+
getDefaultValue () {
|
|
965
|
+
return this.$isInstance ? this.coreMaterial.subsurfaceScale : 0.5;
|
|
966
|
+
},
|
|
967
|
+
isValid () {
|
|
968
|
+
return this.subsurfaceScattering;
|
|
969
|
+
}
|
|
970
|
+
},
|
|
971
|
+
{
|
|
972
|
+
name: 'SubsurfacePower',
|
|
973
|
+
type: 'float',
|
|
974
|
+
phase: 1,
|
|
975
|
+
default: 1.5,
|
|
976
|
+
options: {
|
|
977
|
+
animatable: true,
|
|
978
|
+
minValue: 0,
|
|
979
|
+
maxValue: 16
|
|
980
|
+
},
|
|
981
|
+
get (value) {
|
|
982
|
+
value.num[0] = this.subsurfacePower;
|
|
983
|
+
},
|
|
984
|
+
set (value) {
|
|
985
|
+
this.subsurfacePower = value.num[0];
|
|
986
|
+
},
|
|
987
|
+
getDefaultValue () {
|
|
988
|
+
return this.$isInstance ? this.coreMaterial.subsurfacePower : 1.5;
|
|
989
|
+
},
|
|
990
|
+
isValid () {
|
|
991
|
+
return this.subsurfaceScattering;
|
|
992
|
+
}
|
|
993
|
+
},
|
|
994
|
+
{
|
|
995
|
+
name: 'SubsurfaceIntensity',
|
|
996
|
+
type: 'float',
|
|
997
|
+
phase: 1,
|
|
998
|
+
default: 0.5,
|
|
999
|
+
options: {
|
|
1000
|
+
animatable: true,
|
|
1001
|
+
minValue: 0,
|
|
1002
|
+
maxValue: 4
|
|
1003
|
+
},
|
|
1004
|
+
get (value) {
|
|
1005
|
+
value.num[0] = this.subsurfaceIntensity;
|
|
1006
|
+
},
|
|
1007
|
+
set (value) {
|
|
1008
|
+
this.subsurfaceIntensity = value.num[0];
|
|
1009
|
+
},
|
|
1010
|
+
getDefaultValue () {
|
|
1011
|
+
return this.$isInstance ? this.coreMaterial.subsurfaceIntensity : 0.5;
|
|
1012
|
+
},
|
|
1013
|
+
isValid () {
|
|
1014
|
+
return this.subsurfaceScattering;
|
|
1015
|
+
}
|
|
1016
|
+
},
|
|
1017
|
+
{
|
|
1018
|
+
name: 'Anisotropy',
|
|
1019
|
+
type: 'float',
|
|
1020
|
+
default: 0.75,
|
|
1021
|
+
options: {
|
|
1022
|
+
animatable: true,
|
|
1023
|
+
minValue: -0.95,
|
|
1024
|
+
maxValue: 0.95
|
|
1025
|
+
},
|
|
1026
|
+
get (value) {
|
|
1027
|
+
value.num[0] = this.anisotropy;
|
|
1028
|
+
},
|
|
1029
|
+
set (value) {
|
|
1030
|
+
this.anisotropy = value.num[0];
|
|
1031
|
+
},
|
|
1032
|
+
getDefaultValue () {
|
|
1033
|
+
return this.$isInstance ? this.coreMaterial.anisotropy : 0.75;
|
|
1034
|
+
},
|
|
1035
|
+
isValid () {
|
|
1036
|
+
return this.reflectionMode === 'anisotropic';
|
|
1037
|
+
}
|
|
1038
|
+
},
|
|
1039
|
+
{
|
|
1040
|
+
name: 'AnisotropyDirection',
|
|
1041
|
+
type: 'float',
|
|
1042
|
+
default: 0,
|
|
1043
|
+
options: {
|
|
1044
|
+
animatable: true,
|
|
1045
|
+
minValue: 0,
|
|
1046
|
+
maxValue: 360
|
|
1047
|
+
},
|
|
1048
|
+
get (value) {
|
|
1049
|
+
value.num[0] = this.anisotropyDirection;
|
|
1050
|
+
},
|
|
1051
|
+
set (value) {
|
|
1052
|
+
this.anisotropyDirection = value.num[0];
|
|
1053
|
+
},
|
|
1054
|
+
getDefaultValue () {
|
|
1055
|
+
return this.$isInstance ? this.coreMaterial.anisotropyDirection : 0;
|
|
1056
|
+
},
|
|
1057
|
+
isValid () {
|
|
1058
|
+
return this.reflectionMode === 'anisotropic';
|
|
1059
|
+
}
|
|
1060
|
+
},
|
|
1061
|
+
{
|
|
1062
|
+
name: 'AnisotropyDirectionScaleBias',
|
|
1063
|
+
type: 'vec2',
|
|
1064
|
+
default: [
|
|
1065
|
+
1,
|
|
1066
|
+
0
|
|
1067
|
+
],
|
|
1068
|
+
options: {
|
|
1069
|
+
animatable: true
|
|
1070
|
+
},
|
|
1071
|
+
get (value) {
|
|
1072
|
+
value.num[0] = this.anisotropyDirectionScaleBias.x;
|
|
1073
|
+
value.num[1] = this.anisotropyDirectionScaleBias.y;
|
|
1074
|
+
},
|
|
1075
|
+
set (value) {
|
|
1076
|
+
this.anisotropyDirectionScaleBias = new Vector2(value.num[0], value.num[1]);
|
|
1077
|
+
},
|
|
1078
|
+
getDefaultValue () {
|
|
1079
|
+
return this.$isInstance ? this.coreMaterial.anisotropyDirectionScaleBias : [
|
|
1080
|
+
1,
|
|
1081
|
+
0
|
|
1082
|
+
];
|
|
1083
|
+
},
|
|
1084
|
+
isValid () {
|
|
1085
|
+
return this.reflectionMode === 'anisotropic';
|
|
1086
|
+
}
|
|
857
1087
|
}
|
|
858
1088
|
]);
|
|
859
1089
|
}
|
|
@@ -1063,6 +1293,228 @@ function getUnlitMaterialProps(manager) {
|
|
|
1063
1293
|
];
|
|
1064
1294
|
}
|
|
1065
1295
|
},
|
|
1296
|
+
{
|
|
1297
|
+
name: 'Reflection',
|
|
1298
|
+
type: 'string',
|
|
1299
|
+
default: 'ggx',
|
|
1300
|
+
options: {
|
|
1301
|
+
enum: {
|
|
1302
|
+
labels: [
|
|
1303
|
+
'None',
|
|
1304
|
+
'GGX',
|
|
1305
|
+
'Anisotropic',
|
|
1306
|
+
'Glint'
|
|
1307
|
+
],
|
|
1308
|
+
values: [
|
|
1309
|
+
'none',
|
|
1310
|
+
'ggx',
|
|
1311
|
+
'anisotropic',
|
|
1312
|
+
'glint'
|
|
1313
|
+
]
|
|
1314
|
+
}
|
|
1315
|
+
},
|
|
1316
|
+
get (value) {
|
|
1317
|
+
value.str[0] = this.reflectionMode;
|
|
1318
|
+
},
|
|
1319
|
+
set (value) {
|
|
1320
|
+
this.reflectionMode = value.str[0];
|
|
1321
|
+
},
|
|
1322
|
+
getDefaultValue () {
|
|
1323
|
+
return this.$isInstance ? this.coreMaterial.reflectionMode : 'ggx';
|
|
1324
|
+
}
|
|
1325
|
+
},
|
|
1326
|
+
{
|
|
1327
|
+
name: 'Anisotropy',
|
|
1328
|
+
type: 'float',
|
|
1329
|
+
default: 0.75,
|
|
1330
|
+
options: {
|
|
1331
|
+
animatable: true,
|
|
1332
|
+
minValue: -0.95,
|
|
1333
|
+
maxValue: 0.95
|
|
1334
|
+
},
|
|
1335
|
+
get (value) {
|
|
1336
|
+
value.num[0] = this.anisotropy;
|
|
1337
|
+
},
|
|
1338
|
+
set (value) {
|
|
1339
|
+
this.anisotropy = value.num[0];
|
|
1340
|
+
},
|
|
1341
|
+
getDefaultValue () {
|
|
1342
|
+
return this.$isInstance ? this.coreMaterial.anisotropy : 0.75;
|
|
1343
|
+
},
|
|
1344
|
+
isValid () {
|
|
1345
|
+
return this.reflectionMode === 'anisotropic';
|
|
1346
|
+
}
|
|
1347
|
+
},
|
|
1348
|
+
{
|
|
1349
|
+
name: 'AnisotropyDirection',
|
|
1350
|
+
type: 'float',
|
|
1351
|
+
default: 0,
|
|
1352
|
+
options: {
|
|
1353
|
+
animatable: true,
|
|
1354
|
+
minValue: 0,
|
|
1355
|
+
maxValue: 360
|
|
1356
|
+
},
|
|
1357
|
+
get (value) {
|
|
1358
|
+
value.num[0] = this.anisotropyDirection;
|
|
1359
|
+
},
|
|
1360
|
+
set (value) {
|
|
1361
|
+
this.anisotropyDirection = value.num[0];
|
|
1362
|
+
},
|
|
1363
|
+
getDefaultValue () {
|
|
1364
|
+
return this.$isInstance ? this.coreMaterial.anisotropyDirection : 0;
|
|
1365
|
+
},
|
|
1366
|
+
isValid () {
|
|
1367
|
+
return this.reflectionMode === 'anisotropic';
|
|
1368
|
+
}
|
|
1369
|
+
},
|
|
1370
|
+
...getTextureProps(manager, 'anisotropyDirectionTexture', '2D', false, 0, function() {
|
|
1371
|
+
return this.reflectionMode === 'anisotropic';
|
|
1372
|
+
}),
|
|
1373
|
+
{
|
|
1374
|
+
name: 'AnisotropyDirectionScaleBias',
|
|
1375
|
+
type: 'vec2',
|
|
1376
|
+
default: [
|
|
1377
|
+
1,
|
|
1378
|
+
0
|
|
1379
|
+
],
|
|
1380
|
+
options: {
|
|
1381
|
+
animatable: true
|
|
1382
|
+
},
|
|
1383
|
+
get (value) {
|
|
1384
|
+
value.num[0] = this.anisotropyDirectionScaleBias.x;
|
|
1385
|
+
value.num[1] = this.anisotropyDirectionScaleBias.y;
|
|
1386
|
+
},
|
|
1387
|
+
set (value) {
|
|
1388
|
+
this.anisotropyDirectionScaleBias = new Vector2(value.num[0], value.num[1]);
|
|
1389
|
+
},
|
|
1390
|
+
getDefaultValue () {
|
|
1391
|
+
return this.$isInstance ? this.coreMaterial.anisotropyDirectionScaleBias : [
|
|
1392
|
+
1,
|
|
1393
|
+
0
|
|
1394
|
+
];
|
|
1395
|
+
},
|
|
1396
|
+
isValid () {
|
|
1397
|
+
return !this.$isInstance && this.reflectionMode === 'anisotropic' && !!this.anisotropyDirectionTexture;
|
|
1398
|
+
}
|
|
1399
|
+
},
|
|
1400
|
+
{
|
|
1401
|
+
name: 'SubsurfaceScattering',
|
|
1402
|
+
type: 'bool',
|
|
1403
|
+
phase: 0,
|
|
1404
|
+
default: false,
|
|
1405
|
+
get (value) {
|
|
1406
|
+
value.bool[0] = this.subsurfaceScattering;
|
|
1407
|
+
},
|
|
1408
|
+
set (value) {
|
|
1409
|
+
this.subsurfaceScattering = value.bool[0];
|
|
1410
|
+
},
|
|
1411
|
+
isValid () {
|
|
1412
|
+
return !this.$isInstance;
|
|
1413
|
+
}
|
|
1414
|
+
},
|
|
1415
|
+
{
|
|
1416
|
+
name: 'SubsurfaceColor',
|
|
1417
|
+
type: 'rgb',
|
|
1418
|
+
phase: 1,
|
|
1419
|
+
default: [
|
|
1420
|
+
1,
|
|
1421
|
+
0.3,
|
|
1422
|
+
0.2
|
|
1423
|
+
],
|
|
1424
|
+
options: {
|
|
1425
|
+
animatable: true
|
|
1426
|
+
},
|
|
1427
|
+
get (value) {
|
|
1428
|
+
value.num[0] = this.subsurfaceColor.x;
|
|
1429
|
+
value.num[1] = this.subsurfaceColor.y;
|
|
1430
|
+
value.num[2] = this.subsurfaceColor.z;
|
|
1431
|
+
},
|
|
1432
|
+
set (value) {
|
|
1433
|
+
this.subsurfaceColor = new Vector3(value.num[0], value.num[1], value.num[2]);
|
|
1434
|
+
},
|
|
1435
|
+
getDefaultValue () {
|
|
1436
|
+
return this.$isInstance ? this.coreMaterial.subsurfaceColor : [
|
|
1437
|
+
1,
|
|
1438
|
+
0.3,
|
|
1439
|
+
0.2
|
|
1440
|
+
];
|
|
1441
|
+
},
|
|
1442
|
+
isValid () {
|
|
1443
|
+
return this.subsurfaceScattering;
|
|
1444
|
+
}
|
|
1445
|
+
},
|
|
1446
|
+
{
|
|
1447
|
+
name: 'SubsurfaceScale',
|
|
1448
|
+
type: 'float',
|
|
1449
|
+
phase: 1,
|
|
1450
|
+
default: 0.5,
|
|
1451
|
+
options: {
|
|
1452
|
+
animatable: true,
|
|
1453
|
+
minValue: 0,
|
|
1454
|
+
maxValue: 8
|
|
1455
|
+
},
|
|
1456
|
+
get (value) {
|
|
1457
|
+
value.num[0] = this.subsurfaceScale;
|
|
1458
|
+
},
|
|
1459
|
+
set (value) {
|
|
1460
|
+
this.subsurfaceScale = value.num[0];
|
|
1461
|
+
},
|
|
1462
|
+
getDefaultValue () {
|
|
1463
|
+
return this.$isInstance ? this.coreMaterial.subsurfaceScale : 0.5;
|
|
1464
|
+
},
|
|
1465
|
+
isValid () {
|
|
1466
|
+
return this.subsurfaceScattering;
|
|
1467
|
+
}
|
|
1468
|
+
},
|
|
1469
|
+
{
|
|
1470
|
+
name: 'SubsurfacePower',
|
|
1471
|
+
type: 'float',
|
|
1472
|
+
phase: 1,
|
|
1473
|
+
default: 1.5,
|
|
1474
|
+
options: {
|
|
1475
|
+
animatable: true,
|
|
1476
|
+
minValue: 0,
|
|
1477
|
+
maxValue: 16
|
|
1478
|
+
},
|
|
1479
|
+
get (value) {
|
|
1480
|
+
value.num[0] = this.subsurfacePower;
|
|
1481
|
+
},
|
|
1482
|
+
set (value) {
|
|
1483
|
+
this.subsurfacePower = value.num[0];
|
|
1484
|
+
},
|
|
1485
|
+
getDefaultValue () {
|
|
1486
|
+
return this.$isInstance ? this.coreMaterial.subsurfacePower : 1.5;
|
|
1487
|
+
},
|
|
1488
|
+
isValid () {
|
|
1489
|
+
return this.subsurfaceScattering;
|
|
1490
|
+
}
|
|
1491
|
+
},
|
|
1492
|
+
{
|
|
1493
|
+
name: 'SubsurfaceIntensity',
|
|
1494
|
+
type: 'float',
|
|
1495
|
+
phase: 1,
|
|
1496
|
+
default: 0.5,
|
|
1497
|
+
options: {
|
|
1498
|
+
animatable: true,
|
|
1499
|
+
minValue: 0,
|
|
1500
|
+
maxValue: 4
|
|
1501
|
+
},
|
|
1502
|
+
get (value) {
|
|
1503
|
+
value.num[0] = this.subsurfaceIntensity;
|
|
1504
|
+
},
|
|
1505
|
+
set (value) {
|
|
1506
|
+
this.subsurfaceIntensity = value.num[0];
|
|
1507
|
+
},
|
|
1508
|
+
getDefaultValue () {
|
|
1509
|
+
return this.$isInstance ? this.coreMaterial.subsurfaceIntensity : 0.5;
|
|
1510
|
+
},
|
|
1511
|
+
isValid () {
|
|
1512
|
+
return this.subsurfaceScattering;
|
|
1513
|
+
}
|
|
1514
|
+
},
|
|
1515
|
+
...getTextureProps(manager, 'subsurfaceTexture', '2D', false, 1, function() {
|
|
1516
|
+
return this.subsurfaceScattering;
|
|
1517
|
+
}),
|
|
1066
1518
|
...getTextureProps(manager, 'metallicRoughnessTexture', '2D', false, 0),
|
|
1067
1519
|
...getTextureProps(manager, 'specularColorTexture', '2D', true, 0),
|
|
1068
1520
|
...getPBRCommonProps(manager)
|