@babylonjs/gui 5.0.0-rc.6 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (277) 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 -448
  5. package/2D/advancedDynamicTexture.js +1318 -1318
  6. package/2D/advancedDynamicTexture.js.map +1 -1
  7. package/2D/controls/button.d.ts +135 -135
  8. package/2D/controls/button.js +276 -276
  9. package/2D/controls/button.js.map +1 -1
  10. package/2D/controls/checkbox.d.ts +59 -59
  11. package/2D/controls/checkbox.js +188 -188
  12. package/2D/controls/checkbox.js.map +1 -1
  13. package/2D/controls/colorpicker.d.ts +103 -103
  14. package/2D/controls/colorpicker.js +1417 -1417
  15. package/2D/controls/colorpicker.js.map +1 -1
  16. package/2D/controls/container.d.ts +175 -175
  17. package/2D/controls/container.js +570 -570
  18. package/2D/controls/container.js.map +1 -1
  19. package/2D/controls/control.d.ts +866 -866
  20. package/2D/controls/control.js +2433 -2433
  21. package/2D/controls/control.js.map +1 -1
  22. package/2D/controls/displayGrid.d.ts +53 -53
  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 -59
  29. package/2D/controls/focusableButton.js +99 -99
  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 -139
  35. package/2D/controls/grid.js +529 -529
  36. package/2D/controls/grid.js.map +1 -1
  37. package/2D/controls/image.d.ts +204 -204
  38. package/2D/controls/image.js +887 -887
  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/inputPassword.d.ts +9 -8
  43. package/2D/controls/inputPassword.js +28 -25
  44. package/2D/controls/inputPassword.js.map +1 -1
  45. package/2D/controls/inputText.d.ts +201 -201
  46. package/2D/controls/inputText.js +1119 -1119
  47. package/2D/controls/inputText.js.map +1 -1
  48. package/2D/controls/line.d.ts +66 -66
  49. package/2D/controls/line.js +271 -271
  50. package/2D/controls/line.js.map +1 -1
  51. package/2D/controls/multiLine.d.ts +75 -75
  52. package/2D/controls/multiLine.js +262 -262
  53. package/2D/controls/multiLine.js.map +1 -1
  54. package/2D/controls/radioButton.d.ts +49 -49
  55. package/2D/controls/radioButton.js +205 -205
  56. package/2D/controls/radioButton.js.map +1 -1
  57. package/2D/controls/rectangle.d.ts +29 -29
  58. package/2D/controls/rectangle.js +150 -150
  59. package/2D/controls/rectangle.js.map +1 -1
  60. package/2D/controls/scrollViewers/scrollViewer.d.ts +182 -182
  61. package/2D/controls/scrollViewers/scrollViewer.js +677 -677
  62. package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
  63. package/2D/controls/scrollViewers/scrollViewerWindow.d.ts +57 -57
  64. package/2D/controls/scrollViewers/scrollViewerWindow.js +278 -278
  65. package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
  66. package/2D/controls/selector.d.ts +263 -263
  67. package/2D/controls/selector.js +692 -692
  68. package/2D/controls/sliders/baseSlider.d.ts +82 -82
  69. package/2D/controls/sliders/baseSlider.js +347 -347
  70. package/2D/controls/sliders/baseSlider.js.map +1 -1
  71. package/2D/controls/sliders/imageBasedSlider.d.ts +49 -49
  72. package/2D/controls/sliders/imageBasedSlider.js +192 -192
  73. package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
  74. package/2D/controls/sliders/imageScrollBar.d.ts +65 -65
  75. package/2D/controls/sliders/imageScrollBar.js +263 -263
  76. package/2D/controls/sliders/imageScrollBar.js.map +1 -1
  77. package/2D/controls/sliders/scrollBar.d.ts +38 -38
  78. package/2D/controls/sliders/scrollBar.js +143 -143
  79. package/2D/controls/sliders/scrollBar.js.map +1 -1
  80. package/2D/controls/sliders/slider.d.ts +35 -35
  81. package/2D/controls/sliders/slider.js +271 -271
  82. package/2D/controls/sliders/slider.js.map +1 -1
  83. package/2D/controls/stackPanel.d.ts +64 -64
  84. package/2D/controls/stackPanel.js +246 -246
  85. package/2D/controls/stackPanel.js.map +1 -1
  86. package/2D/controls/statics.d.ts +6 -6
  87. package/2D/controls/statics.js +49 -49
  88. package/2D/controls/textBlock.d.ts +175 -175
  89. package/2D/controls/textBlock.js +603 -603
  90. package/2D/controls/textBlock.js.map +1 -1
  91. package/2D/controls/textWrapper.d.ts +13 -13
  92. package/2D/controls/textWrapper.js +101 -101
  93. package/2D/controls/toggleButton.d.ts +117 -117
  94. package/2D/controls/toggleButton.js +268 -268
  95. package/2D/controls/toggleButton.js.map +1 -1
  96. package/2D/controls/virtualKeyboard.d.ts +96 -96
  97. package/2D/controls/virtualKeyboard.js +256 -256
  98. package/2D/controls/virtualKeyboard.js.map +1 -1
  99. package/2D/index.d.ts +9 -9
  100. package/2D/index.js +10 -9
  101. package/2D/index.js.map +1 -1
  102. package/2D/math2D.d.ts +117 -117
  103. package/2D/math2D.js +221 -221
  104. package/2D/math2D.js.map +1 -1
  105. package/2D/measure.d.ts +77 -77
  106. package/2D/measure.js +139 -139
  107. package/2D/measure.js.map +1 -1
  108. package/2D/multiLinePoint.d.ts +47 -47
  109. package/2D/multiLinePoint.js +127 -127
  110. package/2D/multiLinePoint.js.map +1 -1
  111. package/2D/style.d.ts +46 -46
  112. package/2D/style.js +97 -97
  113. package/2D/style.js.map +1 -1
  114. package/2D/valueAndUnit.d.ts +89 -89
  115. package/2D/valueAndUnit.js +226 -226
  116. package/2D/valueAndUnit.js.map +1 -1
  117. package/2D/xmlLoader.d.ts +60 -60
  118. package/2D/xmlLoader.js +348 -348
  119. package/2D/xmlLoader.js.map +1 -1
  120. package/3D/behaviors/defaultBehavior.d.ts +73 -73
  121. package/3D/behaviors/defaultBehavior.js +121 -121
  122. package/3D/behaviors/defaultBehavior.js.map +1 -1
  123. package/3D/controls/abstractButton3D.d.ts +15 -15
  124. package/3D/controls/abstractButton3D.js +25 -25
  125. package/3D/controls/abstractButton3D.js.map +1 -1
  126. package/3D/controls/button3D.d.ts +30 -30
  127. package/3D/controls/button3D.js +93 -93
  128. package/3D/controls/button3D.js.map +1 -1
  129. package/3D/controls/container3D.d.ts +72 -72
  130. package/3D/controls/container3D.js +139 -139
  131. package/3D/controls/container3D.js.map +1 -1
  132. package/3D/controls/contentDisplay3D.d.ts +30 -30
  133. package/3D/controls/contentDisplay3D.js +79 -79
  134. package/3D/controls/contentDisplay3D.js.map +1 -1
  135. package/3D/controls/control3D.d.ts +201 -201
  136. package/3D/controls/control3D.js +445 -445
  137. package/3D/controls/control3D.js.map +1 -1
  138. package/3D/controls/cylinderPanel.d.ts +17 -17
  139. package/3D/controls/cylinderPanel.js +66 -66
  140. package/3D/controls/cylinderPanel.js.map +1 -1
  141. package/3D/controls/handMenu.d.ts +28 -28
  142. package/3D/controls/handMenu.js +47 -47
  143. package/3D/controls/handMenu.js.map +1 -1
  144. package/3D/controls/holographicBackplate.d.ts +49 -49
  145. package/3D/controls/holographicBackplate.js +120 -120
  146. package/3D/controls/holographicBackplate.js.map +1 -1
  147. package/3D/controls/holographicButton.d.ts +84 -84
  148. package/3D/controls/holographicButton.js +339 -339
  149. package/3D/controls/holographicButton.js.map +1 -1
  150. package/3D/controls/holographicSlate.d.ts +131 -131
  151. package/3D/controls/holographicSlate.js +431 -431
  152. package/3D/controls/holographicSlate.js.map +1 -1
  153. package/3D/controls/index.d.ts +21 -21
  154. package/3D/controls/index.js +21 -21
  155. package/3D/controls/meshButton3D.d.ts +21 -21
  156. package/3D/controls/meshButton3D.js +62 -62
  157. package/3D/controls/meshButton3D.js.map +1 -1
  158. package/3D/controls/nearMenu.d.ts +44 -44
  159. package/3D/controls/nearMenu.js +114 -114
  160. package/3D/controls/nearMenu.js.map +1 -1
  161. package/3D/controls/planePanel.d.ts +9 -9
  162. package/3D/controls/planePanel.js +36 -36
  163. package/3D/controls/planePanel.js.map +1 -1
  164. package/3D/controls/scatterPanel.d.ts +18 -18
  165. package/3D/controls/scatterPanel.js +108 -108
  166. package/3D/controls/scatterPanel.js.map +1 -1
  167. package/3D/controls/slider3D.d.ts +81 -81
  168. package/3D/controls/slider3D.js +268 -268
  169. package/3D/controls/slider3D.js.map +1 -1
  170. package/3D/controls/spherePanel.d.ts +17 -17
  171. package/3D/controls/spherePanel.js +67 -67
  172. package/3D/controls/spherePanel.js.map +1 -1
  173. package/3D/controls/stackPanel3D.d.ts +22 -22
  174. package/3D/controls/stackPanel3D.js +107 -107
  175. package/3D/controls/touchButton3D.d.ts +80 -80
  176. package/3D/controls/touchButton3D.js +233 -233
  177. package/3D/controls/touchButton3D.js.map +1 -1
  178. package/3D/controls/touchHolographicButton.d.ts +110 -110
  179. package/3D/controls/touchHolographicButton.js +445 -445
  180. package/3D/controls/touchHolographicButton.js.map +1 -1
  181. package/3D/controls/touchHolographicMenu.d.ts +61 -61
  182. package/3D/controls/touchHolographicMenu.js +149 -149
  183. package/3D/controls/touchHolographicMenu.js.map +1 -1
  184. package/3D/controls/touchMeshButton3D.d.ts +21 -21
  185. package/3D/controls/touchMeshButton3D.js +62 -62
  186. package/3D/controls/touchMeshButton3D.js.map +1 -1
  187. package/3D/controls/volumeBasedPanel.d.ts +53 -53
  188. package/3D/controls/volumeBasedPanel.js +174 -174
  189. package/3D/controls/volumeBasedPanel.js.map +1 -1
  190. package/3D/gizmos/gizmoHandle.d.ts +108 -108
  191. package/3D/gizmos/gizmoHandle.js +209 -209
  192. package/3D/gizmos/gizmoHandle.js.map +1 -1
  193. package/3D/gizmos/index.d.ts +2 -2
  194. package/3D/gizmos/index.js +2 -2
  195. package/3D/gizmos/slateGizmo.d.ts +57 -57
  196. package/3D/gizmos/slateGizmo.js +369 -369
  197. package/3D/gizmos/slateGizmo.js.map +1 -1
  198. package/3D/gui3DManager.d.ts +94 -94
  199. package/3D/gui3DManager.js +257 -257
  200. package/3D/gui3DManager.js.map +1 -1
  201. package/3D/index.d.ts +5 -5
  202. package/3D/index.js +6 -5
  203. package/3D/index.js.map +1 -1
  204. package/3D/materials/fluent/fluentMaterial.d.ts +91 -90
  205. package/3D/materials/fluent/fluentMaterial.js +292 -292
  206. package/3D/materials/fluent/fluentMaterial.js.map +1 -1
  207. package/3D/materials/fluent/index.d.ts +1 -1
  208. package/3D/materials/fluent/index.js +1 -1
  209. package/3D/materials/fluent/shaders/fluent.fragment.d.ts +5 -5
  210. package/3D/materials/fluent/shaders/fluent.fragment.js +8 -8
  211. package/3D/materials/fluent/shaders/fluent.vertex.d.ts +5 -5
  212. package/3D/materials/fluent/shaders/fluent.vertex.js +8 -8
  213. package/3D/materials/fluentBackplate/fluentBackplateMaterial.d.ts +155 -154
  214. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +469 -469
  215. package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
  216. package/3D/materials/fluentBackplate/index.d.ts +1 -1
  217. package/3D/materials/fluentBackplate/index.js +1 -1
  218. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.d.ts +5 -5
  219. package/3D/materials/fluentBackplate/shaders/fluentBackplate.fragment.js +8 -8
  220. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.d.ts +5 -5
  221. package/3D/materials/fluentBackplate/shaders/fluentBackplate.vertex.js +8 -8
  222. package/3D/materials/fluentButton/fluentButtonMaterial.d.ts +190 -189
  223. package/3D/materials/fluentButton/fluentButtonMaterial.js +539 -539
  224. package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
  225. package/3D/materials/fluentButton/index.d.ts +1 -1
  226. package/3D/materials/fluentButton/index.js +1 -1
  227. package/3D/materials/fluentButton/shaders/fluentButton.fragment.d.ts +5 -5
  228. package/3D/materials/fluentButton/shaders/fluentButton.fragment.js +8 -8
  229. package/3D/materials/fluentButton/shaders/fluentButton.vertex.d.ts +5 -5
  230. package/3D/materials/fluentButton/shaders/fluentButton.vertex.js +8 -8
  231. package/3D/materials/fluentMaterial.d.ts +4 -4
  232. package/3D/materials/fluentMaterial.js +4 -4
  233. package/3D/materials/handle/handleMaterial.d.ts +68 -68
  234. package/3D/materials/handle/handleMaterial.js +126 -126
  235. package/3D/materials/handle/handleMaterial.js.map +1 -1
  236. package/3D/materials/handle/index.d.ts +1 -1
  237. package/3D/materials/handle/index.js +1 -1
  238. package/3D/materials/handle/shaders/handle.fragment.d.ts +5 -5
  239. package/3D/materials/handle/shaders/handle.fragment.js +8 -8
  240. package/3D/materials/handle/shaders/handle.vertex.d.ts +5 -5
  241. package/3D/materials/handle/shaders/handle.vertex.js +8 -8
  242. package/3D/materials/index.d.ts +5 -5
  243. package/3D/materials/index.js +6 -5
  244. package/3D/materials/index.js.map +1 -1
  245. package/3D/materials/mrdl/index.d.ts +3 -3
  246. package/3D/materials/mrdl/index.js +3 -3
  247. package/3D/materials/mrdl/mrdlBackplateMaterial.d.ts +148 -147
  248. package/3D/materials/mrdl/mrdlBackplateMaterial.js +436 -436
  249. package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
  250. package/3D/materials/mrdl/mrdlSliderBarMaterial.d.ts +334 -333
  251. package/3D/materials/mrdl/mrdlSliderBarMaterial.js +851 -851
  252. package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
  253. package/3D/materials/mrdl/mrdlSliderThumbMaterial.d.ts +334 -333
  254. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +851 -851
  255. package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
  256. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.d.ts +5 -5
  257. package/3D/materials/mrdl/shaders/mrdlBackplate.fragment.js +8 -8
  258. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.d.ts +5 -5
  259. package/3D/materials/mrdl/shaders/mrdlBackplate.vertex.js +8 -8
  260. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.d.ts +5 -5
  261. package/3D/materials/mrdl/shaders/mrdlSliderBar.fragment.js +8 -8
  262. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.d.ts +5 -5
  263. package/3D/materials/mrdl/shaders/mrdlSliderBar.vertex.js +8 -8
  264. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.d.ts +5 -5
  265. package/3D/materials/mrdl/shaders/mrdlSliderThumb.fragment.js +8 -8
  266. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.d.ts +5 -5
  267. package/3D/materials/mrdl/shaders/mrdlSliderThumb.vertex.js +8 -8
  268. package/3D/vector3WithInfo.d.ts +16 -16
  269. package/3D/vector3WithInfo.js +23 -23
  270. package/index.d.ts +2 -2
  271. package/index.js +3 -2
  272. package/index.js.map +1 -1
  273. package/legacy/legacy.d.ts +1 -1
  274. package/legacy/legacy.js +14 -13
  275. package/legacy/legacy.js.map +1 -1
  276. package/license.md +71 -0
  277. package/package.json +24 -5
@@ -1,852 +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) {
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);
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) {
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);
852
852
  //# sourceMappingURL=mrdlSliderBarMaterial.js.map