@zephyr3d/scene 0.9.6 → 0.9.8

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 (205) hide show
  1. package/dist/animation/animationset.js +52 -55
  2. package/dist/animation/animationset.js.map +1 -1
  3. package/dist/animation/joint_dynamics/controller.js +92 -32
  4. package/dist/animation/joint_dynamics/controller.js.map +1 -1
  5. package/dist/animation/joint_dynamics/convex_collider.js +320 -0
  6. package/dist/animation/joint_dynamics/convex_collider.js.map +1 -0
  7. package/dist/animation/joint_dynamics/joint_dynamics_system.js +57 -19
  8. package/dist/animation/joint_dynamics/joint_dynamics_system.js.map +1 -1
  9. package/dist/animation/joint_dynamics/solver.js +71 -27
  10. package/dist/animation/joint_dynamics/solver.js.map +1 -1
  11. package/dist/animation/joint_dynamics_modifier.js +4 -3
  12. package/dist/animation/joint_dynamics_modifier.js.map +1 -1
  13. package/dist/animation/skeleton.js +7 -10
  14. package/dist/animation/skeleton.js.map +1 -1
  15. package/dist/app/engine.js +3 -9
  16. package/dist/app/engine.js.map +1 -1
  17. package/dist/app/scriptregistry.js +47 -16
  18. package/dist/app/scriptregistry.js.map +1 -1
  19. package/dist/asset/assetmanager.js +3 -1
  20. package/dist/asset/assetmanager.js.map +1 -1
  21. package/dist/asset/model.js +346 -7
  22. package/dist/asset/model.js.map +1 -1
  23. package/dist/avatar/wardrobe.js +7 -3
  24. package/dist/avatar/wardrobe.js.map +1 -1
  25. package/dist/camera/camera.js +240 -34
  26. package/dist/camera/camera.js.map +1 -1
  27. package/dist/index.d.ts +1350 -622
  28. package/dist/index.js +6 -11
  29. package/dist/index.js.map +1 -1
  30. package/dist/material/blinn.js +1 -1
  31. package/dist/material/blinn.js.map +1 -1
  32. package/dist/material/lambert.js +1 -1
  33. package/dist/material/lambert.js.map +1 -1
  34. package/dist/material/material.js +23 -1
  35. package/dist/material/material.js.map +1 -1
  36. package/dist/material/meshmaterial.js +178 -23
  37. package/dist/material/meshmaterial.js.map +1 -1
  38. package/dist/material/mixins/albedocolor.js +4 -4
  39. package/dist/material/mixins/albedocolor.js.map +1 -1
  40. package/dist/material/mixins/lightmodel/blinnphong.js +2 -1
  41. package/dist/material/mixins/lightmodel/blinnphong.js.map +1 -1
  42. package/dist/material/mixins/lightmodel/lambert.js +2 -1
  43. package/dist/material/mixins/lightmodel/lambert.js.map +1 -1
  44. package/dist/material/mixins/lightmodel/pbrblueprintmixin.js +63 -16
  45. package/dist/material/mixins/lightmodel/pbrblueprintmixin.js.map +1 -1
  46. package/dist/material/mixins/lightmodel/pbrmetallicroughness.js +100 -27
  47. package/dist/material/mixins/lightmodel/pbrmetallicroughness.js.map +1 -1
  48. package/dist/material/mixins/lightmodel/pbrspecularglossness.js +16 -6
  49. package/dist/material/mixins/lightmodel/pbrspecularglossness.js.map +1 -1
  50. package/dist/material/mixins/lit.js +1 -1
  51. package/dist/material/mixins/lit.js.map +1 -1
  52. package/dist/material/mixins/pbr/common.js +276 -65
  53. package/dist/material/mixins/pbr/common.js.map +1 -1
  54. package/dist/material/mixins/texture.js +3 -3
  55. package/dist/material/mixins/texture.js.map +1 -1
  56. package/dist/material/mixins/vertexcolor.js +2 -2
  57. package/dist/material/mixins/vertexcolor.js.map +1 -1
  58. package/dist/material/mtoon.js +574 -0
  59. package/dist/material/mtoon.js.map +1 -0
  60. package/dist/material/pbrblueprint.js +494 -331
  61. package/dist/material/pbrblueprint.js.map +1 -1
  62. package/dist/material/pbrmr.js +118 -100
  63. package/dist/material/pbrmr.js.map +1 -1
  64. package/dist/material/pbrsg.js +1 -1
  65. package/dist/material/pbrsg.js.map +1 -1
  66. package/dist/material/shader/helper.js +45 -15
  67. package/dist/material/shader/helper.js.map +1 -1
  68. package/dist/material/subsurfaceprofile.js +812 -0
  69. package/dist/material/subsurfaceprofile.js.map +1 -0
  70. package/dist/material/unlit.js +1 -1
  71. package/dist/material/unlit.js.map +1 -1
  72. package/dist/posteffect/compositor.js +46 -11
  73. package/dist/posteffect/compositor.js.map +1 -1
  74. package/dist/posteffect/ssr.js +413 -87
  75. package/dist/posteffect/ssr.js.map +1 -1
  76. package/dist/posteffect/sss.js +1053 -0
  77. package/dist/posteffect/sss.js.map +1 -0
  78. package/dist/posteffect/taa.js +61 -60
  79. package/dist/posteffect/taa.js.map +1 -1
  80. package/dist/render/abuffer_oit.js +63 -12
  81. package/dist/render/abuffer_oit.js.map +1 -1
  82. package/dist/render/cluster_light.js +6 -5
  83. package/dist/render/cluster_light.js.map +1 -1
  84. package/dist/render/drawable.js +1 -5
  85. package/dist/render/drawable.js.map +1 -1
  86. package/dist/render/drawable_mixin.js +2 -1
  87. package/dist/render/drawable_mixin.js.map +1 -1
  88. package/dist/render/fbm_wavegenerator.js +2 -1
  89. package/dist/render/fbm_wavegenerator.js.map +1 -1
  90. package/dist/render/gerstner_wavegenerator.js +2 -1
  91. package/dist/render/gerstner_wavegenerator.js.map +1 -1
  92. package/dist/render/globalbindgroup_allocator.js +2 -1
  93. package/dist/render/globalbindgroup_allocator.js.map +1 -1
  94. package/dist/render/lightpass.js +105 -18
  95. package/dist/render/lightpass.js.map +1 -1
  96. package/dist/render/render_queue.js +51 -8
  97. package/dist/render/render_queue.js.map +1 -1
  98. package/dist/render/renderer.js +73 -59
  99. package/dist/render/renderer.js.map +1 -1
  100. package/dist/render/rendergraph/device_pool_allocator.js +8 -0
  101. package/dist/render/rendergraph/device_pool_allocator.js.map +1 -1
  102. package/dist/render/rendergraph/forward_plus_builder.js +481 -95
  103. package/dist/render/rendergraph/forward_plus_builder.js.map +1 -1
  104. package/dist/render/rendergraph/history_resource_manager.js +55 -0
  105. package/dist/render/rendergraph/history_resource_manager.js.map +1 -1
  106. package/dist/render/rendergraph/history_resources.js +3 -1
  107. package/dist/render/rendergraph/history_resources.js.map +1 -1
  108. package/dist/render/rendergraph/types.js.map +1 -1
  109. package/dist/render/renderpass.js +10 -4
  110. package/dist/render/renderpass.js.map +1 -1
  111. package/dist/render/sky.js +31 -1
  112. package/dist/render/sky.js.map +1 -1
  113. package/dist/render/weightedblended_oit.js +23 -5
  114. package/dist/render/weightedblended_oit.js.map +1 -1
  115. package/dist/scene/basesprite.js +4 -2
  116. package/dist/scene/basesprite.js.map +1 -1
  117. package/dist/scene/batchgroup.js +3 -1
  118. package/dist/scene/batchgroup.js.map +1 -1
  119. package/dist/scene/environment.js +11 -1
  120. package/dist/scene/environment.js.map +1 -1
  121. package/dist/scene/light.js +21 -3
  122. package/dist/scene/light.js.map +1 -1
  123. package/dist/scene/mesh.js +29 -14
  124. package/dist/scene/mesh.js.map +1 -1
  125. package/dist/scene/meshdrawable.js +6 -0
  126. package/dist/scene/meshdrawable.js.map +1 -1
  127. package/dist/scene/msdftext.js +5 -2
  128. package/dist/scene/msdftext.js.map +1 -1
  129. package/dist/scene/msdftextsprite.js +5 -3
  130. package/dist/scene/msdftextsprite.js.map +1 -1
  131. package/dist/scene/particlesys.js +3 -1
  132. package/dist/scene/particlesys.js.map +1 -1
  133. package/dist/scene/scene.js +6 -5
  134. package/dist/scene/scene.js.map +1 -1
  135. package/dist/scene/terrain-cm/grass.js +4 -2
  136. package/dist/scene/terrain-cm/grass.js.map +1 -1
  137. package/dist/scene/terrain-cm/grassmaterial.js +2 -1
  138. package/dist/scene/terrain-cm/grassmaterial.js.map +1 -1
  139. package/dist/scene/terrain-cm/terrain-cm.js +4 -2
  140. package/dist/scene/terrain-cm/terrain-cm.js.map +1 -1
  141. package/dist/scene/water.js +4 -2
  142. package/dist/scene/water.js.map +1 -1
  143. package/dist/shaders/shadow.js +26 -393
  144. package/dist/shaders/shadow.js.map +1 -1
  145. package/dist/shadow/esm.js +112 -12
  146. package/dist/shadow/esm.js.map +1 -1
  147. package/dist/shadow/pcf_opt.js +2 -2
  148. package/dist/shadow/pcf_opt.js.map +1 -1
  149. package/dist/shadow/pcf_pd.js +19 -10
  150. package/dist/shadow/pcf_pd.js.map +1 -1
  151. package/dist/shadow/shader.js +58 -7
  152. package/dist/shadow/shader.js.map +1 -1
  153. package/dist/shadow/shadow_impl.js +6 -0
  154. package/dist/shadow/shadow_impl.js.map +1 -1
  155. package/dist/shadow/shadow_region.js +229 -0
  156. package/dist/shadow/shadow_region.js.map +1 -0
  157. package/dist/shadow/shadowmapper.js +67 -59
  158. package/dist/shadow/shadowmapper.js.map +1 -1
  159. package/dist/shadow/vsm.js +45 -19
  160. package/dist/shadow/vsm.js.map +1 -1
  161. package/dist/utility/blueprint/common/constants.js +8 -8
  162. package/dist/utility/blueprint/common/constants.js.map +1 -1
  163. package/dist/utility/blueprint/material/pbr.js +31 -4
  164. package/dist/utility/blueprint/material/pbr.js.map +1 -1
  165. package/dist/utility/blueprint/material/texture.js +1 -17
  166. package/dist/utility/blueprint/material/texture.js.map +1 -1
  167. package/dist/utility/serialization/manager.js +66 -98
  168. package/dist/utility/serialization/manager.js.map +1 -1
  169. package/dist/utility/serialization/scene/animation.js +5 -2
  170. package/dist/utility/serialization/scene/animation.js.map +1 -1
  171. package/dist/utility/serialization/scene/batch.js +4 -1
  172. package/dist/utility/serialization/scene/batch.js.map +1 -1
  173. package/dist/utility/serialization/scene/camera.js +249 -54
  174. package/dist/utility/serialization/scene/camera.js.map +1 -1
  175. package/dist/utility/serialization/scene/common.js +37 -1
  176. package/dist/utility/serialization/scene/common.js.map +1 -1
  177. package/dist/utility/serialization/scene/light.js +42 -3
  178. package/dist/utility/serialization/scene/light.js.map +1 -1
  179. package/dist/utility/serialization/scene/material.js +1112 -646
  180. package/dist/utility/serialization/scene/material.js.map +1 -1
  181. package/dist/utility/serialization/scene/mesh.js +7 -4
  182. package/dist/utility/serialization/scene/mesh.js.map +1 -1
  183. package/dist/utility/serialization/scene/node.js +31 -12
  184. package/dist/utility/serialization/scene/node.js.map +1 -1
  185. package/dist/utility/serialization/scene/particle.js +4 -1
  186. package/dist/utility/serialization/scene/particle.js.map +1 -1
  187. package/dist/utility/serialization/scene/primitive.js +3 -1
  188. package/dist/utility/serialization/scene/primitive.js.map +1 -1
  189. package/dist/utility/serialization/scene/scene.js +18 -0
  190. package/dist/utility/serialization/scene/scene.js.map +1 -1
  191. package/dist/utility/serialization/scene/sprite.js +6 -3
  192. package/dist/utility/serialization/scene/sprite.js.map +1 -1
  193. package/dist/utility/serialization/scene/terrain.js +5 -2
  194. package/dist/utility/serialization/scene/terrain.js.map +1 -1
  195. package/dist/utility/serialization/scene/text.js +3 -1
  196. package/dist/utility/serialization/scene/text.js.map +1 -1
  197. package/dist/utility/serialization/scene/water.js +4 -1
  198. package/dist/utility/serialization/scene/water.js.map +1 -1
  199. package/dist/utility/textures/ltcdata.js +6 -0
  200. package/dist/utility/textures/ltcdata.js.map +1 -0
  201. package/dist/utility/textures/ltclut.js +61 -0
  202. package/dist/utility/textures/ltclut.js.map +1 -0
  203. package/dist/values.js +9 -1
  204. package/dist/values.js.map +1 -1
  205. package/package.json +3 -3
@@ -3,23 +3,258 @@ import { LambertMaterial } from '../../../material/lambert.js';
3
3
  import { BlinnMaterial } from '../../../material/blinn.js';
4
4
  import { UnlitMaterial } from '../../../material/unlit.js';
5
5
  import { ParticleMaterial } from '../../../material/particle.js';
6
+ import { SubsurfaceProfile } from '../../../material/subsurfaceprofile.js';
6
7
  import '@zephyr3d/device';
7
8
  import '../../../values.js';
8
- import { Vector3, Vector2, Vector4 } from '@zephyr3d/base';
9
+ import { Vector3, Vector4, Vector2 } from '@zephyr3d/base';
9
10
  import { MeshMaterial } from '../../../material/meshmaterial.js';
10
11
  import '../../../material/grassmaterial.js';
11
12
  import '../../../material/terrain-cm.js';
12
13
  import { PBRMetallicRoughnessMaterial } from '../../../material/pbrmr.js';
13
14
  import { PBRSpecularGlossinessMaterial } from '../../../material/pbrsg.js';
15
+ import { MToonMaterial } from '../../../material/mtoon.js';
14
16
  import { PBRBluePrintMaterial } from '../../../material/pbrblueprint.js';
15
17
  import { SpriteMaterial } from '../../../material/sprite.js';
16
18
  import { StandardSpriteMaterial } from '../../../material/sprite_std.js';
17
- import '../../../material/msdf_text.js';
18
19
  import { SpriteBlueprintMaterial } from '../../../material/spriteblueprint.js';
19
20
  import { defineProps } from '../types.js';
20
21
  import { getMeshMaterialInstanceUniformsClass, getTextureProps } from './common.js';
21
22
 
23
+ function createBlueprintOutputHiddenPredicate(_outputs) {
24
+ return function() {
25
+ return this instanceof PBRBluePrintMaterial;
26
+ };
27
+ }
28
+ function getSubsurfaceProfileClass() {
29
+ return {
30
+ ctor: SubsurfaceProfile,
31
+ name: 'SubsurfaceProfile',
32
+ getProps () {
33
+ return defineProps([
34
+ {
35
+ name: 'Preset',
36
+ type: 'string',
37
+ default: 'skin_default',
38
+ options: {
39
+ label: 'LookPreset',
40
+ enum: {
41
+ labels: [
42
+ 'Skin Thin',
43
+ 'Skin Default',
44
+ 'Skin HeavyMakeup',
45
+ 'Wax Backlit',
46
+ 'Wax Soft',
47
+ 'Jade Backlit',
48
+ 'Jade Soft'
49
+ ],
50
+ values: [
51
+ 'skin_thin',
52
+ 'skin_default',
53
+ 'skin_heavy_makeup',
54
+ 'wax_backlit',
55
+ 'wax_soft',
56
+ 'jade_backlit',
57
+ 'jade_soft'
58
+ ]
59
+ }
60
+ },
61
+ get (value) {
62
+ value.str[0] = this.preset;
63
+ },
64
+ set (value) {
65
+ this.preset = value.str[0];
66
+ }
67
+ },
68
+ {
69
+ name: 'ScatterColor',
70
+ type: 'rgb',
71
+ default: [
72
+ 1,
73
+ 0.45,
74
+ 0.17
75
+ ],
76
+ options: {
77
+ label: 'MeanFreePathColor',
78
+ animatable: true,
79
+ minValue: 0,
80
+ maxValue: 1
81
+ },
82
+ get (value) {
83
+ value.num[0] = this.meanFreePathColor.x;
84
+ value.num[1] = this.meanFreePathColor.y;
85
+ value.num[2] = this.meanFreePathColor.z;
86
+ },
87
+ set (value) {
88
+ this.meanFreePathColor = new Vector3(value.num[0], value.num[1], value.num[2]);
89
+ }
90
+ },
91
+ {
92
+ name: 'ScatterDistance',
93
+ type: 'float',
94
+ default: 0.92,
95
+ options: {
96
+ label: 'MeanFreePathDistance',
97
+ animatable: true,
98
+ minValue: 0,
99
+ maxValue: 8
100
+ },
101
+ get (value) {
102
+ value.num[0] = this.meanFreePathDistance;
103
+ },
104
+ set (value) {
105
+ this.meanFreePathDistance = value.num[0];
106
+ }
107
+ },
108
+ {
109
+ name: 'ScatterWeight',
110
+ type: 'float',
111
+ default: 0.82,
112
+ options: {
113
+ label: 'ScatterWeight',
114
+ animatable: true,
115
+ minValue: 0,
116
+ maxValue: 8
117
+ },
118
+ get (value) {
119
+ value.num[0] = this.strength;
120
+ },
121
+ set (value) {
122
+ this.strength = value.num[0];
123
+ }
124
+ },
125
+ {
126
+ name: 'ScatterScale',
127
+ type: 'float',
128
+ default: 0.96,
129
+ options: {
130
+ label: 'ScatterScale',
131
+ animatable: true,
132
+ minValue: 0,
133
+ maxValue: 8
134
+ },
135
+ get (value) {
136
+ value.num[0] = this.scale;
137
+ },
138
+ set (value) {
139
+ this.scale = value.num[0];
140
+ }
141
+ },
142
+ {
143
+ name: 'WorldUnitScale',
144
+ type: 'float',
145
+ default: 1,
146
+ options: {
147
+ label: 'WorldUnitScale',
148
+ animatable: true,
149
+ minValue: 0.05,
150
+ maxValue: 4
151
+ },
152
+ get (value) {
153
+ value.num[0] = this.worldUnitScale;
154
+ },
155
+ set (value) {
156
+ this.worldUnitScale = value.num[0];
157
+ }
158
+ },
159
+ {
160
+ name: 'BoundaryColorBleed',
161
+ type: 'float',
162
+ default: 0.22,
163
+ options: {
164
+ label: 'BoundaryColorBleed',
165
+ animatable: true,
166
+ minValue: 0,
167
+ maxValue: 1
168
+ },
169
+ get (value) {
170
+ value.num[0] = this.boundaryColorBleed;
171
+ },
172
+ set (value) {
173
+ this.boundaryColorBleed = value.num[0];
174
+ }
175
+ },
176
+ {
177
+ name: 'TransmissionTintColor',
178
+ type: 'rgb',
179
+ default: [
180
+ 1,
181
+ 0.46,
182
+ 0.34
183
+ ],
184
+ options: {
185
+ label: 'TransmissionTintColor',
186
+ animatable: true,
187
+ minValue: 0,
188
+ maxValue: 1
189
+ },
190
+ get (value) {
191
+ value.num[0] = this.transmissionTintColor.x;
192
+ value.num[1] = this.transmissionTintColor.y;
193
+ value.num[2] = this.transmissionTintColor.z;
194
+ },
195
+ set (value) {
196
+ this.transmissionTintColor = new Vector3(value.num[0], value.num[1], value.num[2]);
197
+ }
198
+ },
199
+ {
200
+ name: 'ExtinctionScale',
201
+ type: 'float',
202
+ default: 1.06,
203
+ options: {
204
+ label: 'ExtinctionScale',
205
+ animatable: true,
206
+ minValue: 0,
207
+ maxValue: 4
208
+ },
209
+ get (value) {
210
+ value.num[0] = this.extinctionScale;
211
+ },
212
+ set (value) {
213
+ this.extinctionScale = value.num[0];
214
+ }
215
+ },
216
+ {
217
+ name: 'NormalScale',
218
+ type: 'float',
219
+ default: 1,
220
+ options: {
221
+ label: 'NormalScale',
222
+ animatable: true,
223
+ minValue: 0,
224
+ maxValue: 2
225
+ },
226
+ get (value) {
227
+ value.num[0] = this.normalScale;
228
+ },
229
+ set (value) {
230
+ this.normalScale = value.num[0];
231
+ }
232
+ },
233
+ {
234
+ name: 'ScatteringDistribution',
235
+ type: 'float',
236
+ default: 0.6,
237
+ options: {
238
+ label: 'ScatteringDistribution',
239
+ animatable: true,
240
+ minValue: 0,
241
+ maxValue: 1
242
+ },
243
+ get (value) {
244
+ value.num[0] = this.scatteringDistribution;
245
+ },
246
+ set (value) {
247
+ this.scatteringDistribution = value.num[0];
248
+ }
249
+ }
250
+ ]);
251
+ }
252
+ };
253
+ }
22
254
  function getPBRCommonProps(manager) {
255
+ const supportsSSSThicknessAuthoring = function() {
256
+ return !this.$isInstance && !!(this.transmission || this.subsurfaceProfile);
257
+ };
23
258
  return defineProps([
24
259
  {
25
260
  name: 'IOR',
@@ -56,11 +291,14 @@ function getPBRCommonProps(manager) {
56
291
  set (value) {
57
292
  this.occlusionStrength = value.num[0];
58
293
  },
294
+ isHidden: createBlueprintOutputHiddenPredicate(),
59
295
  isValid () {
60
296
  return !this.$isInstance && !!this.occlusionTexture;
61
297
  }
62
298
  },
63
- ...getTextureProps(manager, 'occlusionTexture', '2D', false, 0),
299
+ ...getTextureProps(manager, 'occlusionTexture', '2D', false, 0, undefined, [
300
+ 'AO'
301
+ ]),
64
302
  {
65
303
  name: 'EmissiveColor',
66
304
  description: 'Base self-illumination color emitted by the material',
@@ -76,6 +314,7 @@ function getPBRCommonProps(manager) {
76
314
  set (value) {
77
315
  this.emissiveColor = new Vector3(value.num[0], value.num[1], value.num[2]);
78
316
  },
317
+ isHidden: createBlueprintOutputHiddenPredicate(),
79
318
  getDefaultValue () {
80
319
  return this.$isInstance ? this.coreMaterial.emissiveColor : [
81
320
  0,
@@ -99,12 +338,36 @@ function getPBRCommonProps(manager) {
99
338
  set (value) {
100
339
  this.emissiveStrength = value.num[0];
101
340
  },
341
+ isHidden: createBlueprintOutputHiddenPredicate(),
102
342
  getDefaultValue () {
103
343
  return this.$isInstance ? this.coreMaterial.emissiveStrength : 1;
104
344
  }
105
345
  },
106
- ...getTextureProps(manager, 'emissiveTexture', '2D', true, 0),
107
- ...getTextureProps(manager, 'specularTexture', '2D', false, 0),
346
+ {
347
+ name: 'RectSpecularScale',
348
+ type: 'float',
349
+ options: {
350
+ label: 'RectSpecularScale',
351
+ animatable: true,
352
+ minValue: 0,
353
+ maxValue: 4
354
+ },
355
+ get (value) {
356
+ value.num[0] = this.rectSpecularScale;
357
+ },
358
+ set (value) {
359
+ this.rectSpecularScale = value.num[0];
360
+ },
361
+ getDefaultValue () {
362
+ return this.$isInstance ? this.coreMaterial.rectSpecularScale : 1;
363
+ }
364
+ },
365
+ ...getTextureProps(manager, 'emissiveTexture', '2D', true, 0, undefined, [
366
+ 'Emissive'
367
+ ]),
368
+ ...getTextureProps(manager, 'specularTexture', '2D', false, 0, undefined, [
369
+ 'SpecularWeight'
370
+ ]),
108
371
  {
109
372
  name: 'Transmission',
110
373
  description: 'If true, enables light transmission through the material',
@@ -139,11 +402,11 @@ function getPBRCommonProps(manager) {
139
402
  this.transmissionFactor = value.num[0];
140
403
  },
141
404
  isValid () {
142
- return !this.$isInstance && !!this.transmission;
405
+ return supportsSSSThicknessAuthoring.call(this);
143
406
  }
144
407
  },
145
408
  ...getTextureProps(manager, 'transmissionTexture', '2D', false, 1, function() {
146
- return this.transmission;
409
+ return this.transmission || !!this.subsurfaceProfile;
147
410
  }),
148
411
  {
149
412
  name: 'ThicknessFactor',
@@ -163,11 +426,11 @@ function getPBRCommonProps(manager) {
163
426
  this.thicknessFactor = value.num[0];
164
427
  },
165
428
  isValid () {
166
- return !this.$isInstance && !!this.transmission;
429
+ return supportsSSSThicknessAuthoring.call(this);
167
430
  }
168
431
  },
169
432
  ...getTextureProps(manager, 'thicknessTexture', '2D', false, 1, function() {
170
- return this.transmission;
433
+ return this.transmission || !!this.subsurfaceProfile;
171
434
  }),
172
435
  {
173
436
  name: 'AttenuationColor',
@@ -191,7 +454,7 @@ function getPBRCommonProps(manager) {
191
454
  this.attenuationColor = new Vector3(value.num[0], value.num[1], value.num[2]);
192
455
  },
193
456
  isValid () {
194
- return !this.$isInstance && !!this.transmission;
457
+ return supportsSSSThicknessAuthoring.call(this);
195
458
  }
196
459
  },
197
460
  {
@@ -212,7 +475,7 @@ function getPBRCommonProps(manager) {
212
475
  this.attenuationDistance = value.num[0];
213
476
  },
214
477
  isValid () {
215
- return !this.$isInstance && !!this.transmission;
478
+ return supportsSSSThicknessAuthoring.call(this);
216
479
  }
217
480
  },
218
481
  {
@@ -486,6 +749,7 @@ function getLitMaterialProps(manager) {
486
749
  set (value) {
487
750
  this.vertexNormal = value.bool[0];
488
751
  },
752
+ isHidden: createBlueprintOutputHiddenPredicate(),
489
753
  isValid () {
490
754
  return !this.$isInstance;
491
755
  }
@@ -501,11 +765,14 @@ function getLitMaterialProps(manager) {
501
765
  set (value) {
502
766
  this.vertexTangent = value.bool[0];
503
767
  },
768
+ isHidden: createBlueprintOutputHiddenPredicate(),
504
769
  isValid () {
505
770
  return !this.$isInstance && !!this.vertexNormal;
506
771
  }
507
772
  },
508
- ...getTextureProps(manager, 'normalTexture', '2D', false, 0)
773
+ ...getTextureProps(manager, 'normalTexture', '2D', false, 0, undefined, [
774
+ 'Normal'
775
+ ])
509
776
  ]);
510
777
  }
511
778
  function getUnlitMaterialProps(manager) {
@@ -521,6 +788,7 @@ function getUnlitMaterialProps(manager) {
521
788
  set (value) {
522
789
  this.vertexColor = value.bool[0];
523
790
  },
791
+ isHidden: createBlueprintOutputHiddenPredicate(),
524
792
  isValid () {
525
793
  return !this.$isInstance;
526
794
  }
@@ -542,6 +810,7 @@ function getUnlitMaterialProps(manager) {
542
810
  set (value) {
543
811
  this.albedoColor = new Vector4(value.num[0], value.num[1], value.num[2], value.num[3]);
544
812
  },
813
+ isHidden: createBlueprintOutputHiddenPredicate(),
545
814
  getDefaultValue () {
546
815
  return this.$isInstance ? this.coreMaterial.albedoColor : [
547
816
  1,
@@ -551,589 +820,926 @@ function getUnlitMaterialProps(manager) {
551
820
  ];
552
821
  }
553
822
  },
554
- ...getTextureProps(manager, 'albedoTexture', '2D', true, 0)
823
+ ...getTextureProps(manager, 'albedoTexture', '2D', true, 0, undefined, [
824
+ 'BaseColor',
825
+ 'Opacity'
826
+ ])
555
827
  ]);
556
828
  }
557
- /** @internal */ function getMeshMaterialClass() {
558
- return [
829
+ function getMToonMaterialProps(manager) {
830
+ return defineProps([
559
831
  {
560
- ctor: MeshMaterial,
561
- name: 'MeshMaterial',
562
- getProps () {
563
- return defineProps([
564
- {
565
- name: 'AlphaCutoff',
566
- description: 'If greater then 0, pixels which have alpha smaller than alpha cutoff will be discarded',
567
- type: 'float',
568
- default: 0,
569
- options: {
570
- animatable: true,
571
- minValue: 0,
572
- maxValue: 1
573
- },
574
- get (value) {
575
- value.num[0] = this.alphaCutoff;
576
- },
577
- set (value) {
578
- this.alphaCutoff = value.num[0];
579
- },
580
- isValid () {
581
- return !this.$isInstance;
582
- }
583
- },
584
- {
585
- name: 'AlphaToCoverage',
586
- description: 'If true, alpha-to-coverage will be enabled',
587
- type: 'bool',
588
- default: false,
589
- get (value) {
590
- value.bool[0] = this.alphaToCoverage;
591
- },
592
- set (value) {
593
- this.alphaToCoverage = value.bool[0];
594
- },
595
- isValid () {
596
- return !this.$isInstance;
597
- }
598
- },
599
- {
600
- name: 'AlphaDither',
601
- description: 'If true, alpha-dithering will be enabled',
602
- type: 'bool',
603
- default: false,
604
- get (value) {
605
- value.bool[0] = this.alphaDither;
606
- },
607
- set (value) {
608
- this.alphaDither = value.bool[0];
609
- },
610
- isValid () {
611
- return !this.$isInstance && this.alphaCutoff > 0;
612
- }
613
- },
614
- {
615
- name: 'BlendMode',
616
- description: 'Blending mode for this material',
617
- type: 'string',
618
- options: {
619
- enum: {
620
- labels: [
621
- 'None',
622
- 'Blend',
623
- 'Additive'
624
- ],
625
- values: [
626
- 'none',
627
- 'blend',
628
- 'additive'
629
- ]
630
- }
631
- },
632
- default: 'none',
633
- get (value) {
634
- value.str[0] = this.blendMode;
635
- },
636
- set (value) {
637
- this.blendMode = value.str[0];
638
- },
639
- isValid () {
640
- return !this.$isInstance;
641
- }
642
- },
643
- {
644
- name: 'CullMode',
645
- description: 'Cull mode for this material',
646
- type: 'string',
647
- options: {
648
- enum: {
649
- labels: [
650
- 'None',
651
- 'Front',
652
- 'Back'
653
- ],
654
- values: [
655
- 'none',
656
- 'front',
657
- 'back'
658
- ]
659
- }
660
- },
661
- default: 'back',
662
- get (value) {
663
- value.str[0] = this.cullMode;
664
- },
665
- set (value) {
666
- this.cullMode = value.str[0];
667
- },
668
- isValid () {
669
- return !this.$isInstance;
670
- }
671
- },
672
- {
673
- name: 'Opacity',
674
- description: 'Opacity value for this material, no effect if blendingMode is `none`',
675
- type: 'float',
676
- options: {
677
- animatable: true,
678
- minValue: 0,
679
- maxValue: 1
680
- },
681
- default: 1,
682
- get (value) {
683
- value.num[0] = this.opacity;
684
- },
685
- set (value) {
686
- this.opacity = value.num[0];
687
- },
688
- getDefaultValue () {
689
- return this.$isInstance ? this.coreMaterial.opacity : 1;
690
- }
691
- },
692
- {
693
- name: 'TAAStrength',
694
- description: 'TAA strength for this material',
695
- type: 'float',
696
- options: {
697
- minValue: 0,
698
- maxValue: 1
699
- },
700
- default: 15 / 16,
701
- get (value) {
702
- value.num[0] = this.TAAStrength;
703
- },
704
- set (value) {
705
- this.TAAStrength = value.num[0];
706
- },
707
- isValid () {
708
- return !this.$isInstance;
709
- }
710
- }
711
- ]);
832
+ name: 'AlbedoColor',
833
+ description: 'Base RGBA color of the MToon material',
834
+ type: 'rgba',
835
+ options: {
836
+ animatable: true
837
+ },
838
+ get (value) {
839
+ const color = this.albedoColor;
840
+ value.num[0] = color.x;
841
+ value.num[1] = color.y;
842
+ value.num[2] = color.z;
843
+ value.num[3] = color.w;
844
+ },
845
+ set (value) {
846
+ this.albedoColor = new Vector4(value.num[0], value.num[1], value.num[2], value.num[3]);
847
+ },
848
+ getDefaultValue () {
849
+ return this.$isInstance ? this.coreMaterial.albedoColor : [
850
+ 1,
851
+ 1,
852
+ 1,
853
+ 1
854
+ ];
712
855
  }
713
856
  },
714
- getMeshMaterialInstanceUniformsClass(MeshMaterial)
715
- ];
716
- }
717
- /** @internal */ function getSpriteMaterialClass(_manager) {
718
- return [
857
+ ...getTextureProps(manager, 'albedoTexture', '2D', true, 0),
719
858
  {
720
- ctor: SpriteMaterial,
721
- name: 'SpriteMaterial',
722
- parent: MeshMaterial,
723
- getProps () {
724
- return [];
859
+ name: 'NormalScale',
860
+ description: 'Scalar applied to the MToon normal texture',
861
+ type: 'float',
862
+ phase: 1,
863
+ default: 1,
864
+ options: {
865
+ animatable: true,
866
+ minValue: 0,
867
+ maxValue: 2
868
+ },
869
+ get (value) {
870
+ value.num[0] = this.normalScale;
871
+ },
872
+ set (value) {
873
+ this.normalScale = value.num[0];
874
+ },
875
+ isValid () {
876
+ return !this.$isInstance && !!this.normalTexture;
725
877
  }
726
878
  },
727
- getMeshMaterialInstanceUniformsClass(SpriteMaterial)
728
- ];
729
- }
730
- /** @internal */ function getStandardSpriteMaterialClass(manager) {
731
- return [
879
+ ...getTextureProps(manager, 'normalTexture', '2D', false, 0),
732
880
  {
733
- ctor: StandardSpriteMaterial,
734
- name: 'StandardSpriteMaterial',
735
- parent: SpriteMaterial,
736
- getProps () {
737
- return defineProps([
738
- {
739
- name: 'SpriteTexture',
740
- description: 'Texture file path for the sprite',
741
- type: 'object',
742
- default: '',
743
- options: {
744
- mimeTypes: [
745
- 'image/jpeg',
746
- 'image/png',
747
- 'image/tga',
748
- 'image/vnd.radiance',
749
- 'image/x-dds',
750
- 'image/webp'
751
- ]
752
- },
753
- isNullable () {
754
- return true;
755
- },
756
- get (value) {
757
- value.str[0] = manager.getAssetId(this.spriteTexture) ?? '';
758
- },
759
- async set (value) {
760
- if (!value || !value.str[0]) {
761
- this.spriteTexture = null;
762
- } else {
763
- const assetId = value.str[0];
764
- let tex;
765
- try {
766
- tex = await manager.fetchTexture(assetId, {
767
- linearColorSpace: false
768
- });
769
- } catch (err) {
770
- console.error(`Load asset failed: ${value.str[0]}: ${err}`);
771
- tex = null;
772
- }
773
- if (tex?.isTexture2D()) {
774
- this.spriteTexture = tex;
775
- } else {
776
- console.error('Invalid texture type');
777
- }
778
- }
779
- },
780
- isValid () {
781
- return !this.$isInstance;
782
- }
783
- }
784
- ]);
881
+ name: 'DoubleSidedLighting',
882
+ description: 'If true, MToon lighting is evaluated on both sides of the surface',
883
+ type: 'bool',
884
+ default: true,
885
+ get (value) {
886
+ value.bool[0] = this.doubleSidedLighting;
887
+ },
888
+ set (value) {
889
+ this.doubleSidedLighting = value.bool[0];
785
890
  }
786
891
  },
787
- getMeshMaterialInstanceUniformsClass(StandardSpriteMaterial)
788
- ];
789
- }
790
- /** @internal */ function getParticleMaterialClass(manager) {
791
- return [
792
892
  {
793
- ctor: ParticleMaterial,
794
- name: 'ParticleMaterial',
795
- parent: MeshMaterial,
796
- getProps () {
797
- return defineProps([
798
- {
799
- name: 'AlphaMap',
800
- description: 'Alpha texture file path',
801
- type: 'object',
802
- default: '',
803
- options: {
804
- mimeTypes: [
805
- 'image/jpeg',
806
- 'image/png',
807
- 'image/tga',
808
- 'image/vnd.radiance',
809
- 'image/x-dds',
810
- 'image/webp'
811
- ]
812
- },
813
- isNullable () {
814
- return true;
815
- },
816
- get (value) {
817
- value.str[0] = manager.getAssetId(this.alphaMap) ?? '';
818
- },
819
- async set (value) {
820
- if (!value || !value.str[0]) {
821
- this.alphaMap = null;
822
- } else {
823
- const assetId = value.str[0];
824
- let tex = null;
825
- try {
826
- tex = await manager.fetchTexture(assetId, {
827
- linearColorSpace: true
828
- });
829
- } catch (err) {
830
- console.error(`Load asset failed: ${value.str[0]}: ${err}`);
831
- }
832
- if (tex?.isTexture2D()) {
833
- this.alphaMap = tex;
834
- } else {
835
- console.error('Invalid albedo texture');
836
- }
837
- }
838
- }
839
- },
840
- {
841
- name: 'RampMap',
842
- description: 'Ramp texture file path',
843
- type: 'object',
844
- default: '',
845
- options: {
846
- mimeTypes: [
847
- 'image/jpeg',
848
- 'image/png',
849
- 'image/tga',
850
- 'image/vnd.radiance',
851
- 'image/x-dds',
852
- 'image/webp'
853
- ]
854
- },
855
- isNullable () {
856
- return true;
857
- },
858
- get (value) {
859
- value.str[0] = manager.getAssetId(this.rampMap) ?? '';
860
- },
861
- async set (value) {
862
- if (!value || !value.str[0]) {
863
- this.rampMap = null;
864
- } else {
865
- const assetId = value.str[0];
866
- let tex = null;
867
- try {
868
- tex = await manager.fetchTexture(assetId);
869
- } catch (err) {
870
- console.error(`Load asset failed: ${value.str[0]}: ${err}`);
871
- }
872
- if (tex?.isTexture2D()) {
873
- this.rampMap = tex;
874
- } else {
875
- console.error('Invalid albedo texture');
876
- }
877
- }
878
- }
879
- }
880
- ]);
893
+ name: 'EmissiveColor',
894
+ description: 'Base self-illumination color emitted by the MToon material',
895
+ type: 'rgb',
896
+ options: {
897
+ animatable: true
898
+ },
899
+ get (value) {
900
+ value.num[0] = this.emissiveColor.x;
901
+ value.num[1] = this.emissiveColor.y;
902
+ value.num[2] = this.emissiveColor.z;
903
+ },
904
+ set (value) {
905
+ this.emissiveColor = new Vector3(value.num[0], value.num[1], value.num[2]);
906
+ },
907
+ getDefaultValue () {
908
+ return this.$isInstance ? this.coreMaterial.emissiveColor : [
909
+ 0,
910
+ 0,
911
+ 0
912
+ ];
913
+ }
914
+ },
915
+ {
916
+ name: 'EmissiveStrength',
917
+ description: 'Intensity multiplier for the MToon emissive color and texture',
918
+ type: 'float',
919
+ default: 1,
920
+ options: {
921
+ animatable: true,
922
+ minValue: 0
923
+ },
924
+ get (value) {
925
+ value.num[0] = this.emissiveStrength;
926
+ },
927
+ set (value) {
928
+ this.emissiveStrength = value.num[0];
929
+ },
930
+ getDefaultValue () {
931
+ return this.$isInstance ? this.coreMaterial.emissiveStrength : 1;
932
+ }
933
+ },
934
+ ...getTextureProps(manager, 'emissiveTexture', '2D', true, 0),
935
+ {
936
+ name: 'ShadeColorFactor',
937
+ description: 'MToon shadow-side color factor',
938
+ type: 'rgb',
939
+ default: [
940
+ 0,
941
+ 0,
942
+ 0
943
+ ],
944
+ options: {
945
+ animatable: true,
946
+ minValue: 0,
947
+ maxValue: 1
948
+ },
949
+ get (value) {
950
+ value.num[0] = this.shadeColorFactor.x;
951
+ value.num[1] = this.shadeColorFactor.y;
952
+ value.num[2] = this.shadeColorFactor.z;
953
+ },
954
+ set (value) {
955
+ this.shadeColorFactor = new Vector3(value.num[0], value.num[1], value.num[2]);
956
+ },
957
+ getDefaultValue () {
958
+ return this.$isInstance ? this.coreMaterial.shadeColorFactor : [
959
+ 0,
960
+ 0,
961
+ 0
962
+ ];
963
+ }
964
+ },
965
+ ...getTextureProps(manager, 'shadeMultiplyTexture', '2D', true, 0),
966
+ {
967
+ name: 'ShadingShiftFactor',
968
+ description: 'MToon terminator shift factor',
969
+ type: 'float',
970
+ default: 0,
971
+ options: {
972
+ animatable: true,
973
+ minValue: -1,
974
+ maxValue: 1
975
+ },
976
+ get (value) {
977
+ value.num[0] = this.shadingShiftFactor;
978
+ },
979
+ set (value) {
980
+ this.shadingShiftFactor = value.num[0];
981
+ },
982
+ getDefaultValue () {
983
+ return this.$isInstance ? this.coreMaterial.shadingShiftFactor : 0;
984
+ }
985
+ },
986
+ {
987
+ name: 'ShadingShiftTextureScale',
988
+ description: 'Scale applied to the MToon shading shift texture',
989
+ type: 'float',
990
+ phase: 1,
991
+ default: 1,
992
+ options: {
993
+ animatable: true
994
+ },
995
+ get (value) {
996
+ value.num[0] = this.shadingShiftTextureScale;
997
+ },
998
+ set (value) {
999
+ this.shadingShiftTextureScale = value.num[0];
1000
+ },
1001
+ isValid () {
1002
+ return !this.$isInstance && !!this.shadingShiftTexture;
1003
+ }
1004
+ },
1005
+ ...getTextureProps(manager, 'shadingShiftTexture', '2D', false, 0),
1006
+ {
1007
+ name: 'ShadingToonyFactor',
1008
+ description: 'MToon shadow edge sharpness factor',
1009
+ type: 'float',
1010
+ default: 0.9,
1011
+ options: {
1012
+ animatable: true,
1013
+ minValue: 0,
1014
+ maxValue: 0.99
1015
+ },
1016
+ get (value) {
1017
+ value.num[0] = this.shadingToonyFactor;
1018
+ },
1019
+ set (value) {
1020
+ this.shadingToonyFactor = value.num[0];
1021
+ },
1022
+ getDefaultValue () {
1023
+ return this.$isInstance ? this.coreMaterial.shadingToonyFactor : 0.9;
1024
+ }
1025
+ },
1026
+ {
1027
+ name: 'GIEqualizationFactor',
1028
+ description: 'MToon indirect lighting equalization factor',
1029
+ type: 'float',
1030
+ default: 0.9,
1031
+ options: {
1032
+ animatable: true,
1033
+ minValue: 0,
1034
+ maxValue: 1
1035
+ },
1036
+ get (value) {
1037
+ value.num[0] = this.giEqualizationFactor;
1038
+ },
1039
+ set (value) {
1040
+ this.giEqualizationFactor = value.num[0];
1041
+ },
1042
+ getDefaultValue () {
1043
+ return this.$isInstance ? this.coreMaterial.giEqualizationFactor : 0.9;
1044
+ }
1045
+ },
1046
+ {
1047
+ name: 'MatcapFactor',
1048
+ description: 'MToon matcap color factor',
1049
+ type: 'rgb',
1050
+ default: [
1051
+ 1,
1052
+ 1,
1053
+ 1
1054
+ ],
1055
+ options: {
1056
+ animatable: true,
1057
+ minValue: 0,
1058
+ maxValue: 1
1059
+ },
1060
+ get (value) {
1061
+ value.num[0] = this.matcapFactor.x;
1062
+ value.num[1] = this.matcapFactor.y;
1063
+ value.num[2] = this.matcapFactor.z;
1064
+ },
1065
+ set (value) {
1066
+ this.matcapFactor = new Vector3(value.num[0], value.num[1], value.num[2]);
1067
+ },
1068
+ getDefaultValue () {
1069
+ return this.$isInstance ? this.coreMaterial.matcapFactor : [
1070
+ 1,
1071
+ 1,
1072
+ 1
1073
+ ];
1074
+ }
1075
+ },
1076
+ ...getTextureProps(manager, 'matcapTexture', '2D', true, 0),
1077
+ {
1078
+ name: 'ParametricRimColorFactor',
1079
+ description: 'MToon parametric rim color factor',
1080
+ type: 'rgb',
1081
+ default: [
1082
+ 0,
1083
+ 0,
1084
+ 0
1085
+ ],
1086
+ options: {
1087
+ animatable: true,
1088
+ minValue: 0,
1089
+ maxValue: 1
1090
+ },
1091
+ get (value) {
1092
+ value.num[0] = this.parametricRimColorFactor.x;
1093
+ value.num[1] = this.parametricRimColorFactor.y;
1094
+ value.num[2] = this.parametricRimColorFactor.z;
1095
+ },
1096
+ set (value) {
1097
+ this.parametricRimColorFactor = new Vector3(value.num[0], value.num[1], value.num[2]);
1098
+ },
1099
+ getDefaultValue () {
1100
+ return this.$isInstance ? this.coreMaterial.parametricRimColorFactor : [
1101
+ 0,
1102
+ 0,
1103
+ 0
1104
+ ];
1105
+ }
1106
+ },
1107
+ {
1108
+ name: 'ParametricRimFresnelPowerFactor',
1109
+ description: 'MToon parametric rim Fresnel power factor',
1110
+ type: 'float',
1111
+ default: 5,
1112
+ options: {
1113
+ animatable: true,
1114
+ minValue: 0
1115
+ },
1116
+ get (value) {
1117
+ value.num[0] = this.parametricRimFresnelPowerFactor;
1118
+ },
1119
+ set (value) {
1120
+ this.parametricRimFresnelPowerFactor = value.num[0];
1121
+ },
1122
+ getDefaultValue () {
1123
+ return this.$isInstance ? this.coreMaterial.parametricRimFresnelPowerFactor : 5;
1124
+ }
1125
+ },
1126
+ {
1127
+ name: 'ParametricRimLiftFactor',
1128
+ description: 'MToon parametric rim lift factor',
1129
+ type: 'float',
1130
+ default: 0,
1131
+ options: {
1132
+ animatable: true,
1133
+ minValue: 0,
1134
+ maxValue: 1
1135
+ },
1136
+ get (value) {
1137
+ value.num[0] = this.parametricRimLiftFactor;
1138
+ },
1139
+ set (value) {
1140
+ this.parametricRimLiftFactor = value.num[0];
1141
+ },
1142
+ getDefaultValue () {
1143
+ return this.$isInstance ? this.coreMaterial.parametricRimLiftFactor : 0;
1144
+ }
1145
+ },
1146
+ {
1147
+ name: 'RimLightingMixFactor',
1148
+ description: 'MToon rim lighting mix factor',
1149
+ type: 'float',
1150
+ default: 1,
1151
+ options: {
1152
+ animatable: true,
1153
+ minValue: 0,
1154
+ maxValue: 1
1155
+ },
1156
+ get (value) {
1157
+ value.num[0] = this.rimLightingMixFactor;
1158
+ },
1159
+ set (value) {
1160
+ this.rimLightingMixFactor = value.num[0];
1161
+ },
1162
+ getDefaultValue () {
1163
+ return this.$isInstance ? this.coreMaterial.rimLightingMixFactor : 1;
1164
+ }
1165
+ },
1166
+ ...getTextureProps(manager, 'rimMultiplyTexture', '2D', true, 0),
1167
+ {
1168
+ name: 'OutlineWidthMode',
1169
+ description: 'MToon outline width mode',
1170
+ type: 'string',
1171
+ default: 'none',
1172
+ options: {
1173
+ enum: {
1174
+ labels: [
1175
+ 'None',
1176
+ 'World Coordinates',
1177
+ 'Screen Coordinates'
1178
+ ],
1179
+ values: [
1180
+ 'none',
1181
+ 'worldCoordinates',
1182
+ 'screenCoordinates'
1183
+ ]
1184
+ }
1185
+ },
1186
+ get (value) {
1187
+ value.str[0] = this.outlineWidthMode;
1188
+ },
1189
+ set (value) {
1190
+ this.outlineWidthMode = value.str[0];
1191
+ },
1192
+ isValid () {
1193
+ return !this.$isInstance;
1194
+ }
1195
+ },
1196
+ {
1197
+ name: 'OutlineWidthFactor',
1198
+ description: 'MToon outline width factor',
1199
+ type: 'float',
1200
+ default: 0,
1201
+ options: {
1202
+ animatable: true,
1203
+ minValue: 0
1204
+ },
1205
+ get (value) {
1206
+ value.num[0] = this.outlineWidthFactor;
1207
+ },
1208
+ set (value) {
1209
+ this.outlineWidthFactor = value.num[0];
1210
+ },
1211
+ isValid () {
1212
+ return !this.$isInstance && this.outlineWidthMode !== 'none';
1213
+ }
1214
+ },
1215
+ ...getTextureProps(manager, 'outlineWidthMultiplyTexture', '2D', false, 1, function() {
1216
+ return this.outlineWidthMode !== 'none';
1217
+ }),
1218
+ {
1219
+ name: 'OutlineColorFactor',
1220
+ description: 'MToon outline color factor',
1221
+ type: 'rgb',
1222
+ default: [
1223
+ 0,
1224
+ 0,
1225
+ 0
1226
+ ],
1227
+ options: {
1228
+ animatable: true,
1229
+ minValue: 0,
1230
+ maxValue: 1
1231
+ },
1232
+ get (value) {
1233
+ value.num[0] = this.outlineColorFactor.x;
1234
+ value.num[1] = this.outlineColorFactor.y;
1235
+ value.num[2] = this.outlineColorFactor.z;
1236
+ },
1237
+ set (value) {
1238
+ this.outlineColorFactor = new Vector3(value.num[0], value.num[1], value.num[2]);
1239
+ },
1240
+ isValid () {
1241
+ return !this.$isInstance && this.outlineWidthMode !== 'none';
1242
+ }
1243
+ },
1244
+ {
1245
+ name: 'OutlineLightingMixFactor',
1246
+ description: 'MToon outline lighting mix factor',
1247
+ type: 'float',
1248
+ default: 1,
1249
+ options: {
1250
+ animatable: true,
1251
+ minValue: 0,
1252
+ maxValue: 1
1253
+ },
1254
+ get (value) {
1255
+ value.num[0] = this.outlineLightingMixFactor;
1256
+ },
1257
+ set (value) {
1258
+ this.outlineLightingMixFactor = value.num[0];
1259
+ },
1260
+ isValid () {
1261
+ return !this.$isInstance && this.outlineWidthMode !== 'none';
1262
+ }
1263
+ },
1264
+ {
1265
+ name: 'OutlineUsesTangentNormals',
1266
+ description: 'Use the tangent attribute xyz as smooth normals for MToon outline expansion',
1267
+ type: 'boolean',
1268
+ default: false,
1269
+ get (value) {
1270
+ value.bool[0] = this.outlineUsesTangentNormals;
1271
+ },
1272
+ set (value) {
1273
+ this.outlineUsesTangentNormals = value.bool[0];
1274
+ },
1275
+ isValid () {
1276
+ return !this.$isInstance && this.outlineWidthMode !== 'none';
1277
+ }
1278
+ },
1279
+ ...getTextureProps(manager, 'uvAnimationMaskTexture', '2D', false, 0),
1280
+ {
1281
+ name: 'UVAnimationScrollXSpeedFactor',
1282
+ description: 'MToon UV animation scroll speed on the X axis',
1283
+ type: 'float',
1284
+ default: 0,
1285
+ options: {
1286
+ animatable: true
1287
+ },
1288
+ get (value) {
1289
+ value.num[0] = this.uvAnimationScrollXSpeedFactor;
1290
+ },
1291
+ set (value) {
1292
+ this.uvAnimationScrollXSpeedFactor = value.num[0];
1293
+ },
1294
+ getDefaultValue () {
1295
+ return this.$isInstance ? this.coreMaterial.uvAnimationScrollXSpeedFactor : 0;
1296
+ }
1297
+ },
1298
+ {
1299
+ name: 'UVAnimationScrollYSpeedFactor',
1300
+ description: 'MToon UV animation scroll speed on the Y axis',
1301
+ type: 'float',
1302
+ default: 0,
1303
+ options: {
1304
+ animatable: true
1305
+ },
1306
+ get (value) {
1307
+ value.num[0] = this.uvAnimationScrollYSpeedFactor;
1308
+ },
1309
+ set (value) {
1310
+ this.uvAnimationScrollYSpeedFactor = value.num[0];
1311
+ },
1312
+ getDefaultValue () {
1313
+ return this.$isInstance ? this.coreMaterial.uvAnimationScrollYSpeedFactor : 0;
881
1314
  }
882
1315
  },
883
- getMeshMaterialInstanceUniformsClass(ParticleMaterial)
884
- ];
1316
+ {
1317
+ name: 'UVAnimationRotationSpeedFactor',
1318
+ description: 'MToon UV animation rotation speed',
1319
+ type: 'float',
1320
+ default: 0,
1321
+ options: {
1322
+ animatable: true
1323
+ },
1324
+ get (value) {
1325
+ value.num[0] = this.uvAnimationRotationSpeedFactor;
1326
+ },
1327
+ set (value) {
1328
+ this.uvAnimationRotationSpeedFactor = value.num[0];
1329
+ },
1330
+ getDefaultValue () {
1331
+ return this.$isInstance ? this.coreMaterial.uvAnimationRotationSpeedFactor : 0;
1332
+ }
1333
+ },
1334
+ {
1335
+ name: 'TransparentWithZWrite',
1336
+ description: 'If true, transparent MToon pixels also write depth',
1337
+ type: 'bool',
1338
+ default: false,
1339
+ get (value) {
1340
+ value.bool[0] = this.transparentWithZWrite;
1341
+ },
1342
+ set (value) {
1343
+ this.transparentWithZWrite = value.bool[0];
1344
+ },
1345
+ isValid () {
1346
+ return !this.$isInstance;
1347
+ }
1348
+ },
1349
+ {
1350
+ name: 'RenderQueueOffsetNumber',
1351
+ description: 'MToon render queue offset number',
1352
+ type: 'int',
1353
+ default: 0,
1354
+ options: {
1355
+ minValue: -9,
1356
+ maxValue: 9
1357
+ },
1358
+ get (value) {
1359
+ value.num[0] = this.renderQueueOffsetNumber;
1360
+ },
1361
+ set (value) {
1362
+ this.renderQueueOffsetNumber = value.num[0];
1363
+ },
1364
+ isValid () {
1365
+ return !this.$isInstance;
1366
+ }
1367
+ }
1368
+ ]);
885
1369
  }
886
- /** @internal */ function getPBRBluePrintMaterialClass() {
1370
+ /** @internal */ function getMeshMaterialClass() {
887
1371
  return [
888
1372
  {
889
- ctor: PBRBluePrintMaterial,
890
- parent: MeshMaterial,
891
- name: 'PBRBluePrintMaterial',
1373
+ ctor: MeshMaterial,
1374
+ name: 'MeshMaterial',
892
1375
  getProps () {
893
1376
  return defineProps([
894
1377
  {
895
- name: 'doubleSidedLighting',
896
- description: 'If true, double-sided lighting will be enabled',
1378
+ name: 'AlphaCutoff',
1379
+ description: 'If greater then 0, pixels which have alpha smaller than alpha cutoff will be discarded',
1380
+ type: 'float',
1381
+ default: 0,
1382
+ options: {
1383
+ animatable: true,
1384
+ minValue: 0,
1385
+ maxValue: 1
1386
+ },
1387
+ get (value) {
1388
+ value.num[0] = this.alphaCutoff;
1389
+ },
1390
+ set (value) {
1391
+ this.alphaCutoff = value.num[0];
1392
+ },
1393
+ isValid () {
1394
+ return !this.$isInstance;
1395
+ }
1396
+ },
1397
+ {
1398
+ name: 'AlphaToCoverage',
1399
+ description: 'If true, alpha-to-coverage will be enabled',
897
1400
  type: 'bool',
898
1401
  default: false,
899
- isValid () {
900
- return !this.$isInstance && this.cullMode !== 'back';
1402
+ get (value) {
1403
+ value.bool[0] = this.alphaToCoverage;
1404
+ },
1405
+ set (value) {
1406
+ this.alphaToCoverage = value.bool[0];
901
1407
  },
1408
+ isValid () {
1409
+ return !this.$isInstance;
1410
+ }
1411
+ },
1412
+ {
1413
+ name: 'AlphaDither',
1414
+ description: 'If true, alpha-dithering will be enabled',
1415
+ type: 'bool',
1416
+ default: false,
902
1417
  get (value) {
903
- value.bool[0] = this.doubleSidedLighting;
1418
+ value.bool[0] = this.alphaDither;
904
1419
  },
905
1420
  set (value) {
906
- this.doubleSidedLighting = value.bool[0];
1421
+ this.alphaDither = value.bool[0];
1422
+ },
1423
+ isValid () {
1424
+ return !this.$isInstance && this.alphaCutoff > 0;
907
1425
  }
908
1426
  },
909
1427
  {
910
- name: 'Reflection',
911
- description: 'Reflection mode for the material',
1428
+ name: 'BlendMode',
1429
+ description: 'Blending mode for this material',
912
1430
  type: 'string',
913
- default: 'ggx',
914
1431
  options: {
915
1432
  enum: {
916
1433
  labels: [
917
1434
  'None',
918
- 'GGX',
919
- 'Anisotropic',
920
- 'Glint'
1435
+ 'Blend',
1436
+ 'Additive'
921
1437
  ],
922
1438
  values: [
923
1439
  'none',
924
- 'ggx',
925
- 'anisotropic',
926
- 'glint'
1440
+ 'blend',
1441
+ 'additive'
927
1442
  ]
928
1443
  }
929
1444
  },
1445
+ default: 'none',
930
1446
  get (value) {
931
- value.str[0] = this.reflectionMode;
1447
+ value.str[0] = this.blendMode;
932
1448
  },
933
1449
  set (value) {
934
- this.reflectionMode = value.str[0];
1450
+ this.blendMode = value.str[0];
935
1451
  },
936
- getDefaultValue () {
937
- return this.$isInstance ? this.coreMaterial.reflectionMode : 'ggx';
1452
+ isValid () {
1453
+ return !this.$isInstance;
938
1454
  }
939
1455
  },
940
1456
  {
941
- name: 'SubsurfaceScattering',
942
- description: 'If true, subsurface-scattering will be enabled',
1457
+ name: 'TransparentShadowCaster',
943
1458
  type: 'bool',
944
- phase: 0,
945
1459
  default: false,
946
1460
  get (value) {
947
- value.bool[0] = this.subsurfaceScattering;
1461
+ value.bool[0] = this.transparentShadowCaster;
948
1462
  },
949
1463
  set (value) {
950
- this.subsurfaceScattering = value.bool[0];
1464
+ this.transparentShadowCaster = value.bool[0];
951
1465
  },
952
1466
  isValid () {
953
- return !this.$isInstance;
1467
+ return !this.$isInstance && this.blendMode !== 'none';
954
1468
  }
955
1469
  },
956
1470
  {
957
- name: 'SubsurfaceColor',
958
- description: 'Subsurface-scattering color',
959
- type: 'rgb',
960
- phase: 1,
961
- default: [
962
- 1,
963
- 0.3,
964
- 0.2
965
- ],
1471
+ name: 'ShadowAlphaCutoff',
1472
+ type: 'float',
1473
+ default: 0.5,
966
1474
  options: {
967
- animatable: true
1475
+ animatable: true,
1476
+ minValue: 0,
1477
+ maxValue: 1
968
1478
  },
969
1479
  get (value) {
970
- value.num[0] = this.subsurfaceColor.x;
971
- value.num[1] = this.subsurfaceColor.y;
972
- value.num[2] = this.subsurfaceColor.z;
1480
+ value.num[0] = this.shadowAlphaCutoff;
973
1481
  },
974
1482
  set (value) {
975
- this.subsurfaceColor = new Vector3(value.num[0], value.num[1], value.num[2]);
976
- },
977
- getDefaultValue () {
978
- return this.$isInstance ? this.coreMaterial.subsurfaceColor : [
979
- 1,
980
- 0.3,
981
- 0.2
982
- ];
1483
+ this.shadowAlphaCutoff = value.num[0];
983
1484
  },
984
1485
  isValid () {
985
- return this.subsurfaceScattering;
1486
+ return !this.$isInstance && this.blendMode !== 'none' && this.transparentShadowCaster;
986
1487
  }
987
1488
  },
988
1489
  {
989
- name: 'SubsurfaceScale',
990
- description: 'Scale value for subsurface-scattering',
991
- type: 'float',
992
- phase: 1,
993
- default: 0.5,
1490
+ name: 'CullMode',
1491
+ description: 'Cull mode for this material',
1492
+ type: 'string',
994
1493
  options: {
995
- animatable: true,
996
- minValue: 0,
997
- maxValue: 8
1494
+ enum: {
1495
+ labels: [
1496
+ 'None',
1497
+ 'Front',
1498
+ 'Back'
1499
+ ],
1500
+ values: [
1501
+ 'none',
1502
+ 'front',
1503
+ 'back'
1504
+ ]
1505
+ }
998
1506
  },
1507
+ default: 'back',
999
1508
  get (value) {
1000
- value.num[0] = this.subsurfaceScale;
1509
+ value.str[0] = this.cullMode;
1001
1510
  },
1002
1511
  set (value) {
1003
- this.subsurfaceScale = value.num[0];
1004
- },
1005
- getDefaultValue () {
1006
- return this.$isInstance ? this.coreMaterial.subsurfaceScale : 0.5;
1512
+ this.cullMode = value.str[0];
1007
1513
  },
1008
1514
  isValid () {
1009
- return this.subsurfaceScattering;
1515
+ return !this.$isInstance;
1010
1516
  }
1011
1517
  },
1012
1518
  {
1013
- name: 'SubsurfacePower',
1014
- description: 'Power value for subsurface-scattering',
1519
+ name: 'Opacity',
1520
+ description: 'Opacity value for this material, no effect if blendingMode is `none`',
1015
1521
  type: 'float',
1016
- phase: 1,
1017
- default: 1.5,
1018
1522
  options: {
1019
1523
  animatable: true,
1020
1524
  minValue: 0,
1021
- maxValue: 16
1525
+ maxValue: 1
1022
1526
  },
1527
+ default: 1,
1023
1528
  get (value) {
1024
- value.num[0] = this.subsurfacePower;
1529
+ value.num[0] = this.opacity;
1025
1530
  },
1026
1531
  set (value) {
1027
- this.subsurfacePower = value.num[0];
1532
+ this.opacity = value.num[0];
1028
1533
  },
1534
+ isHidden: createBlueprintOutputHiddenPredicate(),
1029
1535
  getDefaultValue () {
1030
- return this.$isInstance ? this.coreMaterial.subsurfacePower : 1.5;
1031
- },
1032
- isValid () {
1033
- return this.subsurfaceScattering;
1536
+ return this.$isInstance ? this.coreMaterial.opacity : 1;
1034
1537
  }
1035
1538
  },
1036
1539
  {
1037
- name: 'SubsurfaceIntensity',
1038
- description: 'Intensity value for subsurface-scattering',
1540
+ name: 'TAAStrength',
1541
+ description: 'TAA strength for this material',
1039
1542
  type: 'float',
1040
- phase: 1,
1041
- default: 0.5,
1042
1543
  options: {
1043
- animatable: true,
1044
1544
  minValue: 0,
1045
- maxValue: 4
1545
+ maxValue: 1
1046
1546
  },
1547
+ default: 15 / 16,
1047
1548
  get (value) {
1048
- value.num[0] = this.subsurfaceIntensity;
1549
+ value.num[0] = this.TAAStrength;
1049
1550
  },
1050
1551
  set (value) {
1051
- this.subsurfaceIntensity = value.num[0];
1052
- },
1053
- getDefaultValue () {
1054
- return this.$isInstance ? this.coreMaterial.subsurfaceIntensity : 0.5;
1552
+ this.TAAStrength = value.num[0];
1055
1553
  },
1056
1554
  isValid () {
1057
- return this.subsurfaceScattering;
1555
+ return !this.$isInstance;
1058
1556
  }
1059
- },
1557
+ }
1558
+ ]);
1559
+ }
1560
+ },
1561
+ getMeshMaterialInstanceUniformsClass(MeshMaterial)
1562
+ ];
1563
+ }
1564
+ /** @internal */ function getSpriteMaterialClass(_manager) {
1565
+ return [
1566
+ {
1567
+ ctor: SpriteMaterial,
1568
+ name: 'SpriteMaterial',
1569
+ parent: MeshMaterial,
1570
+ getProps () {
1571
+ return [];
1572
+ }
1573
+ },
1574
+ getMeshMaterialInstanceUniformsClass(SpriteMaterial)
1575
+ ];
1576
+ }
1577
+ /** @internal */ function getStandardSpriteMaterialClass(manager) {
1578
+ return [
1579
+ {
1580
+ ctor: StandardSpriteMaterial,
1581
+ name: 'StandardSpriteMaterial',
1582
+ parent: SpriteMaterial,
1583
+ getProps () {
1584
+ return defineProps([
1060
1585
  {
1061
- name: 'Anisotropy',
1062
- description: 'Anistropy value',
1063
- type: 'float',
1064
- default: 0.75,
1586
+ name: 'SpriteTexture',
1587
+ description: 'Texture file path for the sprite',
1588
+ type: 'object',
1589
+ default: '',
1065
1590
  options: {
1066
- animatable: true,
1067
- minValue: -0.95,
1068
- maxValue: 0.95
1591
+ mimeTypes: [
1592
+ 'image/jpeg',
1593
+ 'image/png',
1594
+ 'image/tga',
1595
+ 'image/vnd.radiance',
1596
+ 'image/x-dds',
1597
+ 'image/webp'
1598
+ ]
1069
1599
  },
1070
- get (value) {
1071
- value.num[0] = this.anisotropy;
1600
+ isNullable () {
1601
+ return true;
1072
1602
  },
1073
- set (value) {
1074
- this.anisotropy = value.num[0];
1603
+ get (value) {
1604
+ value.str[0] = manager.getAssetId(this.spriteTexture) ?? '';
1075
1605
  },
1076
- getDefaultValue () {
1077
- return this.$isInstance ? this.coreMaterial.anisotropy : 0.75;
1606
+ async set (value) {
1607
+ if (!value || !value.str[0]) {
1608
+ this.spriteTexture = null;
1609
+ } else {
1610
+ const assetId = value.str[0];
1611
+ let tex;
1612
+ try {
1613
+ tex = await manager.fetchTexture(assetId, {
1614
+ linearColorSpace: false
1615
+ });
1616
+ } catch (err) {
1617
+ console.error(`Load asset failed: ${value.str[0]}: ${err}`);
1618
+ tex = null;
1619
+ }
1620
+ if (tex?.isTexture2D()) {
1621
+ this.spriteTexture = tex;
1622
+ } else {
1623
+ console.error('Invalid texture type');
1624
+ }
1625
+ }
1078
1626
  },
1079
1627
  isValid () {
1080
- return this.reflectionMode === 'anisotropic';
1628
+ return !this.$isInstance;
1081
1629
  }
1082
- },
1630
+ }
1631
+ ]);
1632
+ }
1633
+ },
1634
+ getMeshMaterialInstanceUniformsClass(StandardSpriteMaterial)
1635
+ ];
1636
+ }
1637
+ /** @internal */ function getParticleMaterialClass(manager) {
1638
+ return [
1639
+ {
1640
+ ctor: ParticleMaterial,
1641
+ name: 'ParticleMaterial',
1642
+ parent: MeshMaterial,
1643
+ getProps () {
1644
+ return defineProps([
1083
1645
  {
1084
- name: 'AnisotropyDirection',
1085
- description: 'Anisotropy direction',
1086
- type: 'float',
1087
- default: 0,
1646
+ name: 'AlphaMap',
1647
+ description: 'Alpha texture file path',
1648
+ type: 'object',
1649
+ default: '',
1088
1650
  options: {
1089
- animatable: true,
1090
- minValue: 0,
1091
- maxValue: 360
1092
- },
1093
- get (value) {
1094
- value.num[0] = this.anisotropyDirection;
1651
+ mimeTypes: [
1652
+ 'image/jpeg',
1653
+ 'image/png',
1654
+ 'image/tga',
1655
+ 'image/vnd.radiance',
1656
+ 'image/x-dds',
1657
+ 'image/webp'
1658
+ ]
1095
1659
  },
1096
- set (value) {
1097
- this.anisotropyDirection = value.num[0];
1660
+ isNullable () {
1661
+ return true;
1098
1662
  },
1099
- getDefaultValue () {
1100
- return this.$isInstance ? this.coreMaterial.anisotropyDirection : 0;
1663
+ get (value) {
1664
+ value.str[0] = manager.getAssetId(this.alphaMap) ?? '';
1101
1665
  },
1102
- isValid () {
1103
- return this.reflectionMode === 'anisotropic';
1666
+ async set (value) {
1667
+ if (!value || !value.str[0]) {
1668
+ this.alphaMap = null;
1669
+ } else {
1670
+ const assetId = value.str[0];
1671
+ let tex = null;
1672
+ try {
1673
+ tex = await manager.fetchTexture(assetId, {
1674
+ linearColorSpace: true
1675
+ });
1676
+ } catch (err) {
1677
+ console.error(`Load asset failed: ${value.str[0]}: ${err}`);
1678
+ }
1679
+ if (tex?.isTexture2D()) {
1680
+ this.alphaMap = tex;
1681
+ } else {
1682
+ console.error('Invalid albedo texture');
1683
+ }
1684
+ }
1104
1685
  }
1105
1686
  },
1106
1687
  {
1107
- name: 'AnisotropyDirectionScaleBias',
1108
- description: 'Anisotropy direction scale bias',
1109
- type: 'vec2',
1110
- default: [
1111
- 1,
1112
- 0
1113
- ],
1688
+ name: 'RampMap',
1689
+ description: 'Ramp texture file path',
1690
+ type: 'object',
1691
+ default: '',
1114
1692
  options: {
1115
- animatable: true
1116
- },
1117
- get (value) {
1118
- value.num[0] = this.anisotropyDirectionScaleBias.x;
1119
- value.num[1] = this.anisotropyDirectionScaleBias.y;
1693
+ mimeTypes: [
1694
+ 'image/jpeg',
1695
+ 'image/png',
1696
+ 'image/tga',
1697
+ 'image/vnd.radiance',
1698
+ 'image/x-dds',
1699
+ 'image/webp'
1700
+ ]
1120
1701
  },
1121
- set (value) {
1122
- this.anisotropyDirectionScaleBias = new Vector2(value.num[0], value.num[1]);
1702
+ isNullable () {
1703
+ return true;
1123
1704
  },
1124
- getDefaultValue () {
1125
- return this.$isInstance ? this.coreMaterial.anisotropyDirectionScaleBias : [
1126
- 1,
1127
- 0
1128
- ];
1705
+ get (value) {
1706
+ value.str[0] = manager.getAssetId(this.rampMap) ?? '';
1129
1707
  },
1130
- isValid () {
1131
- return this.reflectionMode === 'anisotropic';
1708
+ async set (value) {
1709
+ if (!value || !value.str[0]) {
1710
+ this.rampMap = null;
1711
+ } else {
1712
+ const assetId = value.str[0];
1713
+ let tex = null;
1714
+ try {
1715
+ tex = await manager.fetchTexture(assetId);
1716
+ } catch (err) {
1717
+ console.error(`Load asset failed: ${value.str[0]}: ${err}`);
1718
+ }
1719
+ if (tex?.isTexture2D()) {
1720
+ this.rampMap = tex;
1721
+ } else {
1722
+ console.error('Invalid albedo texture');
1723
+ }
1724
+ }
1132
1725
  }
1133
1726
  }
1134
1727
  ]);
1135
1728
  }
1136
1729
  },
1730
+ getMeshMaterialInstanceUniformsClass(ParticleMaterial)
1731
+ ];
1732
+ }
1733
+ /** @internal */ function getPBRBluePrintMaterialClass() {
1734
+ return [
1735
+ {
1736
+ ctor: PBRBluePrintMaterial,
1737
+ parent: PBRMetallicRoughnessMaterial,
1738
+ name: 'PBRBluePrintMaterial',
1739
+ getProps () {
1740
+ return defineProps([]);
1741
+ }
1742
+ },
1137
1743
  getMeshMaterialInstanceUniformsClass(PBRBluePrintMaterial)
1138
1744
  ];
1139
1745
  }
@@ -1163,6 +1769,19 @@ function getUnlitMaterialProps(manager) {
1163
1769
  getMeshMaterialInstanceUniformsClass(UnlitMaterial)
1164
1770
  ];
1165
1771
  }
1772
+ /** @internal */ function getMToonMaterialClass(manager) {
1773
+ return [
1774
+ {
1775
+ ctor: MToonMaterial,
1776
+ parent: MeshMaterial,
1777
+ name: 'MToonMaterial',
1778
+ getProps () {
1779
+ return getMToonMaterialProps(manager);
1780
+ }
1781
+ },
1782
+ getMeshMaterialInstanceUniformsClass(MToonMaterial)
1783
+ ];
1784
+ }
1166
1785
  /** @internal */ function getLambertMaterialClass(manager) {
1167
1786
  return [
1168
1787
  {
@@ -1203,71 +1822,6 @@ function getUnlitMaterialProps(manager) {
1203
1822
  return this.$isInstance ? this.coreMaterial.shininess : 32;
1204
1823
  }
1205
1824
  },
1206
- {
1207
- name: 'ScatterWrap',
1208
- description: 'Scatter wrap for light warping',
1209
- type: 'float',
1210
- options: {
1211
- animatable: true,
1212
- minValue: 0,
1213
- maxValue: 1
1214
- },
1215
- get (value) {
1216
- value.num[0] = this.scatterWrap;
1217
- },
1218
- set (value) {
1219
- this.scatterWrap = value.num[0];
1220
- },
1221
- getDefaultValue () {
1222
- return this.$isInstance ? this.coreMaterial.scatterWrap : 0;
1223
- }
1224
- },
1225
- {
1226
- name: 'ScatterWidth',
1227
- description: 'Scatter width for light wrapping',
1228
- type: 'float',
1229
- options: {
1230
- animatable: true,
1231
- minValue: 0,
1232
- maxValue: 1
1233
- },
1234
- get (value) {
1235
- value.num[0] = this.scatterWidth;
1236
- },
1237
- set (value) {
1238
- this.scatterWidth = value.num[0];
1239
- },
1240
- getDefaultValue () {
1241
- return this.$isInstance ? this.coreMaterial.scatterWidth : 0;
1242
- }
1243
- },
1244
- {
1245
- name: 'ScatterColor',
1246
- description: 'Scatter color for light warping',
1247
- type: 'rgb',
1248
- options: {
1249
- animatable: true
1250
- },
1251
- get (value) {
1252
- value.num[0] = this.scatterColor.x;
1253
- value.num[1] = this.scatterColor.y;
1254
- value.num[2] = this.scatterColor.z;
1255
- },
1256
- set (value) {
1257
- this.scatterColor = new Vector4(value.num[0], value.num[1], value.num[2], 1);
1258
- },
1259
- getDefaultValue () {
1260
- return this.$isInstance ? [
1261
- this.coreMaterial.scatterColor.x,
1262
- this.coreMaterial.scatterColor.y,
1263
- this.coreMaterial.scatterColor.z
1264
- ] : [
1265
- 0,
1266
- 0,
1267
- 0
1268
- ];
1269
- }
1270
- },
1271
1825
  ...getLitMaterialProps(manager)
1272
1826
  ]);
1273
1827
  }
@@ -1298,6 +1852,7 @@ function getUnlitMaterialProps(manager) {
1298
1852
  set (value) {
1299
1853
  this.metallic = value.num[0];
1300
1854
  },
1855
+ isHidden: createBlueprintOutputHiddenPredicate(),
1301
1856
  getDefaultValue () {
1302
1857
  return this.$isInstance ? this.coreMaterial.metallic : 1;
1303
1858
  }
@@ -1317,6 +1872,7 @@ function getUnlitMaterialProps(manager) {
1317
1872
  set (value) {
1318
1873
  this.roughness = value.num[0];
1319
1874
  },
1875
+ isHidden: createBlueprintOutputHiddenPredicate(),
1320
1876
  getDefaultValue () {
1321
1877
  return this.$isInstance ? this.coreMaterial.roughness : 1;
1322
1878
  }
@@ -1337,6 +1893,7 @@ function getUnlitMaterialProps(manager) {
1337
1893
  set (value) {
1338
1894
  this.specularFactor = new Vector4(value.num[0], value.num[1], value.num[2], value.num[3]);
1339
1895
  },
1896
+ isHidden: createBlueprintOutputHiddenPredicate(),
1340
1897
  getDefaultValue () {
1341
1898
  return this.$isInstance ? this.coreMaterial.specularFactor : [
1342
1899
  1,
@@ -1455,130 +2012,39 @@ function getUnlitMaterialProps(manager) {
1455
2012
  }
1456
2013
  },
1457
2014
  {
1458
- name: 'SubsurfaceScattering',
2015
+ name: 'SubsurfaceProfile',
1459
2016
  description: 'If true, enables subsurface scattering for translucent materials',
1460
- type: 'bool',
1461
- phase: 0,
1462
- default: false,
1463
- get (value) {
1464
- value.bool[0] = this.subsurfaceScattering;
1465
- },
1466
- set (value) {
1467
- this.subsurfaceScattering = value.bool[0];
1468
- },
1469
- isValid () {
1470
- return !this.$isInstance;
1471
- }
1472
- },
1473
- {
1474
- name: 'SubsurfaceColor',
1475
- description: 'Color tint of the subsurface scattering effect',
1476
- type: 'rgb',
1477
- phase: 1,
1478
- default: [
1479
- 1,
1480
- 0.3,
1481
- 0.2
1482
- ],
1483
- options: {
1484
- animatable: true
1485
- },
1486
- get (value) {
1487
- value.num[0] = this.subsurfaceColor.x;
1488
- value.num[1] = this.subsurfaceColor.y;
1489
- value.num[2] = this.subsurfaceColor.z;
1490
- },
1491
- set (value) {
1492
- this.subsurfaceColor = new Vector3(value.num[0], value.num[1], value.num[2]);
1493
- },
1494
- getDefaultValue () {
1495
- return this.$isInstance ? this.coreMaterial.subsurfaceColor : [
1496
- 1,
1497
- 0.3,
1498
- 0.2
1499
- ];
1500
- },
1501
- isValid () {
1502
- return this.subsurfaceScattering;
1503
- }
1504
- },
1505
- {
1506
- name: 'SubsurfaceScale',
1507
- description: 'Distance scale of the subsurface scattering effect',
1508
- type: 'float',
1509
- phase: 1,
1510
- default: 0.5,
1511
- options: {
1512
- animatable: true,
1513
- minValue: 0,
1514
- maxValue: 8
1515
- },
1516
- get (value) {
1517
- value.num[0] = this.subsurfaceScale;
1518
- },
1519
- set (value) {
1520
- this.subsurfaceScale = value.num[0];
1521
- },
1522
- getDefaultValue () {
1523
- return this.$isInstance ? this.coreMaterial.subsurfaceScale : 0.5;
1524
- },
1525
- isValid () {
1526
- return this.subsurfaceScattering;
1527
- }
1528
- },
1529
- {
1530
- name: 'SubsurfacePower',
1531
- description: 'Falloff power controlling how quickly subsurface scattering fades',
1532
- type: 'float',
2017
+ type: 'object',
1533
2018
  phase: 1,
1534
- default: 1.5,
2019
+ default: null,
1535
2020
  options: {
1536
- animatable: true,
1537
- minValue: 0,
1538
- maxValue: 16
1539
- },
1540
- get (value) {
1541
- value.num[0] = this.subsurfacePower;
1542
- },
1543
- set (value) {
1544
- this.subsurfacePower = value.num[0];
1545
- },
1546
- getDefaultValue () {
1547
- return this.$isInstance ? this.coreMaterial.subsurfacePower : 1.5;
2021
+ objectTypes: [
2022
+ SubsurfaceProfile
2023
+ ]
1548
2024
  },
1549
- isValid () {
1550
- return this.subsurfaceScattering;
1551
- }
1552
- },
1553
- {
1554
- name: 'SubsurfaceIntensity',
1555
- description: 'Overall intensity of the subsurface scattering effect',
1556
- type: 'float',
1557
- phase: 1,
1558
- default: 0.5,
1559
- options: {
1560
- animatable: true,
1561
- minValue: 0,
1562
- maxValue: 4
2025
+ isNullable () {
2026
+ return true;
1563
2027
  },
1564
2028
  get (value) {
1565
- value.num[0] = this.subsurfaceIntensity;
2029
+ value.object[0] = this.subsurfaceProfile;
1566
2030
  },
1567
2031
  set (value) {
1568
- this.subsurfaceIntensity = value.num[0];
1569
- },
1570
- getDefaultValue () {
1571
- return this.$isInstance ? this.coreMaterial.subsurfaceIntensity : 0.5;
2032
+ this.subsurfaceProfile = value.object[0] ?? null;
1572
2033
  },
1573
2034
  isValid () {
1574
- return this.subsurfaceScattering;
2035
+ return !this.$isInstance;
1575
2036
  }
1576
2037
  },
1577
2038
  ...getTextureProps(manager, 'subsurfaceTexture', '2D', false, 1, function() {
1578
- return this.subsurfaceScattering;
2039
+ return !!this.subsurfaceProfile;
1579
2040
  }),
1580
- ...getTextureProps(manager, 'metallicRoughnessTexture', '2D', false, 0),
1581
- ...getTextureProps(manager, 'specularColorTexture', '2D', true, 0),
2041
+ ...getTextureProps(manager, 'metallicRoughnessTexture', '2D', false, 0, undefined, [
2042
+ 'Metallic',
2043
+ 'Roughness'
2044
+ ]),
2045
+ ...getTextureProps(manager, 'specularColorTexture', '2D', true, 0, undefined, [
2046
+ 'Specular'
2047
+ ]),
1582
2048
  ...getPBRCommonProps(manager)
1583
2049
  ]);
1584
2050
  }
@@ -1644,5 +2110,5 @@ function getUnlitMaterialProps(manager) {
1644
2110
  ];
1645
2111
  }
1646
2112
 
1647
- export { getBlinnMaterialClass, getLambertMaterialClass, getMeshMaterialClass, getPBRBluePrintMaterialClass, getPBRMetallicRoughnessMaterialClass, getPBRSpecularGlossinessMaterialClass, getParticleMaterialClass, getSpriteBlueprintMaterialClass, getSpriteMaterialClass, getStandardSpriteMaterialClass, getUnlitMaterialClass };
2113
+ export { getBlinnMaterialClass, getLambertMaterialClass, getMToonMaterialClass, getMeshMaterialClass, getPBRBluePrintMaterialClass, getPBRMetallicRoughnessMaterialClass, getPBRSpecularGlossinessMaterialClass, getParticleMaterialClass, getSpriteBlueprintMaterialClass, getSpriteMaterialClass, getStandardSpriteMaterialClass, getSubsurfaceProfileClass, getUnlitMaterialClass };
1648
2114
  //# sourceMappingURL=material.js.map