@babylonjs/gui 5.0.0-rc.1 → 5.0.0-rc.12

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 (306) 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 -423
  5. package/2D/advancedDynamicTexture.js +1318 -1286
  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 -182
  47. package/2D/controls/inputText.js +1119 -1096
  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 -172
  92. package/2D/controls/textBlock.js +603 -598
  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 -348
  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 -128
  155. package/3D/controls/holographicSlate.js +431 -428
  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 -81
  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 -75
  182. package/3D/controls/touchButton3D.js +233 -227
  183. package/3D/controls/touchButton3D.js.map +1 -1
  184. package/3D/controls/touchHolographicButton.d.ts +110 -109
  185. package/3D/controls/touchHolographicButton.js +445 -445
  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 -57
  203. package/3D/gizmos/slateGizmo.js +369 -369
  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/license.md +71 -0
  305. package/package.json +37 -325
  306. package/readme.md +2 -2
@@ -1,787 +1,852 @@
1
- import { __decorate, __extends } from "tslib";
2
- import { SerializationHelper, serialize } from "@babylonjs/core/Misc/decorators.js";
3
- import { Vector2, 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/mrdlSliderBar.fragment.js";
14
- import "./shaders/mrdlSliderBar.vertex.js";
15
- /** @hidden */
16
- var MRDLSliderBarMaterialDefines = /** @class */ (function (_super) {
17
- __extends(MRDLSliderBarMaterialDefines, _super);
18
- function MRDLSliderBarMaterialDefines() {
19
- var _this = _super.call(this) || this;
20
- /*
21
- "SKY_ENABLED", "BLOB_ENABLE_2", "IRIDESCENCE_ENABLED"
22
- */
23
- _this.SKY_ENABLED = true;
24
- _this.BLOB_ENABLE_2 = true;
25
- _this.IRIDESCENCE_ENABLED = true;
26
- _this._needNormals = true;
27
- _this._needUVs = true;
28
- _this.rebuild();
29
- return _this;
30
- }
31
- return MRDLSliderBarMaterialDefines;
32
- }(MaterialDefines));
33
- /**
34
- * Class used to render Slider Bar material with MRDL
35
- */
36
- var MRDLSliderBarMaterial = /** @class */ (function (_super) {
37
- __extends(MRDLSliderBarMaterial, _super);
38
- function MRDLSliderBarMaterial(name, scene) {
39
- var _this = _super.call(this, name, scene) || this;
40
- /**
41
- * Gets or sets the corner Radius on the slider bar.
42
- */
43
- _this.radius = 0.6;
44
- /**
45
- * Gets or sets the Bevel Front on the slider bar.
46
- */
47
- _this.bevelFront = 0.6;
48
- /**
49
- * Gets or sets the Bevel Front Stretch on the slider bar.
50
- */
51
- _this.bevelFrontStretch = 0.077;
52
- /**
53
- * Gets or sets the Bevel Back on the slider bar.
54
- */
55
- _this.bevelBack = 0;
56
- /**
57
- * Gets or sets the Bevel Back Stretch on the slider bar.
58
- */
59
- _this.bevelBackStretch = 0;
60
- /**
61
- * Gets or sets the top left Radii Multiplier.
62
- */
63
- _this.radiusTopLeft = 1.0;
64
- /**
65
- * Gets or sets the top left Radii Multiplier.
66
- */
67
- _this.radiusTopRight = 1.0;
68
- /**
69
- * Gets or sets the top left Radii Multiplier.
70
- */
71
- _this.radiusBottomLeft = 1.0;
72
- /**
73
- * Gets or sets the top left Radii Multiplier.
74
- */
75
- _this.radiusBottomRight = 1.0;
76
- /**
77
- * Gets or sets whether Bulge is enabled.
78
- * Default is false.
79
- */
80
- _this.bulgeEnabled = false;
81
- /**
82
- * Gets or sets the Bulge Height.
83
- */
84
- _this.bulgeHeight = -0.323;
85
- /**
86
- * Gets or sets the Bulge Radius.
87
- */
88
- _this.bulgeRadius = 0.73;
89
- /**
90
- * Gets or sets the Sun Intensity.
91
- */
92
- _this.sunIntensity = 1.102;
93
- /**
94
- * Gets or sets the Sun Theta.
95
- */
96
- _this.sunTheta = 0.76;
97
- /**
98
- * Gets or sets the Sun Phi.
99
- */
100
- _this.sunPhi = 0.526;
101
- /**
102
- * Gets or sets the Indirect Diffuse.
103
- */
104
- _this.indirectDiffuse = 0.658;
105
- /**
106
- * Gets or sets the base albedo.
107
- */
108
- _this.albedo = new Color4(0.0117647, 0.505882, 0.996078, 1);
109
- /**
110
- * Gets or sets the Specular value.
111
- */
112
- _this.specular = 0;
113
- /**
114
- * Gets or sets the Shininess value.
115
- */
116
- _this.shininess = 10;
117
- /**
118
- * Gets or sets the Sharpness value.
119
- */
120
- _this.sharpness = 0;
121
- /**
122
- * Gets or sets the Subsurface value.
123
- */
124
- _this.subsurface = 0;
125
- /**
126
- * Gets or sets the left gradient color.
127
- */
128
- _this.leftGradientColor = new Color4(0.0117647, 0.505882, 0.996078, 1);
129
- /**
130
- * Gets or sets the right gradient color.
131
- */
132
- _this.rightGradientColor = new Color4(0.0117647, 0.505882, 0.996078, 1);
133
- /**
134
- * Gets or sets the reflection value.
135
- */
136
- _this.reflection = 0.749;
137
- /**
138
- * Gets or sets the front reflect value.
139
- */
140
- _this.frontReflect = 0;
141
- /**
142
- * Gets or sets the edge reflect value.
143
- */
144
- _this.edgeReflect = 0.09;
145
- /**
146
- * Gets or sets the power value.
147
- */
148
- _this.power = 8.13;
149
- /**
150
- * Gets or sets the sky color.
151
- */
152
- _this.skyColor = new Color4(0.0117647, 0.964706, 0.996078, 1);
153
- /**
154
- * Gets or sets the horizon color.
155
- */
156
- _this.horizonColor = new Color4(0.0117647, 0.333333, 0.996078, 1);
157
- /**
158
- * Gets or sets the ground color.
159
- */
160
- _this.groundColor = new Color4(0, 0.254902, 0.996078, 1);
161
- /**
162
- * Gets or sets the horizon power value.
163
- */
164
- _this.horizonPower = 1;
165
- /**
166
- * Gets or sets the finger occlusion width value.
167
- */
168
- _this.width = 0.02;
169
- /**
170
- * Gets or sets the finger occlusion fuzz value.
171
- */
172
- _this.fuzz = 0.5;
173
- /**
174
- * Gets or sets the minimum finger occlusion fuzz value.
175
- */
176
- _this.minFuzz = 0.001;
177
- /**
178
- * Gets or sets the finger occlusion clip fade value.
179
- */
180
- _this.clipFade = 0.01;
181
- /**
182
- * Gets or sets the hue shift value.
183
- */
184
- _this.hueShift = 0;
185
- /**
186
- * Gets or sets the saturation shift value.
187
- */
188
- _this.saturationShift = 0;
189
- /**
190
- * Gets or sets the value shift.
191
- */
192
- _this.valueShift = 0;
193
- /**
194
- * Gets or sets the position of the hover glow effect.
195
- */
196
- _this.blobPosition = new Vector3(0, 0, 0.1);
197
- /**
198
- * Gets or sets the intensity of the hover glow effect.
199
- */
200
- _this.blobIntensity = 0.5;
201
- /**
202
- * Gets or sets the near size of the hover glow effect.
203
- */
204
- _this.blobNearSize = 0.01;
205
- /**
206
- * Gets or sets the far size of the hover glow effect.
207
- */
208
- _this.blobFarSize = 0.03;
209
- /**
210
- * Gets or sets the distance considered "near" to the mesh, which controls the size of the hover glow effect (see blobNearSize).
211
- */
212
- _this.blobNearDistance = 0;
213
- /**
214
- * Gets or sets the distance considered "far" from the mesh, which controls the size of the hover glow effect (see blobFarSize).
215
- */
216
- _this.blobFarDistance = 0.08;
217
- /**
218
- * Gets or sets the length of the hover glow effect fade.
219
- */
220
- _this.blobFadeLength = 0.576;
221
- /**
222
- * Gets or sets the progress of the hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).
223
- */
224
- _this.blobPulse = 0;
225
- /**
226
- * Gets or sets the opacity of the hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.
227
- */
228
- _this.blobFade = 1;
229
- /**
230
- * Gets or sets the position of the hover glow effect.
231
- */
232
- _this.blobPosition2 = new Vector3(0.2, 0, 0.1);
233
- /**
234
- * Gets or sets the size of the hover glow effect when the right pointer is considered "near" to the mesh (see blobNearDistance).
235
- */
236
- _this.blobNearSize2 = 0.01;
237
- /**
238
- * Gets or sets the progress of the hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).
239
- */
240
- _this.blobPulse2 = 0;
241
- /**
242
- * Gets or sets the opacity of the hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 1.
243
- */
244
- _this.blobFade2 = 1;
245
- /**
246
- * Gets or sets the texture of the hover glow effect.
247
- */
248
- _this.blobTexture = new Texture("", _this.getScene());
249
- /**
250
- * Gets or sets the finger position for left index.
251
- */
252
- _this.leftIndexPosition = new Vector3(0, 0, 1);
253
- /**
254
- * Gets or sets the finger position for right index.
255
- */
256
- _this.rightIndexPosition = new Vector3(-1, -1, -1);
257
- /**
258
- * Gets or sets the finger position for left index middle position.
259
- */
260
- _this.leftIndexMiddlePosition = new Vector3(0, 0, 0);
261
- /**
262
- * Gets or sets the finger position for right index middle position.
263
- */
264
- _this.rightIndexMiddlePosition = new Vector3(0, 0, 0);
265
- /**
266
- * Gets or sets the Decal Scle for XY.
267
- */
268
- _this.decalScaleXY = new Vector2(1.5, 1.5);
269
- /**
270
- * Gets or sets decalFrontOnly
271
- * Default is true
272
- */
273
- _this.decalFrontOnly = true;
274
- /**
275
- * Gets or sets the Rim Light intensity.
276
- */
277
- _this.rimIntensity = 0.287;
278
- /**
279
- * Gets or sets the Rim Light hue shift value.
280
- */
281
- _this.rimHueShift = 0;
282
- /**
283
- * Gets or sets the Rim Light saturation shift value.
284
- */
285
- _this.rimSaturationShift = 0;
286
- /**
287
- * Gets or sets the Rim Light value shift.
288
- */
289
- _this.rimValueShift = -1;
290
- /**
291
- * Gets or sets the intensity of the iridescence effect.
292
- */
293
- _this.iridescenceIntensity = 0;
294
- /**
295
- * @hidden
296
- */
297
- _this.useGlobalLeftIndex = 1.0;
298
- /**
299
- * @hidden
300
- */
301
- _this.useGlobalRightIndex = 1.0;
302
- /**
303
- * @hidden
304
- */
305
- _this.globalLeftIndexTipProximity = 0.0;
306
- /**
307
- * @hidden
308
- */
309
- _this.globalRightIndexTipProximity = 0.0;
310
- /**
311
- * @hidden
312
- */
313
- _this.globalLeftIndexTipPosition = new Vector4(0.5, 0.0, -0.55, 1.0);
314
- /**
315
- * @hidden
316
- */
317
- _this.globaRightIndexTipPosition = new Vector4(0.0, 0.0, 0.0, 1.0);
318
- /**
319
- * @hidden
320
- */
321
- _this.globalLeftThumbTipPosition = new Vector4(0.5, 0.0, -0.55, 1.0);
322
- /**
323
- * @hidden
324
- */
325
- _this.globalRightThumbTipPosition = new Vector4(0.0, 0.0, 0.0, 1.0);
326
- /**
327
- * @hidden
328
- */
329
- _this.globalLeftIndexMiddlePosition = new Vector4(0.5, 0.0, -0.55, 1.0);
330
- /**
331
- * @hidden
332
- */
333
- _this.globalRightIndexMiddlePosition = new Vector4(0.0, 0.0, 0.0, 1.0);
334
- _this.alphaMode = Constants.ALPHA_DISABLE;
335
- _this.backFaceCulling = false;
336
- _this._blueGradientTexture = new Texture(MRDLSliderBarMaterial.BLUE_GRADIENT_TEXTURE_URL, _this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
337
- return _this;
338
- }
339
- MRDLSliderBarMaterial.prototype.needAlphaBlending = function () {
340
- return false;
341
- };
342
- MRDLSliderBarMaterial.prototype.needAlphaTesting = function () {
343
- return false;
344
- };
345
- MRDLSliderBarMaterial.prototype.getAlphaTestTexture = function () {
346
- return null;
347
- };
348
- // Methods
349
- MRDLSliderBarMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh, useInstances) {
350
- if (this.isFrozen) {
351
- if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
352
- return true;
353
- }
354
- }
355
- if (!subMesh.materialDefines) {
356
- subMesh.materialDefines = new MRDLSliderBarMaterialDefines();
357
- }
358
- var defines = subMesh.materialDefines;
359
- var scene = this.getScene();
360
- if (this._isReadyForSubMesh(subMesh)) {
361
- return true;
362
- }
363
- var engine = scene.getEngine();
364
- // Attribs
365
- MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);
366
- // Get correct effect
367
- if (defines.isDirty) {
368
- defines.markAsProcessed();
369
- scene.resetCachedMaterial();
370
- // Fallbacks
371
- var fallbacks = new EffectFallbacks();
372
- if (defines.FOG) {
373
- fallbacks.addFallback(1, "FOG");
374
- }
375
- MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);
376
- defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
377
- //Attributes
378
- var attribs = [VertexBuffer.PositionKind];
379
- if (defines.NORMAL) {
380
- attribs.push(VertexBuffer.NormalKind);
381
- }
382
- if (defines.UV1) {
383
- attribs.push(VertexBuffer.UVKind);
384
- }
385
- if (defines.UV2) {
386
- attribs.push(VertexBuffer.UV2Kind);
387
- }
388
- if (defines.VERTEXCOLOR) {
389
- attribs.push(VertexBuffer.ColorKind);
390
- }
391
- if (defines.TANGENT) {
392
- attribs.push(VertexBuffer.TangentKind);
393
- }
394
- MaterialHelper.PrepareAttributesForInstances(attribs, defines);
395
- // Legacy browser patch
396
- var shaderName = "mrdlSliderBar";
397
- var join = defines.toString();
398
- var uniforms = [
399
- "world", "viewProjection", "cameraPosition",
400
- "_Radius_", "_Bevel_Front_", "_Bevel_Front_Stretch_", "_Bevel_Back_", "_Bevel_Back_Stretch_",
401
- "_Radius_Top_Left_", "_Radius_Top_Right_", "_Radius_Bottom_Left_", "_Radius_Bottom_Right_",
402
- "_Bulge_Enabled_", "_Bulge_Height_", "_Bulge_Radius_", "_Sun_Intensity_", "_Sun_Theta_", "_Sun_Phi_",
403
- "_Indirect_Diffuse_", "_Albedo_", "_Specular_", "_Shininess_", "_Sharpness_", "_Subsurface_",
404
- "_Left_Color_", "_Right_Color_", "_Reflection_", "_Front_Reflect_", "_Edge_Reflect_", "_Power_",
405
- "_Sky_Color_", "_Horizon_Color_", "_Ground_Color_", "_Horizon_Power_", "_Reflection_Map_",
406
- "_Indirect_Environment_", "_Width_", "_Fuzz_", "_Min_Fuzz_", "_Clip_Fade_", "_Hue_Shift_", "_Saturation_Shift_",
407
- "_Value_Shift_", "_Blob_Position_", "_Blob_Intensity_", "_Blob_Near_Size_", "_Blob_Far_Size_",
408
- "_Blob_Near_Distance_", "_Blob_Far_Distance_", "_Blob_Fade_Length_", "_Blob_Pulse_", "_Blob_Fade_",
409
- "_Blob_Texture_", "_Blob_Position_2_", "_Blob_Near_Size_2_", "_Blob_Pulse_2_", "_Blob_Fade_2_",
410
- "_Left_Index_Pos_", "_Right_Index_Pos_", "_Left_Index_Middle_Pos_", "_Right_Index_Middle_Pos_",
411
- "_Decal_", "_Decal_Scale_XY_", "_Decal_Front_Only_", "_Rim_Intensity_", "_Rim_Texture_", "_Rim_Hue_Shift_",
412
- "_Rim_Saturation_Shift_", "_Rim_Value_Shift_", "_Iridescence_Intensity_", "_Iridescence_Texture_",
413
- "Use_Global_Left_Index", "Use_Global_Right_Index", "Global_Left_Index_Tip_Position", "Global_Right_Index_Tip_Position",
414
- "Global_Left_Thumb_Tip_Position", "Global_Right_Thumb_Tip_Position", "Global_Left_Index_Middle_Position;", "Global_Right_Index_Middle_Position", "Global_Left_Index_Tip_Proximity", "Global_Right_Index_Tip_Proximity"
415
- ];
416
- var samplers = ["_Rim_Texture_", "_Iridescence_Texture_"];
417
- var uniformBuffers = new Array();
418
- MaterialHelper.PrepareUniformsAndSamplersList({
419
- uniformsNames: uniforms,
420
- uniformBuffersNames: uniformBuffers,
421
- samplers: samplers,
422
- defines: defines,
423
- maxSimultaneousLights: 4
424
- });
425
- subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
426
- attributes: attribs,
427
- uniformsNames: uniforms,
428
- uniformBuffersNames: uniformBuffers,
429
- samplers: samplers,
430
- defines: join,
431
- fallbacks: fallbacks,
432
- onCompiled: this.onCompiled,
433
- onError: this.onError,
434
- indexParameters: { maxSimultaneousLights: 4 }
435
- }, engine), defines, this._materialContext);
436
- }
437
- if (!subMesh.effect || !subMesh.effect.isReady()) {
438
- return false;
439
- }
440
- defines._renderId = scene.getRenderId();
441
- subMesh.effect._wasPreviouslyReady = true;
442
- return true;
443
- };
444
- MRDLSliderBarMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
445
- var defines = subMesh.materialDefines;
446
- if (!defines) {
447
- return;
448
- }
449
- var effect = subMesh.effect;
450
- if (!effect) {
451
- return;
452
- }
453
- this._activeEffect = effect;
454
- // Matrices
455
- this.bindOnlyWorldMatrix(world);
456
- this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
457
- this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position);
458
- // "Round Rect"
459
- this._activeEffect.setFloat("_Radius_", this.radius);
460
- this._activeEffect.setFloat("_Bevel_Front_", this.bevelFront);
461
- this._activeEffect.setFloat("_Bevel_Front_Stretch_", this.bevelFrontStretch);
462
- this._activeEffect.setFloat("_Bevel_Back_", this.bevelBack);
463
- this._activeEffect.setFloat("_Bevel_Back_Stretch_", this.bevelBackStretch);
464
- // "Radii Multipliers"
465
- this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft);
466
- this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight);
467
- this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft);
468
- this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight);
469
- // "Bulge"
470
- this._activeEffect.setFloat("_Bulge_Enabled_", this.bulgeEnabled ? 1.0 : 0.0);
471
- this._activeEffect.setFloat("_Bulge_Height_", this.bulgeHeight);
472
- this._activeEffect.setFloat("_Bulge_Radius_", this.bulgeRadius);
473
- // "Sun"
474
- this._activeEffect.setFloat("_Sun_Intensity_", this.sunIntensity);
475
- this._activeEffect.setFloat("_Sun_Theta_", this.sunTheta);
476
- this._activeEffect.setFloat("_Sun_Phi_", this.sunPhi);
477
- this._activeEffect.setFloat("_Indirect_Diffuse_", this.indirectDiffuse);
478
- // "Diffuse And Specular"
479
- this._activeEffect.setDirectColor4("_Albedo_", this.albedo);
480
- this._activeEffect.setFloat("_Specular_", this.specular);
481
- this._activeEffect.setFloat("_Shininess_", this.shininess);
482
- this._activeEffect.setFloat("_Sharpness_", this.sharpness);
483
- this._activeEffect.setFloat("_Subsurface_", this.subsurface);
484
- // "Gradient"
485
- this._activeEffect.setDirectColor4("_Left_Color_", this.leftGradientColor);
486
- this._activeEffect.setDirectColor4("_Right_Color_", this.rightGradientColor);
487
- // "Reflection"
488
- this._activeEffect.setFloat("_Reflection_", this.reflection);
489
- this._activeEffect.setFloat("_Front_Reflect_", this.frontReflect);
490
- this._activeEffect.setFloat("_Edge_Reflect_", this.edgeReflect);
491
- this._activeEffect.setFloat("_Power_", this.power);
492
- // "Sky Environment"
493
- //define SKY_ENABLED true;
494
- this._activeEffect.setDirectColor4("_Sky_Color_", this.skyColor);
495
- this._activeEffect.setDirectColor4("_Horizon_Color_", this.horizonColor);
496
- this._activeEffect.setDirectColor4("_Ground_Color_", this.groundColor);
497
- this._activeEffect.setFloat("_Horizon_Power_", this.horizonPower);
498
- // "Mapped Environment"
499
- //define ENV_ENABLE false;
500
- this._activeEffect.setTexture("_Reflection_Map_", new Texture("", this.getScene()));
501
- this._activeEffect.setTexture("_Indirect_Environment_", new Texture("", this.getScene()));
502
- // "FingerOcclusion"
503
- //define OCCLUSION_ENABLED false;
504
- this._activeEffect.setFloat("_Width_", this.width);
505
- this._activeEffect.setFloat("_Fuzz_", this.fuzz);
506
- this._activeEffect.setFloat("_Min_Fuzz_", this.minFuzz);
507
- this._activeEffect.setFloat("_Clip_Fade_", this.clipFade);
508
- // "View Based Color Shift"
509
- this._activeEffect.setFloat("_Hue_Shift_", this.hueShift);
510
- this._activeEffect.setFloat("_Saturation_Shift_", this.saturationShift);
511
- this._activeEffect.setFloat("_Value_Shift_", this.valueShift);
512
- // "Blob"
513
- //define BLOB_ENABLE false;
514
- this._activeEffect.setVector3("_Blob_Position_", this.blobPosition);
515
- this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
516
- this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize);
517
- this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
518
- this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
519
- this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
520
- this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
521
- this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse);
522
- this._activeEffect.setFloat("_Blob_Fade_", this.blobFade);
523
- // "Blob Texture"
524
- this._activeEffect.setTexture("_Blob_Texture_", this.blobTexture);
525
- // "Blob 2"
526
- //define BLOB_ENABLE_2 true;
527
- this._activeEffect.setVector3("_Blob_Position_2_", this.blobPosition2);
528
- this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2);
529
- this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2);
530
- this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2);
531
- // "Finger Positions"
532
- this._activeEffect.setVector3("_Left_Index_Pos_", this.leftIndexPosition);
533
- this._activeEffect.setVector3("_Right_Index_Pos_", this.rightIndexPosition);
534
- this._activeEffect.setVector3("_Left_Index_Middle_Pos_", this.leftIndexMiddlePosition);
535
- this._activeEffect.setVector3("_Right_Index_Middle_Pos_", this.rightIndexMiddlePosition);
536
- // "Decal Texture"
537
- //define DECAL_ENABLE false;
538
- this._activeEffect.setTexture("_Decal_", new Texture("", this.getScene()));
539
- this._activeEffect.setVector2("_Decal_Scale_XY_", this.decalScaleXY);
540
- this._activeEffect.setFloat("_Decal_Front_Only_", this.decalFrontOnly ? 1.0 : 0.0);
541
- // "Rim Light"
542
- this._activeEffect.setFloat("_Rim_Intensity_", this.rimIntensity);
543
- this._activeEffect.setTexture("_Rim_Texture_", this._blueGradientTexture);
544
- this._activeEffect.setFloat("_Rim_Hue_Shift_", this.rimHueShift);
545
- this._activeEffect.setFloat("_Rim_Saturation_Shift_", this.rimSaturationShift);
546
- this._activeEffect.setFloat("_Rim_Value_Shift_", this.rimValueShift);
547
- // "Iridescence"
548
- //define IRIDESCENCE_ENABLED true;
549
- this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
550
- this._activeEffect.setTexture("_Iridescence_Texture_", this._blueGradientTexture);
551
- // Global inputs
552
- this._activeEffect.setFloat("Use_Global_Left_Index", this.useGlobalLeftIndex);
553
- this._activeEffect.setFloat("Use_Global_Right_Index", this.useGlobalRightIndex);
554
- this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this.globalLeftIndexTipPosition);
555
- this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this.globaRightIndexTipPosition);
556
- this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position", this.globalLeftThumbTipPosition);
557
- this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position", this.globalRightThumbTipPosition);
558
- this._activeEffect.setVector4("Global_Left_Index_Middle_Position", this.globalLeftIndexMiddlePosition);
559
- this._activeEffect.setVector4("Global_Right_Index_Middle_Position", this.globalRightIndexMiddlePosition);
560
- this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity", this.globalLeftIndexTipProximity);
561
- this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity", this.globalRightIndexTipProximity);
562
- this._afterBind(mesh, this._activeEffect);
563
- };
564
- /**
565
- * Get the list of animatables in the material.
566
- * @returns the list of animatables object used in the material
567
- */
568
- MRDLSliderBarMaterial.prototype.getAnimatables = function () {
569
- return [];
570
- };
571
- MRDLSliderBarMaterial.prototype.dispose = function (forceDisposeEffect) {
572
- _super.prototype.dispose.call(this, forceDisposeEffect);
573
- };
574
- MRDLSliderBarMaterial.prototype.clone = function (name) {
575
- var _this = this;
576
- return SerializationHelper.Clone(function () { return new MRDLSliderBarMaterial(name, _this.getScene()); }, this);
577
- };
578
- MRDLSliderBarMaterial.prototype.serialize = function () {
579
- var serializationObject = _super.prototype.serialize.call(this);
580
- serializationObject.customType = "BABYLON.MRDLSliderBarMaterial";
581
- return serializationObject;
582
- };
583
- MRDLSliderBarMaterial.prototype.getClassName = function () {
584
- return "MRDLSliderBarMaterial";
585
- };
586
- // Statics
587
- MRDLSliderBarMaterial.Parse = function (source, scene, rootUrl) {
588
- return SerializationHelper.Parse(function () { return new MRDLSliderBarMaterial(source.name, scene); }, source, scene, rootUrl);
589
- };
590
- /**
591
- * URL pointing to the texture used to define the coloring for the Iridescent Map effect.
592
- */
593
- MRDLSliderBarMaterial.BLUE_GRADIENT_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png";
594
- __decorate([
595
- serialize()
596
- ], MRDLSliderBarMaterial.prototype, "radius", void 0);
597
- __decorate([
598
- serialize()
599
- ], MRDLSliderBarMaterial.prototype, "bevelFront", void 0);
600
- __decorate([
601
- serialize()
602
- ], MRDLSliderBarMaterial.prototype, "bevelFrontStretch", void 0);
603
- __decorate([
604
- serialize()
605
- ], MRDLSliderBarMaterial.prototype, "bevelBack", void 0);
606
- __decorate([
607
- serialize()
608
- ], MRDLSliderBarMaterial.prototype, "bevelBackStretch", void 0);
609
- __decorate([
610
- serialize()
611
- ], MRDLSliderBarMaterial.prototype, "radiusTopLeft", void 0);
612
- __decorate([
613
- serialize()
614
- ], MRDLSliderBarMaterial.prototype, "radiusTopRight", void 0);
615
- __decorate([
616
- serialize()
617
- ], MRDLSliderBarMaterial.prototype, "radiusBottomLeft", void 0);
618
- __decorate([
619
- serialize()
620
- ], MRDLSliderBarMaterial.prototype, "radiusBottomRight", void 0);
621
- __decorate([
622
- serialize()
623
- ], MRDLSliderBarMaterial.prototype, "bulgeEnabled", void 0);
624
- __decorate([
625
- serialize()
626
- ], MRDLSliderBarMaterial.prototype, "bulgeHeight", void 0);
627
- __decorate([
628
- serialize()
629
- ], MRDLSliderBarMaterial.prototype, "bulgeRadius", void 0);
630
- __decorate([
631
- serialize()
632
- ], MRDLSliderBarMaterial.prototype, "sunIntensity", void 0);
633
- __decorate([
634
- serialize()
635
- ], MRDLSliderBarMaterial.prototype, "sunTheta", void 0);
636
- __decorate([
637
- serialize()
638
- ], MRDLSliderBarMaterial.prototype, "sunPhi", void 0);
639
- __decorate([
640
- serialize()
641
- ], MRDLSliderBarMaterial.prototype, "indirectDiffuse", void 0);
642
- __decorate([
643
- serialize()
644
- ], MRDLSliderBarMaterial.prototype, "albedo", void 0);
645
- __decorate([
646
- serialize()
647
- ], MRDLSliderBarMaterial.prototype, "specular", void 0);
648
- __decorate([
649
- serialize()
650
- ], MRDLSliderBarMaterial.prototype, "shininess", void 0);
651
- __decorate([
652
- serialize()
653
- ], MRDLSliderBarMaterial.prototype, "sharpness", void 0);
654
- __decorate([
655
- serialize()
656
- ], MRDLSliderBarMaterial.prototype, "subsurface", void 0);
657
- __decorate([
658
- serialize()
659
- ], MRDLSliderBarMaterial.prototype, "leftGradientColor", void 0);
660
- __decorate([
661
- serialize()
662
- ], MRDLSliderBarMaterial.prototype, "rightGradientColor", void 0);
663
- __decorate([
664
- serialize()
665
- ], MRDLSliderBarMaterial.prototype, "reflection", void 0);
666
- __decorate([
667
- serialize()
668
- ], MRDLSliderBarMaterial.prototype, "frontReflect", void 0);
669
- __decorate([
670
- serialize()
671
- ], MRDLSliderBarMaterial.prototype, "edgeReflect", void 0);
672
- __decorate([
673
- serialize()
674
- ], MRDLSliderBarMaterial.prototype, "power", void 0);
675
- __decorate([
676
- serialize()
677
- ], MRDLSliderBarMaterial.prototype, "skyColor", void 0);
678
- __decorate([
679
- serialize()
680
- ], MRDLSliderBarMaterial.prototype, "horizonColor", void 0);
681
- __decorate([
682
- serialize()
683
- ], MRDLSliderBarMaterial.prototype, "groundColor", void 0);
684
- __decorate([
685
- serialize()
686
- ], MRDLSliderBarMaterial.prototype, "horizonPower", void 0);
687
- __decorate([
688
- serialize()
689
- ], MRDLSliderBarMaterial.prototype, "width", void 0);
690
- __decorate([
691
- serialize()
692
- ], MRDLSliderBarMaterial.prototype, "fuzz", void 0);
693
- __decorate([
694
- serialize()
695
- ], MRDLSliderBarMaterial.prototype, "minFuzz", void 0);
696
- __decorate([
697
- serialize()
698
- ], MRDLSliderBarMaterial.prototype, "clipFade", void 0);
699
- __decorate([
700
- serialize()
701
- ], MRDLSliderBarMaterial.prototype, "hueShift", void 0);
702
- __decorate([
703
- serialize()
704
- ], MRDLSliderBarMaterial.prototype, "saturationShift", void 0);
705
- __decorate([
706
- serialize()
707
- ], MRDLSliderBarMaterial.prototype, "valueShift", void 0);
708
- __decorate([
709
- serialize()
710
- ], MRDLSliderBarMaterial.prototype, "blobPosition", void 0);
711
- __decorate([
712
- serialize()
713
- ], MRDLSliderBarMaterial.prototype, "blobIntensity", void 0);
714
- __decorate([
715
- serialize()
716
- ], MRDLSliderBarMaterial.prototype, "blobNearSize", void 0);
717
- __decorate([
718
- serialize()
719
- ], MRDLSliderBarMaterial.prototype, "blobFarSize", void 0);
720
- __decorate([
721
- serialize()
722
- ], MRDLSliderBarMaterial.prototype, "blobNearDistance", void 0);
723
- __decorate([
724
- serialize()
725
- ], MRDLSliderBarMaterial.prototype, "blobFarDistance", void 0);
726
- __decorate([
727
- serialize()
728
- ], MRDLSliderBarMaterial.prototype, "blobFadeLength", void 0);
729
- __decorate([
730
- serialize()
731
- ], MRDLSliderBarMaterial.prototype, "blobPulse", void 0);
732
- __decorate([
733
- serialize()
734
- ], MRDLSliderBarMaterial.prototype, "blobFade", void 0);
735
- __decorate([
736
- serialize()
737
- ], MRDLSliderBarMaterial.prototype, "blobPosition2", void 0);
738
- __decorate([
739
- serialize()
740
- ], MRDLSliderBarMaterial.prototype, "blobNearSize2", void 0);
741
- __decorate([
742
- serialize()
743
- ], MRDLSliderBarMaterial.prototype, "blobPulse2", void 0);
744
- __decorate([
745
- serialize()
746
- ], MRDLSliderBarMaterial.prototype, "blobFade2", void 0);
747
- __decorate([
748
- serialize()
749
- ], MRDLSliderBarMaterial.prototype, "blobTexture", void 0);
750
- __decorate([
751
- serialize()
752
- ], MRDLSliderBarMaterial.prototype, "leftIndexPosition", void 0);
753
- __decorate([
754
- serialize()
755
- ], MRDLSliderBarMaterial.prototype, "rightIndexPosition", void 0);
756
- __decorate([
757
- serialize()
758
- ], MRDLSliderBarMaterial.prototype, "leftIndexMiddlePosition", void 0);
759
- __decorate([
760
- serialize()
761
- ], MRDLSliderBarMaterial.prototype, "rightIndexMiddlePosition", void 0);
762
- __decorate([
763
- serialize()
764
- ], MRDLSliderBarMaterial.prototype, "decalScaleXY", void 0);
765
- __decorate([
766
- serialize()
767
- ], MRDLSliderBarMaterial.prototype, "decalFrontOnly", void 0);
768
- __decorate([
769
- serialize()
770
- ], MRDLSliderBarMaterial.prototype, "rimIntensity", void 0);
771
- __decorate([
772
- serialize()
773
- ], MRDLSliderBarMaterial.prototype, "rimHueShift", void 0);
774
- __decorate([
775
- serialize()
776
- ], MRDLSliderBarMaterial.prototype, "rimSaturationShift", void 0);
777
- __decorate([
778
- serialize()
779
- ], MRDLSliderBarMaterial.prototype, "rimValueShift", void 0);
780
- __decorate([
781
- serialize()
782
- ], MRDLSliderBarMaterial.prototype, "iridescenceIntensity", void 0);
783
- return MRDLSliderBarMaterial;
784
- }(PushMaterial));
785
- export { MRDLSliderBarMaterial };
786
- RegisterClass("BABYLON.GUI.MRDLSliderBarMaterial", MRDLSliderBarMaterial);
1
+ import { __decorate, __extends } from "tslib";
2
+ import { SerializationHelper, serialize } from "@babylonjs/core/Misc/decorators.js";
3
+ import { Vector2, 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/mrdlSliderBar.fragment";
14
+ import "./shaders/mrdlSliderBar.vertex";
15
+ /** @hidden */
16
+ var MRDLSliderBarMaterialDefines = /** @class */ (function (_super) {
17
+ __extends(MRDLSliderBarMaterialDefines, _super);
18
+ function MRDLSliderBarMaterialDefines() {
19
+ var _this = _super.call(this) || this;
20
+ /*
21
+ "SKY_ENABLED", "BLOB_ENABLE_2", "IRIDESCENCE_ENABLED"
22
+ */
23
+ _this.SKY_ENABLED = true;
24
+ _this.BLOB_ENABLE_2 = true;
25
+ _this.IRIDESCENCE_ENABLED = true;
26
+ _this._needNormals = true;
27
+ _this._needUVs = true;
28
+ _this.rebuild();
29
+ return _this;
30
+ }
31
+ return MRDLSliderBarMaterialDefines;
32
+ }(MaterialDefines));
33
+ /**
34
+ * Class used to render Slider Bar material with MRDL
35
+ */
36
+ var MRDLSliderBarMaterial = /** @class */ (function (_super) {
37
+ __extends(MRDLSliderBarMaterial, _super);
38
+ function MRDLSliderBarMaterial(name, scene) {
39
+ var _this = _super.call(this, name, scene) || this;
40
+ /**
41
+ * Gets or sets the corner Radius on the slider bar.
42
+ */
43
+ _this.radius = 0.6;
44
+ /**
45
+ * Gets or sets the Bevel Front on the slider bar.
46
+ */
47
+ _this.bevelFront = 0.6;
48
+ /**
49
+ * Gets or sets the Bevel Front Stretch on the slider bar.
50
+ */
51
+ _this.bevelFrontStretch = 0.077;
52
+ /**
53
+ * Gets or sets the Bevel Back on the slider bar.
54
+ */
55
+ _this.bevelBack = 0;
56
+ /**
57
+ * Gets or sets the Bevel Back Stretch on the slider bar.
58
+ */
59
+ _this.bevelBackStretch = 0;
60
+ /**
61
+ * Gets or sets the top left Radii Multiplier.
62
+ */
63
+ _this.radiusTopLeft = 1.0;
64
+ /**
65
+ * Gets or sets the top left Radii Multiplier.
66
+ */
67
+ _this.radiusTopRight = 1.0;
68
+ /**
69
+ * Gets or sets the top left Radii Multiplier.
70
+ */
71
+ _this.radiusBottomLeft = 1.0;
72
+ /**
73
+ * Gets or sets the top left Radii Multiplier.
74
+ */
75
+ _this.radiusBottomRight = 1.0;
76
+ /**
77
+ * Gets or sets whether Bulge is enabled.
78
+ * Default is false.
79
+ */
80
+ _this.bulgeEnabled = false;
81
+ /**
82
+ * Gets or sets the Bulge Height.
83
+ */
84
+ _this.bulgeHeight = -0.323;
85
+ /**
86
+ * Gets or sets the Bulge Radius.
87
+ */
88
+ _this.bulgeRadius = 0.73;
89
+ /**
90
+ * Gets or sets the Sun Intensity.
91
+ */
92
+ _this.sunIntensity = 1.102;
93
+ /**
94
+ * Gets or sets the Sun Theta.
95
+ */
96
+ _this.sunTheta = 0.76;
97
+ /**
98
+ * Gets or sets the Sun Phi.
99
+ */
100
+ _this.sunPhi = 0.526;
101
+ /**
102
+ * Gets or sets the Indirect Diffuse.
103
+ */
104
+ _this.indirectDiffuse = 0.658;
105
+ /**
106
+ * Gets or sets the base albedo.
107
+ */
108
+ _this.albedo = new Color4(0.0117647, 0.505882, 0.996078, 1);
109
+ /**
110
+ * Gets or sets the Specular value.
111
+ */
112
+ _this.specular = 0;
113
+ /**
114
+ * Gets or sets the Shininess value.
115
+ */
116
+ _this.shininess = 10;
117
+ /**
118
+ * Gets or sets the Sharpness value.
119
+ */
120
+ _this.sharpness = 0;
121
+ /**
122
+ * Gets or sets the Subsurface value.
123
+ */
124
+ _this.subsurface = 0;
125
+ /**
126
+ * Gets or sets the left gradient color.
127
+ */
128
+ _this.leftGradientColor = new Color4(0.0117647, 0.505882, 0.996078, 1);
129
+ /**
130
+ * Gets or sets the right gradient color.
131
+ */
132
+ _this.rightGradientColor = new Color4(0.0117647, 0.505882, 0.996078, 1);
133
+ /**
134
+ * Gets or sets the reflection value.
135
+ */
136
+ _this.reflection = 0.749;
137
+ /**
138
+ * Gets or sets the front reflect value.
139
+ */
140
+ _this.frontReflect = 0;
141
+ /**
142
+ * Gets or sets the edge reflect value.
143
+ */
144
+ _this.edgeReflect = 0.09;
145
+ /**
146
+ * Gets or sets the power value.
147
+ */
148
+ _this.power = 8.13;
149
+ /**
150
+ * Gets or sets the sky color.
151
+ */
152
+ _this.skyColor = new Color4(0.0117647, 0.964706, 0.996078, 1);
153
+ /**
154
+ * Gets or sets the horizon color.
155
+ */
156
+ _this.horizonColor = new Color4(0.0117647, 0.333333, 0.996078, 1);
157
+ /**
158
+ * Gets or sets the ground color.
159
+ */
160
+ _this.groundColor = new Color4(0, 0.254902, 0.996078, 1);
161
+ /**
162
+ * Gets or sets the horizon power value.
163
+ */
164
+ _this.horizonPower = 1;
165
+ /**
166
+ * Gets or sets the finger occlusion width value.
167
+ */
168
+ _this.width = 0.02;
169
+ /**
170
+ * Gets or sets the finger occlusion fuzz value.
171
+ */
172
+ _this.fuzz = 0.5;
173
+ /**
174
+ * Gets or sets the minimum finger occlusion fuzz value.
175
+ */
176
+ _this.minFuzz = 0.001;
177
+ /**
178
+ * Gets or sets the finger occlusion clip fade value.
179
+ */
180
+ _this.clipFade = 0.01;
181
+ /**
182
+ * Gets or sets the hue shift value.
183
+ */
184
+ _this.hueShift = 0;
185
+ /**
186
+ * Gets or sets the saturation shift value.
187
+ */
188
+ _this.saturationShift = 0;
189
+ /**
190
+ * Gets or sets the value shift.
191
+ */
192
+ _this.valueShift = 0;
193
+ /**
194
+ * Gets or sets the position of the hover glow effect.
195
+ */
196
+ _this.blobPosition = new Vector3(0, 0, 0.1);
197
+ /**
198
+ * Gets or sets the intensity of the hover glow effect.
199
+ */
200
+ _this.blobIntensity = 0.5;
201
+ /**
202
+ * Gets or sets the near size of the hover glow effect.
203
+ */
204
+ _this.blobNearSize = 0.01;
205
+ /**
206
+ * Gets or sets the far size of the hover glow effect.
207
+ */
208
+ _this.blobFarSize = 0.03;
209
+ /**
210
+ * Gets or sets the distance considered "near" to the mesh, which controls the size of the hover glow effect (see blobNearSize).
211
+ */
212
+ _this.blobNearDistance = 0;
213
+ /**
214
+ * Gets or sets the distance considered "far" from the mesh, which controls the size of the hover glow effect (see blobFarSize).
215
+ */
216
+ _this.blobFarDistance = 0.08;
217
+ /**
218
+ * Gets or sets the length of the hover glow effect fade.
219
+ */
220
+ _this.blobFadeLength = 0.576;
221
+ /**
222
+ * Gets or sets the progress of the hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).
223
+ */
224
+ _this.blobPulse = 0;
225
+ /**
226
+ * Gets or sets the opacity of the hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.
227
+ */
228
+ _this.blobFade = 1;
229
+ /**
230
+ * Gets or sets the position of the hover glow effect.
231
+ */
232
+ _this.blobPosition2 = new Vector3(0.2, 0, 0.1);
233
+ /**
234
+ * Gets or sets the size of the hover glow effect when the right pointer is considered "near" to the mesh (see blobNearDistance).
235
+ */
236
+ _this.blobNearSize2 = 0.01;
237
+ /**
238
+ * Gets or sets the progress of the hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).
239
+ */
240
+ _this.blobPulse2 = 0;
241
+ /**
242
+ * Gets or sets the opacity of the hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 1.
243
+ */
244
+ _this.blobFade2 = 1;
245
+ /**
246
+ * Gets or sets the texture of the hover glow effect.
247
+ */
248
+ _this.blobTexture = new Texture("", _this.getScene());
249
+ /**
250
+ * Gets or sets the finger position for left index.
251
+ */
252
+ _this.leftIndexPosition = new Vector3(0, 0, 1);
253
+ /**
254
+ * Gets or sets the finger position for right index.
255
+ */
256
+ _this.rightIndexPosition = new Vector3(-1, -1, -1);
257
+ /**
258
+ * Gets or sets the finger position for left index middle position.
259
+ */
260
+ _this.leftIndexMiddlePosition = new Vector3(0, 0, 0);
261
+ /**
262
+ * Gets or sets the finger position for right index middle position.
263
+ */
264
+ _this.rightIndexMiddlePosition = new Vector3(0, 0, 0);
265
+ /**
266
+ * Gets or sets the Decal Scle for XY.
267
+ */
268
+ _this.decalScaleXY = new Vector2(1.5, 1.5);
269
+ /**
270
+ * Gets or sets decalFrontOnly
271
+ * Default is true
272
+ */
273
+ _this.decalFrontOnly = true;
274
+ /**
275
+ * Gets or sets the Rim Light intensity.
276
+ */
277
+ _this.rimIntensity = 0.287;
278
+ /**
279
+ * Gets or sets the Rim Light hue shift value.
280
+ */
281
+ _this.rimHueShift = 0;
282
+ /**
283
+ * Gets or sets the Rim Light saturation shift value.
284
+ */
285
+ _this.rimSaturationShift = 0;
286
+ /**
287
+ * Gets or sets the Rim Light value shift.
288
+ */
289
+ _this.rimValueShift = -1;
290
+ /**
291
+ * Gets or sets the intensity of the iridescence effect.
292
+ */
293
+ _this.iridescenceIntensity = 0;
294
+ /**
295
+ * @hidden
296
+ */
297
+ _this.useGlobalLeftIndex = 1.0;
298
+ /**
299
+ * @hidden
300
+ */
301
+ _this.useGlobalRightIndex = 1.0;
302
+ /**
303
+ * @hidden
304
+ */
305
+ _this.globalLeftIndexTipProximity = 0.0;
306
+ /**
307
+ * @hidden
308
+ */
309
+ _this.globalRightIndexTipProximity = 0.0;
310
+ /**
311
+ * @hidden
312
+ */
313
+ _this.globalLeftIndexTipPosition = new Vector4(0.5, 0.0, -0.55, 1.0);
314
+ /**
315
+ * @hidden
316
+ */
317
+ _this.globaRightIndexTipPosition = new Vector4(0.0, 0.0, 0.0, 1.0);
318
+ /**
319
+ * @hidden
320
+ */
321
+ _this.globalLeftThumbTipPosition = new Vector4(0.5, 0.0, -0.55, 1.0);
322
+ /**
323
+ * @hidden
324
+ */
325
+ _this.globalRightThumbTipPosition = new Vector4(0.0, 0.0, 0.0, 1.0);
326
+ /**
327
+ * @hidden
328
+ */
329
+ _this.globalLeftIndexMiddlePosition = new Vector4(0.5, 0.0, -0.55, 1.0);
330
+ /**
331
+ * @hidden
332
+ */
333
+ _this.globalRightIndexMiddlePosition = new Vector4(0.0, 0.0, 0.0, 1.0);
334
+ _this.alphaMode = Constants.ALPHA_DISABLE;
335
+ _this.backFaceCulling = false;
336
+ _this._blueGradientTexture = new Texture(MRDLSliderBarMaterial.BLUE_GRADIENT_TEXTURE_URL, _this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
337
+ return _this;
338
+ }
339
+ MRDLSliderBarMaterial.prototype.needAlphaBlending = function () {
340
+ return false;
341
+ };
342
+ MRDLSliderBarMaterial.prototype.needAlphaTesting = function () {
343
+ return false;
344
+ };
345
+ MRDLSliderBarMaterial.prototype.getAlphaTestTexture = function () {
346
+ return null;
347
+ };
348
+ // Methods
349
+ MRDLSliderBarMaterial.prototype.isReadyForSubMesh = function (mesh, subMesh) {
350
+ if (this.isFrozen) {
351
+ if (subMesh.effect && subMesh.effect._wasPreviouslyReady) {
352
+ return true;
353
+ }
354
+ }
355
+ if (!subMesh.materialDefines) {
356
+ subMesh.materialDefines = new MRDLSliderBarMaterialDefines();
357
+ }
358
+ var defines = subMesh.materialDefines;
359
+ var scene = this.getScene();
360
+ if (this._isReadyForSubMesh(subMesh)) {
361
+ return true;
362
+ }
363
+ var engine = scene.getEngine();
364
+ // Attribs
365
+ MaterialHelper.PrepareDefinesForAttributes(mesh, defines, false, false);
366
+ // Get correct effect
367
+ if (defines.isDirty) {
368
+ defines.markAsProcessed();
369
+ scene.resetCachedMaterial();
370
+ // Fallbacks
371
+ var fallbacks = new EffectFallbacks();
372
+ if (defines.FOG) {
373
+ fallbacks.addFallback(1, "FOG");
374
+ }
375
+ MaterialHelper.HandleFallbacksForShadows(defines, fallbacks);
376
+ defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
377
+ //Attributes
378
+ var attribs = [VertexBuffer.PositionKind];
379
+ if (defines.NORMAL) {
380
+ attribs.push(VertexBuffer.NormalKind);
381
+ }
382
+ if (defines.UV1) {
383
+ attribs.push(VertexBuffer.UVKind);
384
+ }
385
+ if (defines.UV2) {
386
+ attribs.push(VertexBuffer.UV2Kind);
387
+ }
388
+ if (defines.VERTEXCOLOR) {
389
+ attribs.push(VertexBuffer.ColorKind);
390
+ }
391
+ if (defines.TANGENT) {
392
+ attribs.push(VertexBuffer.TangentKind);
393
+ }
394
+ MaterialHelper.PrepareAttributesForInstances(attribs, defines);
395
+ // Legacy browser patch
396
+ var shaderName = "mrdlSliderBar";
397
+ var join = defines.toString();
398
+ var uniforms = [
399
+ "world",
400
+ "viewProjection",
401
+ "cameraPosition",
402
+ "_Radius_",
403
+ "_Bevel_Front_",
404
+ "_Bevel_Front_Stretch_",
405
+ "_Bevel_Back_",
406
+ "_Bevel_Back_Stretch_",
407
+ "_Radius_Top_Left_",
408
+ "_Radius_Top_Right_",
409
+ "_Radius_Bottom_Left_",
410
+ "_Radius_Bottom_Right_",
411
+ "_Bulge_Enabled_",
412
+ "_Bulge_Height_",
413
+ "_Bulge_Radius_",
414
+ "_Sun_Intensity_",
415
+ "_Sun_Theta_",
416
+ "_Sun_Phi_",
417
+ "_Indirect_Diffuse_",
418
+ "_Albedo_",
419
+ "_Specular_",
420
+ "_Shininess_",
421
+ "_Sharpness_",
422
+ "_Subsurface_",
423
+ "_Left_Color_",
424
+ "_Right_Color_",
425
+ "_Reflection_",
426
+ "_Front_Reflect_",
427
+ "_Edge_Reflect_",
428
+ "_Power_",
429
+ "_Sky_Color_",
430
+ "_Horizon_Color_",
431
+ "_Ground_Color_",
432
+ "_Horizon_Power_",
433
+ "_Reflection_Map_",
434
+ "_Indirect_Environment_",
435
+ "_Width_",
436
+ "_Fuzz_",
437
+ "_Min_Fuzz_",
438
+ "_Clip_Fade_",
439
+ "_Hue_Shift_",
440
+ "_Saturation_Shift_",
441
+ "_Value_Shift_",
442
+ "_Blob_Position_",
443
+ "_Blob_Intensity_",
444
+ "_Blob_Near_Size_",
445
+ "_Blob_Far_Size_",
446
+ "_Blob_Near_Distance_",
447
+ "_Blob_Far_Distance_",
448
+ "_Blob_Fade_Length_",
449
+ "_Blob_Pulse_",
450
+ "_Blob_Fade_",
451
+ "_Blob_Texture_",
452
+ "_Blob_Position_2_",
453
+ "_Blob_Near_Size_2_",
454
+ "_Blob_Pulse_2_",
455
+ "_Blob_Fade_2_",
456
+ "_Left_Index_Pos_",
457
+ "_Right_Index_Pos_",
458
+ "_Left_Index_Middle_Pos_",
459
+ "_Right_Index_Middle_Pos_",
460
+ "_Decal_",
461
+ "_Decal_Scale_XY_",
462
+ "_Decal_Front_Only_",
463
+ "_Rim_Intensity_",
464
+ "_Rim_Texture_",
465
+ "_Rim_Hue_Shift_",
466
+ "_Rim_Saturation_Shift_",
467
+ "_Rim_Value_Shift_",
468
+ "_Iridescence_Intensity_",
469
+ "_Iridescence_Texture_",
470
+ "Use_Global_Left_Index",
471
+ "Use_Global_Right_Index",
472
+ "Global_Left_Index_Tip_Position",
473
+ "Global_Right_Index_Tip_Position",
474
+ "Global_Left_Thumb_Tip_Position",
475
+ "Global_Right_Thumb_Tip_Position",
476
+ "Global_Left_Index_Middle_Position;",
477
+ "Global_Right_Index_Middle_Position",
478
+ "Global_Left_Index_Tip_Proximity",
479
+ "Global_Right_Index_Tip_Proximity",
480
+ ];
481
+ var samplers = ["_Rim_Texture_", "_Iridescence_Texture_"];
482
+ var uniformBuffers = new Array();
483
+ MaterialHelper.PrepareUniformsAndSamplersList({
484
+ uniformsNames: uniforms,
485
+ uniformBuffersNames: uniformBuffers,
486
+ samplers: samplers,
487
+ defines: defines,
488
+ maxSimultaneousLights: 4,
489
+ });
490
+ subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
491
+ attributes: attribs,
492
+ uniformsNames: uniforms,
493
+ uniformBuffersNames: uniformBuffers,
494
+ samplers: samplers,
495
+ defines: join,
496
+ fallbacks: fallbacks,
497
+ onCompiled: this.onCompiled,
498
+ onError: this.onError,
499
+ indexParameters: { maxSimultaneousLights: 4 },
500
+ }, engine), defines, this._materialContext);
501
+ }
502
+ if (!subMesh.effect || !subMesh.effect.isReady()) {
503
+ return false;
504
+ }
505
+ defines._renderId = scene.getRenderId();
506
+ subMesh.effect._wasPreviouslyReady = true;
507
+ return true;
508
+ };
509
+ MRDLSliderBarMaterial.prototype.bindForSubMesh = function (world, mesh, subMesh) {
510
+ var defines = subMesh.materialDefines;
511
+ if (!defines) {
512
+ return;
513
+ }
514
+ var effect = subMesh.effect;
515
+ if (!effect) {
516
+ return;
517
+ }
518
+ this._activeEffect = effect;
519
+ // Matrices
520
+ this.bindOnlyWorldMatrix(world);
521
+ this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
522
+ this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera.position);
523
+ // "Round Rect"
524
+ this._activeEffect.setFloat("_Radius_", this.radius);
525
+ this._activeEffect.setFloat("_Bevel_Front_", this.bevelFront);
526
+ this._activeEffect.setFloat("_Bevel_Front_Stretch_", this.bevelFrontStretch);
527
+ this._activeEffect.setFloat("_Bevel_Back_", this.bevelBack);
528
+ this._activeEffect.setFloat("_Bevel_Back_Stretch_", this.bevelBackStretch);
529
+ // "Radii Multipliers"
530
+ this._activeEffect.setFloat("_Radius_Top_Left_", this.radiusTopLeft);
531
+ this._activeEffect.setFloat("_Radius_Top_Right_", this.radiusTopRight);
532
+ this._activeEffect.setFloat("_Radius_Bottom_Left_", this.radiusBottomLeft);
533
+ this._activeEffect.setFloat("_Radius_Bottom_Right_", this.radiusBottomRight);
534
+ // "Bulge"
535
+ this._activeEffect.setFloat("_Bulge_Enabled_", this.bulgeEnabled ? 1.0 : 0.0);
536
+ this._activeEffect.setFloat("_Bulge_Height_", this.bulgeHeight);
537
+ this._activeEffect.setFloat("_Bulge_Radius_", this.bulgeRadius);
538
+ // "Sun"
539
+ this._activeEffect.setFloat("_Sun_Intensity_", this.sunIntensity);
540
+ this._activeEffect.setFloat("_Sun_Theta_", this.sunTheta);
541
+ this._activeEffect.setFloat("_Sun_Phi_", this.sunPhi);
542
+ this._activeEffect.setFloat("_Indirect_Diffuse_", this.indirectDiffuse);
543
+ // "Diffuse And Specular"
544
+ this._activeEffect.setDirectColor4("_Albedo_", this.albedo);
545
+ this._activeEffect.setFloat("_Specular_", this.specular);
546
+ this._activeEffect.setFloat("_Shininess_", this.shininess);
547
+ this._activeEffect.setFloat("_Sharpness_", this.sharpness);
548
+ this._activeEffect.setFloat("_Subsurface_", this.subsurface);
549
+ // "Gradient"
550
+ this._activeEffect.setDirectColor4("_Left_Color_", this.leftGradientColor);
551
+ this._activeEffect.setDirectColor4("_Right_Color_", this.rightGradientColor);
552
+ // "Reflection"
553
+ this._activeEffect.setFloat("_Reflection_", this.reflection);
554
+ this._activeEffect.setFloat("_Front_Reflect_", this.frontReflect);
555
+ this._activeEffect.setFloat("_Edge_Reflect_", this.edgeReflect);
556
+ this._activeEffect.setFloat("_Power_", this.power);
557
+ // "Sky Environment"
558
+ //define SKY_ENABLED true;
559
+ this._activeEffect.setDirectColor4("_Sky_Color_", this.skyColor);
560
+ this._activeEffect.setDirectColor4("_Horizon_Color_", this.horizonColor);
561
+ this._activeEffect.setDirectColor4("_Ground_Color_", this.groundColor);
562
+ this._activeEffect.setFloat("_Horizon_Power_", this.horizonPower);
563
+ // "Mapped Environment"
564
+ //define ENV_ENABLE false;
565
+ this._activeEffect.setTexture("_Reflection_Map_", new Texture("", this.getScene()));
566
+ this._activeEffect.setTexture("_Indirect_Environment_", new Texture("", this.getScene()));
567
+ // "FingerOcclusion"
568
+ //define OCCLUSION_ENABLED false;
569
+ this._activeEffect.setFloat("_Width_", this.width);
570
+ this._activeEffect.setFloat("_Fuzz_", this.fuzz);
571
+ this._activeEffect.setFloat("_Min_Fuzz_", this.minFuzz);
572
+ this._activeEffect.setFloat("_Clip_Fade_", this.clipFade);
573
+ // "View Based Color Shift"
574
+ this._activeEffect.setFloat("_Hue_Shift_", this.hueShift);
575
+ this._activeEffect.setFloat("_Saturation_Shift_", this.saturationShift);
576
+ this._activeEffect.setFloat("_Value_Shift_", this.valueShift);
577
+ // "Blob"
578
+ //define BLOB_ENABLE false;
579
+ this._activeEffect.setVector3("_Blob_Position_", this.blobPosition);
580
+ this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
581
+ this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize);
582
+ this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
583
+ this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
584
+ this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
585
+ this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
586
+ this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse);
587
+ this._activeEffect.setFloat("_Blob_Fade_", this.blobFade);
588
+ // "Blob Texture"
589
+ this._activeEffect.setTexture("_Blob_Texture_", this.blobTexture);
590
+ // "Blob 2"
591
+ //define BLOB_ENABLE_2 true;
592
+ this._activeEffect.setVector3("_Blob_Position_2_", this.blobPosition2);
593
+ this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2);
594
+ this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2);
595
+ this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2);
596
+ // "Finger Positions"
597
+ this._activeEffect.setVector3("_Left_Index_Pos_", this.leftIndexPosition);
598
+ this._activeEffect.setVector3("_Right_Index_Pos_", this.rightIndexPosition);
599
+ this._activeEffect.setVector3("_Left_Index_Middle_Pos_", this.leftIndexMiddlePosition);
600
+ this._activeEffect.setVector3("_Right_Index_Middle_Pos_", this.rightIndexMiddlePosition);
601
+ // "Decal Texture"
602
+ //define DECAL_ENABLE false;
603
+ this._activeEffect.setTexture("_Decal_", new Texture("", this.getScene()));
604
+ this._activeEffect.setVector2("_Decal_Scale_XY_", this.decalScaleXY);
605
+ this._activeEffect.setFloat("_Decal_Front_Only_", this.decalFrontOnly ? 1.0 : 0.0);
606
+ // "Rim Light"
607
+ this._activeEffect.setFloat("_Rim_Intensity_", this.rimIntensity);
608
+ this._activeEffect.setTexture("_Rim_Texture_", this._blueGradientTexture);
609
+ this._activeEffect.setFloat("_Rim_Hue_Shift_", this.rimHueShift);
610
+ this._activeEffect.setFloat("_Rim_Saturation_Shift_", this.rimSaturationShift);
611
+ this._activeEffect.setFloat("_Rim_Value_Shift_", this.rimValueShift);
612
+ // "Iridescence"
613
+ //define IRIDESCENCE_ENABLED true;
614
+ this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
615
+ this._activeEffect.setTexture("_Iridescence_Texture_", this._blueGradientTexture);
616
+ // Global inputs
617
+ this._activeEffect.setFloat("Use_Global_Left_Index", this.useGlobalLeftIndex);
618
+ this._activeEffect.setFloat("Use_Global_Right_Index", this.useGlobalRightIndex);
619
+ this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this.globalLeftIndexTipPosition);
620
+ this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this.globaRightIndexTipPosition);
621
+ this._activeEffect.setVector4("Global_Left_Thumb_Tip_Position", this.globalLeftThumbTipPosition);
622
+ this._activeEffect.setVector4("Global_Right_Thumb_Tip_Position", this.globalRightThumbTipPosition);
623
+ this._activeEffect.setVector4("Global_Left_Index_Middle_Position", this.globalLeftIndexMiddlePosition);
624
+ this._activeEffect.setVector4("Global_Right_Index_Middle_Position", this.globalRightIndexMiddlePosition);
625
+ this._activeEffect.setFloat("Global_Left_Index_Tip_Proximity", this.globalLeftIndexTipProximity);
626
+ this._activeEffect.setFloat("Global_Right_Index_Tip_Proximity", this.globalRightIndexTipProximity);
627
+ this._afterBind(mesh, this._activeEffect);
628
+ };
629
+ /**
630
+ * Get the list of animatables in the material.
631
+ * @returns the list of animatables object used in the material
632
+ */
633
+ MRDLSliderBarMaterial.prototype.getAnimatables = function () {
634
+ return [];
635
+ };
636
+ MRDLSliderBarMaterial.prototype.dispose = function (forceDisposeEffect) {
637
+ _super.prototype.dispose.call(this, forceDisposeEffect);
638
+ };
639
+ MRDLSliderBarMaterial.prototype.clone = function (name) {
640
+ var _this = this;
641
+ return SerializationHelper.Clone(function () { return new MRDLSliderBarMaterial(name, _this.getScene()); }, this);
642
+ };
643
+ MRDLSliderBarMaterial.prototype.serialize = function () {
644
+ var serializationObject = _super.prototype.serialize.call(this);
645
+ serializationObject.customType = "BABYLON.MRDLSliderBarMaterial";
646
+ return serializationObject;
647
+ };
648
+ MRDLSliderBarMaterial.prototype.getClassName = function () {
649
+ return "MRDLSliderBarMaterial";
650
+ };
651
+ // Statics
652
+ MRDLSliderBarMaterial.Parse = function (source, scene, rootUrl) {
653
+ return SerializationHelper.Parse(function () { return new MRDLSliderBarMaterial(source.name, scene); }, source, scene, rootUrl);
654
+ };
655
+ /**
656
+ * URL pointing to the texture used to define the coloring for the Iridescent Map effect.
657
+ */
658
+ MRDLSliderBarMaterial.BLUE_GRADIENT_TEXTURE_URL = "https://assets.babylonjs.com/meshes/MRTK/MRDL/mrtk-mrdl-blue-gradient.png";
659
+ __decorate([
660
+ serialize()
661
+ ], MRDLSliderBarMaterial.prototype, "radius", void 0);
662
+ __decorate([
663
+ serialize()
664
+ ], MRDLSliderBarMaterial.prototype, "bevelFront", void 0);
665
+ __decorate([
666
+ serialize()
667
+ ], MRDLSliderBarMaterial.prototype, "bevelFrontStretch", void 0);
668
+ __decorate([
669
+ serialize()
670
+ ], MRDLSliderBarMaterial.prototype, "bevelBack", void 0);
671
+ __decorate([
672
+ serialize()
673
+ ], MRDLSliderBarMaterial.prototype, "bevelBackStretch", void 0);
674
+ __decorate([
675
+ serialize()
676
+ ], MRDLSliderBarMaterial.prototype, "radiusTopLeft", void 0);
677
+ __decorate([
678
+ serialize()
679
+ ], MRDLSliderBarMaterial.prototype, "radiusTopRight", void 0);
680
+ __decorate([
681
+ serialize()
682
+ ], MRDLSliderBarMaterial.prototype, "radiusBottomLeft", void 0);
683
+ __decorate([
684
+ serialize()
685
+ ], MRDLSliderBarMaterial.prototype, "radiusBottomRight", void 0);
686
+ __decorate([
687
+ serialize()
688
+ ], MRDLSliderBarMaterial.prototype, "bulgeEnabled", void 0);
689
+ __decorate([
690
+ serialize()
691
+ ], MRDLSliderBarMaterial.prototype, "bulgeHeight", void 0);
692
+ __decorate([
693
+ serialize()
694
+ ], MRDLSliderBarMaterial.prototype, "bulgeRadius", void 0);
695
+ __decorate([
696
+ serialize()
697
+ ], MRDLSliderBarMaterial.prototype, "sunIntensity", void 0);
698
+ __decorate([
699
+ serialize()
700
+ ], MRDLSliderBarMaterial.prototype, "sunTheta", void 0);
701
+ __decorate([
702
+ serialize()
703
+ ], MRDLSliderBarMaterial.prototype, "sunPhi", void 0);
704
+ __decorate([
705
+ serialize()
706
+ ], MRDLSliderBarMaterial.prototype, "indirectDiffuse", void 0);
707
+ __decorate([
708
+ serialize()
709
+ ], MRDLSliderBarMaterial.prototype, "albedo", void 0);
710
+ __decorate([
711
+ serialize()
712
+ ], MRDLSliderBarMaterial.prototype, "specular", void 0);
713
+ __decorate([
714
+ serialize()
715
+ ], MRDLSliderBarMaterial.prototype, "shininess", void 0);
716
+ __decorate([
717
+ serialize()
718
+ ], MRDLSliderBarMaterial.prototype, "sharpness", void 0);
719
+ __decorate([
720
+ serialize()
721
+ ], MRDLSliderBarMaterial.prototype, "subsurface", void 0);
722
+ __decorate([
723
+ serialize()
724
+ ], MRDLSliderBarMaterial.prototype, "leftGradientColor", void 0);
725
+ __decorate([
726
+ serialize()
727
+ ], MRDLSliderBarMaterial.prototype, "rightGradientColor", void 0);
728
+ __decorate([
729
+ serialize()
730
+ ], MRDLSliderBarMaterial.prototype, "reflection", void 0);
731
+ __decorate([
732
+ serialize()
733
+ ], MRDLSliderBarMaterial.prototype, "frontReflect", void 0);
734
+ __decorate([
735
+ serialize()
736
+ ], MRDLSliderBarMaterial.prototype, "edgeReflect", void 0);
737
+ __decorate([
738
+ serialize()
739
+ ], MRDLSliderBarMaterial.prototype, "power", void 0);
740
+ __decorate([
741
+ serialize()
742
+ ], MRDLSliderBarMaterial.prototype, "skyColor", void 0);
743
+ __decorate([
744
+ serialize()
745
+ ], MRDLSliderBarMaterial.prototype, "horizonColor", void 0);
746
+ __decorate([
747
+ serialize()
748
+ ], MRDLSliderBarMaterial.prototype, "groundColor", void 0);
749
+ __decorate([
750
+ serialize()
751
+ ], MRDLSliderBarMaterial.prototype, "horizonPower", void 0);
752
+ __decorate([
753
+ serialize()
754
+ ], MRDLSliderBarMaterial.prototype, "width", void 0);
755
+ __decorate([
756
+ serialize()
757
+ ], MRDLSliderBarMaterial.prototype, "fuzz", void 0);
758
+ __decorate([
759
+ serialize()
760
+ ], MRDLSliderBarMaterial.prototype, "minFuzz", void 0);
761
+ __decorate([
762
+ serialize()
763
+ ], MRDLSliderBarMaterial.prototype, "clipFade", void 0);
764
+ __decorate([
765
+ serialize()
766
+ ], MRDLSliderBarMaterial.prototype, "hueShift", void 0);
767
+ __decorate([
768
+ serialize()
769
+ ], MRDLSliderBarMaterial.prototype, "saturationShift", void 0);
770
+ __decorate([
771
+ serialize()
772
+ ], MRDLSliderBarMaterial.prototype, "valueShift", void 0);
773
+ __decorate([
774
+ serialize()
775
+ ], MRDLSliderBarMaterial.prototype, "blobPosition", void 0);
776
+ __decorate([
777
+ serialize()
778
+ ], MRDLSliderBarMaterial.prototype, "blobIntensity", void 0);
779
+ __decorate([
780
+ serialize()
781
+ ], MRDLSliderBarMaterial.prototype, "blobNearSize", void 0);
782
+ __decorate([
783
+ serialize()
784
+ ], MRDLSliderBarMaterial.prototype, "blobFarSize", void 0);
785
+ __decorate([
786
+ serialize()
787
+ ], MRDLSliderBarMaterial.prototype, "blobNearDistance", void 0);
788
+ __decorate([
789
+ serialize()
790
+ ], MRDLSliderBarMaterial.prototype, "blobFarDistance", void 0);
791
+ __decorate([
792
+ serialize()
793
+ ], MRDLSliderBarMaterial.prototype, "blobFadeLength", void 0);
794
+ __decorate([
795
+ serialize()
796
+ ], MRDLSliderBarMaterial.prototype, "blobPulse", void 0);
797
+ __decorate([
798
+ serialize()
799
+ ], MRDLSliderBarMaterial.prototype, "blobFade", void 0);
800
+ __decorate([
801
+ serialize()
802
+ ], MRDLSliderBarMaterial.prototype, "blobPosition2", void 0);
803
+ __decorate([
804
+ serialize()
805
+ ], MRDLSliderBarMaterial.prototype, "blobNearSize2", void 0);
806
+ __decorate([
807
+ serialize()
808
+ ], MRDLSliderBarMaterial.prototype, "blobPulse2", void 0);
809
+ __decorate([
810
+ serialize()
811
+ ], MRDLSliderBarMaterial.prototype, "blobFade2", void 0);
812
+ __decorate([
813
+ serialize()
814
+ ], MRDLSliderBarMaterial.prototype, "blobTexture", void 0);
815
+ __decorate([
816
+ serialize()
817
+ ], MRDLSliderBarMaterial.prototype, "leftIndexPosition", void 0);
818
+ __decorate([
819
+ serialize()
820
+ ], MRDLSliderBarMaterial.prototype, "rightIndexPosition", void 0);
821
+ __decorate([
822
+ serialize()
823
+ ], MRDLSliderBarMaterial.prototype, "leftIndexMiddlePosition", void 0);
824
+ __decorate([
825
+ serialize()
826
+ ], MRDLSliderBarMaterial.prototype, "rightIndexMiddlePosition", void 0);
827
+ __decorate([
828
+ serialize()
829
+ ], MRDLSliderBarMaterial.prototype, "decalScaleXY", void 0);
830
+ __decorate([
831
+ serialize()
832
+ ], MRDLSliderBarMaterial.prototype, "decalFrontOnly", void 0);
833
+ __decorate([
834
+ serialize()
835
+ ], MRDLSliderBarMaterial.prototype, "rimIntensity", void 0);
836
+ __decorate([
837
+ serialize()
838
+ ], MRDLSliderBarMaterial.prototype, "rimHueShift", void 0);
839
+ __decorate([
840
+ serialize()
841
+ ], MRDLSliderBarMaterial.prototype, "rimSaturationShift", void 0);
842
+ __decorate([
843
+ serialize()
844
+ ], MRDLSliderBarMaterial.prototype, "rimValueShift", void 0);
845
+ __decorate([
846
+ serialize()
847
+ ], MRDLSliderBarMaterial.prototype, "iridescenceIntensity", void 0);
848
+ return MRDLSliderBarMaterial;
849
+ }(PushMaterial));
850
+ export { MRDLSliderBarMaterial };
851
+ RegisterClass("BABYLON.GUI.MRDLSliderBarMaterial", MRDLSliderBarMaterial);
787
852
  //# sourceMappingURL=mrdlSliderBarMaterial.js.map