@babylonjs/gui 5.0.0-beta.9 → 5.0.0-rc.10

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 (305) hide show
  1. package/2D/adtInstrumentation.d.ts +52 -52
  2. package/2D/adtInstrumentation.js +126 -126
  3. package/2D/adtInstrumentation.js.map +1 -1
  4. package/2D/advancedDynamicTexture.d.ts +449 -412
  5. package/2D/advancedDynamicTexture.js +1318 -1239
  6. package/2D/advancedDynamicTexture.js.map +1 -1
  7. package/2D/controls/button.d.ts +135 -97
  8. package/2D/controls/button.js +276 -238
  9. package/2D/controls/button.js.map +1 -1
  10. package/2D/controls/checkbox.d.ts +59 -51
  11. package/2D/controls/checkbox.js +188 -178
  12. package/2D/controls/checkbox.js.map +1 -1
  13. package/2D/controls/colorpicker.d.ts +103 -90
  14. package/2D/controls/colorpicker.js +1417 -1400
  15. package/2D/controls/colorpicker.js.map +1 -1
  16. package/2D/controls/container.d.ts +175 -130
  17. package/2D/controls/container.js +570 -525
  18. package/2D/controls/container.js.map +1 -1
  19. package/2D/controls/control.d.ts +866 -743
  20. package/2D/controls/control.js +2433 -2308
  21. package/2D/controls/control.js.map +1 -1
  22. package/2D/controls/displayGrid.d.ts +53 -55
  23. package/2D/controls/displayGrid.js +245 -245
  24. package/2D/controls/displayGrid.js.map +1 -1
  25. package/2D/controls/ellipse.d.ts +21 -21
  26. package/2D/controls/ellipse.js +85 -85
  27. package/2D/controls/ellipse.js.map +1 -1
  28. package/2D/controls/focusableButton.d.ts +59 -52
  29. package/2D/controls/focusableButton.js +99 -92
  30. package/2D/controls/focusableButton.js.map +1 -1
  31. package/2D/controls/focusableControl.d.ts +34 -34
  32. package/2D/controls/focusableControl.js +1 -1
  33. package/2D/controls/focusableControl.js.map +1 -1
  34. package/2D/controls/grid.d.ts +139 -135
  35. package/2D/controls/grid.js +529 -525
  36. package/2D/controls/grid.js.map +1 -1
  37. package/2D/controls/image.d.ts +204 -197
  38. package/2D/controls/image.js +887 -879
  39. package/2D/controls/image.js.map +1 -1
  40. package/2D/controls/index.d.ts +29 -29
  41. package/2D/controls/index.js +29 -29
  42. package/2D/controls/index.js.map +1 -1
  43. package/2D/controls/inputPassword.d.ts +9 -8
  44. package/2D/controls/inputPassword.js +28 -25
  45. package/2D/controls/inputPassword.js.map +1 -1
  46. package/2D/controls/inputText.d.ts +201 -180
  47. package/2D/controls/inputText.js +1119 -1095
  48. package/2D/controls/inputText.js.map +1 -1
  49. package/2D/controls/line.d.ts +66 -66
  50. package/2D/controls/line.js +271 -271
  51. package/2D/controls/line.js.map +1 -1
  52. package/2D/controls/multiLine.d.ts +75 -77
  53. package/2D/controls/multiLine.js +262 -262
  54. package/2D/controls/multiLine.js.map +1 -1
  55. package/2D/controls/radioButton.d.ts +49 -49
  56. package/2D/controls/radioButton.js +205 -205
  57. package/2D/controls/radioButton.js.map +1 -1
  58. package/2D/controls/rectangle.d.ts +29 -29
  59. package/2D/controls/rectangle.js +150 -150
  60. package/2D/controls/rectangle.js.map +1 -1
  61. package/2D/controls/scrollViewers/scrollViewer.d.ts +182 -175
  62. package/2D/controls/scrollViewers/scrollViewer.js +677 -676
  63. package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
  64. package/2D/controls/scrollViewers/scrollViewerWindow.d.ts +57 -45
  65. package/2D/controls/scrollViewers/scrollViewerWindow.js +278 -263
  66. package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
  67. package/2D/controls/selector.d.ts +263 -209
  68. package/2D/controls/selector.js +692 -629
  69. package/2D/controls/selector.js.map +1 -1
  70. package/2D/controls/sliders/baseSlider.d.ts +82 -78
  71. package/2D/controls/sliders/baseSlider.js +347 -343
  72. package/2D/controls/sliders/baseSlider.js.map +1 -1
  73. package/2D/controls/sliders/imageBasedSlider.d.ts +49 -47
  74. package/2D/controls/sliders/imageBasedSlider.js +192 -188
  75. package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
  76. package/2D/controls/sliders/imageScrollBar.d.ts +65 -61
  77. package/2D/controls/sliders/imageScrollBar.js +263 -256
  78. package/2D/controls/sliders/imageScrollBar.js.map +1 -1
  79. package/2D/controls/sliders/scrollBar.d.ts +38 -34
  80. package/2D/controls/sliders/scrollBar.js +143 -136
  81. package/2D/controls/sliders/scrollBar.js.map +1 -1
  82. package/2D/controls/sliders/slider.d.ts +35 -37
  83. package/2D/controls/sliders/slider.js +271 -271
  84. package/2D/controls/sliders/slider.js.map +1 -1
  85. package/2D/controls/stackPanel.d.ts +64 -56
  86. package/2D/controls/stackPanel.js +246 -236
  87. package/2D/controls/stackPanel.js.map +1 -1
  88. package/2D/controls/statics.d.ts +6 -6
  89. package/2D/controls/statics.js +49 -47
  90. package/2D/controls/statics.js.map +1 -1
  91. package/2D/controls/textBlock.d.ts +175 -171
  92. package/2D/controls/textBlock.js +603 -588
  93. package/2D/controls/textBlock.js.map +1 -1
  94. package/2D/controls/textWrapper.d.ts +13 -13
  95. package/2D/controls/textWrapper.js +101 -101
  96. package/2D/controls/textWrapper.js.map +1 -1
  97. package/2D/controls/toggleButton.d.ts +117 -83
  98. package/2D/controls/toggleButton.js +268 -234
  99. package/2D/controls/toggleButton.js.map +1 -1
  100. package/2D/controls/virtualKeyboard.d.ts +96 -96
  101. package/2D/controls/virtualKeyboard.js +256 -256
  102. package/2D/controls/virtualKeyboard.js.map +1 -1
  103. package/2D/index.d.ts +9 -9
  104. package/2D/index.js +10 -9
  105. package/2D/index.js.map +1 -1
  106. package/2D/math2D.d.ts +117 -117
  107. package/2D/math2D.js +221 -221
  108. package/2D/math2D.js.map +1 -1
  109. package/2D/measure.d.ts +77 -77
  110. package/2D/measure.js +139 -149
  111. package/2D/measure.js.map +1 -1
  112. package/2D/multiLinePoint.d.ts +47 -47
  113. package/2D/multiLinePoint.js +127 -127
  114. package/2D/multiLinePoint.js.map +1 -1
  115. package/2D/style.d.ts +46 -46
  116. package/2D/style.js +97 -97
  117. package/2D/style.js.map +1 -1
  118. package/2D/valueAndUnit.d.ts +89 -89
  119. package/2D/valueAndUnit.js +226 -222
  120. package/2D/valueAndUnit.js.map +1 -1
  121. package/2D/xmlLoader.d.ts +60 -60
  122. package/2D/xmlLoader.js +348 -341
  123. package/2D/xmlLoader.js.map +1 -1
  124. package/3D/behaviors/defaultBehavior.d.ts +73 -73
  125. package/3D/behaviors/defaultBehavior.js +121 -121
  126. package/3D/behaviors/defaultBehavior.js.map +1 -1
  127. package/3D/controls/abstractButton3D.d.ts +15 -15
  128. package/3D/controls/abstractButton3D.js +25 -25
  129. package/3D/controls/abstractButton3D.js.map +1 -1
  130. package/3D/controls/button3D.d.ts +30 -30
  131. package/3D/controls/button3D.js +93 -93
  132. package/3D/controls/button3D.js.map +1 -1
  133. package/3D/controls/container3D.d.ts +72 -72
  134. package/3D/controls/container3D.js +139 -140
  135. package/3D/controls/container3D.js.map +1 -1
  136. package/3D/controls/contentDisplay3D.d.ts +30 -30
  137. package/3D/controls/contentDisplay3D.js +79 -78
  138. package/3D/controls/contentDisplay3D.js.map +1 -1
  139. package/3D/controls/control3D.d.ts +201 -165
  140. package/3D/controls/control3D.js +445 -408
  141. package/3D/controls/control3D.js.map +1 -1
  142. package/3D/controls/cylinderPanel.d.ts +17 -17
  143. package/3D/controls/cylinderPanel.js +66 -66
  144. package/3D/controls/cylinderPanel.js.map +1 -1
  145. package/3D/controls/handMenu.d.ts +28 -28
  146. package/3D/controls/handMenu.js +47 -47
  147. package/3D/controls/handMenu.js.map +1 -1
  148. package/3D/controls/holographicBackplate.d.ts +49 -48
  149. package/3D/controls/holographicBackplate.js +120 -120
  150. package/3D/controls/holographicBackplate.js.map +1 -1
  151. package/3D/controls/holographicButton.d.ts +84 -83
  152. package/3D/controls/holographicButton.js +339 -338
  153. package/3D/controls/holographicButton.js.map +1 -1
  154. package/3D/controls/holographicSlate.d.ts +131 -118
  155. package/3D/controls/holographicSlate.js +431 -369
  156. package/3D/controls/holographicSlate.js.map +1 -1
  157. package/3D/controls/index.d.ts +21 -21
  158. package/3D/controls/index.js +21 -21
  159. package/3D/controls/index.js.map +1 -1
  160. package/3D/controls/meshButton3D.d.ts +21 -21
  161. package/3D/controls/meshButton3D.js +62 -61
  162. package/3D/controls/meshButton3D.js.map +1 -1
  163. package/3D/controls/nearMenu.d.ts +44 -44
  164. package/3D/controls/nearMenu.js +114 -112
  165. package/3D/controls/nearMenu.js.map +1 -1
  166. package/3D/controls/planePanel.d.ts +9 -9
  167. package/3D/controls/planePanel.js +36 -36
  168. package/3D/controls/planePanel.js.map +1 -1
  169. package/3D/controls/scatterPanel.d.ts +18 -18
  170. package/3D/controls/scatterPanel.js +108 -108
  171. package/3D/controls/scatterPanel.js.map +1 -1
  172. package/3D/controls/slider3D.d.ts +81 -80
  173. package/3D/controls/slider3D.js +268 -267
  174. package/3D/controls/slider3D.js.map +1 -1
  175. package/3D/controls/spherePanel.d.ts +17 -17
  176. package/3D/controls/spherePanel.js +67 -67
  177. package/3D/controls/spherePanel.js.map +1 -1
  178. package/3D/controls/stackPanel3D.d.ts +22 -22
  179. package/3D/controls/stackPanel3D.js +107 -107
  180. package/3D/controls/stackPanel3D.js.map +1 -1
  181. package/3D/controls/touchButton3D.d.ts +80 -64
  182. package/3D/controls/touchButton3D.js +233 -188
  183. package/3D/controls/touchButton3D.js.map +1 -1
  184. package/3D/controls/touchHolographicButton.d.ts +110 -104
  185. package/3D/controls/touchHolographicButton.js +445 -432
  186. package/3D/controls/touchHolographicButton.js.map +1 -1
  187. package/3D/controls/touchHolographicMenu.d.ts +61 -61
  188. package/3D/controls/touchHolographicMenu.js +149 -148
  189. package/3D/controls/touchHolographicMenu.js.map +1 -1
  190. package/3D/controls/touchMeshButton3D.d.ts +21 -22
  191. package/3D/controls/touchMeshButton3D.js +62 -62
  192. package/3D/controls/touchMeshButton3D.js.map +1 -1
  193. package/3D/controls/volumeBasedPanel.d.ts +53 -52
  194. package/3D/controls/volumeBasedPanel.js +174 -174
  195. package/3D/controls/volumeBasedPanel.js.map +1 -1
  196. package/3D/gizmos/gizmoHandle.d.ts +108 -108
  197. package/3D/gizmos/gizmoHandle.js +209 -209
  198. package/3D/gizmos/gizmoHandle.js.map +1 -1
  199. package/3D/gizmos/index.d.ts +2 -2
  200. package/3D/gizmos/index.js +2 -2
  201. package/3D/gizmos/index.js.map +1 -1
  202. package/3D/gizmos/slateGizmo.d.ts +57 -59
  203. package/3D/gizmos/slateGizmo.js +369 -363
  204. package/3D/gizmos/slateGizmo.js.map +1 -1
  205. package/3D/gui3DManager.d.ts +94 -94
  206. package/3D/gui3DManager.js +257 -257
  207. package/3D/gui3DManager.js.map +1 -1
  208. package/3D/index.d.ts +5 -5
  209. package/3D/index.js +6 -5
  210. package/3D/index.js.map +1 -1
  211. package/3D/materials/fluent/fluentMaterial.d.ts +91 -90
  212. package/3D/materials/fluent/fluentMaterial.js +292 -281
  213. package/3D/materials/fluent/fluentMaterial.js.map +1 -1
  214. package/3D/materials/fluent/index.d.ts +1 -1
  215. package/3D/materials/fluent/index.js +1 -1
  216. package/3D/materials/fluent/index.js.map +1 -1
  217. package/3D/materials/fluent/shaders/fluent.fragment.d.ts +5 -5
  218. package/3D/materials/fluent/shaders/fluent.fragment.js +8 -6
  219. package/3D/materials/fluent/shaders/fluent.fragment.js.map +1 -1
  220. package/3D/materials/fluent/shaders/fluent.vertex.d.ts +5 -5
  221. package/3D/materials/fluent/shaders/fluent.vertex.js +8 -6
  222. package/3D/materials/fluent/shaders/fluent.vertex.js.map +1 -1
  223. package/3D/materials/fluentBackplate/fluentBackplateMaterial.d.ts +155 -154
  224. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +469 -434
  225. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  226. package/3D/materials/fluentBackplate/index.d.ts +1 -1
  227. package/3D/materials/fluentBackplate/index.js +1 -1
  228. package/3D/materials/fluentBackplate/index.js.map +1 -1
  229. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.d.ts +5 -5
  230. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +8 -6
  231. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js.map +1 -1
  232. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.d.ts +5 -5
  233. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +8 -6
  234. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js.map +1 -1
  235. package/3D/materials/fluentButton/fluentButtonMaterial.d.ts +190 -189
  236. package/3D/materials/fluentButton/fluentButtonMaterial.js +539 -537
  237. package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
  238. package/3D/materials/fluentButton/index.d.ts +1 -1
  239. package/3D/materials/fluentButton/index.js +1 -1
  240. package/3D/materials/fluentButton/index.js.map +1 -1
  241. package/3D/materials/fluentButton/shaders/fluentButton.fragment.d.ts +5 -5
  242. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +8 -6
  243. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js.map +1 -1
  244. package/3D/materials/fluentButton/shaders/fluentButton.vertex.d.ts +5 -5
  245. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +8 -6
  246. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js.map +1 -1
  247. package/3D/materials/fluentMaterial.d.ts +4 -4
  248. package/3D/materials/fluentMaterial.js +4 -4
  249. package/3D/materials/fluentMaterial.js.map +1 -1
  250. package/3D/materials/handle/handleMaterial.d.ts +68 -68
  251. package/3D/materials/handle/handleMaterial.js +126 -126
  252. package/3D/materials/handle/handleMaterial.js.map +1 -1
  253. package/3D/materials/handle/index.d.ts +1 -1
  254. package/3D/materials/handle/index.js +1 -1
  255. package/3D/materials/handle/index.js.map +1 -1
  256. package/3D/materials/handle/shaders/handle.fragment.d.ts +5 -5
  257. package/3D/materials/handle/shaders/handle.fragment.js +8 -6
  258. package/3D/materials/handle/shaders/handle.fragment.js.map +1 -1
  259. package/3D/materials/handle/shaders/handle.vertex.d.ts +5 -5
  260. package/3D/materials/handle/shaders/handle.vertex.js +8 -6
  261. package/3D/materials/handle/shaders/handle.vertex.js.map +1 -1
  262. package/3D/materials/index.d.ts +5 -5
  263. package/3D/materials/index.js +6 -5
  264. package/3D/materials/index.js.map +1 -1
  265. package/3D/materials/mrdl/index.d.ts +3 -3
  266. package/3D/materials/mrdl/index.js +3 -3
  267. package/3D/materials/mrdl/index.js.map +1 -1
  268. package/3D/materials/mrdl/mrdlBackplateMaterial.d.ts +148 -147
  269. package/3D/materials/mrdl/mrdlBackplateMaterial.js +436 -409
  270. package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
  271. package/3D/materials/mrdl/mrdlSliderBarMaterial.d.ts +334 -333
  272. package/3D/materials/mrdl/mrdlSliderBarMaterial.js +851 -786
  273. package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
  274. package/3D/materials/mrdl/mrdlSliderThumbMaterial.d.ts +334 -333
  275. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +851 -786
  276. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
  277. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.d.ts +5 -5
  278. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +8 -6
  279. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js.map +1 -1
  280. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.d.ts +5 -5
  281. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +8 -6
  282. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js.map +1 -1
  283. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.d.ts +5 -5
  284. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +8 -6
  285. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js.map +1 -1
  286. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.d.ts +5 -5
  287. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +8 -6
  288. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js.map +1 -1
  289. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.d.ts +5 -5
  290. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +8 -6
  291. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js.map +1 -1
  292. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.d.ts +5 -5
  293. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +8 -6
  294. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js.map +1 -1
  295. package/3D/vector3WithInfo.d.ts +16 -16
  296. package/3D/vector3WithInfo.js +23 -23
  297. package/3D/vector3WithInfo.js.map +1 -1
  298. package/index.d.ts +2 -2
  299. package/index.js +3 -2
  300. package/index.js.map +1 -1
  301. package/legacy/legacy.d.ts +1 -1
  302. package/legacy/legacy.js +14 -13
  303. package/legacy/legacy.js.map +1 -1
  304. package/package.json +21 -328
  305. package/readme.md +2 -2
@@ -1,435 +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 desgin
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, useInstances) {
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", "viewProjection", "cameraPosition",
214
- "_Radius_", "_Line_Width_", "_Absolute_Sizes_", "_Filter_Width_", "_Base_Color_", "_Line_Color_",
215
- "_Radius_Top_Left_", "_Radius_Top_Right_", "_Radius_Bottom_Left_", "_Radius_Bottom_Right_",
216
- "_Blob_Position_", "_Blob_Intensity_", "_Blob_Near_Size_", "_Blob_Far_Size_", "_Blob_Near_Distance_",
217
- "_Blob_Far_Distance_", "_Blob_Fade_Length_", "_Blob_Pulse_", "_Blob_Fade_", "_Blob_Texture_",
218
- "_Blob_Position_2_", "_Blob_Near_Size_2_", "_Blob_Pulse_2_", "_Blob_Fade_2_", "_Rate_", "_Highlight_Color_",
219
- "_Highlight_Width_", "_Highlight_Transform_", "_Highlight_", "_Iridescence_Intensity_", "_Iridescence_Edge_Intensity_",
220
- "_Angle_", "_Fade_Out_", "_Reflected_", "_Frequency_", "_Vertical_Offset_", "_Iridescent_Map_",
221
- "_Use_Global_Left_Index_", "_Use_Global_Right_Index_", "Global_Left_Index_Tip_Position", "Global_Right_Index_Tip_Position"
222
- ];
223
- var samplers = ["_Blob_Texture_", "_Iridescent_Map_"];
224
- var uniformBuffers = new Array();
225
- MaterialHelper.PrepareUniformsAndSamplersList({
226
- uniformsNames: uniforms,
227
- uniformBuffersNames: uniformBuffers,
228
- samplers: samplers,
229
- defines: defines,
230
- maxSimultaneousLights: 4
231
- });
232
- subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
233
- attributes: attribs,
234
- uniformsNames: uniforms,
235
- uniformBuffersNames: uniformBuffers,
236
- samplers: samplers,
237
- defines: join,
238
- fallbacks: fallbacks,
239
- onCompiled: this.onCompiled,
240
- onError: this.onError,
241
- indexParameters: { maxSimultaneousLights: 4 }
242
- }, engine), defines, this._materialContext);
243
- }
244
- if (!subMesh.effect || !subMesh.effect.isReady()) {
245
- return false;
246
- }
247
- defines._renderId = scene.getRenderId();
248
- subMesh.effect._wasPreviouslyReady = true;
249
- return true;
250
- };
251
- FluentBackplateMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
252
- var _a, _b;
253
- var defines = subMesh.materialDefines;
254
- if (!defines) {
255
- return;
256
- }
257
- var effect = subMesh.effect;
258
- if (!effect) {
259
- return;
260
- }
261
- this._activeEffect = effect;
262
- // Matrices
263
- this.bindOnlyWorldMatrix(world);
264
- this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
265
- this._activeEffect.setVector3("cameraPosition", (_b = (_a = this.getScene().activeCamera) === null || _a === void 0 ? void 0 : _a.position) !== null && _b !== void 0 ? _b : Vector3.ZeroReadOnly);
266
- // "Round Rect"
267
- this._activeEffect.setFloat("_Radius_", this.radius);
268
- this._activeEffect.setFloat("_Line_Width_", this.lineWidth);
269
- this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1.0 : 0.0);
270
- this._activeEffect.setFloat("_Filter_Width_", this._filterWidth);
271
- this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor);
272
- this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor);
273
- // "Radii Multipliers"
274
- this._activeEffect.setFloat("_Radius_Top_Left_", 1);
275
- this._activeEffect.setFloat("_Radius_Top_Right_", 1.0);
276
- this._activeEffect.setFloat("_Radius_Bottom_Left_", 1.0);
277
- this._activeEffect.setFloat("_Radius_Bottom_Right_", 1.0);
278
- // "Blob"
279
- //define BLOB_ENABLE true;
280
- this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
281
- this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize);
282
- this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
283
- this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
284
- this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
285
- this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
286
- this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse);
287
- this._activeEffect.setFloat("_Blob_Fade_", this.blobFade);
288
- // "Blob Texture"
289
- this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture);
290
- // "Blob 2"
291
- //define BLOB_ENABLE_2 true;
292
- this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2);
293
- this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2);
294
- this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2);
295
- // "Line Highlight"
296
- this._activeEffect.setFloat("_Rate_", this._rate);
297
- this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor);
298
- this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth);
299
- this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform);
300
- this._activeEffect.setFloat("_Highlight_", this._highlight);
301
- // "Iridescence"
302
- this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
303
- this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity);
304
- this._activeEffect.setFloat("_Angle_", this._angle);
305
- // "Fade"
306
- this._activeEffect.setFloat("_Fade_Out_", this.fadeOut);
307
- // "Antialiasing"
308
- //define SMOOTH_EDGES true;
309
- // "ChooseAngle"
310
- this._activeEffect.setFloat("_Reflected_", this._reflected ? 1.0 : 0.0);
311
- // "Multiply"
312
- this._activeEffect.setFloat("_Frequency_", this._frequency);
313
- this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset);
314
- // "Color Texture"
315
- //define IRIDESCENT_MAP_ENABLE true;
316
- this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMap);
317
- // "Global"
318
- this._activeEffect.setFloat("_Use_Global_Left_Index_", 1.0);
319
- this._activeEffect.setFloat("_Use_Global_Right_Index_", 1.0);
320
- this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1.0);
321
- this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this._globalLeftIndexTipPosition4);
322
- this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1.0);
323
- this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this._globalRightIndexTipPosition4);
324
- this._afterBind(mesh, this._activeEffect);
325
- };
326
- /**
327
- * Get the list of animatables in the material.
328
- * @returns the list of animatables object used in the material
329
- */
330
- FluentBackplateMaterial.prototype.getAnimatables = function () {
331
- return [];
332
- };
333
- FluentBackplateMaterial.prototype.dispose = function (forceDisposeEffect) {
334
- _super.prototype.dispose.call(this, forceDisposeEffect);
335
- this._blobTexture.dispose();
336
- this._iridescentMap.dispose();
337
- };
338
- FluentBackplateMaterial.prototype.clone = function (name) {
339
- var _this = this;
340
- return SerializationHelper.Clone(function () { return new FluentBackplateMaterial(name, _this.getScene()); }, this);
341
- };
342
- FluentBackplateMaterial.prototype.serialize = function () {
343
- var serializationObject = _super.prototype.serialize.call(this);
344
- serializationObject.customType = "BABYLON.FluentBackplateMaterial";
345
- return serializationObject;
346
- };
347
- FluentBackplateMaterial.prototype.getClassName = function () {
348
- return "FluentBackplateMaterial";
349
- };
350
- // Statics
351
- FluentBackplateMaterial.Parse = function (source, scene, rootUrl) {
352
- return SerializationHelper.Parse(function () { return new FluentBackplateMaterial(source.name, scene); }, source, scene, rootUrl);
353
- };
354
- /**
355
- * URL pointing to the texture used to define the coloring for the fluent blob effect.
356
- */
357
- FluentBackplateMaterial.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-blob.png";
358
- /**
359
- * URL pointing to the texture used to define iridescent map.
360
- */
361
- FluentBackplateMaterial.IM_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/mrtk-fluent-backplate-iridescence.png";
362
- __decorate([
363
- serialize()
364
- ], FluentBackplateMaterial.prototype, "radius", void 0);
365
- __decorate([
366
- serialize()
367
- ], FluentBackplateMaterial.prototype, "lineWidth", void 0);
368
- __decorate([
369
- serialize()
370
- ], FluentBackplateMaterial.prototype, "absoluteSizes", void 0);
371
- __decorate([
372
- serialize()
373
- ], FluentBackplateMaterial.prototype, "baseColor", void 0);
374
- __decorate([
375
- serialize()
376
- ], FluentBackplateMaterial.prototype, "lineColor", void 0);
377
- __decorate([
378
- serialize()
379
- ], FluentBackplateMaterial.prototype, "blobIntensity", void 0);
380
- __decorate([
381
- serialize()
382
- ], FluentBackplateMaterial.prototype, "blobFarSize", void 0);
383
- __decorate([
384
- serialize()
385
- ], FluentBackplateMaterial.prototype, "blobNearDistance", void 0);
386
- __decorate([
387
- serialize()
388
- ], FluentBackplateMaterial.prototype, "blobFarDistance", void 0);
389
- __decorate([
390
- serialize()
391
- ], FluentBackplateMaterial.prototype, "blobFadeLength", void 0);
392
- __decorate([
393
- serialize()
394
- ], FluentBackplateMaterial.prototype, "blobNearSize", void 0);
395
- __decorate([
396
- serialize()
397
- ], FluentBackplateMaterial.prototype, "blobPulse", void 0);
398
- __decorate([
399
- serialize()
400
- ], FluentBackplateMaterial.prototype, "blobFade", void 0);
401
- __decorate([
402
- serialize()
403
- ], FluentBackplateMaterial.prototype, "blobNearSize2", void 0);
404
- __decorate([
405
- serialize()
406
- ], FluentBackplateMaterial.prototype, "blobPulse2", void 0);
407
- __decorate([
408
- serialize()
409
- ], FluentBackplateMaterial.prototype, "blobFade2", void 0);
410
- __decorate([
411
- serialize()
412
- ], FluentBackplateMaterial.prototype, "highlightColor", void 0);
413
- __decorate([
414
- serialize()
415
- ], FluentBackplateMaterial.prototype, "highlightWidth", void 0);
416
- __decorate([
417
- serialize()
418
- ], FluentBackplateMaterial.prototype, "iridescenceIntensity", void 0);
419
- __decorate([
420
- serialize()
421
- ], FluentBackplateMaterial.prototype, "iridescenceEdgeIntensity", void 0);
422
- __decorate([
423
- serialize()
424
- ], FluentBackplateMaterial.prototype, "fadeOut", void 0);
425
- __decorate([
426
- serializeAsVector3()
427
- ], FluentBackplateMaterial.prototype, "globalLeftIndexTipPosition", void 0);
428
- __decorate([
429
- serializeAsVector3()
430
- ], FluentBackplateMaterial.prototype, "globalRightIndexTipPosition", void 0);
431
- return FluentBackplateMaterial;
432
- }(PushMaterial));
433
- export { FluentBackplateMaterial };
434
- 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);
435
470
  //# sourceMappingURL=fluentBackplateMaterial.js.map