@babylonjs/gui 9.15.0 → 9.16.0

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 { __classPrivateFieldGet, __classPrivateFieldSet, __esDecorate, __runInitializers } from "@babylonjs/core/tslib.es6.js";
2
2
  import { serializeAsColor4, serializeAsVector3, serializeAsTexture, serialize, expandToProperty, serializeAsColor3 } from "@babylonjs/core/Misc/decorators.js";
3
3
  import { SerializationHelper } from "@babylonjs/core/Misc/decorators.serialization.js";
4
4
  import { Vector3, TmpVectors } from "@babylonjs/core/Maths/math.vector.pure.js";
@@ -22,289 +22,338 @@ export class FluentMaterialDefines extends MaterialDefines {
22
22
  /**
23
23
  * Class used to render controls with fluent design
24
24
  */
25
- export class FluentMaterial extends PushMaterial {
26
- /**
27
- * Creates a new Fluent material
28
- * @param name defines the name of the material
29
- * @param scene defines the hosting scene
30
- */
31
- constructor(name, scene) {
32
- super(name, scene);
33
- this._shadersLoaded = false;
34
- /**
35
- * Gets or sets inner glow intensity. A value of 0 means no glow (default is 0.5)
36
- */
37
- this.innerGlowColorIntensity = 0.5;
38
- /**
39
- * Gets or sets the inner glow color (white by default)
40
- */
41
- this.innerGlowColor = new Color3(1.0, 1.0, 1.0);
42
- /**
43
- * Gets or sets the albedo color (Default is Color3(0.3, 0.35, 0.4))
44
- */
45
- this.albedoColor = new Color3(0.3, 0.35, 0.4);
46
- /**
47
- * Gets or sets a boolean indicating if borders must be rendered (default is false)
48
- */
49
- this.renderBorders = false;
50
- /**
51
- * Gets or sets border width (default is 0.5)
52
- */
53
- this.borderWidth = 0.5;
54
- /**
55
- * Gets or sets a value indicating the smoothing value applied to border edges (0.02 by default)
56
- */
57
- this.edgeSmoothingValue = 0.02;
58
- /**
59
- * Gets or sets the minimum value that can be applied to border width (default is 0.1)
60
- */
61
- this.borderMinValue = 0.1;
62
- /**
63
- * Gets or sets a boolean indicating if hover light must be rendered (default is false)
64
- */
65
- this.renderHoverLight = false;
66
- /**
67
- * Gets or sets the radius used to render the hover light (default is 0.01)
68
- */
69
- this.hoverRadius = 0.01;
70
- /**
71
- * Gets or sets the color used to render the hover light (default is Color4(0.3, 0.3, 0.3, 1.0))
72
- */
73
- this.hoverColor = new Color4(0.3, 0.3, 0.3, 1.0);
74
- /**
75
- * Gets or sets the hover light position in world space (default is Vector3.Zero())
76
- */
77
- this.hoverPosition = Vector3.Zero();
78
- }
79
- needAlphaBlending() {
80
- return this.alpha !== 1.0;
81
- }
82
- needAlphaTesting() {
83
- return false;
84
- }
85
- getAlphaTestTexture() {
86
- return null;
87
- }
88
- isReadyForSubMesh(mesh, subMesh) {
89
- const drawWrapper = subMesh._drawWrapper;
90
- if (this.isFrozen) {
91
- if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {
92
- return true;
25
+ let FluentMaterial = (() => {
26
+ var _a, _FluentMaterial_innerGlowColorIntensity_accessor_storage, _FluentMaterial_renderBorders_accessor_storage, _FluentMaterial_renderHoverLight_accessor_storage, _FluentMaterial_albedoTexture_accessor_storage;
27
+ let _classSuper = PushMaterial;
28
+ let _innerGlowColorIntensity_decorators;
29
+ let _innerGlowColorIntensity_initializers = [];
30
+ let _innerGlowColorIntensity_extraInitializers = [];
31
+ let _innerGlowColor_decorators;
32
+ let _innerGlowColor_initializers = [];
33
+ let _innerGlowColor_extraInitializers = [];
34
+ let _albedoColor_decorators;
35
+ let _albedoColor_initializers = [];
36
+ let _albedoColor_extraInitializers = [];
37
+ let _renderBorders_decorators;
38
+ let _renderBorders_initializers = [];
39
+ let _renderBorders_extraInitializers = [];
40
+ let _borderWidth_decorators;
41
+ let _borderWidth_initializers = [];
42
+ let _borderWidth_extraInitializers = [];
43
+ let _edgeSmoothingValue_decorators;
44
+ let _edgeSmoothingValue_initializers = [];
45
+ let _edgeSmoothingValue_extraInitializers = [];
46
+ let _borderMinValue_decorators;
47
+ let _borderMinValue_initializers = [];
48
+ let _borderMinValue_extraInitializers = [];
49
+ let _renderHoverLight_decorators;
50
+ let _renderHoverLight_initializers = [];
51
+ let _renderHoverLight_extraInitializers = [];
52
+ let _hoverRadius_decorators;
53
+ let _hoverRadius_initializers = [];
54
+ let _hoverRadius_extraInitializers = [];
55
+ let _hoverColor_decorators;
56
+ let _hoverColor_initializers = [];
57
+ let _hoverColor_extraInitializers = [];
58
+ let _hoverPosition_decorators;
59
+ let _hoverPosition_initializers = [];
60
+ let _hoverPosition_extraInitializers = [];
61
+ let __albedoTexture_decorators;
62
+ let __albedoTexture_initializers = [];
63
+ let __albedoTexture_extraInitializers = [];
64
+ let _albedoTexture_decorators;
65
+ let _albedoTexture_initializers = [];
66
+ let _albedoTexture_extraInitializers = [];
67
+ return _a = class FluentMaterial extends _classSuper {
68
+ /**
69
+ * Gets or sets inner glow intensity. A value of 0 means no glow (default is 0.5)
70
+ */
71
+ get innerGlowColorIntensity() { return __classPrivateFieldGet(this, _FluentMaterial_innerGlowColorIntensity_accessor_storage, "f"); }
72
+ set innerGlowColorIntensity(value) { __classPrivateFieldSet(this, _FluentMaterial_innerGlowColorIntensity_accessor_storage, value, "f"); }
73
+ /**
74
+ * Gets or sets a boolean indicating if borders must be rendered (default is false)
75
+ */
76
+ get renderBorders() { return __classPrivateFieldGet(this, _FluentMaterial_renderBorders_accessor_storage, "f"); }
77
+ set renderBorders(value) { __classPrivateFieldSet(this, _FluentMaterial_renderBorders_accessor_storage, value, "f"); }
78
+ /**
79
+ * Gets or sets a boolean indicating if hover light must be rendered (default is false)
80
+ */
81
+ get renderHoverLight() { return __classPrivateFieldGet(this, _FluentMaterial_renderHoverLight_accessor_storage, "f"); }
82
+ set renderHoverLight(value) { __classPrivateFieldSet(this, _FluentMaterial_renderHoverLight_accessor_storage, value, "f"); }
83
+ /** Gets or sets the texture to use for albedo color */
84
+ get albedoTexture() { return __classPrivateFieldGet(this, _FluentMaterial_albedoTexture_accessor_storage, "f"); }
85
+ set albedoTexture(value) { __classPrivateFieldSet(this, _FluentMaterial_albedoTexture_accessor_storage, value, "f"); }
86
+ /**
87
+ * Creates a new Fluent material
88
+ * @param name defines the name of the material
89
+ * @param scene defines the hosting scene
90
+ */
91
+ constructor(name, scene) {
92
+ super(name, scene);
93
+ this._shadersLoaded = false;
94
+ _FluentMaterial_innerGlowColorIntensity_accessor_storage.set(this, __runInitializers(this, _innerGlowColorIntensity_initializers, 0.5));
95
+ /**
96
+ * Gets or sets the inner glow color (white by default)
97
+ */
98
+ this.innerGlowColor = (__runInitializers(this, _innerGlowColorIntensity_extraInitializers), __runInitializers(this, _innerGlowColor_initializers, new Color3(1.0, 1.0, 1.0)));
99
+ /**
100
+ * Gets or sets the albedo color (Default is Color3(0.3, 0.35, 0.4))
101
+ */
102
+ this.albedoColor = (__runInitializers(this, _innerGlowColor_extraInitializers), __runInitializers(this, _albedoColor_initializers, new Color3(0.3, 0.35, 0.4)));
103
+ _FluentMaterial_renderBorders_accessor_storage.set(this, (__runInitializers(this, _albedoColor_extraInitializers), __runInitializers(this, _renderBorders_initializers, false)));
104
+ /**
105
+ * Gets or sets border width (default is 0.5)
106
+ */
107
+ this.borderWidth = (__runInitializers(this, _renderBorders_extraInitializers), __runInitializers(this, _borderWidth_initializers, 0.5));
108
+ /**
109
+ * Gets or sets a value indicating the smoothing value applied to border edges (0.02 by default)
110
+ */
111
+ this.edgeSmoothingValue = (__runInitializers(this, _borderWidth_extraInitializers), __runInitializers(this, _edgeSmoothingValue_initializers, 0.02));
112
+ /**
113
+ * Gets or sets the minimum value that can be applied to border width (default is 0.1)
114
+ */
115
+ this.borderMinValue = (__runInitializers(this, _edgeSmoothingValue_extraInitializers), __runInitializers(this, _borderMinValue_initializers, 0.1));
116
+ _FluentMaterial_renderHoverLight_accessor_storage.set(this, (__runInitializers(this, _borderMinValue_extraInitializers), __runInitializers(this, _renderHoverLight_initializers, false)));
117
+ /**
118
+ * Gets or sets the radius used to render the hover light (default is 0.01)
119
+ */
120
+ this.hoverRadius = (__runInitializers(this, _renderHoverLight_extraInitializers), __runInitializers(this, _hoverRadius_initializers, 0.01));
121
+ /**
122
+ * Gets or sets the color used to render the hover light (default is Color4(0.3, 0.3, 0.3, 1.0))
123
+ */
124
+ this.hoverColor = (__runInitializers(this, _hoverRadius_extraInitializers), __runInitializers(this, _hoverColor_initializers, new Color4(0.3, 0.3, 0.3, 1.0)));
125
+ /**
126
+ * Gets or sets the hover light position in world space (default is Vector3.Zero())
127
+ */
128
+ this.hoverPosition = (__runInitializers(this, _hoverColor_extraInitializers), __runInitializers(this, _hoverPosition_initializers, Vector3.Zero()));
129
+ this._albedoTexture = (__runInitializers(this, _hoverPosition_extraInitializers), __runInitializers(this, __albedoTexture_initializers, void 0));
130
+ _FluentMaterial_albedoTexture_accessor_storage.set(this, (__runInitializers(this, __albedoTexture_extraInitializers), __runInitializers(this, _albedoTexture_initializers, void 0)));
131
+ __runInitializers(this, _albedoTexture_extraInitializers);
93
132
  }
94
- }
95
- if (!subMesh.materialDefines) {
96
- subMesh.materialDefines = new FluentMaterialDefines();
97
- }
98
- const scene = this.getScene();
99
- const defines = subMesh.materialDefines;
100
- if (!this.checkReadyOnEveryCall && subMesh.effect) {
101
- if (defines._renderId === scene.getRenderId()) {
102
- return true;
133
+ needAlphaBlending() {
134
+ return this.alpha !== 1.0;
103
135
  }
104
- }
105
- if (defines._areTexturesDirty) {
106
- defines.INNERGLOW = this.innerGlowColorIntensity > 0;
107
- defines.BORDER = this.renderBorders;
108
- defines.HOVERLIGHT = this.renderHoverLight;
109
- if (this._albedoTexture) {
110
- if (!this._albedoTexture.isReadyOrNotBlocking()) {
111
- return false;
112
- }
113
- else {
114
- defines.TEXTURE = true;
115
- }
136
+ needAlphaTesting() {
137
+ return false;
116
138
  }
117
- else {
118
- defines.TEXTURE = false;
139
+ getAlphaTestTexture() {
140
+ return null;
119
141
  }
120
- }
121
- const engine = scene.getEngine();
122
- // Get correct effect
123
- if (defines.isDirty) {
124
- defines.markAsProcessed();
125
- scene.resetCachedMaterial();
126
- //Attributes
127
- const attribs = [VertexBuffer.PositionKind];
128
- attribs.push(VertexBuffer.NormalKind);
129
- attribs.push(VertexBuffer.UVKind);
130
- const shaderName = "fluent";
131
- const uniforms = [
132
- "world",
133
- "viewProjection",
134
- "innerGlowColor",
135
- "albedoColor",
136
- "borderWidth",
137
- "edgeSmoothingValue",
138
- "scaleFactor",
139
- "borderMinValue",
140
- "hoverColor",
141
- "hoverPosition",
142
- "hoverRadius",
143
- "textureMatrix",
144
- ];
145
- const samplers = ["albedoSampler"];
146
- const uniformBuffers = [];
147
- PrepareUniformsAndSamplersList({
148
- uniformsNames: uniforms,
149
- uniformBuffersNames: uniformBuffers,
150
- samplers: samplers,
151
- defines: defines,
152
- maxSimultaneousLights: 4,
153
- shaderLanguage: this._shaderLanguage,
154
- });
155
- const join = defines.toString();
156
- subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
157
- attributes: attribs,
158
- uniformsNames: uniforms,
159
- uniformBuffersNames: uniformBuffers,
160
- samplers: samplers,
161
- defines: join,
162
- fallbacks: null,
163
- onCompiled: this.onCompiled,
164
- onError: this.onError,
165
- indexParameters: { maxSimultaneousLights: 4 },
166
- shaderLanguage: this._shaderLanguage,
167
- extraInitializationsAsync: this._shadersLoaded
168
- ? undefined
169
- : async () => {
170
- if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
171
- await Promise.all([import("./wgsl/fluent.vertex.js"), import("./wgsl/fluent.fragment.js")]);
142
+ isReadyForSubMesh(mesh, subMesh) {
143
+ const drawWrapper = subMesh._drawWrapper;
144
+ if (this.isFrozen) {
145
+ if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {
146
+ return true;
147
+ }
148
+ }
149
+ if (!subMesh.materialDefines) {
150
+ subMesh.materialDefines = new FluentMaterialDefines();
151
+ }
152
+ const scene = this.getScene();
153
+ const defines = subMesh.materialDefines;
154
+ if (!this.checkReadyOnEveryCall && subMesh.effect) {
155
+ if (defines._renderId === scene.getRenderId()) {
156
+ return true;
157
+ }
158
+ }
159
+ if (defines._areTexturesDirty) {
160
+ defines.INNERGLOW = this.innerGlowColorIntensity > 0;
161
+ defines.BORDER = this.renderBorders;
162
+ defines.HOVERLIGHT = this.renderHoverLight;
163
+ if (this._albedoTexture) {
164
+ if (!this._albedoTexture.isReadyOrNotBlocking()) {
165
+ return false;
172
166
  }
173
167
  else {
174
- await Promise.all([import("./shaders/fluent.vertex.js"), import("./shaders/fluent.fragment.js")]);
168
+ defines.TEXTURE = true;
175
169
  }
176
- this._shadersLoaded = true;
177
- },
178
- }, engine), defines, this._materialContext);
179
- }
180
- if (!subMesh.effect || !subMesh.effect.isReady()) {
181
- return false;
182
- }
183
- defines._renderId = scene.getRenderId();
184
- drawWrapper._wasPreviouslyReady = true;
185
- return true;
186
- }
187
- bindForSubMesh(world, mesh, subMesh) {
188
- const scene = this.getScene();
189
- const defines = subMesh.materialDefines;
190
- if (!defines) {
191
- return;
192
- }
193
- const effect = subMesh.effect;
194
- if (!effect) {
195
- return;
196
- }
197
- this._activeEffect = effect;
198
- // Matrices
199
- this.bindOnlyWorldMatrix(world);
200
- this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
201
- if (this._mustRebind(scene, effect, subMesh)) {
202
- this._activeEffect.setColor4("albedoColor", this.albedoColor, this.alpha);
203
- if (defines.INNERGLOW) {
204
- this._activeEffect.setColor4("innerGlowColor", this.innerGlowColor, this.innerGlowColorIntensity);
170
+ }
171
+ else {
172
+ defines.TEXTURE = false;
173
+ }
174
+ }
175
+ const engine = scene.getEngine();
176
+ // Get correct effect
177
+ if (defines.isDirty) {
178
+ defines.markAsProcessed();
179
+ scene.resetCachedMaterial();
180
+ //Attributes
181
+ const attribs = [VertexBuffer.PositionKind];
182
+ attribs.push(VertexBuffer.NormalKind);
183
+ attribs.push(VertexBuffer.UVKind);
184
+ const shaderName = "fluent";
185
+ const uniforms = [
186
+ "world",
187
+ "viewProjection",
188
+ "innerGlowColor",
189
+ "albedoColor",
190
+ "borderWidth",
191
+ "edgeSmoothingValue",
192
+ "scaleFactor",
193
+ "borderMinValue",
194
+ "hoverColor",
195
+ "hoverPosition",
196
+ "hoverRadius",
197
+ "textureMatrix",
198
+ ];
199
+ const samplers = ["albedoSampler"];
200
+ const uniformBuffers = [];
201
+ PrepareUniformsAndSamplersList({
202
+ uniformsNames: uniforms,
203
+ uniformBuffersNames: uniformBuffers,
204
+ samplers: samplers,
205
+ defines: defines,
206
+ maxSimultaneousLights: 4,
207
+ shaderLanguage: this._shaderLanguage,
208
+ });
209
+ const join = defines.toString();
210
+ subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
211
+ attributes: attribs,
212
+ uniformsNames: uniforms,
213
+ uniformBuffersNames: uniformBuffers,
214
+ samplers: samplers,
215
+ defines: join,
216
+ fallbacks: null,
217
+ onCompiled: this.onCompiled,
218
+ onError: this.onError,
219
+ indexParameters: { maxSimultaneousLights: 4 },
220
+ shaderLanguage: this._shaderLanguage,
221
+ extraInitializationsAsync: this._shadersLoaded
222
+ ? undefined
223
+ : async () => {
224
+ if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
225
+ await Promise.all([import("./wgsl/fluent.vertex.js"), import("./wgsl/fluent.fragment.js")]);
226
+ }
227
+ else {
228
+ await Promise.all([import("./shaders/fluent.vertex.js"), import("./shaders/fluent.fragment.js")]);
229
+ }
230
+ this._shadersLoaded = true;
231
+ },
232
+ }, engine), defines, this._materialContext);
233
+ }
234
+ if (!subMesh.effect || !subMesh.effect.isReady()) {
235
+ return false;
236
+ }
237
+ defines._renderId = scene.getRenderId();
238
+ drawWrapper._wasPreviouslyReady = true;
239
+ return true;
205
240
  }
206
- if (defines.BORDER) {
207
- this._activeEffect.setFloat("borderWidth", this.borderWidth);
208
- this._activeEffect.setFloat("edgeSmoothingValue", this.edgeSmoothingValue);
209
- this._activeEffect.setFloat("borderMinValue", this.borderMinValue);
210
- mesh.getBoundingInfo().boundingBox.extendSize.multiplyToRef(mesh.scaling, TmpVectors.Vector3[0]);
211
- this._activeEffect.setVector3("scaleFactor", TmpVectors.Vector3[0]);
241
+ bindForSubMesh(world, mesh, subMesh) {
242
+ const scene = this.getScene();
243
+ const defines = subMesh.materialDefines;
244
+ if (!defines) {
245
+ return;
246
+ }
247
+ const effect = subMesh.effect;
248
+ if (!effect) {
249
+ return;
250
+ }
251
+ this._activeEffect = effect;
252
+ // Matrices
253
+ this.bindOnlyWorldMatrix(world);
254
+ this._activeEffect.setMatrix("viewProjection", scene.getTransformMatrix());
255
+ if (this._mustRebind(scene, effect, subMesh)) {
256
+ this._activeEffect.setColor4("albedoColor", this.albedoColor, this.alpha);
257
+ if (defines.INNERGLOW) {
258
+ this._activeEffect.setColor4("innerGlowColor", this.innerGlowColor, this.innerGlowColorIntensity);
259
+ }
260
+ if (defines.BORDER) {
261
+ this._activeEffect.setFloat("borderWidth", this.borderWidth);
262
+ this._activeEffect.setFloat("edgeSmoothingValue", this.edgeSmoothingValue);
263
+ this._activeEffect.setFloat("borderMinValue", this.borderMinValue);
264
+ mesh.getBoundingInfo().boundingBox.extendSize.multiplyToRef(mesh.scaling, TmpVectors.Vector3[0]);
265
+ this._activeEffect.setVector3("scaleFactor", TmpVectors.Vector3[0]);
266
+ }
267
+ if (defines.HOVERLIGHT) {
268
+ this._activeEffect.setDirectColor4("hoverColor", this.hoverColor);
269
+ this._activeEffect.setFloat("hoverRadius", this.hoverRadius);
270
+ this._activeEffect.setVector3("hoverPosition", this.hoverPosition);
271
+ }
272
+ if (defines.TEXTURE && this._albedoTexture) {
273
+ this._activeEffect.setTexture("albedoSampler", this._albedoTexture);
274
+ const matrix = this._albedoTexture.getTextureMatrix();
275
+ this._activeEffect.setMatrix("textureMatrix", matrix);
276
+ }
277
+ }
278
+ this._afterBind(mesh, this._activeEffect, subMesh);
212
279
  }
213
- if (defines.HOVERLIGHT) {
214
- this._activeEffect.setDirectColor4("hoverColor", this.hoverColor);
215
- this._activeEffect.setFloat("hoverRadius", this.hoverRadius);
216
- this._activeEffect.setVector3("hoverPosition", this.hoverPosition);
280
+ getActiveTextures() {
281
+ const activeTextures = super.getActiveTextures();
282
+ return activeTextures;
217
283
  }
218
- if (defines.TEXTURE && this._albedoTexture) {
219
- this._activeEffect.setTexture("albedoSampler", this._albedoTexture);
220
- const matrix = this._albedoTexture.getTextureMatrix();
221
- this._activeEffect.setMatrix("textureMatrix", matrix);
284
+ hasTexture(texture) {
285
+ if (super.hasTexture(texture)) {
286
+ return true;
287
+ }
288
+ return false;
222
289
  }
223
- }
224
- this._afterBind(mesh, this._activeEffect, subMesh);
225
- }
226
- getActiveTextures() {
227
- const activeTextures = super.getActiveTextures();
228
- return activeTextures;
229
- }
230
- hasTexture(texture) {
231
- if (super.hasTexture(texture)) {
232
- return true;
233
- }
234
- return false;
235
- }
236
- /**
237
- * Disposes the material.
238
- * @param forceDisposeEffect specifies if effects should be forcefully disposed
239
- */
240
- dispose(forceDisposeEffect) {
241
- super.dispose(forceDisposeEffect);
242
- }
243
- clone(name) {
244
- return SerializationHelper.Clone(() => new FluentMaterial(name, this.getScene()), this);
245
- }
246
- serialize() {
247
- const serializationObject = super.serialize();
248
- serializationObject.customType = "BABYLON.GUI.FluentMaterial";
249
- return serializationObject;
250
- }
251
- getClassName() {
252
- return "FluentMaterial";
253
- }
254
- // Statics
255
- /**
256
- * Creates a fluent material from parsed material data.
257
- * @param source defines the JSON representation of the material
258
- * @param scene defines the hosting scene
259
- * @param rootUrl defines the root URL to use to load textures and relative dependencies
260
- * @returns a new fluent material
261
- */
262
- static Parse(source, scene, rootUrl) {
263
- return SerializationHelper.Parse(() => new FluentMaterial(source.name, scene), source, scene, rootUrl);
264
- }
265
- }
266
- __decorate([
267
- serialize(),
268
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
269
- ], FluentMaterial.prototype, "innerGlowColorIntensity", void 0);
270
- __decorate([
271
- serializeAsColor3()
272
- ], FluentMaterial.prototype, "innerGlowColor", void 0);
273
- __decorate([
274
- serializeAsColor3()
275
- ], FluentMaterial.prototype, "albedoColor", void 0);
276
- __decorate([
277
- serialize(),
278
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
279
- ], FluentMaterial.prototype, "renderBorders", void 0);
280
- __decorate([
281
- serialize()
282
- ], FluentMaterial.prototype, "borderWidth", void 0);
283
- __decorate([
284
- serialize()
285
- ], FluentMaterial.prototype, "edgeSmoothingValue", void 0);
286
- __decorate([
287
- serialize()
288
- ], FluentMaterial.prototype, "borderMinValue", void 0);
289
- __decorate([
290
- serialize(),
291
- expandToProperty("_markAllSubMeshesAsTexturesDirty")
292
- ], FluentMaterial.prototype, "renderHoverLight", void 0);
293
- __decorate([
294
- serialize()
295
- ], FluentMaterial.prototype, "hoverRadius", void 0);
296
- __decorate([
297
- serializeAsColor4()
298
- ], FluentMaterial.prototype, "hoverColor", void 0);
299
- __decorate([
300
- serializeAsVector3()
301
- ], FluentMaterial.prototype, "hoverPosition", void 0);
302
- __decorate([
303
- serializeAsTexture("albedoTexture")
304
- ], FluentMaterial.prototype, "_albedoTexture", void 0);
305
- __decorate([
306
- expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty")
307
- ], FluentMaterial.prototype, "albedoTexture", void 0);
290
+ /**
291
+ * Disposes the material.
292
+ * @param forceDisposeEffect specifies if effects should be forcefully disposed
293
+ */
294
+ dispose(forceDisposeEffect) {
295
+ super.dispose(forceDisposeEffect);
296
+ }
297
+ clone(name) {
298
+ return SerializationHelper.Clone(() => new _a(name, this.getScene()), this);
299
+ }
300
+ serialize() {
301
+ const serializationObject = super.serialize();
302
+ serializationObject.customType = "BABYLON.GUI.FluentMaterial";
303
+ return serializationObject;
304
+ }
305
+ getClassName() {
306
+ return "FluentMaterial";
307
+ }
308
+ // Statics
309
+ /**
310
+ * Creates a fluent material from parsed material data.
311
+ * @param source defines the JSON representation of the material
312
+ * @param scene defines the hosting scene
313
+ * @param rootUrl defines the root URL to use to load textures and relative dependencies
314
+ * @returns a new fluent material
315
+ */
316
+ static Parse(source, scene, rootUrl) {
317
+ return SerializationHelper.Parse(() => new _a(source.name, scene), source, scene, rootUrl);
318
+ }
319
+ },
320
+ _FluentMaterial_innerGlowColorIntensity_accessor_storage = new WeakMap(),
321
+ _FluentMaterial_renderBorders_accessor_storage = new WeakMap(),
322
+ _FluentMaterial_renderHoverLight_accessor_storage = new WeakMap(),
323
+ _FluentMaterial_albedoTexture_accessor_storage = new WeakMap(),
324
+ (() => {
325
+ const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
326
+ _innerGlowColorIntensity_decorators = [serialize(), expandToProperty("_markAllSubMeshesAsTexturesDirty")];
327
+ _innerGlowColor_decorators = [serializeAsColor3()];
328
+ _albedoColor_decorators = [serializeAsColor3()];
329
+ _renderBorders_decorators = [serialize(), expandToProperty("_markAllSubMeshesAsTexturesDirty")];
330
+ _borderWidth_decorators = [serialize()];
331
+ _edgeSmoothingValue_decorators = [serialize()];
332
+ _borderMinValue_decorators = [serialize()];
333
+ _renderHoverLight_decorators = [serialize(), expandToProperty("_markAllSubMeshesAsTexturesDirty")];
334
+ _hoverRadius_decorators = [serialize()];
335
+ _hoverColor_decorators = [serializeAsColor4()];
336
+ _hoverPosition_decorators = [serializeAsVector3()];
337
+ __albedoTexture_decorators = [serializeAsTexture("albedoTexture")];
338
+ _albedoTexture_decorators = [expandToProperty("_markAllSubMeshesAsTexturesAndMiscDirty")];
339
+ __esDecorate(_a, null, _innerGlowColorIntensity_decorators, { kind: "accessor", name: "innerGlowColorIntensity", static: false, private: false, access: { has: obj => "innerGlowColorIntensity" in obj, get: obj => obj.innerGlowColorIntensity, set: (obj, value) => { obj.innerGlowColorIntensity = value; } }, metadata: _metadata }, _innerGlowColorIntensity_initializers, _innerGlowColorIntensity_extraInitializers);
340
+ __esDecorate(_a, null, _renderBorders_decorators, { kind: "accessor", name: "renderBorders", static: false, private: false, access: { has: obj => "renderBorders" in obj, get: obj => obj.renderBorders, set: (obj, value) => { obj.renderBorders = value; } }, metadata: _metadata }, _renderBorders_initializers, _renderBorders_extraInitializers);
341
+ __esDecorate(_a, null, _renderHoverLight_decorators, { kind: "accessor", name: "renderHoverLight", static: false, private: false, access: { has: obj => "renderHoverLight" in obj, get: obj => obj.renderHoverLight, set: (obj, value) => { obj.renderHoverLight = value; } }, metadata: _metadata }, _renderHoverLight_initializers, _renderHoverLight_extraInitializers);
342
+ __esDecorate(_a, null, _albedoTexture_decorators, { kind: "accessor", name: "albedoTexture", static: false, private: false, access: { has: obj => "albedoTexture" in obj, get: obj => obj.albedoTexture, set: (obj, value) => { obj.albedoTexture = value; } }, metadata: _metadata }, _albedoTexture_initializers, _albedoTexture_extraInitializers);
343
+ __esDecorate(null, null, _innerGlowColor_decorators, { kind: "field", name: "innerGlowColor", static: false, private: false, access: { has: obj => "innerGlowColor" in obj, get: obj => obj.innerGlowColor, set: (obj, value) => { obj.innerGlowColor = value; } }, metadata: _metadata }, _innerGlowColor_initializers, _innerGlowColor_extraInitializers);
344
+ __esDecorate(null, null, _albedoColor_decorators, { kind: "field", name: "albedoColor", static: false, private: false, access: { has: obj => "albedoColor" in obj, get: obj => obj.albedoColor, set: (obj, value) => { obj.albedoColor = value; } }, metadata: _metadata }, _albedoColor_initializers, _albedoColor_extraInitializers);
345
+ __esDecorate(null, null, _borderWidth_decorators, { kind: "field", name: "borderWidth", static: false, private: false, access: { has: obj => "borderWidth" in obj, get: obj => obj.borderWidth, set: (obj, value) => { obj.borderWidth = value; } }, metadata: _metadata }, _borderWidth_initializers, _borderWidth_extraInitializers);
346
+ __esDecorate(null, null, _edgeSmoothingValue_decorators, { kind: "field", name: "edgeSmoothingValue", static: false, private: false, access: { has: obj => "edgeSmoothingValue" in obj, get: obj => obj.edgeSmoothingValue, set: (obj, value) => { obj.edgeSmoothingValue = value; } }, metadata: _metadata }, _edgeSmoothingValue_initializers, _edgeSmoothingValue_extraInitializers);
347
+ __esDecorate(null, null, _borderMinValue_decorators, { kind: "field", name: "borderMinValue", static: false, private: false, access: { has: obj => "borderMinValue" in obj, get: obj => obj.borderMinValue, set: (obj, value) => { obj.borderMinValue = value; } }, metadata: _metadata }, _borderMinValue_initializers, _borderMinValue_extraInitializers);
348
+ __esDecorate(null, null, _hoverRadius_decorators, { kind: "field", name: "hoverRadius", static: false, private: false, access: { has: obj => "hoverRadius" in obj, get: obj => obj.hoverRadius, set: (obj, value) => { obj.hoverRadius = value; } }, metadata: _metadata }, _hoverRadius_initializers, _hoverRadius_extraInitializers);
349
+ __esDecorate(null, null, _hoverColor_decorators, { kind: "field", name: "hoverColor", static: false, private: false, access: { has: obj => "hoverColor" in obj, get: obj => obj.hoverColor, set: (obj, value) => { obj.hoverColor = value; } }, metadata: _metadata }, _hoverColor_initializers, _hoverColor_extraInitializers);
350
+ __esDecorate(null, null, _hoverPosition_decorators, { kind: "field", name: "hoverPosition", static: false, private: false, access: { has: obj => "hoverPosition" in obj, get: obj => obj.hoverPosition, set: (obj, value) => { obj.hoverPosition = value; } }, metadata: _metadata }, _hoverPosition_initializers, _hoverPosition_extraInitializers);
351
+ __esDecorate(null, null, __albedoTexture_decorators, { kind: "field", name: "_albedoTexture", static: false, private: false, access: { has: obj => "_albedoTexture" in obj, get: obj => obj._albedoTexture, set: (obj, value) => { obj._albedoTexture = value; } }, metadata: _metadata }, __albedoTexture_initializers, __albedoTexture_extraInitializers);
352
+ if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
353
+ })(),
354
+ _a;
355
+ })();
356
+ export { FluentMaterial };
308
357
  let _Registered = false;
309
358
  /**
310
359
  * Registers the FluentMaterial class with the type store for serialization support.