@babylonjs/gui 5.0.0-rc.5 → 5.0.0-rc.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (203) hide show
  1. package/2D/adtInstrumentation.d.ts +52 -52
  2. package/2D/adtInstrumentation.js +126 -126
  3. package/2D/advancedDynamicTexture.d.ts +448 -448
  4. package/2D/advancedDynamicTexture.js +1318 -1318
  5. package/2D/controls/button.d.ts +135 -135
  6. package/2D/controls/button.js +276 -276
  7. package/2D/controls/checkbox.d.ts +59 -59
  8. package/2D/controls/checkbox.js +188 -188
  9. package/2D/controls/colorpicker.d.ts +103 -103
  10. package/2D/controls/colorpicker.js +1417 -1417
  11. package/2D/controls/container.d.ts +175 -175
  12. package/2D/controls/container.js +570 -570
  13. package/2D/controls/control.d.ts +866 -866
  14. package/2D/controls/control.js +2433 -2433
  15. package/2D/controls/displayGrid.d.ts +53 -53
  16. package/2D/controls/displayGrid.js +245 -245
  17. package/2D/controls/ellipse.d.ts +21 -21
  18. package/2D/controls/ellipse.js +85 -85
  19. package/2D/controls/focusableButton.d.ts +59 -59
  20. package/2D/controls/focusableButton.js +99 -99
  21. package/2D/controls/focusableControl.d.ts +34 -34
  22. package/2D/controls/focusableControl.js +1 -1
  23. package/2D/controls/grid.d.ts +139 -139
  24. package/2D/controls/grid.js +529 -529
  25. package/2D/controls/image.d.ts +204 -204
  26. package/2D/controls/image.js +887 -887
  27. package/2D/controls/index.d.ts +29 -29
  28. package/2D/controls/index.js +29 -29
  29. package/2D/controls/inputPassword.d.ts +8 -8
  30. package/2D/controls/inputPassword.js +25 -25
  31. package/2D/controls/inputText.d.ts +201 -201
  32. package/2D/controls/inputText.js +1119 -1119
  33. package/2D/controls/line.d.ts +66 -66
  34. package/2D/controls/line.js +271 -271
  35. package/2D/controls/multiLine.d.ts +75 -75
  36. package/2D/controls/multiLine.js +262 -262
  37. package/2D/controls/radioButton.d.ts +49 -49
  38. package/2D/controls/radioButton.js +205 -205
  39. package/2D/controls/rectangle.d.ts +29 -29
  40. package/2D/controls/rectangle.js +150 -150
  41. package/2D/controls/scrollViewers/scrollViewer.d.ts +182 -182
  42. package/2D/controls/scrollViewers/scrollViewer.js +677 -677
  43. package/2D/controls/scrollViewers/scrollViewerWindow.d.ts +57 -57
  44. package/2D/controls/scrollViewers/scrollViewerWindow.js +278 -278
  45. package/2D/controls/selector.d.ts +263 -263
  46. package/2D/controls/selector.js +692 -692
  47. package/2D/controls/sliders/baseSlider.d.ts +82 -82
  48. package/2D/controls/sliders/baseSlider.js +347 -347
  49. package/2D/controls/sliders/imageBasedSlider.d.ts +49 -49
  50. package/2D/controls/sliders/imageBasedSlider.js +192 -192
  51. package/2D/controls/sliders/imageScrollBar.d.ts +65 -65
  52. package/2D/controls/sliders/imageScrollBar.js +263 -263
  53. package/2D/controls/sliders/scrollBar.d.ts +38 -38
  54. package/2D/controls/sliders/scrollBar.js +143 -143
  55. package/2D/controls/sliders/slider.d.ts +35 -35
  56. package/2D/controls/sliders/slider.js +271 -271
  57. package/2D/controls/stackPanel.d.ts +64 -64
  58. package/2D/controls/stackPanel.js +246 -246
  59. package/2D/controls/statics.d.ts +6 -6
  60. package/2D/controls/statics.js +49 -49
  61. package/2D/controls/textBlock.d.ts +175 -175
  62. package/2D/controls/textBlock.js +603 -603
  63. package/2D/controls/textWrapper.d.ts +13 -13
  64. package/2D/controls/textWrapper.js +101 -101
  65. package/2D/controls/toggleButton.d.ts +117 -117
  66. package/2D/controls/toggleButton.js +268 -268
  67. package/2D/controls/virtualKeyboard.d.ts +96 -96
  68. package/2D/controls/virtualKeyboard.js +256 -256
  69. package/2D/index.d.ts +9 -9
  70. package/2D/index.js +9 -9
  71. package/2D/math2D.d.ts +117 -117
  72. package/2D/math2D.js +221 -221
  73. package/2D/measure.d.ts +77 -77
  74. package/2D/measure.js +139 -139
  75. package/2D/multiLinePoint.d.ts +47 -47
  76. package/2D/multiLinePoint.js +127 -127
  77. package/2D/style.d.ts +46 -46
  78. package/2D/style.js +97 -97
  79. package/2D/valueAndUnit.d.ts +89 -89
  80. package/2D/valueAndUnit.js +226 -226
  81. package/2D/xmlLoader.d.ts +60 -60
  82. package/2D/xmlLoader.js +348 -348
  83. package/3D/behaviors/defaultBehavior.d.ts +73 -73
  84. package/3D/behaviors/defaultBehavior.js +121 -121
  85. package/3D/controls/abstractButton3D.d.ts +15 -15
  86. package/3D/controls/abstractButton3D.js +25 -25
  87. package/3D/controls/button3D.d.ts +30 -30
  88. package/3D/controls/button3D.js +93 -93
  89. package/3D/controls/container3D.d.ts +72 -72
  90. package/3D/controls/container3D.js +139 -139
  91. package/3D/controls/contentDisplay3D.d.ts +30 -30
  92. package/3D/controls/contentDisplay3D.js +79 -79
  93. package/3D/controls/control3D.d.ts +201 -201
  94. package/3D/controls/control3D.js +445 -445
  95. package/3D/controls/cylinderPanel.d.ts +17 -17
  96. package/3D/controls/cylinderPanel.js +66 -66
  97. package/3D/controls/handMenu.d.ts +28 -28
  98. package/3D/controls/handMenu.js +47 -47
  99. package/3D/controls/holographicBackplate.d.ts +49 -49
  100. package/3D/controls/holographicBackplate.js +120 -120
  101. package/3D/controls/holographicButton.d.ts +84 -84
  102. package/3D/controls/holographicButton.js +339 -339
  103. package/3D/controls/holographicSlate.d.ts +131 -131
  104. package/3D/controls/holographicSlate.js +431 -431
  105. package/3D/controls/index.d.ts +21 -21
  106. package/3D/controls/index.js +21 -21
  107. package/3D/controls/meshButton3D.d.ts +21 -21
  108. package/3D/controls/meshButton3D.js +62 -62
  109. package/3D/controls/nearMenu.d.ts +44 -44
  110. package/3D/controls/nearMenu.js +114 -114
  111. package/3D/controls/planePanel.d.ts +9 -9
  112. package/3D/controls/planePanel.js +36 -36
  113. package/3D/controls/scatterPanel.d.ts +18 -18
  114. package/3D/controls/scatterPanel.js +108 -108
  115. package/3D/controls/slider3D.d.ts +81 -81
  116. package/3D/controls/slider3D.js +268 -268
  117. package/3D/controls/spherePanel.d.ts +17 -17
  118. package/3D/controls/spherePanel.js +67 -67
  119. package/3D/controls/stackPanel3D.d.ts +22 -22
  120. package/3D/controls/stackPanel3D.js +107 -107
  121. package/3D/controls/touchButton3D.d.ts +80 -80
  122. package/3D/controls/touchButton3D.js +233 -233
  123. package/3D/controls/touchHolographicButton.d.ts +110 -110
  124. package/3D/controls/touchHolographicButton.js +445 -445
  125. package/3D/controls/touchHolographicMenu.d.ts +61 -61
  126. package/3D/controls/touchHolographicMenu.js +149 -149
  127. package/3D/controls/touchMeshButton3D.d.ts +21 -21
  128. package/3D/controls/touchMeshButton3D.js +62 -62
  129. package/3D/controls/volumeBasedPanel.d.ts +53 -53
  130. package/3D/controls/volumeBasedPanel.js +174 -174
  131. package/3D/gizmos/gizmoHandle.d.ts +108 -108
  132. package/3D/gizmos/gizmoHandle.js +209 -209
  133. package/3D/gizmos/index.d.ts +2 -2
  134. package/3D/gizmos/index.js +2 -2
  135. package/3D/gizmos/slateGizmo.d.ts +57 -57
  136. package/3D/gizmos/slateGizmo.js +369 -369
  137. package/3D/gui3DManager.d.ts +94 -94
  138. package/3D/gui3DManager.js +257 -257
  139. package/3D/index.d.ts +5 -5
  140. package/3D/index.js +5 -5
  141. package/3D/materials/fluent/fluentMaterial.d.ts +90 -90
  142. package/3D/materials/fluent/fluentMaterial.js +292 -292
  143. package/3D/materials/fluent/index.d.ts +1 -1
  144. package/3D/materials/fluent/index.js +1 -1
  145. package/3D/materials/fluent/shaders/fluent.fragment.d.ts +5 -5
  146. package/3D/materials/fluent/shaders/fluent.fragment.js +8 -8
  147. package/3D/materials/fluent/shaders/fluent.vertex.d.ts +5 -5
  148. package/3D/materials/fluent/shaders/fluent.vertex.js +8 -8
  149. package/3D/materials/fluentBackplate/fluentBackplateMaterial.d.ts +154 -154
  150. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +469 -469
  151. package/3D/materials/fluentBackplate/index.d.ts +1 -1
  152. package/3D/materials/fluentBackplate/index.js +1 -1
  153. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.d.ts +5 -5
  154. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +8 -8
  155. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.d.ts +5 -5
  156. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +8 -8
  157. package/3D/materials/fluentButton/fluentButtonMaterial.d.ts +189 -189
  158. package/3D/materials/fluentButton/fluentButtonMaterial.js +539 -539
  159. package/3D/materials/fluentButton/index.d.ts +1 -1
  160. package/3D/materials/fluentButton/index.js +1 -1
  161. package/3D/materials/fluentButton/shaders/fluentButton.fragment.d.ts +5 -5
  162. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +8 -8
  163. package/3D/materials/fluentButton/shaders/fluentButton.vertex.d.ts +5 -5
  164. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +8 -8
  165. package/3D/materials/fluentMaterial.d.ts +4 -4
  166. package/3D/materials/fluentMaterial.js +4 -4
  167. package/3D/materials/handle/handleMaterial.d.ts +68 -68
  168. package/3D/materials/handle/handleMaterial.js +126 -126
  169. package/3D/materials/handle/index.d.ts +1 -1
  170. package/3D/materials/handle/index.js +1 -1
  171. package/3D/materials/handle/shaders/handle.fragment.d.ts +5 -5
  172. package/3D/materials/handle/shaders/handle.fragment.js +8 -8
  173. package/3D/materials/handle/shaders/handle.vertex.d.ts +5 -5
  174. package/3D/materials/handle/shaders/handle.vertex.js +8 -8
  175. package/3D/materials/index.d.ts +5 -5
  176. package/3D/materials/index.js +5 -5
  177. package/3D/materials/mrdl/index.d.ts +3 -3
  178. package/3D/materials/mrdl/index.js +3 -3
  179. package/3D/materials/mrdl/mrdlBackplateMaterial.d.ts +147 -147
  180. package/3D/materials/mrdl/mrdlBackplateMaterial.js +436 -436
  181. package/3D/materials/mrdl/mrdlSliderBarMaterial.d.ts +333 -333
  182. package/3D/materials/mrdl/mrdlSliderBarMaterial.js +851 -851
  183. package/3D/materials/mrdl/mrdlSliderThumbMaterial.d.ts +333 -333
  184. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +851 -851
  185. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.d.ts +5 -5
  186. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +8 -8
  187. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.d.ts +5 -5
  188. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +8 -8
  189. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.d.ts +5 -5
  190. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +8 -8
  191. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.d.ts +5 -5
  192. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +8 -8
  193. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.d.ts +5 -5
  194. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +8 -8
  195. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.d.ts +5 -5
  196. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +8 -8
  197. package/3D/vector3WithInfo.d.ts +16 -16
  198. package/3D/vector3WithInfo.js +23 -23
  199. package/index.d.ts +2 -2
  200. package/index.js +2 -2
  201. package/legacy/legacy.d.ts +1 -1
  202. package/legacy/legacy.js +13 -13
  203. package/package.json +2 -2
@@ -1,470 +1,470 @@
1
- import { __decorate, __extends } from "tslib";
2
- import { SerializationHelper, serialize, serializeAsVector3 } from "@babylonjs/core/Misc/decorators.js";
3
- import { Vector3, Vector4 } from "@babylonjs/core/Maths/math.vector.js";
4
- import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
5
- import { MaterialDefines } from "@babylonjs/core/Materials/materialDefines.js";
6
- import { MaterialHelper } from "@babylonjs/core/Materials/materialHelper.js";
7
- import { PushMaterial } from "@babylonjs/core/Materials/pushMaterial.js";
8
- import { VertexBuffer } from "@babylonjs/core/Buffers/buffer.js";
9
- import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
10
- import { Color4 } from "@babylonjs/core/Maths/math.color.js";
11
- import { EffectFallbacks } from "@babylonjs/core/Materials/effectFallbacks.js";
12
- import { Constants } from "@babylonjs/core/Engines/constants.js";
13
- import "./shaders/fluentBackplate.fragment.js";
14
- import "./shaders/fluentBackplate.vertex.js";
15
- /** @hidden */
16
- var FluentBackplateMaterialDefines = /** @class */ (function (_super) {
17
- __extends(FluentBackplateMaterialDefines, _super);
18
- function FluentBackplateMaterialDefines() {
19
- var _this = _super.call(this) || this;
20
- _this.BLOB_ENABLE = true;
21
- _this.BLOB_ENABLE_2 = true;
22
- _this.SMOOTH_EDGES = true;
23
- _this.IRIDESCENT_MAP_ENABLE = true;
24
- _this._needNormals = true;
25
- _this.rebuild();
26
- return _this;
27
- }
28
- return FluentBackplateMaterialDefines;
29
- }(MaterialDefines));
30
- /**
31
- * Class used to render square buttons with fluent design
32
- */
33
- var FluentBackplateMaterial = /** @class */ (function (_super) {
34
- __extends(FluentBackplateMaterial, _super);
35
- function FluentBackplateMaterial(name, scene) {
36
- var _this = _super.call(this, name, scene) || this;
37
- /**
38
- * Gets or sets the corner radius on the backplate. Best to keep this value between 0.01 and 0.5. Default is 0.03.
39
- */
40
- _this.radius = 0.03;
41
- /**
42
- * Gets or sets the line width of the backplate.
43
- */
44
- _this.lineWidth = 0.01;
45
- /**
46
- * Gets or sets whether to use absolute sizes when calculating effects on the backplate.
47
- * Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.
48
- */
49
- _this.absoluteSizes = false;
50
- /** @hidden */
51
- _this._filterWidth = 1;
52
- /**
53
- * Gets or sets the base color of the backplate.
54
- */
55
- _this.baseColor = new Color4(0.0392157, 0.0666667, 0.207843, 1);
56
- /**
57
- * Gets or sets the line color of the backplate.
58
- */
59
- _this.lineColor = new Color4(0.14902, 0.133333, 0.384314, 1);
60
- /**
61
- * Gets or sets the intensity of the fluent hover glow effect.
62
- */
63
- _this.blobIntensity = 0.98;
64
- /**
65
- * Gets or sets the far size of the fluent hover glow effect.
66
- */
67
- _this.blobFarSize = 0.04;
68
- /**
69
- * Gets or sets the distance considered "near" to the backplate, which controls the size of the fluent hover glow effect (see blobNearSize).
70
- */
71
- _this.blobNearDistance = 0;
72
- /**
73
- * Gets or sets the distance considered "far" from the backplate, which controls the size of the fluent hover glow effect (see blobFarSize).
74
- */
75
- _this.blobFarDistance = 0.08;
76
- /**
77
- * Gets or sets the length of the fluent hover glow effect fade.
78
- */
79
- _this.blobFadeLength = 0.08;
80
- /**
81
- * Gets or sets the size of the fluent hover glow effect when the left pointer is considered "near" to the backplate (see blobNearDistance).
82
- */
83
- _this.blobNearSize = 0.22;
84
- /**
85
- * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).
86
- */
87
- _this.blobPulse = 0;
88
- /**
89
- * Gets or sets the opacity of the fluent hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.
90
- */
91
- _this.blobFade = 0;
92
- /**
93
- * Gets or sets the size of the fluent hover glow effect when the right pointer is considered "near" to the backplate (see blobNearDistance).
94
- */
95
- _this.blobNearSize2 = 0.22;
96
- /**
97
- * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).
98
- */
99
- _this.blobPulse2 = 0;
100
- /**
101
- * Gets or sets the opacity of the fluent hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 0.
102
- */
103
- _this.blobFade2 = 0;
104
- /** @hidden */
105
- _this._rate = 0.135;
106
- /**
107
- * Gets or sets the color of the highlights on the backplate line.
108
- */
109
- _this.highlightColor = new Color4(0.98, 0.98, 0.98, 1);
110
- /**
111
- * Gets or sets the width of the highlights on the backplate line.
112
- */
113
- _this.highlightWidth = 0.25;
114
- /** @hidden */
115
- _this._highlightTransform = new Vector4(1, 1, 0, 0);
116
- /** @hidden */
117
- _this._highlight = 1;
118
- /**
119
- * Gets or sets the intensity of the iridescence effect.
120
- */
121
- _this.iridescenceIntensity = 0;
122
- /**
123
- * Gets or sets the intensity of the iridescence effect on the backplate edges.
124
- */
125
- _this.iridescenceEdgeIntensity = 1;
126
- /** @hidden */
127
- _this._angle = -45;
128
- /**
129
- * Gets or sets the opacity of the backplate (0.0 - 1.0).
130
- */
131
- _this.fadeOut = 1;
132
- /** @hidden */
133
- _this._reflected = true;
134
- /** @hidden */
135
- _this._frequency = 1;
136
- /** @hidden */
137
- _this._verticalOffset = 0;
138
- /**
139
- * Gets or sets the world-space position of the tip of the left index finger.
140
- */
141
- _this.globalLeftIndexTipPosition = Vector3.Zero();
142
- _this._globalLeftIndexTipPosition4 = Vector4.Zero();
143
- /**
144
- * Gets or sets the world-space position of the tip of the right index finger.
145
- */
146
- _this.globalRightIndexTipPosition = Vector3.Zero();
147
- _this._globalRightIndexTipPosition4 = Vector4.Zero();
148
- _this.alphaMode = Constants.ALPHA_DISABLE;
149
- _this.backFaceCulling = false;
150
- _this._blobTexture = new Texture(FluentBackplateMaterial.BLOB_TEXTURE_URL, _this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
151
- _this._iridescentMap = new Texture(FluentBackplateMaterial.IM_TEXTURE_URL, _this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
152
- return _this;
153
- }
154
- FluentBackplateMaterial.prototype.needAlphaBlending = function () {
155
- return false;
156
- };
157
- FluentBackplateMaterial.prototype.needAlphaTesting = function () {
158
- return false;
159
- };
160
- FluentBackplateMaterial.prototype.getAlphaTestTexture = function () {
161
- return null;
162
- };
163
- FluentBackplateMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh) {
164
- if (this.isFrozen) {
165
- if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
166
- return true;
167
- }
168
- }
169
- if (!subMesh.materialDefines) {
170
- subMesh.materialDefines = new FluentBackplateMaterialDefines();
171
- }
172
- var defines = subMesh.materialDefines;
173
- var scene = this.getScene();
174
- if (this._isReadyForSubMesh(subMesh)) {
175
- return true;
176
- }
177
- var engine = scene.getEngine();
178
- // Attribs
179
- MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);
180
- // Get correct effect
181
- if (defines.isDirty) {
182
- defines.markAsProcessed();
183
- scene.resetCachedMaterial();
184
- // Fallbacks
185
- var fallbacks = new EffectFallbacks();
186
- if (defines.FOG) {
187
- fallbacks.addFallback(1, "FOG");
188
- }
189
- MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);
190
- defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
191
- //Attributes
192
- var attribs = [VertexBuffer.PositionKind];
193
- if (defines.NORMAL) {
194
- attribs.push(VertexBuffer.NormalKind);
195
- }
196
- if (defines.UV1) {
197
- attribs.push(VertexBuffer.UVKind);
198
- }
199
- if (defines.UV2) {
200
- attribs.push(VertexBuffer.UV2Kind);
201
- }
202
- if (defines.VERTEXCOLOR) {
203
- attribs.push(VertexBuffer.ColorKind);
204
- }
205
- if (defines.TANGENT) {
206
- attribs.push(VertexBuffer.TangentKind);
207
- }
208
- MaterialHelper.PrepareAttributesForInstances(attribs, defines);
209
- // Legacy browser patch
210
- var shaderName = "fluentBackplate";
211
- var join = defines.toString();
212
- var uniforms = [
213
- "world",
214
- "viewProjection",
215
- "cameraPosition",
216
- "_Radius_",
217
- "_Line_Width_",
218
- "_Absolute_Sizes_",
219
- "_Filter_Width_",
220
- "_Base_Color_",
221
- "_Line_Color_",
222
- "_Radius_Top_Left_",
223
- "_Radius_Top_Right_",
224
- "_Radius_Bottom_Left_",
225
- "_Radius_Bottom_Right_",
226
- "_Blob_Position_",
227
- "_Blob_Intensity_",
228
- "_Blob_Near_Size_",
229
- "_Blob_Far_Size_",
230
- "_Blob_Near_Distance_",
231
- "_Blob_Far_Distance_",
232
- "_Blob_Fade_Length_",
233
- "_Blob_Pulse_",
234
- "_Blob_Fade_",
235
- "_Blob_Texture_",
236
- "_Blob_Position_2_",
237
- "_Blob_Near_Size_2_",
238
- "_Blob_Pulse_2_",
239
- "_Blob_Fade_2_",
240
- "_Rate_",
241
- "_Highlight_Color_",
242
- "_Highlight_Width_",
243
- "_Highlight_Transform_",
244
- "_Highlight_",
245
- "_Iridescence_Intensity_",
246
- "_Iridescence_Edge_Intensity_",
247
- "_Angle_",
248
- "_Fade_Out_",
249
- "_Reflected_",
250
- "_Frequency_",
251
- "_Vertical_Offset_",
252
- "_Iridescent_Map_",
253
- "_Use_Global_Left_Index_",
254
- "_Use_Global_Right_Index_",
255
- "Global_Left_Index_Tip_Position",
256
- "Global_Right_Index_Tip_Position",
257
- ];
258
- var samplers = ["_Blob_Texture_", "_Iridescent_Map_"];
259
- var uniformBuffers = new Array();
260
- MaterialHelper.PrepareUniformsAndSamplersList({
261
- uniformsNames: uniforms,
262
- uniformBuffersNames: uniformBuffers,
263
- samplers: samplers,
264
- defines: defines,
265
- maxSimultaneousLights: 4,
266
- });
267
- subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
268
- attributes: attribs,
269
- uniformsNames: uniforms,
270
- uniformBuffersNames: uniformBuffers,
271
- samplers: samplers,
272
- defines: join,
273
- fallbacks: fallbacks,
274
- onCompiled: this.onCompiled,
275
- onError: this.onError,
276
- indexParameters: { maxSimultaneousLights: 4 },
277
- }, engine), defines, this._materialContext);
278
- }
279
- if (!subMesh.effect || !subMesh.effect.isReady()) {
280
- return false;
281
- }
282
- defines._renderId = scene.getRenderId();
283
- subMesh.effect._wasPreviouslyReady = true;
284
- return true;
285
- };
286
- FluentBackplateMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
287
- var _a, _b;
288
- var defines = subMesh.materialDefines;
289
- if (!defines) {
290
- return;
291
- }
292
- var effect = subMesh.effect;
293
- if (!effect) {
294
- return;
295
- }
296
- this._activeEffect = effect;
297
- // Matrices
298
- this.bindOnlyWorldMatrix(world);
299
- this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
300
- this._activeEffect.setVector3("cameraPosition", (_b = (_a = this.getScene().activeCamera) === null || _a === void 0 ? void 0 : _a.position) !== null && _b !== void 0 ? _b : Vector3.ZeroReadOnly);
301
- // "Round Rect"
302
- this._activeEffect.setFloat("_Radius_", this.radius);
303
- this._activeEffect.setFloat("_Line_Width_", this.lineWidth);
304
- this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1.0 : 0.0);
305
- this._activeEffect.setFloat("_Filter_Width_", this._filterWidth);
306
- this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor);
307
- this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor);
308
- // "Radii Multipliers"
309
- this._activeEffect.setFloat("_Radius_Top_Left_", 1);
310
- this._activeEffect.setFloat("_Radius_Top_Right_", 1.0);
311
- this._activeEffect.setFloat("_Radius_Bottom_Left_", 1.0);
312
- this._activeEffect.setFloat("_Radius_Bottom_Right_", 1.0);
313
- // "Blob"
314
- //define BLOB_ENABLE true;
315
- this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
316
- this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize);
317
- this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
318
- this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
319
- this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
320
- this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
321
- this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse);
322
- this._activeEffect.setFloat("_Blob_Fade_", this.blobFade);
323
- // "Blob Texture"
324
- this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture);
325
- // "Blob 2"
326
- //define BLOB_ENABLE_2 true;
327
- this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2);
328
- this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2);
329
- this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2);
330
- // "Line Highlight"
331
- this._activeEffect.setFloat("_Rate_", this._rate);
332
- this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor);
333
- this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth);
334
- this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform);
335
- this._activeEffect.setFloat("_Highlight_", this._highlight);
336
- // "Iridescence"
337
- this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
338
- this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity);
339
- this._activeEffect.setFloat("_Angle_", this._angle);
340
- // "Fade"
341
- this._activeEffect.setFloat("_Fade_Out_", this.fadeOut);
342
- // "Antialiasing"
343
- //define SMOOTH_EDGES true;
344
- // "ChooseAngle"
345
- this._activeEffect.setFloat("_Reflected_", this._reflected ? 1.0 : 0.0);
346
- // "Multiply"
347
- this._activeEffect.setFloat("_Frequency_", this._frequency);
348
- this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset);
349
- // "Color Texture"
350
- //define IRIDESCENT_MAP_ENABLE true;
351
- this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMap);
352
- // "Global"
353
- this._activeEffect.setFloat("_Use_Global_Left_Index_", 1.0);
354
- this._activeEffect.setFloat("_Use_Global_Right_Index_", 1.0);
355
- this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1.0);
356
- this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this._globalLeftIndexTipPosition4);
357
- this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1.0);
358
- this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this._globalRightIndexTipPosition4);
359
- this._afterBind(mesh, this._activeEffect);
360
- };
361
- /**
362
- * Get the list of animatables in the material.
363
- * @returns the list of animatables object used in the material
364
- */
365
- FluentBackplateMaterial.prototype.getAnimatables = function () {
366
- return [];
367
- };
368
- FluentBackplateMaterial.prototype.dispose = function (forceDisposeEffect) {
369
- _super.prototype.dispose.call(this, forceDisposeEffect);
370
- this._blobTexture.dispose();
371
- this._iridescentMap.dispose();
372
- };
373
- FluentBackplateMaterial.prototype.clone = function (name) {
374
- var _this = this;
375
- return SerializationHelper.Clone(function () { return new FluentBackplateMaterial(name, _this.getScene()); }, this);
376
- };
377
- FluentBackplateMaterial.prototype.serialize = function () {
378
- var serializationObject = _super.prototype.serialize.call(this);
379
- serializationObject.customType = "BABYLON.FluentBackplateMaterial";
380
- return serializationObject;
381
- };
382
- FluentBackplateMaterial.prototype.getClassName = function () {
383
- return "FluentBackplateMaterial";
384
- };
385
- // Statics
386
- FluentBackplateMaterial.Parse = function (source, scene, rootUrl) {
387
- return SerializationHelper.Parse(function () { return new FluentBackplateMaterial(source.name, scene); }, source, scene, rootUrl);
388
- };
389
- /**
390
- * URL pointing to the texture used to define the coloring for the fluent blob effect.
391
- */
392
- FluentBackplateMaterial.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-blob.png";
393
- /**
394
- * URL pointing to the texture used to define iridescent map.
395
- */
396
- FluentBackplateMaterial.IM_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-iridescence.png";
397
- __decorate([
398
- serialize()
399
- ], FluentBackplateMaterial.prototype, "radius", void 0);
400
- __decorate([
401
- serialize()
402
- ], FluentBackplateMaterial.prototype, "lineWidth", void 0);
403
- __decorate([
404
- serialize()
405
- ], FluentBackplateMaterial.prototype, "absoluteSizes", void 0);
406
- __decorate([
407
- serialize()
408
- ], FluentBackplateMaterial.prototype, "baseColor", void 0);
409
- __decorate([
410
- serialize()
411
- ], FluentBackplateMaterial.prototype, "lineColor", void 0);
412
- __decorate([
413
- serialize()
414
- ], FluentBackplateMaterial.prototype, "blobIntensity", void 0);
415
- __decorate([
416
- serialize()
417
- ], FluentBackplateMaterial.prototype, "blobFarSize", void 0);
418
- __decorate([
419
- serialize()
420
- ], FluentBackplateMaterial.prototype, "blobNearDistance", void 0);
421
- __decorate([
422
- serialize()
423
- ], FluentBackplateMaterial.prototype, "blobFarDistance", void 0);
424
- __decorate([
425
- serialize()
426
- ], FluentBackplateMaterial.prototype, "blobFadeLength", void 0);
427
- __decorate([
428
- serialize()
429
- ], FluentBackplateMaterial.prototype, "blobNearSize", void 0);
430
- __decorate([
431
- serialize()
432
- ], FluentBackplateMaterial.prototype, "blobPulse", void 0);
433
- __decorate([
434
- serialize()
435
- ], FluentBackplateMaterial.prototype, "blobFade", void 0);
436
- __decorate([
437
- serialize()
438
- ], FluentBackplateMaterial.prototype, "blobNearSize2", void 0);
439
- __decorate([
440
- serialize()
441
- ], FluentBackplateMaterial.prototype, "blobPulse2", void 0);
442
- __decorate([
443
- serialize()
444
- ], FluentBackplateMaterial.prototype, "blobFade2", void 0);
445
- __decorate([
446
- serialize()
447
- ], FluentBackplateMaterial.prototype, "highlightColor", void 0);
448
- __decorate([
449
- serialize()
450
- ], FluentBackplateMaterial.prototype, "highlightWidth", void 0);
451
- __decorate([
452
- serialize()
453
- ], FluentBackplateMaterial.prototype, "iridescenceIntensity", void 0);
454
- __decorate([
455
- serialize()
456
- ], FluentBackplateMaterial.prototype, "iridescenceEdgeIntensity", void 0);
457
- __decorate([
458
- serialize()
459
- ], FluentBackplateMaterial.prototype, "fadeOut", void 0);
460
- __decorate([
461
- serializeAsVector3()
462
- ], FluentBackplateMaterial.prototype, "globalLeftIndexTipPosition", void 0);
463
- __decorate([
464
- serializeAsVector3()
465
- ], FluentBackplateMaterial.prototype, "globalRightIndexTipPosition", void 0);
466
- return FluentBackplateMaterial;
467
- }(PushMaterial));
468
- export { FluentBackplateMaterial };
469
- RegisterClass("BABYLON.GUI.FluentBackplateMaterial", FluentBackplateMaterial);
1
+ import { __decorate, __extends } from "tslib";
2
+ import { SerializationHelper, serialize, serializeAsVector3 } from "@babylonjs/core/Misc/decorators.js";
3
+ import { Vector3, Vector4 } from "@babylonjs/core/Maths/math.vector.js";
4
+ import { Texture } from "@babylonjs/core/Materials/Textures/texture.js";
5
+ import { MaterialDefines } from "@babylonjs/core/Materials/materialDefines.js";
6
+ import { MaterialHelper } from "@babylonjs/core/Materials/materialHelper.js";
7
+ import { PushMaterial } from "@babylonjs/core/Materials/pushMaterial.js";
8
+ import { VertexBuffer } from "@babylonjs/core/Buffers/buffer.js";
9
+ import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
10
+ import { Color4 } from "@babylonjs/core/Maths/math.color.js";
11
+ import { EffectFallbacks } from "@babylonjs/core/Materials/effectFallbacks.js";
12
+ import { Constants } from "@babylonjs/core/Engines/constants.js";
13
+ import "./shaders/fluentBackplate.fragment";
14
+ import "./shaders/fluentBackplate.vertex";
15
+ /** @hidden */
16
+ var FluentBackplateMaterialDefines = /** @class */ (function (_super) {
17
+ __extends(FluentBackplateMaterialDefines, _super);
18
+ function FluentBackplateMaterialDefines() {
19
+ var _this = _super.call(this) || this;
20
+ _this.BLOB_ENABLE = true;
21
+ _this.BLOB_ENABLE_2 = true;
22
+ _this.SMOOTH_EDGES = true;
23
+ _this.IRIDESCENT_MAP_ENABLE = true;
24
+ _this._needNormals = true;
25
+ _this.rebuild();
26
+ return _this;
27
+ }
28
+ return FluentBackplateMaterialDefines;
29
+ }(MaterialDefines));
30
+ /**
31
+ * Class used to render square buttons with fluent design
32
+ */
33
+ var FluentBackplateMaterial = /** @class */ (function (_super) {
34
+ __extends(FluentBackplateMaterial, _super);
35
+ function FluentBackplateMaterial(name, scene) {
36
+ var _this = _super.call(this, name, scene) || this;
37
+ /**
38
+ * Gets or sets the corner radius on the backplate. Best to keep this value between 0.01 and 0.5. Default is 0.03.
39
+ */
40
+ _this.radius = 0.03;
41
+ /**
42
+ * Gets or sets the line width of the backplate.
43
+ */
44
+ _this.lineWidth = 0.01;
45
+ /**
46
+ * Gets or sets whether to use absolute sizes when calculating effects on the backplate.
47
+ * Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.
48
+ */
49
+ _this.absoluteSizes = false;
50
+ /** @hidden */
51
+ _this._filterWidth = 1;
52
+ /**
53
+ * Gets or sets the base color of the backplate.
54
+ */
55
+ _this.baseColor = new Color4(0.0392157, 0.0666667, 0.207843, 1);
56
+ /**
57
+ * Gets or sets the line color of the backplate.
58
+ */
59
+ _this.lineColor = new Color4(0.14902, 0.133333, 0.384314, 1);
60
+ /**
61
+ * Gets or sets the intensity of the fluent hover glow effect.
62
+ */
63
+ _this.blobIntensity = 0.98;
64
+ /**
65
+ * Gets or sets the far size of the fluent hover glow effect.
66
+ */
67
+ _this.blobFarSize = 0.04;
68
+ /**
69
+ * Gets or sets the distance considered "near" to the backplate, which controls the size of the fluent hover glow effect (see blobNearSize).
70
+ */
71
+ _this.blobNearDistance = 0;
72
+ /**
73
+ * Gets or sets the distance considered "far" from the backplate, which controls the size of the fluent hover glow effect (see blobFarSize).
74
+ */
75
+ _this.blobFarDistance = 0.08;
76
+ /**
77
+ * Gets or sets the length of the fluent hover glow effect fade.
78
+ */
79
+ _this.blobFadeLength = 0.08;
80
+ /**
81
+ * Gets or sets the size of the fluent hover glow effect when the left pointer is considered "near" to the backplate (see blobNearDistance).
82
+ */
83
+ _this.blobNearSize = 0.22;
84
+ /**
85
+ * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).
86
+ */
87
+ _this.blobPulse = 0;
88
+ /**
89
+ * Gets or sets the opacity of the fluent hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.
90
+ */
91
+ _this.blobFade = 0;
92
+ /**
93
+ * Gets or sets the size of the fluent hover glow effect when the right pointer is considered "near" to the backplate (see blobNearDistance).
94
+ */
95
+ _this.blobNearSize2 = 0.22;
96
+ /**
97
+ * Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).
98
+ */
99
+ _this.blobPulse2 = 0;
100
+ /**
101
+ * Gets or sets the opacity of the fluent hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 0.
102
+ */
103
+ _this.blobFade2 = 0;
104
+ /** @hidden */
105
+ _this._rate = 0.135;
106
+ /**
107
+ * Gets or sets the color of the highlights on the backplate line.
108
+ */
109
+ _this.highlightColor = new Color4(0.98, 0.98, 0.98, 1);
110
+ /**
111
+ * Gets or sets the width of the highlights on the backplate line.
112
+ */
113
+ _this.highlightWidth = 0.25;
114
+ /** @hidden */
115
+ _this._highlightTransform = new Vector4(1, 1, 0, 0);
116
+ /** @hidden */
117
+ _this._highlight = 1;
118
+ /**
119
+ * Gets or sets the intensity of the iridescence effect.
120
+ */
121
+ _this.iridescenceIntensity = 0;
122
+ /**
123
+ * Gets or sets the intensity of the iridescence effect on the backplate edges.
124
+ */
125
+ _this.iridescenceEdgeIntensity = 1;
126
+ /** @hidden */
127
+ _this._angle = -45;
128
+ /**
129
+ * Gets or sets the opacity of the backplate (0.0 - 1.0).
130
+ */
131
+ _this.fadeOut = 1;
132
+ /** @hidden */
133
+ _this._reflected = true;
134
+ /** @hidden */
135
+ _this._frequency = 1;
136
+ /** @hidden */
137
+ _this._verticalOffset = 0;
138
+ /**
139
+ * Gets or sets the world-space position of the tip of the left index finger.
140
+ */
141
+ _this.globalLeftIndexTipPosition = Vector3.Zero();
142
+ _this._globalLeftIndexTipPosition4 = Vector4.Zero();
143
+ /**
144
+ * Gets or sets the world-space position of the tip of the right index finger.
145
+ */
146
+ _this.globalRightIndexTipPosition = Vector3.Zero();
147
+ _this._globalRightIndexTipPosition4 = Vector4.Zero();
148
+ _this.alphaMode = Constants.ALPHA_DISABLE;
149
+ _this.backFaceCulling = false;
150
+ _this._blobTexture = new Texture(FluentBackplateMaterial.BLOB_TEXTURE_URL, _this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
151
+ _this._iridescentMap = new Texture(FluentBackplateMaterial.IM_TEXTURE_URL, _this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
152
+ return _this;
153
+ }
154
+ FluentBackplateMaterial.prototype.needAlphaBlending = function () {
155
+ return false;
156
+ };
157
+ FluentBackplateMaterial.prototype.needAlphaTesting = function () {
158
+ return false;
159
+ };
160
+ FluentBackplateMaterial.prototype.getAlphaTestTexture = function () {
161
+ return null;
162
+ };
163
+ FluentBackplateMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh) {
164
+ if (this.isFrozen) {
165
+ if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
166
+ return true;
167
+ }
168
+ }
169
+ if (!subMesh.materialDefines) {
170
+ subMesh.materialDefines = new FluentBackplateMaterialDefines();
171
+ }
172
+ var defines = subMesh.materialDefines;
173
+ var scene = this.getScene();
174
+ if (this._isReadyForSubMesh(subMesh)) {
175
+ return true;
176
+ }
177
+ var engine = scene.getEngine();
178
+ // Attribs
179
+ MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);
180
+ // Get correct effect
181
+ if (defines.isDirty) {
182
+ defines.markAsProcessed();
183
+ scene.resetCachedMaterial();
184
+ // Fallbacks
185
+ var fallbacks = new EffectFallbacks();
186
+ if (defines.FOG) {
187
+ fallbacks.addFallback(1, "FOG");
188
+ }
189
+ MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);
190
+ defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
191
+ //Attributes
192
+ var attribs = [VertexBuffer.PositionKind];
193
+ if (defines.NORMAL) {
194
+ attribs.push(VertexBuffer.NormalKind);
195
+ }
196
+ if (defines.UV1) {
197
+ attribs.push(VertexBuffer.UVKind);
198
+ }
199
+ if (defines.UV2) {
200
+ attribs.push(VertexBuffer.UV2Kind);
201
+ }
202
+ if (defines.VERTEXCOLOR) {
203
+ attribs.push(VertexBuffer.ColorKind);
204
+ }
205
+ if (defines.TANGENT) {
206
+ attribs.push(VertexBuffer.TangentKind);
207
+ }
208
+ MaterialHelper.PrepareAttributesForInstances(attribs, defines);
209
+ // Legacy browser patch
210
+ var shaderName = "fluentBackplate";
211
+ var join = defines.toString();
212
+ var uniforms = [
213
+ "world",
214
+ "viewProjection",
215
+ "cameraPosition",
216
+ "_Radius_",
217
+ "_Line_Width_",
218
+ "_Absolute_Sizes_",
219
+ "_Filter_Width_",
220
+ "_Base_Color_",
221
+ "_Line_Color_",
222
+ "_Radius_Top_Left_",
223
+ "_Radius_Top_Right_",
224
+ "_Radius_Bottom_Left_",
225
+ "_Radius_Bottom_Right_",
226
+ "_Blob_Position_",
227
+ "_Blob_Intensity_",
228
+ "_Blob_Near_Size_",
229
+ "_Blob_Far_Size_",
230
+ "_Blob_Near_Distance_",
231
+ "_Blob_Far_Distance_",
232
+ "_Blob_Fade_Length_",
233
+ "_Blob_Pulse_",
234
+ "_Blob_Fade_",
235
+ "_Blob_Texture_",
236
+ "_Blob_Position_2_",
237
+ "_Blob_Near_Size_2_",
238
+ "_Blob_Pulse_2_",
239
+ "_Blob_Fade_2_",
240
+ "_Rate_",
241
+ "_Highlight_Color_",
242
+ "_Highlight_Width_",
243
+ "_Highlight_Transform_",
244
+ "_Highlight_",
245
+ "_Iridescence_Intensity_",
246
+ "_Iridescence_Edge_Intensity_",
247
+ "_Angle_",
248
+ "_Fade_Out_",
249
+ "_Reflected_",
250
+ "_Frequency_",
251
+ "_Vertical_Offset_",
252
+ "_Iridescent_Map_",
253
+ "_Use_Global_Left_Index_",
254
+ "_Use_Global_Right_Index_",
255
+ "Global_Left_Index_Tip_Position",
256
+ "Global_Right_Index_Tip_Position",
257
+ ];
258
+ var samplers = ["_Blob_Texture_", "_Iridescent_Map_"];
259
+ var uniformBuffers = new Array();
260
+ MaterialHelper.PrepareUniformsAndSamplersList({
261
+ uniformsNames: uniforms,
262
+ uniformBuffersNames: uniformBuffers,
263
+ samplers: samplers,
264
+ defines: defines,
265
+ maxSimultaneousLights: 4,
266
+ });
267
+ subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
268
+ attributes: attribs,
269
+ uniformsNames: uniforms,
270
+ uniformBuffersNames: uniformBuffers,
271
+ samplers: samplers,
272
+ defines: join,
273
+ fallbacks: fallbacks,
274
+ onCompiled: this.onCompiled,
275
+ onError: this.onError,
276
+ indexParameters: { maxSimultaneousLights: 4 },
277
+ }, engine), defines, this._materialContext);
278
+ }
279
+ if (!subMesh.effect || !subMesh.effect.isReady()) {
280
+ return false;
281
+ }
282
+ defines._renderId = scene.getRenderId();
283
+ subMesh.effect._wasPreviouslyReady = true;
284
+ return true;
285
+ };
286
+ FluentBackplateMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
287
+ var _a, _b;
288
+ var defines = subMesh.materialDefines;
289
+ if (!defines) {
290
+ return;
291
+ }
292
+ var effect = subMesh.effect;
293
+ if (!effect) {
294
+ return;
295
+ }
296
+ this._activeEffect = effect;
297
+ // Matrices
298
+ this.bindOnlyWorldMatrix(world);
299
+ this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
300
+ this._activeEffect.setVector3("cameraPosition", (_b = (_a = this.getScene().activeCamera) === null || _a === void 0 ? void 0 : _a.position) !== null && _b !== void 0 ? _b : Vector3.ZeroReadOnly);
301
+ // "Round Rect"
302
+ this._activeEffect.setFloat("_Radius_", this.radius);
303
+ this._activeEffect.setFloat("_Line_Width_", this.lineWidth);
304
+ this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1.0 : 0.0);
305
+ this._activeEffect.setFloat("_Filter_Width_", this._filterWidth);
306
+ this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor);
307
+ this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor);
308
+ // "Radii Multipliers"
309
+ this._activeEffect.setFloat("_Radius_Top_Left_", 1);
310
+ this._activeEffect.setFloat("_Radius_Top_Right_", 1.0);
311
+ this._activeEffect.setFloat("_Radius_Bottom_Left_", 1.0);
312
+ this._activeEffect.setFloat("_Radius_Bottom_Right_", 1.0);
313
+ // "Blob"
314
+ //define BLOB_ENABLE true;
315
+ this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
316
+ this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize);
317
+ this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
318
+ this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
319
+ this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
320
+ this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
321
+ this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse);
322
+ this._activeEffect.setFloat("_Blob_Fade_", this.blobFade);
323
+ // "Blob Texture"
324
+ this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture);
325
+ // "Blob 2"
326
+ //define BLOB_ENABLE_2 true;
327
+ this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2);
328
+ this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2);
329
+ this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2);
330
+ // "Line Highlight"
331
+ this._activeEffect.setFloat("_Rate_", this._rate);
332
+ this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor);
333
+ this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth);
334
+ this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform);
335
+ this._activeEffect.setFloat("_Highlight_", this._highlight);
336
+ // "Iridescence"
337
+ this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
338
+ this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity);
339
+ this._activeEffect.setFloat("_Angle_", this._angle);
340
+ // "Fade"
341
+ this._activeEffect.setFloat("_Fade_Out_", this.fadeOut);
342
+ // "Antialiasing"
343
+ //define SMOOTH_EDGES true;
344
+ // "ChooseAngle"
345
+ this._activeEffect.setFloat("_Reflected_", this._reflected ? 1.0 : 0.0);
346
+ // "Multiply"
347
+ this._activeEffect.setFloat("_Frequency_", this._frequency);
348
+ this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset);
349
+ // "Color Texture"
350
+ //define IRIDESCENT_MAP_ENABLE true;
351
+ this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMap);
352
+ // "Global"
353
+ this._activeEffect.setFloat("_Use_Global_Left_Index_", 1.0);
354
+ this._activeEffect.setFloat("_Use_Global_Right_Index_", 1.0);
355
+ this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1.0);
356
+ this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this._globalLeftIndexTipPosition4);
357
+ this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1.0);
358
+ this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this._globalRightIndexTipPosition4);
359
+ this._afterBind(mesh, this._activeEffect);
360
+ };
361
+ /**
362
+ * Get the list of animatables in the material.
363
+ * @returns the list of animatables object used in the material
364
+ */
365
+ FluentBackplateMaterial.prototype.getAnimatables = function () {
366
+ return [];
367
+ };
368
+ FluentBackplateMaterial.prototype.dispose = function (forceDisposeEffect) {
369
+ _super.prototype.dispose.call(this, forceDisposeEffect);
370
+ this._blobTexture.dispose();
371
+ this._iridescentMap.dispose();
372
+ };
373
+ FluentBackplateMaterial.prototype.clone = function (name) {
374
+ var _this = this;
375
+ return SerializationHelper.Clone(function () { return new FluentBackplateMaterial(name, _this.getScene()); }, this);
376
+ };
377
+ FluentBackplateMaterial.prototype.serialize = function () {
378
+ var serializationObject = _super.prototype.serialize.call(this);
379
+ serializationObject.customType = "BABYLON.FluentBackplateMaterial";
380
+ return serializationObject;
381
+ };
382
+ FluentBackplateMaterial.prototype.getClassName = function () {
383
+ return "FluentBackplateMaterial";
384
+ };
385
+ // Statics
386
+ FluentBackplateMaterial.Parse = function (source, scene, rootUrl) {
387
+ return SerializationHelper.Parse(function () { return new FluentBackplateMaterial(source.name, scene); }, source, scene, rootUrl);
388
+ };
389
+ /**
390
+ * URL pointing to the texture used to define the coloring for the fluent blob effect.
391
+ */
392
+ FluentBackplateMaterial.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-blob.png";
393
+ /**
394
+ * URL pointing to the texture used to define iridescent map.
395
+ */
396
+ FluentBackplateMaterial.IM_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-iridescence.png";
397
+ __decorate([
398
+ serialize()
399
+ ], FluentBackplateMaterial.prototype, "radius", void 0);
400
+ __decorate([
401
+ serialize()
402
+ ], FluentBackplateMaterial.prototype, "lineWidth", void 0);
403
+ __decorate([
404
+ serialize()
405
+ ], FluentBackplateMaterial.prototype, "absoluteSizes", void 0);
406
+ __decorate([
407
+ serialize()
408
+ ], FluentBackplateMaterial.prototype, "baseColor", void 0);
409
+ __decorate([
410
+ serialize()
411
+ ], FluentBackplateMaterial.prototype, "lineColor", void 0);
412
+ __decorate([
413
+ serialize()
414
+ ], FluentBackplateMaterial.prototype, "blobIntensity", void 0);
415
+ __decorate([
416
+ serialize()
417
+ ], FluentBackplateMaterial.prototype, "blobFarSize", void 0);
418
+ __decorate([
419
+ serialize()
420
+ ], FluentBackplateMaterial.prototype, "blobNearDistance", void 0);
421
+ __decorate([
422
+ serialize()
423
+ ], FluentBackplateMaterial.prototype, "blobFarDistance", void 0);
424
+ __decorate([
425
+ serialize()
426
+ ], FluentBackplateMaterial.prototype, "blobFadeLength", void 0);
427
+ __decorate([
428
+ serialize()
429
+ ], FluentBackplateMaterial.prototype, "blobNearSize", void 0);
430
+ __decorate([
431
+ serialize()
432
+ ], FluentBackplateMaterial.prototype, "blobPulse", void 0);
433
+ __decorate([
434
+ serialize()
435
+ ], FluentBackplateMaterial.prototype, "blobFade", void 0);
436
+ __decorate([
437
+ serialize()
438
+ ], FluentBackplateMaterial.prototype, "blobNearSize2", void 0);
439
+ __decorate([
440
+ serialize()
441
+ ], FluentBackplateMaterial.prototype, "blobPulse2", void 0);
442
+ __decorate([
443
+ serialize()
444
+ ], FluentBackplateMaterial.prototype, "blobFade2", void 0);
445
+ __decorate([
446
+ serialize()
447
+ ], FluentBackplateMaterial.prototype, "highlightColor", void 0);
448
+ __decorate([
449
+ serialize()
450
+ ], FluentBackplateMaterial.prototype, "highlightWidth", void 0);
451
+ __decorate([
452
+ serialize()
453
+ ], FluentBackplateMaterial.prototype, "iridescenceIntensity", void 0);
454
+ __decorate([
455
+ serialize()
456
+ ], FluentBackplateMaterial.prototype, "iridescenceEdgeIntensity", void 0);
457
+ __decorate([
458
+ serialize()
459
+ ], FluentBackplateMaterial.prototype, "fadeOut", void 0);
460
+ __decorate([
461
+ serializeAsVector3()
462
+ ], FluentBackplateMaterial.prototype, "globalLeftIndexTipPosition", void 0);
463
+ __decorate([
464
+ serializeAsVector3()
465
+ ], FluentBackplateMaterial.prototype, "globalRightIndexTipPosition", void 0);
466
+ return FluentBackplateMaterial;
467
+ }(PushMaterial));
468
+ export { FluentBackplateMaterial };
469
+ RegisterClass("BABYLON.GUI.FluentBackplateMaterial", FluentBackplateMaterial);
470
470
  //# sourceMappingURL=fluentBackplateMaterial.js.map