@zephyr3d/editor 0.3.8 → 0.3.9

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.
Files changed (137) hide show
  1. package/dist/assets/{index-BZ1L8ggE.js → index-CO6yA4Rj.js} +313 -11
  2. package/dist/assistant/zephyr-types-index.json +13834 -11679
  3. package/dist/index.html +1 -1
  4. package/dist/modules/zephyr3d_backend-webgpu.js +1 -1
  5. package/dist/modules/zephyr3d_backend-webgpu.js.map +1 -1
  6. package/dist/modules/zephyr3d_device.js +2 -2
  7. package/dist/modules/zephyr3d_device.js.map +1 -1
  8. package/dist/modules/zephyr3d_scene.js +2325 -515
  9. package/dist/modules/zephyr3d_scene.js.map +1 -1
  10. package/dist/vendor/zephyr3d/backend-webgpu/dist/renderpass_webgpu.js +1 -1
  11. package/dist/vendor/zephyr3d/backend-webgpu/dist/renderpass_webgpu.js.map +1 -1
  12. package/dist/vendor/zephyr3d/device/dist/device.js +2 -2
  13. package/dist/vendor/zephyr3d/device/dist/device.js.map +1 -1
  14. package/dist/vendor/zephyr3d/scene/dist/app/engine.js +3 -1
  15. package/dist/vendor/zephyr3d/scene/dist/app/engine.js.map +1 -1
  16. package/dist/vendor/zephyr3d/scene/dist/asset/assetmanager.js +1 -0
  17. package/dist/vendor/zephyr3d/scene/dist/asset/assetmanager.js.map +1 -1
  18. package/dist/vendor/zephyr3d/scene/dist/camera/camera.js +87 -0
  19. package/dist/vendor/zephyr3d/scene/dist/camera/camera.js.map +1 -1
  20. package/dist/vendor/zephyr3d/scene/dist/index.d.ts +158 -4
  21. package/dist/vendor/zephyr3d/scene/dist/index.js +3 -0
  22. package/dist/vendor/zephyr3d/scene/dist/index.js.map +1 -1
  23. package/dist/vendor/zephyr3d/scene/dist/material/meshmaterial.js +8 -1
  24. package/dist/vendor/zephyr3d/scene/dist/material/meshmaterial.js.map +1 -1
  25. package/dist/vendor/zephyr3d/scene/dist/material/shader/helper.js +6 -0
  26. package/dist/vendor/zephyr3d/scene/dist/material/shader/helper.js.map +1 -1
  27. package/dist/vendor/zephyr3d/scene/dist/material/skin.js +263 -0
  28. package/dist/vendor/zephyr3d/scene/dist/material/skin.js.map +1 -0
  29. package/dist/vendor/zephyr3d/scene/dist/posteffect/compositor.js +3 -0
  30. package/dist/vendor/zephyr3d/scene/dist/posteffect/compositor.js.map +1 -1
  31. package/dist/vendor/zephyr3d/scene/dist/posteffect/skinsss.js +194 -0
  32. package/dist/vendor/zephyr3d/scene/dist/posteffect/skinsss.js.map +1 -0
  33. package/dist/vendor/zephyr3d/scene/dist/posteffect/ssr.js +26 -49
  34. package/dist/vendor/zephyr3d/scene/dist/posteffect/ssr.js.map +1 -1
  35. package/dist/vendor/zephyr3d/scene/dist/posteffect/sss.js +1 -0
  36. package/dist/vendor/zephyr3d/scene/dist/posteffect/sss.js.map +1 -1
  37. package/dist/vendor/zephyr3d/scene/dist/posteffect/taa.js +2 -40
  38. package/dist/vendor/zephyr3d/scene/dist/posteffect/taa.js.map +1 -1
  39. package/dist/vendor/zephyr3d/scene/dist/render/abuffer_oit.js +1 -0
  40. package/dist/vendor/zephyr3d/scene/dist/render/abuffer_oit.js.map +1 -1
  41. package/dist/vendor/zephyr3d/scene/dist/render/drawable_mixin.js +1 -0
  42. package/dist/vendor/zephyr3d/scene/dist/render/drawable_mixin.js.map +1 -1
  43. package/dist/vendor/zephyr3d/scene/dist/render/fbm_wavegenerator.js +1 -0
  44. package/dist/vendor/zephyr3d/scene/dist/render/fbm_wavegenerator.js.map +1 -1
  45. package/dist/vendor/zephyr3d/scene/dist/render/gerstner_wavegenerator.js +1 -0
  46. package/dist/vendor/zephyr3d/scene/dist/render/gerstner_wavegenerator.js.map +1 -1
  47. package/dist/vendor/zephyr3d/scene/dist/render/globalbindgroup_allocator.js +1 -0
  48. package/dist/vendor/zephyr3d/scene/dist/render/globalbindgroup_allocator.js.map +1 -1
  49. package/dist/vendor/zephyr3d/scene/dist/render/lightpass.js +4 -1
  50. package/dist/vendor/zephyr3d/scene/dist/render/lightpass.js.map +1 -1
  51. package/dist/vendor/zephyr3d/scene/dist/render/render_queue.js +1 -0
  52. package/dist/vendor/zephyr3d/scene/dist/render/render_queue.js.map +1 -1
  53. package/dist/vendor/zephyr3d/scene/dist/render/renderer.js +1 -0
  54. package/dist/vendor/zephyr3d/scene/dist/render/renderer.js.map +1 -1
  55. package/dist/vendor/zephyr3d/scene/dist/render/rendergraph/device_pool_allocator.js +12 -5
  56. package/dist/vendor/zephyr3d/scene/dist/render/rendergraph/device_pool_allocator.js.map +1 -1
  57. package/dist/vendor/zephyr3d/scene/dist/render/rendergraph/forward_plus_builder.js +78 -8
  58. package/dist/vendor/zephyr3d/scene/dist/render/rendergraph/forward_plus_builder.js.map +1 -1
  59. package/dist/vendor/zephyr3d/scene/dist/scene/basesprite.js +1 -0
  60. package/dist/vendor/zephyr3d/scene/dist/scene/basesprite.js.map +1 -1
  61. package/dist/vendor/zephyr3d/scene/dist/scene/batchgroup.js +1 -0
  62. package/dist/vendor/zephyr3d/scene/dist/scene/batchgroup.js.map +1 -1
  63. package/dist/vendor/zephyr3d/scene/dist/scene/environment.js +1 -0
  64. package/dist/vendor/zephyr3d/scene/dist/scene/environment.js.map +1 -1
  65. package/dist/vendor/zephyr3d/scene/dist/scene/light.js +158 -154
  66. package/dist/vendor/zephyr3d/scene/dist/scene/light.js.map +1 -1
  67. package/dist/vendor/zephyr3d/scene/dist/scene/mesh.js +1 -0
  68. package/dist/vendor/zephyr3d/scene/dist/scene/mesh.js.map +1 -1
  69. package/dist/vendor/zephyr3d/scene/dist/scene/msdftext.js +1 -0
  70. package/dist/vendor/zephyr3d/scene/dist/scene/msdftext.js.map +1 -1
  71. package/dist/vendor/zephyr3d/scene/dist/scene/msdftextsprite.js +1 -0
  72. package/dist/vendor/zephyr3d/scene/dist/scene/msdftextsprite.js.map +1 -1
  73. package/dist/vendor/zephyr3d/scene/dist/scene/particlesys.js +1 -0
  74. package/dist/vendor/zephyr3d/scene/dist/scene/particlesys.js.map +1 -1
  75. package/dist/vendor/zephyr3d/scene/dist/scene/scene.js +1 -0
  76. package/dist/vendor/zephyr3d/scene/dist/scene/scene.js.map +1 -1
  77. package/dist/vendor/zephyr3d/scene/dist/scene/terrain-cm/grass.js +1 -0
  78. package/dist/vendor/zephyr3d/scene/dist/scene/terrain-cm/grass.js.map +1 -1
  79. package/dist/vendor/zephyr3d/scene/dist/scene/terrain-cm/grassmaterial.js +1 -0
  80. package/dist/vendor/zephyr3d/scene/dist/scene/terrain-cm/grassmaterial.js.map +1 -1
  81. package/dist/vendor/zephyr3d/scene/dist/scene/terrain-cm/terrain-cm.js +1 -0
  82. package/dist/vendor/zephyr3d/scene/dist/scene/terrain-cm/terrain-cm.js.map +1 -1
  83. package/dist/vendor/zephyr3d/scene/dist/scene/water.js +1 -0
  84. package/dist/vendor/zephyr3d/scene/dist/scene/water.js.map +1 -1
  85. package/dist/vendor/zephyr3d/scene/dist/shaders/shadow.js +617 -1
  86. package/dist/vendor/zephyr3d/scene/dist/shaders/shadow.js.map +1 -1
  87. package/dist/vendor/zephyr3d/scene/dist/shadow/esm.js +1 -0
  88. package/dist/vendor/zephyr3d/scene/dist/shadow/esm.js.map +1 -1
  89. package/dist/vendor/zephyr3d/scene/dist/shadow/pcf_opt.js +1 -0
  90. package/dist/vendor/zephyr3d/scene/dist/shadow/pcf_opt.js.map +1 -1
  91. package/dist/vendor/zephyr3d/scene/dist/shadow/pcf_pd.js +1 -0
  92. package/dist/vendor/zephyr3d/scene/dist/shadow/pcf_pd.js.map +1 -1
  93. package/dist/vendor/zephyr3d/scene/dist/shadow/pcss.js +182 -0
  94. package/dist/vendor/zephyr3d/scene/dist/shadow/pcss.js.map +1 -0
  95. package/dist/vendor/zephyr3d/scene/dist/shadow/shader.js +1 -0
  96. package/dist/vendor/zephyr3d/scene/dist/shadow/shader.js.map +1 -1
  97. package/dist/vendor/zephyr3d/scene/dist/shadow/shadow_impl.js.map +1 -1
  98. package/dist/vendor/zephyr3d/scene/dist/shadow/shadowmapper.js +183 -105
  99. package/dist/vendor/zephyr3d/scene/dist/shadow/shadowmapper.js.map +1 -1
  100. package/dist/vendor/zephyr3d/scene/dist/shadow/ssm.js +1 -0
  101. package/dist/vendor/zephyr3d/scene/dist/shadow/ssm.js.map +1 -1
  102. package/dist/vendor/zephyr3d/scene/dist/shadow/vsm.js +1 -0
  103. package/dist/vendor/zephyr3d/scene/dist/shadow/vsm.js.map +1 -1
  104. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/manager.js +3 -1
  105. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/manager.js.map +1 -1
  106. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/animation.js +1 -0
  107. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/animation.js.map +1 -1
  108. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/batch.js +1 -0
  109. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/batch.js.map +1 -1
  110. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/camera.js +122 -0
  111. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/camera.js.map +1 -1
  112. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/common.js +1 -0
  113. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/common.js.map +1 -1
  114. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/light.js +102 -21
  115. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/light.js.map +1 -1
  116. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/material.js +195 -3
  117. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/material.js.map +1 -1
  118. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/mesh.js +1 -0
  119. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/mesh.js.map +1 -1
  120. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/node.js +1 -0
  121. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/node.js.map +1 -1
  122. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/particle.js +1 -0
  123. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/particle.js.map +1 -1
  124. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/primitive.js +1 -0
  125. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/primitive.js.map +1 -1
  126. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/sprite.js +1 -0
  127. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/sprite.js.map +1 -1
  128. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/terrain.js +1 -0
  129. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/terrain.js.map +1 -1
  130. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/text.js +1 -0
  131. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/text.js.map +1 -1
  132. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/water.js +1 -0
  133. package/dist/vendor/zephyr3d/scene/dist/utility/serialization/scene/water.js.map +1 -1
  134. package/dist/vendor/zephyr3d/scene/dist/values.js +1 -0
  135. package/dist/vendor/zephyr3d/scene/dist/values.js.map +1 -1
  136. package/electron/main.cjs +30 -6
  137. package/package.json +4 -4
@@ -4,6 +4,7 @@ import { BlinnMaterial } from '../../../material/blinn.js';
4
4
  import { UnlitMaterial } from '../../../material/unlit.js';
5
5
  import { ParticleMaterial } from '../../../material/particle.js';
6
6
  import { SubsurfaceProfile } from '../../../material/subsurfaceprofile.js';
7
+ import { SkinMaterial } from '../../../material/skin.js';
7
8
  import '@zephyr3d/device';
8
9
  import '../../../values.js';
9
10
  import { Vector3, Vector4, Vector2 } from '@zephyr3d/base';
@@ -727,9 +728,9 @@ function getLitMaterialProps(manager) {
727
728
  name: 'doubleSidedLighting',
728
729
  description: 'If true, lighting is evaluated on both sides of the surface',
729
730
  type: 'bool',
730
- default: false,
731
+ default: true,
731
732
  isValid () {
732
- return !this.$isInstance && this.cullMode !== 'back';
733
+ return !this.$isInstance;
733
734
  },
734
735
  get (value) {
735
736
  value.bool[0] = this.doubleSidedLighting;
@@ -738,6 +739,27 @@ function getLitMaterialProps(manager) {
738
739
  this.doubleSidedLighting = value.bool[0];
739
740
  }
740
741
  },
742
+ {
743
+ name: 'NormalScale',
744
+ description: 'Scalar applied to the normal texture',
745
+ type: 'float',
746
+ phase: 1,
747
+ default: 1,
748
+ options: {
749
+ animatable: true,
750
+ minValue: 0,
751
+ maxValue: 2
752
+ },
753
+ get (value) {
754
+ value.num[0] = this.normalScale;
755
+ },
756
+ set (value) {
757
+ this.normalScale = value.num[0];
758
+ },
759
+ isValid () {
760
+ return !this.$isInstance && !!this.normalTexture;
761
+ }
762
+ },
741
763
  {
742
764
  name: 'vertexNormal',
743
765
  description: 'If true, uses vertex normals for lighting and normal mapping',
@@ -1829,6 +1851,176 @@ function getMToonMaterialProps(manager) {
1829
1851
  getMeshMaterialInstanceUniformsClass(BlinnMaterial)
1830
1852
  ];
1831
1853
  }
1854
+ /** @internal */ function getSkinMaterialClass(manager) {
1855
+ return [
1856
+ {
1857
+ ctor: SkinMaterial,
1858
+ parent: MeshMaterial,
1859
+ name: 'SkinMaterial',
1860
+ getProps () {
1861
+ return defineProps([
1862
+ {
1863
+ name: 'Shininess',
1864
+ description: 'Blinn specular exponent for skin highlights',
1865
+ type: 'float',
1866
+ default: 72,
1867
+ options: {
1868
+ animatable: true,
1869
+ minValue: 1,
1870
+ maxValue: 2048
1871
+ },
1872
+ get (value) {
1873
+ value.num[0] = this.shininess;
1874
+ },
1875
+ set (value) {
1876
+ this.shininess = value.num[0];
1877
+ },
1878
+ getDefaultValue () {
1879
+ return this.$isInstance ? this.coreMaterial.shininess : 72;
1880
+ }
1881
+ },
1882
+ {
1883
+ name: 'SpecularStrength',
1884
+ description: 'Direct specular strength for restrained skin highlights',
1885
+ type: 'float',
1886
+ default: 0.22,
1887
+ options: {
1888
+ animatable: true,
1889
+ minValue: 0,
1890
+ maxValue: 4
1891
+ },
1892
+ get (value) {
1893
+ value.num[0] = this.specularStrength;
1894
+ },
1895
+ set (value) {
1896
+ this.specularStrength = value.num[0];
1897
+ },
1898
+ getDefaultValue () {
1899
+ return this.$isInstance ? this.coreMaterial.specularStrength : 0.22;
1900
+ }
1901
+ },
1902
+ {
1903
+ name: 'DiffuseWrap',
1904
+ description: 'Wrap amount for visible diffuse lighting',
1905
+ type: 'float',
1906
+ default: 0.28,
1907
+ options: {
1908
+ animatable: true,
1909
+ minValue: 0,
1910
+ maxValue: 2
1911
+ },
1912
+ get (value) {
1913
+ value.num[0] = this.diffuseWrap;
1914
+ },
1915
+ set (value) {
1916
+ this.diffuseWrap = value.num[0];
1917
+ },
1918
+ getDefaultValue () {
1919
+ return this.$isInstance ? this.coreMaterial.diffuseWrap : 0.28;
1920
+ }
1921
+ },
1922
+ {
1923
+ name: 'DiffuseSoftness',
1924
+ description: 'Blend from hard Lambert lighting to wrapped diffuse lighting',
1925
+ type: 'float',
1926
+ default: 0.45,
1927
+ options: {
1928
+ animatable: true,
1929
+ minValue: 0,
1930
+ maxValue: 1
1931
+ },
1932
+ get (value) {
1933
+ value.num[0] = this.diffuseSoftness;
1934
+ },
1935
+ set (value) {
1936
+ this.diffuseSoftness = value.num[0];
1937
+ },
1938
+ getDefaultValue () {
1939
+ return this.$isInstance ? this.coreMaterial.diffuseSoftness : 0.45;
1940
+ }
1941
+ },
1942
+ {
1943
+ name: 'ScatterWrap',
1944
+ description: 'Wide wrap amount written to the Skin SSS scattering source',
1945
+ type: 'float',
1946
+ default: 0.65,
1947
+ options: {
1948
+ animatable: true,
1949
+ minValue: 0,
1950
+ maxValue: 2
1951
+ },
1952
+ get (value) {
1953
+ value.num[0] = this.scatterWrap;
1954
+ },
1955
+ set (value) {
1956
+ this.scatterWrap = value.num[0];
1957
+ },
1958
+ getDefaultValue () {
1959
+ return this.$isInstance ? this.coreMaterial.scatterWrap : 0.65;
1960
+ }
1961
+ },
1962
+ {
1963
+ name: 'ScatterStrength',
1964
+ description: 'Strength of the lighting multiplier written to the Skin SSS side buffer',
1965
+ type: 'float',
1966
+ default: 0.7,
1967
+ options: {
1968
+ animatable: true,
1969
+ minValue: 0,
1970
+ maxValue: 4
1971
+ },
1972
+ get (value) {
1973
+ value.num[0] = this.scatterStrength;
1974
+ },
1975
+ set (value) {
1976
+ this.scatterStrength = value.num[0];
1977
+ },
1978
+ getDefaultValue () {
1979
+ return this.$isInstance ? this.coreMaterial.scatterStrength : 0.7;
1980
+ }
1981
+ },
1982
+ {
1983
+ name: 'ScatterColor',
1984
+ description: 'Warm tint for the blurred skin scattering contribution',
1985
+ type: 'rgba',
1986
+ default: [
1987
+ 1,
1988
+ 0.42,
1989
+ 0.28,
1990
+ 1
1991
+ ],
1992
+ options: {
1993
+ animatable: true,
1994
+ minValue: 0,
1995
+ maxValue: 1
1996
+ },
1997
+ get (value) {
1998
+ value.num[0] = this.scatterColor.x;
1999
+ value.num[1] = this.scatterColor.y;
2000
+ value.num[2] = this.scatterColor.z;
2001
+ value.num[3] = this.scatterColor.w;
2002
+ },
2003
+ set (value) {
2004
+ this.scatterColor = new Vector4(value.num[0], value.num[1], value.num[2], value.num[3]);
2005
+ },
2006
+ getDefaultValue () {
2007
+ const color = this.$isInstance ? this.coreMaterial.scatterColor : new Vector4(1, 0.42, 0.28, 1);
2008
+ return [
2009
+ color.x,
2010
+ color.y,
2011
+ color.z,
2012
+ color.w
2013
+ ];
2014
+ }
2015
+ },
2016
+ ...getTextureProps(manager, 'subsurfaceTexture', '2D', false, 1),
2017
+ ...getLitMaterialProps(manager)
2018
+ ]);
2019
+ }
2020
+ },
2021
+ getMeshMaterialInstanceUniformsClass(SkinMaterial)
2022
+ ];
2023
+ }
1832
2024
  /** @internal */ function getPBRMetallicRoughnessMaterialClass(manager) {
1833
2025
  return [
1834
2026
  {
@@ -2110,5 +2302,5 @@ function getMToonMaterialProps(manager) {
2110
2302
  ];
2111
2303
  }
2112
2304
 
2113
- export { getBlinnMaterialClass, getLambertMaterialClass, getMToonMaterialClass, getMeshMaterialClass, getPBRBluePrintMaterialClass, getPBRMetallicRoughnessMaterialClass, getPBRSpecularGlossinessMaterialClass, getParticleMaterialClass, getSpriteBlueprintMaterialClass, getSpriteMaterialClass, getStandardSpriteMaterialClass, getSubsurfaceProfileClass, getUnlitMaterialClass };
2305
+ export { getBlinnMaterialClass, getLambertMaterialClass, getMToonMaterialClass, getMeshMaterialClass, getPBRBluePrintMaterialClass, getPBRMetallicRoughnessMaterialClass, getPBRSpecularGlossinessMaterialClass, getParticleMaterialClass, getSkinMaterialClass, getSpriteBlueprintMaterialClass, getSpriteMaterialClass, getStandardSpriteMaterialClass, getSubsurfaceProfileClass, getUnlitMaterialClass };
2114
2306
  //# sourceMappingURL=material.js.map