@babylonjs/gui 9.15.0 → 9.16.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.
Files changed (64) hide show
  1. package/2D/controls/checkbox.pure.js +164 -153
  2. package/2D/controls/checkbox.pure.js.map +1 -1
  3. package/2D/controls/colorpicker.pure.js +1300 -1289
  4. package/2D/controls/colorpicker.pure.js.map +1 -1
  5. package/2D/controls/container.pure.js +597 -582
  6. package/2D/controls/container.pure.js.map +1 -1
  7. package/2D/controls/control.pure.js +2474 -2434
  8. package/2D/controls/control.pure.js.map +1 -1
  9. package/2D/controls/displayGrid.pure.js +201 -190
  10. package/2D/controls/displayGrid.pure.js.map +1 -1
  11. package/2D/controls/ellipse.pure.js +96 -85
  12. package/2D/controls/ellipse.pure.js.map +1 -1
  13. package/2D/controls/grid.pure.js +511 -500
  14. package/2D/controls/grid.pure.js.map +1 -1
  15. package/2D/controls/image.pure.js +888 -877
  16. package/2D/controls/image.pure.js.map +1 -1
  17. package/2D/controls/inputText.pure.js +988 -973
  18. package/2D/controls/inputText.pure.js.map +1 -1
  19. package/2D/controls/inputTextArea.pure.js +955 -944
  20. package/2D/controls/inputTextArea.pure.js.map +1 -1
  21. package/2D/controls/line.pure.js +237 -226
  22. package/2D/controls/line.pure.js.map +1 -1
  23. package/2D/controls/multiLine.pure.js +233 -222
  24. package/2D/controls/multiLine.pure.js.map +1 -1
  25. package/2D/controls/radioButton.pure.js +182 -169
  26. package/2D/controls/radioButton.pure.js.map +1 -1
  27. package/2D/controls/rectangle.pure.js +211 -200
  28. package/2D/controls/rectangle.pure.js.map +1 -1
  29. package/2D/controls/scrollViewers/scrollViewer.pure.js +579 -567
  30. package/2D/controls/scrollViewers/scrollViewer.pure.js.map +1 -1
  31. package/2D/controls/sliders/baseSlider.js +291 -280
  32. package/2D/controls/sliders/baseSlider.js.map +1 -1
  33. package/2D/controls/sliders/imageBasedSlider.pure.js +158 -147
  34. package/2D/controls/sliders/imageBasedSlider.pure.js.map +1 -1
  35. package/2D/controls/sliders/imageScrollBar.js +237 -223
  36. package/2D/controls/sliders/imageScrollBar.js.map +1 -1
  37. package/2D/controls/sliders/scrollBar.pure.js +169 -158
  38. package/2D/controls/sliders/scrollBar.pure.js.map +1 -1
  39. package/2D/controls/sliders/slider.pure.js +251 -240
  40. package/2D/controls/sliders/slider.pure.js.map +1 -1
  41. package/2D/controls/stackPanel.pure.js +236 -221
  42. package/2D/controls/stackPanel.pure.js.map +1 -1
  43. package/2D/controls/textBlock.pure.js +637 -626
  44. package/2D/controls/textBlock.pure.js.map +1 -1
  45. package/3D/materials/fluent/fluentMaterial.pure.d.ts +4 -4
  46. package/3D/materials/fluent/fluentMaterial.pure.js +322 -273
  47. package/3D/materials/fluent/fluentMaterial.pure.js.map +1 -1
  48. package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js +510 -454
  49. package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js.map +1 -1
  50. package/3D/materials/fluentButton/fluentButtonMaterial.pure.js +612 -529
  51. package/3D/materials/fluentButton/fluentButtonMaterial.pure.js.map +1 -1
  52. package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js +313 -274
  53. package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js.map +1 -1
  54. package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js +462 -405
  55. package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js.map +1 -1
  56. package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js +583 -501
  57. package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js.map +1 -1
  58. package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js +226 -203
  59. package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js.map +1 -1
  60. package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js +961 -825
  61. package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js.map +1 -1
  62. package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js +961 -825
  63. package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js.map +1 -1
  64. package/package.json +2 -2
@@ -1,4 +1,4 @@
1
- import { __decorate } from "@babylonjs/core/tslib.es6.js";
1
+ import { __esDecorate, __runInitializers } from "@babylonjs/core/tslib.es6.js";
2
2
  import { serialize, serializeAsVector3 } from "@babylonjs/core/Misc/decorators.js";
3
3
  import { SerializationHelper } from "@babylonjs/core/Misc/decorators.serialization.js";
4
4
  import { Vector3, Vector4 } from "@babylonjs/core/Maths/math.vector.pure.js";
@@ -27,467 +27,523 @@ class FluentBackplateMaterialDefines extends MaterialDefines {
27
27
  /**
28
28
  * Class used to render square buttons with fluent design
29
29
  */
30
- export class FluentBackplateMaterial extends PushMaterial {
31
- constructor(name, scene) {
32
- super(name, scene);
33
- this._shadersLoaded = false;
34
- /**
35
- * Gets or sets the corner radius on the backplate. Best to keep this value between 0.01 and 0.5. Default is 0.03.
36
- */
37
- this.radius = 0.03;
38
- /**
39
- * Gets or sets the line width of the backplate.
40
- */
41
- this.lineWidth = 0.01;
42
- /**
43
- * Gets or sets whether to use absolute sizes when calculating effects on the backplate.
44
- * Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.
45
- */
46
- this.absoluteSizes = false;
47
- /** @internal */
48
- this._filterWidth = 1;
49
- /**
50
- * Gets or sets the base color of the backplate.
51
- */
52
- this.baseColor = new Color4(0.0392157, 0.0666667, 0.207843, 1);
53
- /**
54
- * Gets or sets the line color of the backplate.
55
- */
56
- this.lineColor = new Color4(0.14902, 0.133333, 0.384314, 1);
57
- /**
58
- * Gets or sets the intensity of the fluent hover glow effect.
59
- */
60
- this.blobIntensity = 0.98;
61
- /**
62
- * Gets or sets the far size of the fluent hover glow effect.
63
- */
64
- this.blobFarSize = 0.04;
65
- /**
66
- * Gets or sets the distance considered "near" to the backplate, which controls the size of the fluent hover glow effect (see blobNearSize).
67
- */
68
- this.blobNearDistance = 0;
69
- /**
70
- * Gets or sets the distance considered "far" from the backplate, which controls the size of the fluent hover glow effect (see blobFarSize).
71
- */
72
- this.blobFarDistance = 0.08;
73
- /**
74
- * Gets or sets the length of the fluent hover glow effect fade.
75
- */
76
- this.blobFadeLength = 0.08;
77
- /**
78
- * Gets or sets the size of the fluent hover glow effect when the left pointer is considered "near" to the backplate (see blobNearDistance).
79
- */
80
- this.blobNearSize = 0.22;
81
- /**
82
- * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).
83
- */
84
- this.blobPulse = 0;
85
- /**
86
- * Gets or sets the opacity of the fluent hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.
87
- */
88
- this.blobFade = 0;
89
- /**
90
- * Gets or sets the size of the fluent hover glow effect when the right pointer is considered "near" to the backplate (see blobNearDistance).
91
- */
92
- this.blobNearSize2 = 0.22;
93
- /**
94
- * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).
95
- */
96
- this.blobPulse2 = 0;
97
- /**
98
- * Gets or sets the opacity of the fluent hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 0.
99
- */
100
- this.blobFade2 = 0;
101
- /** @internal */
102
- this._rate = 0.135;
103
- /**
104
- * Gets or sets the color of the highlights on the backplate line.
105
- */
106
- this.highlightColor = new Color4(0.98, 0.98, 0.98, 1);
107
- /**
108
- * Gets or sets the width of the highlights on the backplate line.
109
- */
110
- this.highlightWidth = 0.25;
111
- /** @internal */
112
- this._highlightTransform = new Vector4(1, 1, 0, 0);
113
- /** @internal */
114
- this._highlight = 1;
115
- /**
116
- * Gets or sets the intensity of the iridescence effect.
117
- */
118
- this.iridescenceIntensity = 0;
119
- /**
120
- * Gets or sets the intensity of the iridescence effect on the backplate edges.
121
- */
122
- this.iridescenceEdgeIntensity = 1;
123
- /** @internal */
124
- this._angle = -45;
125
- /**
126
- * Gets or sets the opacity of the backplate (0.0 - 1.0).
127
- */
128
- this.fadeOut = 1;
129
- /** @internal */
130
- this._reflected = true;
131
- /** @internal */
132
- this._frequency = 1;
133
- /** @internal */
134
- this._verticalOffset = 0;
135
- /**
136
- * Gets or sets the world-space position of the tip of the left index finger.
137
- */
138
- this.globalLeftIndexTipPosition = Vector3.Zero();
139
- this._globalLeftIndexTipPosition4 = Vector4.Zero();
140
- /**
141
- * Gets or sets the world-space position of the tip of the right index finger.
142
- */
143
- this.globalRightIndexTipPosition = Vector3.Zero();
144
- this._globalRightIndexTipPosition4 = Vector4.Zero();
145
- this.alphaMode = Constants.ALPHA_DISABLE;
146
- this.backFaceCulling = false;
147
- const blobTextureUrl = Tools.GetAssetUrl(FluentBackplateMaterial.BLOB_TEXTURE_URL);
148
- const iridescentMapUrl = Tools.GetAssetUrl(FluentBackplateMaterial.IM_TEXTURE_URL);
149
- this._blobTexture = new Texture(blobTextureUrl, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
150
- this._iridescentMap = new Texture(iridescentMapUrl, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
151
- }
152
- needAlphaBlending() {
153
- return false;
154
- }
155
- needAlphaTesting() {
156
- return false;
157
- }
158
- getAlphaTestTexture() {
159
- return null;
160
- }
161
- isReadyForSubMesh(mesh, subMesh) {
162
- const drawWrapper = subMesh._drawWrapper;
163
- if (this.isFrozen) {
164
- if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {
30
+ let FluentBackplateMaterial = (() => {
31
+ var _a;
32
+ let _classSuper = PushMaterial;
33
+ let _radius_decorators;
34
+ let _radius_initializers = [];
35
+ let _radius_extraInitializers = [];
36
+ let _lineWidth_decorators;
37
+ let _lineWidth_initializers = [];
38
+ let _lineWidth_extraInitializers = [];
39
+ let _absoluteSizes_decorators;
40
+ let _absoluteSizes_initializers = [];
41
+ let _absoluteSizes_extraInitializers = [];
42
+ let _baseColor_decorators;
43
+ let _baseColor_initializers = [];
44
+ let _baseColor_extraInitializers = [];
45
+ let _lineColor_decorators;
46
+ let _lineColor_initializers = [];
47
+ let _lineColor_extraInitializers = [];
48
+ let _blobIntensity_decorators;
49
+ let _blobIntensity_initializers = [];
50
+ let _blobIntensity_extraInitializers = [];
51
+ let _blobFarSize_decorators;
52
+ let _blobFarSize_initializers = [];
53
+ let _blobFarSize_extraInitializers = [];
54
+ let _blobNearDistance_decorators;
55
+ let _blobNearDistance_initializers = [];
56
+ let _blobNearDistance_extraInitializers = [];
57
+ let _blobFarDistance_decorators;
58
+ let _blobFarDistance_initializers = [];
59
+ let _blobFarDistance_extraInitializers = [];
60
+ let _blobFadeLength_decorators;
61
+ let _blobFadeLength_initializers = [];
62
+ let _blobFadeLength_extraInitializers = [];
63
+ let _blobNearSize_decorators;
64
+ let _blobNearSize_initializers = [];
65
+ let _blobNearSize_extraInitializers = [];
66
+ let _blobPulse_decorators;
67
+ let _blobPulse_initializers = [];
68
+ let _blobPulse_extraInitializers = [];
69
+ let _blobFade_decorators;
70
+ let _blobFade_initializers = [];
71
+ let _blobFade_extraInitializers = [];
72
+ let _blobNearSize2_decorators;
73
+ let _blobNearSize2_initializers = [];
74
+ let _blobNearSize2_extraInitializers = [];
75
+ let _blobPulse2_decorators;
76
+ let _blobPulse2_initializers = [];
77
+ let _blobPulse2_extraInitializers = [];
78
+ let _blobFade2_decorators;
79
+ let _blobFade2_initializers = [];
80
+ let _blobFade2_extraInitializers = [];
81
+ let _highlightColor_decorators;
82
+ let _highlightColor_initializers = [];
83
+ let _highlightColor_extraInitializers = [];
84
+ let _highlightWidth_decorators;
85
+ let _highlightWidth_initializers = [];
86
+ let _highlightWidth_extraInitializers = [];
87
+ let _iridescenceIntensity_decorators;
88
+ let _iridescenceIntensity_initializers = [];
89
+ let _iridescenceIntensity_extraInitializers = [];
90
+ let _iridescenceEdgeIntensity_decorators;
91
+ let _iridescenceEdgeIntensity_initializers = [];
92
+ let _iridescenceEdgeIntensity_extraInitializers = [];
93
+ let _fadeOut_decorators;
94
+ let _fadeOut_initializers = [];
95
+ let _fadeOut_extraInitializers = [];
96
+ let _globalLeftIndexTipPosition_decorators;
97
+ let _globalLeftIndexTipPosition_initializers = [];
98
+ let _globalLeftIndexTipPosition_extraInitializers = [];
99
+ let _globalRightIndexTipPosition_decorators;
100
+ let _globalRightIndexTipPosition_initializers = [];
101
+ let _globalRightIndexTipPosition_extraInitializers = [];
102
+ return _a = class FluentBackplateMaterial extends _classSuper {
103
+ constructor(name, scene) {
104
+ super(name, scene);
105
+ this._shadersLoaded = false;
106
+ /**
107
+ * Gets or sets the corner radius on the backplate. Best to keep this value between 0.01 and 0.5. Default is 0.03.
108
+ */
109
+ this.radius = __runInitializers(this, _radius_initializers, 0.03);
110
+ /**
111
+ * Gets or sets the line width of the backplate.
112
+ */
113
+ this.lineWidth = (__runInitializers(this, _radius_extraInitializers), __runInitializers(this, _lineWidth_initializers, 0.01));
114
+ /**
115
+ * Gets or sets whether to use absolute sizes when calculating effects on the backplate.
116
+ * Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.
117
+ */
118
+ this.absoluteSizes = (__runInitializers(this, _lineWidth_extraInitializers), __runInitializers(this, _absoluteSizes_initializers, false));
119
+ /** @internal */
120
+ this._filterWidth = (__runInitializers(this, _absoluteSizes_extraInitializers), 1);
121
+ /**
122
+ * Gets or sets the base color of the backplate.
123
+ */
124
+ this.baseColor = __runInitializers(this, _baseColor_initializers, new Color4(0.0392157, 0.0666667, 0.207843, 1));
125
+ /**
126
+ * Gets or sets the line color of the backplate.
127
+ */
128
+ this.lineColor = (__runInitializers(this, _baseColor_extraInitializers), __runInitializers(this, _lineColor_initializers, new Color4(0.14902, 0.133333, 0.384314, 1)));
129
+ /**
130
+ * Gets or sets the intensity of the fluent hover glow effect.
131
+ */
132
+ this.blobIntensity = (__runInitializers(this, _lineColor_extraInitializers), __runInitializers(this, _blobIntensity_initializers, 0.98));
133
+ /**
134
+ * Gets or sets the far size of the fluent hover glow effect.
135
+ */
136
+ this.blobFarSize = (__runInitializers(this, _blobIntensity_extraInitializers), __runInitializers(this, _blobFarSize_initializers, 0.04));
137
+ /**
138
+ * Gets or sets the distance considered "near" to the backplate, which controls the size of the fluent hover glow effect (see blobNearSize).
139
+ */
140
+ this.blobNearDistance = (__runInitializers(this, _blobFarSize_extraInitializers), __runInitializers(this, _blobNearDistance_initializers, 0));
141
+ /**
142
+ * Gets or sets the distance considered "far" from the backplate, which controls the size of the fluent hover glow effect (see blobFarSize).
143
+ */
144
+ this.blobFarDistance = (__runInitializers(this, _blobNearDistance_extraInitializers), __runInitializers(this, _blobFarDistance_initializers, 0.08));
145
+ /**
146
+ * Gets or sets the length of the fluent hover glow effect fade.
147
+ */
148
+ this.blobFadeLength = (__runInitializers(this, _blobFarDistance_extraInitializers), __runInitializers(this, _blobFadeLength_initializers, 0.08));
149
+ /**
150
+ * Gets or sets the size of the fluent hover glow effect when the left pointer is considered "near" to the backplate (see blobNearDistance).
151
+ */
152
+ this.blobNearSize = (__runInitializers(this, _blobFadeLength_extraInitializers), __runInitializers(this, _blobNearSize_initializers, 0.22));
153
+ /**
154
+ * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).
155
+ */
156
+ this.blobPulse = (__runInitializers(this, _blobNearSize_extraInitializers), __runInitializers(this, _blobPulse_initializers, 0));
157
+ /**
158
+ * Gets or sets the opacity of the fluent hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.
159
+ */
160
+ this.blobFade = (__runInitializers(this, _blobPulse_extraInitializers), __runInitializers(this, _blobFade_initializers, 0));
161
+ /**
162
+ * Gets or sets the size of the fluent hover glow effect when the right pointer is considered "near" to the backplate (see blobNearDistance).
163
+ */
164
+ this.blobNearSize2 = (__runInitializers(this, _blobFade_extraInitializers), __runInitializers(this, _blobNearSize2_initializers, 0.22));
165
+ /**
166
+ * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).
167
+ */
168
+ this.blobPulse2 = (__runInitializers(this, _blobNearSize2_extraInitializers), __runInitializers(this, _blobPulse2_initializers, 0));
169
+ /**
170
+ * Gets or sets the opacity of the fluent hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 0.
171
+ */
172
+ this.blobFade2 = (__runInitializers(this, _blobPulse2_extraInitializers), __runInitializers(this, _blobFade2_initializers, 0));
173
+ /** @internal */
174
+ this._rate = (__runInitializers(this, _blobFade2_extraInitializers), 0.135);
175
+ /**
176
+ * Gets or sets the color of the highlights on the backplate line.
177
+ */
178
+ this.highlightColor = __runInitializers(this, _highlightColor_initializers, new Color4(0.98, 0.98, 0.98, 1));
179
+ /**
180
+ * Gets or sets the width of the highlights on the backplate line.
181
+ */
182
+ this.highlightWidth = (__runInitializers(this, _highlightColor_extraInitializers), __runInitializers(this, _highlightWidth_initializers, 0.25));
183
+ /** @internal */
184
+ this._highlightTransform = (__runInitializers(this, _highlightWidth_extraInitializers), new Vector4(1, 1, 0, 0));
185
+ /** @internal */
186
+ this._highlight = 1;
187
+ /**
188
+ * Gets or sets the intensity of the iridescence effect.
189
+ */
190
+ this.iridescenceIntensity = __runInitializers(this, _iridescenceIntensity_initializers, 0);
191
+ /**
192
+ * Gets or sets the intensity of the iridescence effect on the backplate edges.
193
+ */
194
+ this.iridescenceEdgeIntensity = (__runInitializers(this, _iridescenceIntensity_extraInitializers), __runInitializers(this, _iridescenceEdgeIntensity_initializers, 1));
195
+ /** @internal */
196
+ this._angle = (__runInitializers(this, _iridescenceEdgeIntensity_extraInitializers), -45);
197
+ /**
198
+ * Gets or sets the opacity of the backplate (0.0 - 1.0).
199
+ */
200
+ this.fadeOut = __runInitializers(this, _fadeOut_initializers, 1);
201
+ /** @internal */
202
+ this._reflected = (__runInitializers(this, _fadeOut_extraInitializers), true);
203
+ /** @internal */
204
+ this._frequency = 1;
205
+ /** @internal */
206
+ this._verticalOffset = 0;
207
+ /**
208
+ * Gets or sets the world-space position of the tip of the left index finger.
209
+ */
210
+ this.globalLeftIndexTipPosition = __runInitializers(this, _globalLeftIndexTipPosition_initializers, Vector3.Zero());
211
+ this._globalLeftIndexTipPosition4 = (__runInitializers(this, _globalLeftIndexTipPosition_extraInitializers), Vector4.Zero());
212
+ /**
213
+ * Gets or sets the world-space position of the tip of the right index finger.
214
+ */
215
+ this.globalRightIndexTipPosition = __runInitializers(this, _globalRightIndexTipPosition_initializers, Vector3.Zero());
216
+ this._globalRightIndexTipPosition4 = (__runInitializers(this, _globalRightIndexTipPosition_extraInitializers), Vector4.Zero());
217
+ this.alphaMode = Constants.ALPHA_DISABLE;
218
+ this.backFaceCulling = false;
219
+ const blobTextureUrl = Tools.GetAssetUrl(_a.BLOB_TEXTURE_URL);
220
+ const iridescentMapUrl = Tools.GetAssetUrl(_a.IM_TEXTURE_URL);
221
+ this._blobTexture = new Texture(blobTextureUrl, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
222
+ this._iridescentMap = new Texture(iridescentMapUrl, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
223
+ }
224
+ needAlphaBlending() {
225
+ return false;
226
+ }
227
+ needAlphaTesting() {
228
+ return false;
229
+ }
230
+ getAlphaTestTexture() {
231
+ return null;
232
+ }
233
+ isReadyForSubMesh(mesh, subMesh) {
234
+ const drawWrapper = subMesh._drawWrapper;
235
+ if (this.isFrozen) {
236
+ if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {
237
+ return true;
238
+ }
239
+ }
240
+ if (!this._blobTexture.isReady() || !this._iridescentMap.isReady()) {
241
+ return false;
242
+ }
243
+ if (!subMesh.materialDefines) {
244
+ subMesh.materialDefines = new FluentBackplateMaterialDefines();
245
+ }
246
+ const defines = subMesh.materialDefines;
247
+ const scene = this.getScene();
248
+ if (this._isReadyForSubMesh(subMesh)) {
249
+ return true;
250
+ }
251
+ const engine = scene.getEngine();
252
+ // Attribs
253
+ PrepareDefinesForAttributes(mesh, defines, false, false);
254
+ // Get correct effect
255
+ if (defines.isDirty) {
256
+ defines.markAsProcessed();
257
+ scene.resetCachedMaterial();
258
+ // Fallbacks
259
+ const fallbacks = new EffectFallbacks();
260
+ if (defines.FOG) {
261
+ fallbacks.addFallback(1, "FOG");
262
+ }
263
+ HandleFallbacksForShadows(defines, fallbacks);
264
+ defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
265
+ //Attributes
266
+ const attribs = [VertexBuffer.PositionKind];
267
+ if (defines.NORMAL) {
268
+ attribs.push(VertexBuffer.NormalKind);
269
+ }
270
+ if (defines.UV1) {
271
+ attribs.push(VertexBuffer.UVKind);
272
+ }
273
+ if (defines.UV2) {
274
+ attribs.push(VertexBuffer.UV2Kind);
275
+ }
276
+ if (defines.VERTEXCOLOR) {
277
+ attribs.push(VertexBuffer.ColorKind);
278
+ }
279
+ if (defines.TANGENT) {
280
+ attribs.push(VertexBuffer.TangentKind);
281
+ }
282
+ PrepareAttributesForInstances(attribs, defines);
283
+ // Legacy browser patch
284
+ const shaderName = "fluentBackplate";
285
+ const join = defines.toString();
286
+ const uniforms = [
287
+ "world",
288
+ "viewProjection",
289
+ "cameraPosition",
290
+ "_Radius_",
291
+ "_Line_Width_",
292
+ "_Absolute_Sizes_",
293
+ "_Filter_Width_",
294
+ "_Base_Color_",
295
+ "_Line_Color_",
296
+ "_Radius_Top_Left_",
297
+ "_Radius_Top_Right_",
298
+ "_Radius_Bottom_Left_",
299
+ "_Radius_Bottom_Right_",
300
+ "_Blob_Position_",
301
+ "_Blob_Intensity_",
302
+ "_Blob_Near_Size_",
303
+ "_Blob_Far_Size_",
304
+ "_Blob_Near_Distance_",
305
+ "_Blob_Far_Distance_",
306
+ "_Blob_Fade_Length_",
307
+ "_Blob_Pulse_",
308
+ "_Blob_Fade_",
309
+ "_Blob_Texture_",
310
+ "_Blob_Position_2_",
311
+ "_Blob_Near_Size_2_",
312
+ "_Blob_Pulse_2_",
313
+ "_Blob_Fade_2_",
314
+ "_Rate_",
315
+ "_Highlight_Color_",
316
+ "_Highlight_Width_",
317
+ "_Highlight_Transform_",
318
+ "_Highlight_",
319
+ "_Iridescence_Intensity_",
320
+ "_Iridescence_Edge_Intensity_",
321
+ "_Angle_",
322
+ "_Fade_Out_",
323
+ "_Reflected_",
324
+ "_Frequency_",
325
+ "_Vertical_Offset_",
326
+ "_Iridescent_Map_",
327
+ "_Use_Global_Left_Index_",
328
+ "_Use_Global_Right_Index_",
329
+ "Global_Left_Index_Tip_Position",
330
+ "Global_Right_Index_Tip_Position",
331
+ ];
332
+ const samplers = ["_Blob_Texture_", "_Iridescent_Map_"];
333
+ const uniformBuffers = [];
334
+ PrepareUniformsAndSamplersList({
335
+ uniformsNames: uniforms,
336
+ uniformBuffersNames: uniformBuffers,
337
+ samplers: samplers,
338
+ defines: defines,
339
+ maxSimultaneousLights: 4,
340
+ shaderLanguage: this._shaderLanguage,
341
+ });
342
+ subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
343
+ attributes: attribs,
344
+ uniformsNames: uniforms,
345
+ uniformBuffersNames: uniformBuffers,
346
+ samplers: samplers,
347
+ defines: join,
348
+ fallbacks: fallbacks,
349
+ onCompiled: this.onCompiled,
350
+ onError: this.onError,
351
+ indexParameters: { maxSimultaneousLights: 4 },
352
+ shaderLanguage: this._shaderLanguage,
353
+ extraInitializationsAsync: this._shadersLoaded
354
+ ? undefined
355
+ : async () => {
356
+ if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
357
+ await Promise.all([import("./wgsl/fluentBackplate.vertex.js"), import("./wgsl/fluentBackplate.fragment.js")]);
358
+ }
359
+ else {
360
+ await Promise.all([import("./shaders/fluentBackplate.vertex.js"), import("./shaders/fluentBackplate.fragment.js")]);
361
+ }
362
+ this._shadersLoaded = true;
363
+ },
364
+ }, engine), defines, this._materialContext);
365
+ }
366
+ if (!subMesh.effect || !subMesh.effect.isReady()) {
367
+ return false;
368
+ }
369
+ defines._renderId = scene.getRenderId();
370
+ drawWrapper._wasPreviouslyReady = true;
165
371
  return true;
166
372
  }
167
- }
168
- if (!this._blobTexture.isReady() || !this._iridescentMap.isReady()) {
169
- return false;
170
- }
171
- if (!subMesh.materialDefines) {
172
- subMesh.materialDefines = new FluentBackplateMaterialDefines();
173
- }
174
- const defines = subMesh.materialDefines;
175
- const scene = this.getScene();
176
- if (this._isReadyForSubMesh(subMesh)) {
177
- return true;
178
- }
179
- const engine = scene.getEngine();
180
- // Attribs
181
- PrepareDefinesForAttributes(mesh, defines, false, false);
182
- // Get correct effect
183
- if (defines.isDirty) {
184
- defines.markAsProcessed();
185
- scene.resetCachedMaterial();
186
- // Fallbacks
187
- const fallbacks = new EffectFallbacks();
188
- if (defines.FOG) {
189
- fallbacks.addFallback(1, "FOG");
373
+ bindForSubMesh(world, mesh, subMesh) {
374
+ const defines = subMesh.materialDefines;
375
+ if (!defines) {
376
+ return;
377
+ }
378
+ const effect = subMesh.effect;
379
+ if (!effect) {
380
+ return;
381
+ }
382
+ this._activeEffect = effect;
383
+ // Matrices
384
+ this.bindOnlyWorldMatrix(world);
385
+ this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
386
+ this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera?.position ?? Vector3.ZeroReadOnly);
387
+ // "Round Rect"
388
+ this._activeEffect.setFloat("_Radius_", this.radius);
389
+ this._activeEffect.setFloat("_Line_Width_", this.lineWidth);
390
+ this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1.0 : 0.0);
391
+ this._activeEffect.setFloat("_Filter_Width_", this._filterWidth);
392
+ this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor);
393
+ this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor);
394
+ // "Radii Multipliers"
395
+ this._activeEffect.setFloat("_Radius_Top_Left_", 1);
396
+ this._activeEffect.setFloat("_Radius_Top_Right_", 1.0);
397
+ this._activeEffect.setFloat("_Radius_Bottom_Left_", 1.0);
398
+ this._activeEffect.setFloat("_Radius_Bottom_Right_", 1.0);
399
+ // "Blob"
400
+ //define BLOB_ENABLE true;
401
+ this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
402
+ this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize);
403
+ this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
404
+ this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
405
+ this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
406
+ this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
407
+ this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse);
408
+ this._activeEffect.setFloat("_Blob_Fade_", this.blobFade);
409
+ // "Blob Texture"
410
+ this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture);
411
+ // "Blob 2"
412
+ //define BLOB_ENABLE_2 true;
413
+ this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2);
414
+ this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2);
415
+ this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2);
416
+ // "Line Highlight"
417
+ this._activeEffect.setFloat("_Rate_", this._rate);
418
+ this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor);
419
+ this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth);
420
+ this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform);
421
+ this._activeEffect.setFloat("_Highlight_", this._highlight);
422
+ // "Iridescence"
423
+ this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
424
+ this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity);
425
+ this._activeEffect.setFloat("_Angle_", this._angle);
426
+ // "Fade"
427
+ this._activeEffect.setFloat("_Fade_Out_", this.fadeOut);
428
+ // "Antialiasing"
429
+ //define SMOOTH_EDGES true;
430
+ // "ChooseAngle"
431
+ this._activeEffect.setFloat("_Reflected_", this._reflected ? 1.0 : 0.0);
432
+ // "Multiply"
433
+ this._activeEffect.setFloat("_Frequency_", this._frequency);
434
+ this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset);
435
+ // "Color Texture"
436
+ //define IRIDESCENT_MAP_ENABLE true;
437
+ this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMap);
438
+ // "Global"
439
+ this._activeEffect.setFloat("_Use_Global_Left_Index_", 1.0);
440
+ this._activeEffect.setFloat("_Use_Global_Right_Index_", 1.0);
441
+ this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1.0);
442
+ this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this._globalLeftIndexTipPosition4);
443
+ this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1.0);
444
+ this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this._globalRightIndexTipPosition4);
445
+ this._afterBind(mesh, this._activeEffect, subMesh);
190
446
  }
191
- HandleFallbacksForShadows(defines, fallbacks);
192
- defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
193
- //Attributes
194
- const attribs = [VertexBuffer.PositionKind];
195
- if (defines.NORMAL) {
196
- attribs.push(VertexBuffer.NormalKind);
447
+ /**
448
+ * Get the list of animatables in the material.
449
+ * @returns the list of animatables object used in the material
450
+ */
451
+ getAnimatables() {
452
+ return [];
197
453
  }
198
- if (defines.UV1) {
199
- attribs.push(VertexBuffer.UVKind);
454
+ /**
455
+ * Disposes the material.
456
+ * @param forceDisposeEffect specifies if effects should be forcefully disposed
457
+ */
458
+ dispose(forceDisposeEffect) {
459
+ super.dispose(forceDisposeEffect);
460
+ this._blobTexture.dispose();
461
+ this._iridescentMap.dispose();
200
462
  }
201
- if (defines.UV2) {
202
- attribs.push(VertexBuffer.UV2Kind);
463
+ clone(name) {
464
+ return SerializationHelper.Clone(() => new _a(name, this.getScene()), this);
203
465
  }
204
- if (defines.VERTEXCOLOR) {
205
- attribs.push(VertexBuffer.ColorKind);
466
+ serialize() {
467
+ const serializationObject = super.serialize();
468
+ serializationObject.customType = "BABYLON.FluentBackplateMaterial";
469
+ return serializationObject;
206
470
  }
207
- if (defines.TANGENT) {
208
- attribs.push(VertexBuffer.TangentKind);
471
+ getClassName() {
472
+ return "FluentBackplateMaterial";
209
473
  }
210
- PrepareAttributesForInstances(attribs, defines);
211
- // Legacy browser patch
212
- const shaderName = "fluentBackplate";
213
- const join = defines.toString();
214
- const uniforms = [
215
- "world",
216
- "viewProjection",
217
- "cameraPosition",
218
- "_Radius_",
219
- "_Line_Width_",
220
- "_Absolute_Sizes_",
221
- "_Filter_Width_",
222
- "_Base_Color_",
223
- "_Line_Color_",
224
- "_Radius_Top_Left_",
225
- "_Radius_Top_Right_",
226
- "_Radius_Bottom_Left_",
227
- "_Radius_Bottom_Right_",
228
- "_Blob_Position_",
229
- "_Blob_Intensity_",
230
- "_Blob_Near_Size_",
231
- "_Blob_Far_Size_",
232
- "_Blob_Near_Distance_",
233
- "_Blob_Far_Distance_",
234
- "_Blob_Fade_Length_",
235
- "_Blob_Pulse_",
236
- "_Blob_Fade_",
237
- "_Blob_Texture_",
238
- "_Blob_Position_2_",
239
- "_Blob_Near_Size_2_",
240
- "_Blob_Pulse_2_",
241
- "_Blob_Fade_2_",
242
- "_Rate_",
243
- "_Highlight_Color_",
244
- "_Highlight_Width_",
245
- "_Highlight_Transform_",
246
- "_Highlight_",
247
- "_Iridescence_Intensity_",
248
- "_Iridescence_Edge_Intensity_",
249
- "_Angle_",
250
- "_Fade_Out_",
251
- "_Reflected_",
252
- "_Frequency_",
253
- "_Vertical_Offset_",
254
- "_Iridescent_Map_",
255
- "_Use_Global_Left_Index_",
256
- "_Use_Global_Right_Index_",
257
- "Global_Left_Index_Tip_Position",
258
- "Global_Right_Index_Tip_Position",
259
- ];
260
- const samplers = ["_Blob_Texture_", "_Iridescent_Map_"];
261
- const uniformBuffers = [];
262
- PrepareUniformsAndSamplersList({
263
- uniformsNames: uniforms,
264
- uniformBuffersNames: uniformBuffers,
265
- samplers: samplers,
266
- defines: defines,
267
- maxSimultaneousLights: 4,
268
- shaderLanguage: this._shaderLanguage,
269
- });
270
- subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
271
- attributes: attribs,
272
- uniformsNames: uniforms,
273
- uniformBuffersNames: uniformBuffers,
274
- samplers: samplers,
275
- defines: join,
276
- fallbacks: fallbacks,
277
- onCompiled: this.onCompiled,
278
- onError: this.onError,
279
- indexParameters: { maxSimultaneousLights: 4 },
280
- shaderLanguage: this._shaderLanguage,
281
- extraInitializationsAsync: this._shadersLoaded
282
- ? undefined
283
- : async () => {
284
- if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
285
- await Promise.all([import("./wgsl/fluentBackplate.vertex.js"), import("./wgsl/fluentBackplate.fragment.js")]);
286
- }
287
- else {
288
- await Promise.all([import("./shaders/fluentBackplate.vertex.js"), import("./shaders/fluentBackplate.fragment.js")]);
289
- }
290
- this._shadersLoaded = true;
291
- },
292
- }, engine), defines, this._materialContext);
293
- }
294
- if (!subMesh.effect || !subMesh.effect.isReady()) {
295
- return false;
296
- }
297
- defines._renderId = scene.getRenderId();
298
- drawWrapper._wasPreviouslyReady = true;
299
- return true;
300
- }
301
- bindForSubMesh(world, mesh, subMesh) {
302
- const defines = subMesh.materialDefines;
303
- if (!defines) {
304
- return;
305
- }
306
- const effect = subMesh.effect;
307
- if (!effect) {
308
- return;
309
- }
310
- this._activeEffect = effect;
311
- // Matrices
312
- this.bindOnlyWorldMatrix(world);
313
- this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
314
- this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera?.position ?? Vector3.ZeroReadOnly);
315
- // "Round Rect"
316
- this._activeEffect.setFloat("_Radius_", this.radius);
317
- this._activeEffect.setFloat("_Line_Width_", this.lineWidth);
318
- this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1.0 : 0.0);
319
- this._activeEffect.setFloat("_Filter_Width_", this._filterWidth);
320
- this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor);
321
- this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor);
322
- // "Radii Multipliers"
323
- this._activeEffect.setFloat("_Radius_Top_Left_", 1);
324
- this._activeEffect.setFloat("_Radius_Top_Right_", 1.0);
325
- this._activeEffect.setFloat("_Radius_Bottom_Left_", 1.0);
326
- this._activeEffect.setFloat("_Radius_Bottom_Right_", 1.0);
327
- // "Blob"
328
- //define BLOB_ENABLE true;
329
- this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
330
- this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize);
331
- this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
332
- this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
333
- this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
334
- this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
335
- this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse);
336
- this._activeEffect.setFloat("_Blob_Fade_", this.blobFade);
337
- // "Blob Texture"
338
- this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture);
339
- // "Blob 2"
340
- //define BLOB_ENABLE_2 true;
341
- this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2);
342
- this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2);
343
- this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2);
344
- // "Line Highlight"
345
- this._activeEffect.setFloat("_Rate_", this._rate);
346
- this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor);
347
- this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth);
348
- this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform);
349
- this._activeEffect.setFloat("_Highlight_", this._highlight);
350
- // "Iridescence"
351
- this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
352
- this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity);
353
- this._activeEffect.setFloat("_Angle_", this._angle);
354
- // "Fade"
355
- this._activeEffect.setFloat("_Fade_Out_", this.fadeOut);
356
- // "Antialiasing"
357
- //define SMOOTH_EDGES true;
358
- // "ChooseAngle"
359
- this._activeEffect.setFloat("_Reflected_", this._reflected ? 1.0 : 0.0);
360
- // "Multiply"
361
- this._activeEffect.setFloat("_Frequency_", this._frequency);
362
- this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset);
363
- // "Color Texture"
364
- //define IRIDESCENT_MAP_ENABLE true;
365
- this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMap);
366
- // "Global"
367
- this._activeEffect.setFloat("_Use_Global_Left_Index_", 1.0);
368
- this._activeEffect.setFloat("_Use_Global_Right_Index_", 1.0);
369
- this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1.0);
370
- this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this._globalLeftIndexTipPosition4);
371
- this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1.0);
372
- this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this._globalRightIndexTipPosition4);
373
- this._afterBind(mesh, this._activeEffect, subMesh);
374
- }
375
- /**
376
- * Get the list of animatables in the material.
377
- * @returns the list of animatables object used in the material
378
- */
379
- getAnimatables() {
380
- return [];
381
- }
382
- /**
383
- * Disposes the material.
384
- * @param forceDisposeEffect specifies if effects should be forcefully disposed
385
- */
386
- dispose(forceDisposeEffect) {
387
- super.dispose(forceDisposeEffect);
388
- this._blobTexture.dispose();
389
- this._iridescentMap.dispose();
390
- }
391
- clone(name) {
392
- return SerializationHelper.Clone(() => new FluentBackplateMaterial(name, this.getScene()), this);
393
- }
394
- serialize() {
395
- const serializationObject = super.serialize();
396
- serializationObject.customType = "BABYLON.FluentBackplateMaterial";
397
- return serializationObject;
398
- }
399
- getClassName() {
400
- return "FluentBackplateMaterial";
401
- }
402
- // Statics
403
- /**
404
- * Creates a fluent backplate material from parsed material data.
405
- * @param source defines the JSON representation of the material
406
- * @param scene defines the hosting scene
407
- * @param rootUrl defines the root URL to use to load textures and relative dependencies
408
- * @returns a new fluent backplate material
409
- */
410
- static Parse(source, scene, rootUrl) {
411
- return SerializationHelper.Parse(() => new FluentBackplateMaterial(source.name, scene), source, scene, rootUrl);
412
- }
413
- }
414
- /**
415
- * URL pointing to the texture used to define the coloring for the fluent blob effect.
416
- */
417
- FluentBackplateMaterial.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/core/MRTK/mrtk-fluent-backplate-blob.png";
418
- /**
419
- * URL pointing to the texture used to define iridescent map.
420
- */
421
- FluentBackplateMaterial.IM_TEXTURE_URL = "https://assets.babylonjs.com/core/MRTK/mrtk-fluent-backplate-iridescence.png";
422
- __decorate([
423
- serialize()
424
- ], FluentBackplateMaterial.prototype, "radius", void 0);
425
- __decorate([
426
- serialize()
427
- ], FluentBackplateMaterial.prototype, "lineWidth", void 0);
428
- __decorate([
429
- serialize()
430
- ], FluentBackplateMaterial.prototype, "absoluteSizes", void 0);
431
- __decorate([
432
- serialize()
433
- ], FluentBackplateMaterial.prototype, "baseColor", void 0);
434
- __decorate([
435
- serialize()
436
- ], FluentBackplateMaterial.prototype, "lineColor", void 0);
437
- __decorate([
438
- serialize()
439
- ], FluentBackplateMaterial.prototype, "blobIntensity", void 0);
440
- __decorate([
441
- serialize()
442
- ], FluentBackplateMaterial.prototype, "blobFarSize", void 0);
443
- __decorate([
444
- serialize()
445
- ], FluentBackplateMaterial.prototype, "blobNearDistance", void 0);
446
- __decorate([
447
- serialize()
448
- ], FluentBackplateMaterial.prototype, "blobFarDistance", void 0);
449
- __decorate([
450
- serialize()
451
- ], FluentBackplateMaterial.prototype, "blobFadeLength", void 0);
452
- __decorate([
453
- serialize()
454
- ], FluentBackplateMaterial.prototype, "blobNearSize", void 0);
455
- __decorate([
456
- serialize()
457
- ], FluentBackplateMaterial.prototype, "blobPulse", void 0);
458
- __decorate([
459
- serialize()
460
- ], FluentBackplateMaterial.prototype, "blobFade", void 0);
461
- __decorate([
462
- serialize()
463
- ], FluentBackplateMaterial.prototype, "blobNearSize2", void 0);
464
- __decorate([
465
- serialize()
466
- ], FluentBackplateMaterial.prototype, "blobPulse2", void 0);
467
- __decorate([
468
- serialize()
469
- ], FluentBackplateMaterial.prototype, "blobFade2", void 0);
470
- __decorate([
471
- serialize()
472
- ], FluentBackplateMaterial.prototype, "highlightColor", void 0);
473
- __decorate([
474
- serialize()
475
- ], FluentBackplateMaterial.prototype, "highlightWidth", void 0);
476
- __decorate([
477
- serialize()
478
- ], FluentBackplateMaterial.prototype, "iridescenceIntensity", void 0);
479
- __decorate([
480
- serialize()
481
- ], FluentBackplateMaterial.prototype, "iridescenceEdgeIntensity", void 0);
482
- __decorate([
483
- serialize()
484
- ], FluentBackplateMaterial.prototype, "fadeOut", void 0);
485
- __decorate([
486
- serializeAsVector3()
487
- ], FluentBackplateMaterial.prototype, "globalLeftIndexTipPosition", void 0);
488
- __decorate([
489
- serializeAsVector3()
490
- ], FluentBackplateMaterial.prototype, "globalRightIndexTipPosition", void 0);
474
+ // Statics
475
+ /**
476
+ * Creates a fluent backplate material from parsed material data.
477
+ * @param source defines the JSON representation of the material
478
+ * @param scene defines the hosting scene
479
+ * @param rootUrl defines the root URL to use to load textures and relative dependencies
480
+ * @returns a new fluent backplate material
481
+ */
482
+ static Parse(source, scene, rootUrl) {
483
+ return SerializationHelper.Parse(() => new _a(source.name, scene), source, scene, rootUrl);
484
+ }
485
+ },
486
+ (() => {
487
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
488
+ _radius_decorators = [serialize()];
489
+ _lineWidth_decorators = [serialize()];
490
+ _absoluteSizes_decorators = [serialize()];
491
+ _baseColor_decorators = [serialize()];
492
+ _lineColor_decorators = [serialize()];
493
+ _blobIntensity_decorators = [serialize()];
494
+ _blobFarSize_decorators = [serialize()];
495
+ _blobNearDistance_decorators = [serialize()];
496
+ _blobFarDistance_decorators = [serialize()];
497
+ _blobFadeLength_decorators = [serialize()];
498
+ _blobNearSize_decorators = [serialize()];
499
+ _blobPulse_decorators = [serialize()];
500
+ _blobFade_decorators = [serialize()];
501
+ _blobNearSize2_decorators = [serialize()];
502
+ _blobPulse2_decorators = [serialize()];
503
+ _blobFade2_decorators = [serialize()];
504
+ _highlightColor_decorators = [serialize()];
505
+ _highlightWidth_decorators = [serialize()];
506
+ _iridescenceIntensity_decorators = [serialize()];
507
+ _iridescenceEdgeIntensity_decorators = [serialize()];
508
+ _fadeOut_decorators = [serialize()];
509
+ _globalLeftIndexTipPosition_decorators = [serializeAsVector3()];
510
+ _globalRightIndexTipPosition_decorators = [serializeAsVector3()];
511
+ __esDecorate(null, null, _radius_decorators, { kind: "field", name: "radius", static: false, private: false, access: { has: obj => "radius" in obj, get: obj => obj.radius, set: (obj, value) => { obj.radius = value; } }, metadata: _metadata }, _radius_initializers, _radius_extraInitializers);
512
+ __esDecorate(null, null, _lineWidth_decorators, { kind: "field", name: "lineWidth", static: false, private: false, access: { has: obj => "lineWidth" in obj, get: obj => obj.lineWidth, set: (obj, value) => { obj.lineWidth = value; } }, metadata: _metadata }, _lineWidth_initializers, _lineWidth_extraInitializers);
513
+ __esDecorate(null, null, _absoluteSizes_decorators, { kind: "field", name: "absoluteSizes", static: false, private: false, access: { has: obj => "absoluteSizes" in obj, get: obj => obj.absoluteSizes, set: (obj, value) => { obj.absoluteSizes = value; } }, metadata: _metadata }, _absoluteSizes_initializers, _absoluteSizes_extraInitializers);
514
+ __esDecorate(null, null, _baseColor_decorators, { kind: "field", name: "baseColor", static: false, private: false, access: { has: obj => "baseColor" in obj, get: obj => obj.baseColor, set: (obj, value) => { obj.baseColor = value; } }, metadata: _metadata }, _baseColor_initializers, _baseColor_extraInitializers);
515
+ __esDecorate(null, null, _lineColor_decorators, { kind: "field", name: "lineColor", static: false, private: false, access: { has: obj => "lineColor" in obj, get: obj => obj.lineColor, set: (obj, value) => { obj.lineColor = value; } }, metadata: _metadata }, _lineColor_initializers, _lineColor_extraInitializers);
516
+ __esDecorate(null, null, _blobIntensity_decorators, { kind: "field", name: "blobIntensity", static: false, private: false, access: { has: obj => "blobIntensity" in obj, get: obj => obj.blobIntensity, set: (obj, value) => { obj.blobIntensity = value; } }, metadata: _metadata }, _blobIntensity_initializers, _blobIntensity_extraInitializers);
517
+ __esDecorate(null, null, _blobFarSize_decorators, { kind: "field", name: "blobFarSize", static: false, private: false, access: { has: obj => "blobFarSize" in obj, get: obj => obj.blobFarSize, set: (obj, value) => { obj.blobFarSize = value; } }, metadata: _metadata }, _blobFarSize_initializers, _blobFarSize_extraInitializers);
518
+ __esDecorate(null, null, _blobNearDistance_decorators, { kind: "field", name: "blobNearDistance", static: false, private: false, access: { has: obj => "blobNearDistance" in obj, get: obj => obj.blobNearDistance, set: (obj, value) => { obj.blobNearDistance = value; } }, metadata: _metadata }, _blobNearDistance_initializers, _blobNearDistance_extraInitializers);
519
+ __esDecorate(null, null, _blobFarDistance_decorators, { kind: "field", name: "blobFarDistance", static: false, private: false, access: { has: obj => "blobFarDistance" in obj, get: obj => obj.blobFarDistance, set: (obj, value) => { obj.blobFarDistance = value; } }, metadata: _metadata }, _blobFarDistance_initializers, _blobFarDistance_extraInitializers);
520
+ __esDecorate(null, null, _blobFadeLength_decorators, { kind: "field", name: "blobFadeLength", static: false, private: false, access: { has: obj => "blobFadeLength" in obj, get: obj => obj.blobFadeLength, set: (obj, value) => { obj.blobFadeLength = value; } }, metadata: _metadata }, _blobFadeLength_initializers, _blobFadeLength_extraInitializers);
521
+ __esDecorate(null, null, _blobNearSize_decorators, { kind: "field", name: "blobNearSize", static: false, private: false, access: { has: obj => "blobNearSize" in obj, get: obj => obj.blobNearSize, set: (obj, value) => { obj.blobNearSize = value; } }, metadata: _metadata }, _blobNearSize_initializers, _blobNearSize_extraInitializers);
522
+ __esDecorate(null, null, _blobPulse_decorators, { kind: "field", name: "blobPulse", static: false, private: false, access: { has: obj => "blobPulse" in obj, get: obj => obj.blobPulse, set: (obj, value) => { obj.blobPulse = value; } }, metadata: _metadata }, _blobPulse_initializers, _blobPulse_extraInitializers);
523
+ __esDecorate(null, null, _blobFade_decorators, { kind: "field", name: "blobFade", static: false, private: false, access: { has: obj => "blobFade" in obj, get: obj => obj.blobFade, set: (obj, value) => { obj.blobFade = value; } }, metadata: _metadata }, _blobFade_initializers, _blobFade_extraInitializers);
524
+ __esDecorate(null, null, _blobNearSize2_decorators, { kind: "field", name: "blobNearSize2", static: false, private: false, access: { has: obj => "blobNearSize2" in obj, get: obj => obj.blobNearSize2, set: (obj, value) => { obj.blobNearSize2 = value; } }, metadata: _metadata }, _blobNearSize2_initializers, _blobNearSize2_extraInitializers);
525
+ __esDecorate(null, null, _blobPulse2_decorators, { kind: "field", name: "blobPulse2", static: false, private: false, access: { has: obj => "blobPulse2" in obj, get: obj => obj.blobPulse2, set: (obj, value) => { obj.blobPulse2 = value; } }, metadata: _metadata }, _blobPulse2_initializers, _blobPulse2_extraInitializers);
526
+ __esDecorate(null, null, _blobFade2_decorators, { kind: "field", name: "blobFade2", static: false, private: false, access: { has: obj => "blobFade2" in obj, get: obj => obj.blobFade2, set: (obj, value) => { obj.blobFade2 = value; } }, metadata: _metadata }, _blobFade2_initializers, _blobFade2_extraInitializers);
527
+ __esDecorate(null, null, _highlightColor_decorators, { kind: "field", name: "highlightColor", static: false, private: false, access: { has: obj => "highlightColor" in obj, get: obj => obj.highlightColor, set: (obj, value) => { obj.highlightColor = value; } }, metadata: _metadata }, _highlightColor_initializers, _highlightColor_extraInitializers);
528
+ __esDecorate(null, null, _highlightWidth_decorators, { kind: "field", name: "highlightWidth", static: false, private: false, access: { has: obj => "highlightWidth" in obj, get: obj => obj.highlightWidth, set: (obj, value) => { obj.highlightWidth = value; } }, metadata: _metadata }, _highlightWidth_initializers, _highlightWidth_extraInitializers);
529
+ __esDecorate(null, null, _iridescenceIntensity_decorators, { kind: "field", name: "iridescenceIntensity", static: false, private: false, access: { has: obj => "iridescenceIntensity" in obj, get: obj => obj.iridescenceIntensity, set: (obj, value) => { obj.iridescenceIntensity = value; } }, metadata: _metadata }, _iridescenceIntensity_initializers, _iridescenceIntensity_extraInitializers);
530
+ __esDecorate(null, null, _iridescenceEdgeIntensity_decorators, { kind: "field", name: "iridescenceEdgeIntensity", static: false, private: false, access: { has: obj => "iridescenceEdgeIntensity" in obj, get: obj => obj.iridescenceEdgeIntensity, set: (obj, value) => { obj.iridescenceEdgeIntensity = value; } }, metadata: _metadata }, _iridescenceEdgeIntensity_initializers, _iridescenceEdgeIntensity_extraInitializers);
531
+ __esDecorate(null, null, _fadeOut_decorators, { kind: "field", name: "fadeOut", static: false, private: false, access: { has: obj => "fadeOut" in obj, get: obj => obj.fadeOut, set: (obj, value) => { obj.fadeOut = value; } }, metadata: _metadata }, _fadeOut_initializers, _fadeOut_extraInitializers);
532
+ __esDecorate(null, null, _globalLeftIndexTipPosition_decorators, { kind: "field", name: "globalLeftIndexTipPosition", static: false, private: false, access: { has: obj => "globalLeftIndexTipPosition" in obj, get: obj => obj.globalLeftIndexTipPosition, set: (obj, value) => { obj.globalLeftIndexTipPosition = value; } }, metadata: _metadata }, _globalLeftIndexTipPosition_initializers, _globalLeftIndexTipPosition_extraInitializers);
533
+ __esDecorate(null, null, _globalRightIndexTipPosition_decorators, { kind: "field", name: "globalRightIndexTipPosition", static: false, private: false, access: { has: obj => "globalRightIndexTipPosition" in obj, get: obj => obj.globalRightIndexTipPosition, set: (obj, value) => { obj.globalRightIndexTipPosition = value; } }, metadata: _metadata }, _globalRightIndexTipPosition_initializers, _globalRightIndexTipPosition_extraInitializers);
534
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
535
+ })(),
536
+ /**
537
+ * URL pointing to the texture used to define the coloring for the fluent blob effect.
538
+ */
539
+ _a.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/core/MRTK/mrtk-fluent-backplate-blob.png",
540
+ /**
541
+ * URL pointing to the texture used to define iridescent map.
542
+ */
543
+ _a.IM_TEXTURE_URL = "https://assets.babylonjs.com/core/MRTK/mrtk-fluent-backplate-iridescence.png",
544
+ _a;
545
+ })();
546
+ export { FluentBackplateMaterial };
491
547
  let _Registered = false;
492
548
  /**
493
549
  * Registers the FluentBackplateMaterial class with the type store for serialization support.