@babylonjs/gui 9.13.0 → 9.15.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.
- package/2D/FrameGraph/pure.d.ts +2 -0
- package/2D/FrameGraph/pure.js +3 -0
- package/2D/FrameGraph/pure.js.map +1 -0
- package/2D/FrameGraph/renderGraphGUIBlock.d.ts +3 -41
- package/2D/FrameGraph/renderGraphGUIBlock.js +5 -64
- package/2D/FrameGraph/renderGraphGUIBlock.js.map +1 -1
- package/2D/FrameGraph/renderGraphGUIBlock.pure.d.ts +48 -0
- package/2D/FrameGraph/renderGraphGUIBlock.pure.js +78 -0
- package/2D/FrameGraph/renderGraphGUIBlock.pure.js.map +1 -0
- package/2D/advancedDynamicTexture.d.ts +2 -2
- package/2D/advancedDynamicTexture.js +2 -2
- package/2D/advancedDynamicTexture.js.map +1 -1
- package/2D/controls/button.d.ts +3 -107
- package/2D/controls/button.js +5 -243
- package/2D/controls/button.js.map +1 -1
- package/2D/controls/button.pure.d.ts +114 -0
- package/2D/controls/button.pure.js +257 -0
- package/2D/controls/button.pure.js.map +1 -0
- package/2D/controls/checkbox.d.ts +3 -51
- package/2D/controls/checkbox.js +5 -161
- package/2D/controls/checkbox.js.map +1 -1
- package/2D/controls/checkbox.pure.d.ts +58 -0
- package/2D/controls/checkbox.pure.js +175 -0
- package/2D/controls/checkbox.pure.js.map +1 -0
- package/2D/controls/colorpicker.d.ts +5 -101
- package/2D/controls/colorpicker.js +7 -1394
- package/2D/controls/colorpicker.js.map +1 -1
- package/2D/controls/colorpicker.pure.d.ts +106 -0
- package/2D/controls/colorpicker.pure.js +1406 -0
- package/2D/controls/colorpicker.pure.js.map +1 -0
- package/2D/controls/container.d.ts +3 -177
- package/2D/controls/container.js +5 -615
- package/2D/controls/container.js.map +1 -1
- package/2D/controls/container.pure.d.ts +184 -0
- package/2D/controls/container.pure.js +629 -0
- package/2D/controls/container.pure.js.map +1 -0
- package/2D/controls/control.d.ts +3 -944
- package/2D/controls/control.js +5 -2457
- package/2D/controls/control.js.map +1 -1
- package/2D/controls/control.pure.d.ts +951 -0
- package/2D/controls/control.pure.js +2471 -0
- package/2D/controls/control.pure.js.map +1 -0
- package/2D/controls/displayGrid.d.ts +5 -53
- package/2D/controls/displayGrid.js +7 -201
- package/2D/controls/displayGrid.js.map +1 -1
- package/2D/controls/displayGrid.pure.d.ts +58 -0
- package/2D/controls/displayGrid.pure.js +213 -0
- package/2D/controls/displayGrid.pure.js.map +1 -0
- package/2D/controls/ellipse.d.ts +5 -25
- package/2D/controls/ellipse.js +7 -92
- package/2D/controls/ellipse.js.map +1 -1
- package/2D/controls/ellipse.pure.d.ts +30 -0
- package/2D/controls/ellipse.pure.js +104 -0
- package/2D/controls/ellipse.pure.js.map +1 -0
- package/2D/controls/focusableButton.d.ts +3 -15
- package/2D/controls/focusableButton.js +5 -22
- package/2D/controls/focusableButton.js.map +1 -1
- package/2D/controls/focusableButton.pure.d.ts +22 -0
- package/2D/controls/focusableButton.pure.js +36 -0
- package/2D/controls/focusableButton.pure.js.map +1 -0
- package/2D/controls/gradient/LinearGradient.d.ts +3 -43
- package/2D/controls/gradient/LinearGradient.js +5 -70
- package/2D/controls/gradient/LinearGradient.js.map +1 -1
- package/2D/controls/gradient/LinearGradient.pure.d.ts +50 -0
- package/2D/controls/gradient/LinearGradient.pure.js +84 -0
- package/2D/controls/gradient/LinearGradient.pure.js.map +1 -0
- package/2D/controls/gradient/RadialGradient.d.ts +3 -51
- package/2D/controls/gradient/RadialGradient.js +5 -86
- package/2D/controls/gradient/RadialGradient.js.map +1 -1
- package/2D/controls/gradient/RadialGradient.pure.d.ts +58 -0
- package/2D/controls/gradient/RadialGradient.pure.js +100 -0
- package/2D/controls/gradient/RadialGradient.pure.js.map +1 -0
- package/2D/controls/gradient/pure.d.ts +3 -0
- package/2D/controls/gradient/pure.js +4 -0
- package/2D/controls/gradient/pure.js.map +1 -0
- package/2D/controls/grid.d.ts +3 -149
- package/2D/controls/grid.js +5 -525
- package/2D/controls/grid.js.map +1 -1
- package/2D/controls/grid.pure.d.ts +156 -0
- package/2D/controls/grid.pure.js +539 -0
- package/2D/controls/grid.pure.js.map +1 -0
- package/2D/controls/image.d.ts +3 -226
- package/2D/controls/image.js +5 -913
- package/2D/controls/image.js.map +1 -1
- package/2D/controls/image.pure.d.ts +233 -0
- package/2D/controls/image.pure.js +927 -0
- package/2D/controls/image.pure.js.map +1 -0
- package/2D/controls/inputPassword.d.ts +3 -7
- package/2D/controls/inputPassword.js +5 -19
- package/2D/controls/inputPassword.js.map +1 -1
- package/2D/controls/inputPassword.pure.d.ts +14 -0
- package/2D/controls/inputPassword.pure.js +33 -0
- package/2D/controls/inputPassword.pure.js.map +1 -0
- package/2D/controls/inputText.d.ts +3 -202
- package/2D/controls/inputText.js +5 -1050
- package/2D/controls/inputText.js.map +1 -1
- package/2D/controls/inputText.pure.d.ts +209 -0
- package/2D/controls/inputText.pure.js +1064 -0
- package/2D/controls/inputText.pure.js.map +1 -0
- package/2D/controls/inputTextArea.d.ts +3 -140
- package/2D/controls/inputTextArea.js +5 -1023
- package/2D/controls/inputTextArea.js.map +1 -1
- package/2D/controls/inputTextArea.pure.d.ts +147 -0
- package/2D/controls/inputTextArea.pure.js +1037 -0
- package/2D/controls/inputTextArea.pure.js.map +1 -0
- package/2D/controls/line.d.ts +5 -74
- package/2D/controls/line.js +7 -234
- package/2D/controls/line.js.map +1 -1
- package/2D/controls/line.pure.d.ts +79 -0
- package/2D/controls/line.pure.js +246 -0
- package/2D/controls/line.pure.js.map +1 -0
- package/2D/controls/multiLine.d.ts +3 -73
- package/2D/controls/multiLine.js +5 -234
- package/2D/controls/multiLine.js.map +1 -1
- package/2D/controls/multiLine.pure.d.ts +80 -0
- package/2D/controls/multiLine.pure.js +248 -0
- package/2D/controls/multiLine.pure.js.map +1 -0
- package/2D/controls/pure.d.ts +38 -0
- package/2D/controls/pure.js +39 -0
- package/2D/controls/pure.js.map +1 -0
- package/2D/controls/radioButton.d.ts +3 -47
- package/2D/controls/radioButton.js +5 -182
- package/2D/controls/radioButton.js.map +1 -1
- package/2D/controls/radioButton.pure.d.ts +54 -0
- package/2D/controls/radioButton.pure.js +196 -0
- package/2D/controls/radioButton.pure.js.map +1 -0
- package/2D/controls/rectangle.d.ts +5 -43
- package/2D/controls/rectangle.js +7 -205
- package/2D/controls/rectangle.js.map +1 -1
- package/2D/controls/rectangle.pure.d.ts +48 -0
- package/2D/controls/rectangle.pure.js +217 -0
- package/2D/controls/rectangle.pure.js.map +1 -0
- package/2D/controls/scrollViewers/pure.d.ts +2 -0
- package/2D/controls/scrollViewers/pure.js +3 -0
- package/2D/controls/scrollViewers/pure.js.map +1 -0
- package/2D/controls/scrollViewers/scrollViewer.d.ts +3 -176
- package/2D/controls/scrollViewers/scrollViewer.js +5 -584
- package/2D/controls/scrollViewers/scrollViewer.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewer.pure.d.ts +183 -0
- package/2D/controls/scrollViewers/scrollViewer.pure.js +598 -0
- package/2D/controls/scrollViewers/scrollViewer.pure.js.map +1 -0
- package/2D/controls/scrollViewers/scrollViewerWindow.d.ts +1 -1
- package/2D/controls/scrollViewers/scrollViewerWindow.js +2 -2
- package/2D/controls/scrollViewers/scrollViewerWindow.js.map +1 -1
- package/2D/controls/selector.d.ts +2 -2
- package/2D/controls/selector.js +8 -8
- package/2D/controls/selector.js.map +1 -1
- package/2D/controls/sliders/baseSlider.d.ts +1 -1
- package/2D/controls/sliders/baseSlider.js +1 -1
- package/2D/controls/sliders/baseSlider.js.map +1 -1
- package/2D/controls/sliders/imageBasedSlider.d.ts +3 -45
- package/2D/controls/sliders/imageBasedSlider.js +5 -165
- package/2D/controls/sliders/imageBasedSlider.js.map +1 -1
- package/2D/controls/sliders/imageBasedSlider.pure.d.ts +52 -0
- package/2D/controls/sliders/imageBasedSlider.pure.js +179 -0
- package/2D/controls/sliders/imageBasedSlider.pure.js.map +1 -0
- package/2D/controls/sliders/pure.d.ts +4 -0
- package/2D/controls/sliders/pure.js +5 -0
- package/2D/controls/sliders/pure.js.map +1 -0
- package/2D/controls/sliders/scrollBar.d.ts +3 -48
- package/2D/controls/sliders/scrollBar.js +5 -170
- package/2D/controls/sliders/scrollBar.js.map +1 -1
- package/2D/controls/sliders/scrollBar.pure.d.ts +55 -0
- package/2D/controls/sliders/scrollBar.pure.js +184 -0
- package/2D/controls/sliders/scrollBar.pure.js.map +1 -0
- package/2D/controls/sliders/slider.d.ts +3 -44
- package/2D/controls/sliders/slider.js +5 -278
- package/2D/controls/sliders/slider.js.map +1 -1
- package/2D/controls/sliders/slider.pure.d.ts +51 -0
- package/2D/controls/sliders/slider.pure.js +292 -0
- package/2D/controls/sliders/slider.pure.js.map +1 -0
- package/2D/controls/stackPanel.d.ts +3 -62
- package/2D/controls/stackPanel.js +5 -243
- package/2D/controls/stackPanel.js.map +1 -1
- package/2D/controls/stackPanel.pure.d.ts +69 -0
- package/2D/controls/stackPanel.pure.js +257 -0
- package/2D/controls/stackPanel.pure.js.map +1 -0
- package/2D/controls/statics.d.ts +3 -4
- package/2D/controls/statics.js +5 -47
- package/2D/controls/statics.js.map +1 -1
- package/2D/controls/statics.pure.d.ts +11 -0
- package/2D/controls/statics.pure.js +61 -0
- package/2D/controls/statics.pure.js.map +1 -0
- package/2D/controls/textBlock.d.ts +3 -217
- package/2D/controls/textBlock.js +5 -676
- package/2D/controls/textBlock.js.map +1 -1
- package/2D/controls/textBlock.pure.d.ts +224 -0
- package/2D/controls/textBlock.pure.js +690 -0
- package/2D/controls/textBlock.pure.js.map +1 -0
- package/2D/controls/toggleButton.d.ts +3 -91
- package/2D/controls/toggleButton.js +5 -226
- package/2D/controls/toggleButton.js.map +1 -1
- package/2D/controls/toggleButton.pure.d.ts +98 -0
- package/2D/controls/toggleButton.pure.js +240 -0
- package/2D/controls/toggleButton.pure.js.map +1 -0
- package/2D/controls/virtualKeyboard.d.ts +3 -100
- package/2D/controls/virtualKeyboard.js +5 -272
- package/2D/controls/virtualKeyboard.js.map +1 -1
- package/2D/controls/virtualKeyboard.pure.d.ts +107 -0
- package/2D/controls/virtualKeyboard.pure.js +286 -0
- package/2D/controls/virtualKeyboard.pure.js.map +1 -0
- package/2D/math2D.d.ts +1 -1
- package/2D/math2D.js +1 -1
- package/2D/math2D.js.map +1 -1
- package/2D/measure.js +1 -1
- package/2D/measure.js.map +1 -1
- package/2D/pure.d.ts +13 -0
- package/2D/pure.js +15 -0
- package/2D/pure.js.map +1 -0
- package/3D/controls/MRTK3/touchHolographicButton.d.ts +4 -4
- package/3D/controls/MRTK3/touchHolographicButton.js +10 -10
- package/3D/controls/MRTK3/touchHolographicButton.js.map +1 -1
- package/3D/controls/holographicBackplate.d.ts +1 -1
- package/3D/controls/holographicBackplate.js +1 -1
- package/3D/controls/holographicBackplate.js.map +1 -1
- package/3D/controls/holographicButton.d.ts +1 -1
- package/3D/controls/holographicButton.js +4 -4
- package/3D/controls/holographicButton.js.map +1 -1
- package/3D/controls/holographicSlate.js +4 -4
- package/3D/controls/holographicSlate.js.map +1 -1
- package/3D/controls/pure.d.ts +23 -0
- package/3D/controls/pure.js +24 -0
- package/3D/controls/pure.js.map +1 -0
- package/3D/controls/slider3D.d.ts +3 -3
- package/3D/controls/slider3D.js +3 -3
- package/3D/controls/slider3D.js.map +1 -1
- package/3D/controls/touchHolographicButton.d.ts +2 -2
- package/3D/controls/touchHolographicButton.js +5 -5
- package/3D/controls/touchHolographicButton.js.map +1 -1
- package/3D/controls/touchHolographicMenu.js +1 -1
- package/3D/controls/touchHolographicMenu.js.map +1 -1
- package/3D/gizmos/gizmoHandle.d.ts +1 -1
- package/3D/gizmos/gizmoHandle.js +1 -1
- package/3D/gizmos/gizmoHandle.js.map +1 -1
- package/3D/gizmos/pure.d.ts +3 -0
- package/3D/gizmos/pure.js +4 -0
- package/3D/gizmos/pure.js.map +1 -0
- package/3D/materials/fluent/fluentMaterial.d.ts +5 -100
- package/3D/materials/fluent/fluentMaterial.js +7 -305
- package/3D/materials/fluent/fluentMaterial.js.map +1 -1
- package/3D/materials/fluent/fluentMaterial.pure.d.ts +105 -0
- package/3D/materials/fluent/fluentMaterial.pure.js +320 -0
- package/3D/materials/fluent/fluentMaterial.pure.js.map +1 -0
- package/3D/materials/fluent/pure.d.ts +2 -0
- package/3D/materials/fluent/pure.js +3 -0
- package/3D/materials/fluent/pure.js.map +1 -0
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.d.ts +5 -164
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js +7 -488
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.js.map +1 -1
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.d.ts +169 -0
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js +503 -0
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js.map +1 -0
- package/3D/materials/fluentBackplate/pure.d.ts +2 -0
- package/3D/materials/fluentBackplate/pure.js +3 -0
- package/3D/materials/fluentBackplate/pure.js.map +1 -0
- package/3D/materials/fluentButton/fluentButtonMaterial.d.ts +5 -200
- package/3D/materials/fluentButton/fluentButtonMaterial.js +7 -563
- package/3D/materials/fluentButton/fluentButtonMaterial.js.map +1 -1
- package/3D/materials/fluentButton/fluentButtonMaterial.pure.d.ts +205 -0
- package/3D/materials/fluentButton/fluentButtonMaterial.pure.js +578 -0
- package/3D/materials/fluentButton/fluentButtonMaterial.pure.js.map +1 -0
- package/3D/materials/fluentButton/pure.d.ts +2 -0
- package/3D/materials/fluentButton/pure.js +3 -0
- package/3D/materials/fluentButton/pure.js.map +1 -0
- package/3D/materials/fluentMaterial.d.ts +1 -1
- package/3D/materials/fluentMaterial.js +1 -1
- package/3D/materials/fluentMaterial.js.map +1 -1
- package/3D/materials/handle/handleMaterial.d.ts +5 -66
- package/3D/materials/handle/handleMaterial.js +5 -118
- package/3D/materials/handle/handleMaterial.js.map +1 -1
- package/3D/materials/handle/handleMaterial.pure.d.ts +66 -0
- package/3D/materials/handle/handleMaterial.pure.js +121 -0
- package/3D/materials/handle/handleMaterial.pure.js.map +1 -0
- package/3D/materials/handle/pure.d.ts +2 -0
- package/3D/materials/handle/pure.js +3 -0
- package/3D/materials/handle/pure.js.map +1 -0
- package/3D/materials/mrdl/mrdlBackglowMaterial.d.ts +5 -85
- package/3D/materials/mrdl/mrdlBackglowMaterial.js +7 -299
- package/3D/materials/mrdl/mrdlBackglowMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackglowMaterial.pure.d.ts +90 -0
- package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js +314 -0
- package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js.map +1 -0
- package/3D/materials/mrdl/mrdlBackplateMaterial.d.ts +5 -145
- package/3D/materials/mrdl/mrdlBackplateMaterial.js +7 -433
- package/3D/materials/mrdl/mrdlBackplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackplateMaterial.pure.d.ts +157 -0
- package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js +455 -0
- package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js.map +1 -0
- package/3D/materials/mrdl/mrdlFrontplateMaterial.d.ts +5 -183
- package/3D/materials/mrdl/mrdlFrontplateMaterial.js +7 -532
- package/3D/materials/mrdl/mrdlFrontplateMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.d.ts +188 -0
- package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js +547 -0
- package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js.map +1 -0
- package/3D/materials/mrdl/mrdlInnerquadMaterial.d.ts +5 -54
- package/3D/materials/mrdl/mrdlInnerquadMaterial.js +7 -227
- package/3D/materials/mrdl/mrdlInnerquadMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.d.ts +59 -0
- package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js +242 -0
- package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js.map +1 -0
- package/3D/materials/mrdl/mrdlSliderBarMaterial.d.ts +5 -334
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js +7 -855
- package/3D/materials/mrdl/mrdlSliderBarMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.d.ts +346 -0
- package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js +877 -0
- package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js.map +1 -0
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.d.ts +5 -334
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js +7 -855
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.d.ts +346 -0
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js +877 -0
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js.map +1 -0
- package/3D/materials/mrdl/pure.d.ts +7 -0
- package/3D/materials/mrdl/pure.js +8 -0
- package/3D/materials/mrdl/pure.js.map +1 -0
- package/3D/materials/pure.d.ts +6 -0
- package/3D/materials/pure.js +8 -0
- package/3D/materials/pure.js.map +1 -0
- package/3D/pure.d.ts +6 -0
- package/3D/pure.js +8 -0
- package/3D/pure.js.map +1 -0
- package/package.json +50 -3
- package/pure.d.ts +3 -0
- package/pure.js +5 -0
- package/pure.js.map +1 -0
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { type Nullable } from "@babylonjs/core/types.js";
|
|
2
|
+
import { type Matrix, Vector3, Vector4 } from "@babylonjs/core/Maths/math.vector.pure.js";
|
|
3
|
+
import { type IAnimatable } from "@babylonjs/core/Animations/animatable.interface.js";
|
|
4
|
+
import { type BaseTexture } from "@babylonjs/core/Materials/Textures/baseTexture.js";
|
|
5
|
+
import { PushMaterial } from "@babylonjs/core/Materials/pushMaterial.js";
|
|
6
|
+
import { type AbstractMesh } from "@babylonjs/core/Meshes/abstractMesh.pure.js";
|
|
7
|
+
import { type SubMesh } from "@babylonjs/core/Meshes/subMesh.js";
|
|
8
|
+
import { type Mesh } from "@babylonjs/core/Meshes/mesh.js";
|
|
9
|
+
import { type Scene } from "@babylonjs/core/scene.js";
|
|
10
|
+
import { Color4 } from "@babylonjs/core/Maths/math.color.pure.js";
|
|
11
|
+
/**
|
|
12
|
+
* Class used to render square buttons with fluent design
|
|
13
|
+
*/
|
|
14
|
+
export declare class FluentBackplateMaterial extends PushMaterial {
|
|
15
|
+
private _shadersLoaded;
|
|
16
|
+
/**
|
|
17
|
+
* URL pointing to the texture used to define the coloring for the fluent blob effect.
|
|
18
|
+
*/
|
|
19
|
+
static BLOB_TEXTURE_URL: string;
|
|
20
|
+
/**
|
|
21
|
+
* URL pointing to the texture used to define iridescent map.
|
|
22
|
+
*/
|
|
23
|
+
static IM_TEXTURE_URL: string;
|
|
24
|
+
private _blobTexture;
|
|
25
|
+
private _iridescentMap;
|
|
26
|
+
/**
|
|
27
|
+
* Gets or sets the corner radius on the backplate. Best to keep this value between 0.01 and 0.5. Default is 0.03.
|
|
28
|
+
*/
|
|
29
|
+
radius: number;
|
|
30
|
+
/**
|
|
31
|
+
* Gets or sets the line width of the backplate.
|
|
32
|
+
*/
|
|
33
|
+
lineWidth: number;
|
|
34
|
+
/**
|
|
35
|
+
* Gets or sets whether to use absolute sizes when calculating effects on the backplate.
|
|
36
|
+
* Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.
|
|
37
|
+
*/
|
|
38
|
+
absoluteSizes: boolean;
|
|
39
|
+
/** @internal */
|
|
40
|
+
_filterWidth: number;
|
|
41
|
+
/**
|
|
42
|
+
* Gets or sets the base color of the backplate.
|
|
43
|
+
*/
|
|
44
|
+
baseColor: Color4;
|
|
45
|
+
/**
|
|
46
|
+
* Gets or sets the line color of the backplate.
|
|
47
|
+
*/
|
|
48
|
+
lineColor: Color4;
|
|
49
|
+
/**
|
|
50
|
+
* Gets or sets the intensity of the fluent hover glow effect.
|
|
51
|
+
*/
|
|
52
|
+
blobIntensity: number;
|
|
53
|
+
/**
|
|
54
|
+
* Gets or sets the far size of the fluent hover glow effect.
|
|
55
|
+
*/
|
|
56
|
+
blobFarSize: number;
|
|
57
|
+
/**
|
|
58
|
+
* Gets or sets the distance considered "near" to the backplate, which controls the size of the fluent hover glow effect (see blobNearSize).
|
|
59
|
+
*/
|
|
60
|
+
blobNearDistance: number;
|
|
61
|
+
/**
|
|
62
|
+
* Gets or sets the distance considered "far" from the backplate, which controls the size of the fluent hover glow effect (see blobFarSize).
|
|
63
|
+
*/
|
|
64
|
+
blobFarDistance: number;
|
|
65
|
+
/**
|
|
66
|
+
* Gets or sets the length of the fluent hover glow effect fade.
|
|
67
|
+
*/
|
|
68
|
+
blobFadeLength: number;
|
|
69
|
+
/**
|
|
70
|
+
* Gets or sets the size of the fluent hover glow effect when the left pointer is considered "near" to the backplate (see blobNearDistance).
|
|
71
|
+
*/
|
|
72
|
+
blobNearSize: number;
|
|
73
|
+
/**
|
|
74
|
+
* Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).
|
|
75
|
+
*/
|
|
76
|
+
blobPulse: number;
|
|
77
|
+
/**
|
|
78
|
+
* Gets or sets the opacity of the fluent hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.
|
|
79
|
+
*/
|
|
80
|
+
blobFade: number;
|
|
81
|
+
/**
|
|
82
|
+
* Gets or sets the size of the fluent hover glow effect when the right pointer is considered "near" to the backplate (see blobNearDistance).
|
|
83
|
+
*/
|
|
84
|
+
blobNearSize2: number;
|
|
85
|
+
/**
|
|
86
|
+
* Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).
|
|
87
|
+
*/
|
|
88
|
+
blobPulse2: number;
|
|
89
|
+
/**
|
|
90
|
+
* Gets or sets the opacity of the fluent hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 0.
|
|
91
|
+
*/
|
|
92
|
+
blobFade2: number;
|
|
93
|
+
/** @internal */
|
|
94
|
+
_rate: number;
|
|
95
|
+
/**
|
|
96
|
+
* Gets or sets the color of the highlights on the backplate line.
|
|
97
|
+
*/
|
|
98
|
+
highlightColor: Color4;
|
|
99
|
+
/**
|
|
100
|
+
* Gets or sets the width of the highlights on the backplate line.
|
|
101
|
+
*/
|
|
102
|
+
highlightWidth: number;
|
|
103
|
+
/** @internal */
|
|
104
|
+
_highlightTransform: Vector4;
|
|
105
|
+
/** @internal */
|
|
106
|
+
_highlight: number;
|
|
107
|
+
/**
|
|
108
|
+
* Gets or sets the intensity of the iridescence effect.
|
|
109
|
+
*/
|
|
110
|
+
iridescenceIntensity: number;
|
|
111
|
+
/**
|
|
112
|
+
* Gets or sets the intensity of the iridescence effect on the backplate edges.
|
|
113
|
+
*/
|
|
114
|
+
iridescenceEdgeIntensity: number;
|
|
115
|
+
/** @internal */
|
|
116
|
+
_angle: number;
|
|
117
|
+
/**
|
|
118
|
+
* Gets or sets the opacity of the backplate (0.0 - 1.0).
|
|
119
|
+
*/
|
|
120
|
+
fadeOut: number;
|
|
121
|
+
/** @internal */
|
|
122
|
+
_reflected: boolean;
|
|
123
|
+
/** @internal */
|
|
124
|
+
_frequency: number;
|
|
125
|
+
/** @internal */
|
|
126
|
+
_verticalOffset: number;
|
|
127
|
+
/**
|
|
128
|
+
* Gets or sets the world-space position of the tip of the left index finger.
|
|
129
|
+
*/
|
|
130
|
+
globalLeftIndexTipPosition: Vector3;
|
|
131
|
+
private _globalLeftIndexTipPosition4;
|
|
132
|
+
/**
|
|
133
|
+
* Gets or sets the world-space position of the tip of the right index finger.
|
|
134
|
+
*/
|
|
135
|
+
globalRightIndexTipPosition: Vector3;
|
|
136
|
+
private _globalRightIndexTipPosition4;
|
|
137
|
+
constructor(name: string, scene?: Scene);
|
|
138
|
+
needAlphaBlending(): boolean;
|
|
139
|
+
needAlphaTesting(): boolean;
|
|
140
|
+
getAlphaTestTexture(): Nullable<BaseTexture>;
|
|
141
|
+
isReadyForSubMesh(mesh: AbstractMesh, subMesh: SubMesh): boolean;
|
|
142
|
+
bindForSubMesh(world: Matrix, mesh: Mesh, subMesh: SubMesh): void;
|
|
143
|
+
/**
|
|
144
|
+
* Get the list of animatables in the material.
|
|
145
|
+
* @returns the list of animatables object used in the material
|
|
146
|
+
*/
|
|
147
|
+
getAnimatables(): IAnimatable[];
|
|
148
|
+
/**
|
|
149
|
+
* Disposes the material.
|
|
150
|
+
* @param forceDisposeEffect specifies if effects should be forcefully disposed
|
|
151
|
+
*/
|
|
152
|
+
dispose(forceDisposeEffect?: boolean): void;
|
|
153
|
+
clone(name: string): FluentBackplateMaterial;
|
|
154
|
+
serialize(): any;
|
|
155
|
+
getClassName(): string;
|
|
156
|
+
/**
|
|
157
|
+
* Creates a fluent backplate material from parsed material data.
|
|
158
|
+
* @param source defines the JSON representation of the material
|
|
159
|
+
* @param scene defines the hosting scene
|
|
160
|
+
* @param rootUrl defines the root URL to use to load textures and relative dependencies
|
|
161
|
+
* @returns a new fluent backplate material
|
|
162
|
+
*/
|
|
163
|
+
static Parse(source: any, scene: Scene, rootUrl: string): FluentBackplateMaterial;
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Registers the FluentBackplateMaterial class with the type store for serialization support.
|
|
167
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
168
|
+
*/
|
|
169
|
+
export declare function RegisterFluentBackplateMaterial(): void;
|
|
@@ -0,0 +1,503 @@
|
|
|
1
|
+
import { __decorate } from "@babylonjs/core/tslib.es6.js";
|
|
2
|
+
import { serialize, serializeAsVector3 } from "@babylonjs/core/Misc/decorators.js";
|
|
3
|
+
import { SerializationHelper } from "@babylonjs/core/Misc/decorators.serialization.js";
|
|
4
|
+
import { Vector3, Vector4 } from "@babylonjs/core/Maths/math.vector.pure.js";
|
|
5
|
+
import { Texture } from "@babylonjs/core/Materials/Textures/texture.pure.js";
|
|
6
|
+
import { MaterialDefines } from "@babylonjs/core/Materials/materialDefines.js";
|
|
7
|
+
import { PushMaterial } from "@babylonjs/core/Materials/pushMaterial.js";
|
|
8
|
+
import { VertexBuffer } from "@babylonjs/core/Buffers/buffer.pure.js";
|
|
9
|
+
import { RegisterClass } from "@babylonjs/core/Misc/typeStore.js";
|
|
10
|
+
import { Color4 } from "@babylonjs/core/Maths/math.color.pure.js";
|
|
11
|
+
import { EffectFallbacks } from "@babylonjs/core/Materials/effectFallbacks.js";
|
|
12
|
+
import { Constants } from "@babylonjs/core/Engines/constants.js";
|
|
13
|
+
import { HandleFallbacksForShadows, PrepareAttributesForInstances, PrepareDefinesForAttributes, PrepareUniformsAndSamplersList } from "@babylonjs/core/Materials/materialHelper.functions.js";
|
|
14
|
+
import { Tools } from "@babylonjs/core/Misc/tools.pure.js";
|
|
15
|
+
/** @internal */
|
|
16
|
+
class FluentBackplateMaterialDefines extends MaterialDefines {
|
|
17
|
+
constructor() {
|
|
18
|
+
super();
|
|
19
|
+
this.BLOB_ENABLE = true;
|
|
20
|
+
this.BLOB_ENABLE_2 = true;
|
|
21
|
+
this.SMOOTH_EDGES = true;
|
|
22
|
+
this.IRIDESCENT_MAP_ENABLE = true;
|
|
23
|
+
this._needNormals = true;
|
|
24
|
+
this.rebuild();
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Class used to render square buttons with fluent design
|
|
29
|
+
*/
|
|
30
|
+
export class FluentBackplateMaterial extends PushMaterial {
|
|
31
|
+
constructor(name, scene) {
|
|
32
|
+
super(name, scene);
|
|
33
|
+
this._shadersLoaded = false;
|
|
34
|
+
/**
|
|
35
|
+
* Gets or sets the corner radius on the backplate. Best to keep this value between 0.01 and 0.5. Default is 0.03.
|
|
36
|
+
*/
|
|
37
|
+
this.radius = 0.03;
|
|
38
|
+
/**
|
|
39
|
+
* Gets or sets the line width of the backplate.
|
|
40
|
+
*/
|
|
41
|
+
this.lineWidth = 0.01;
|
|
42
|
+
/**
|
|
43
|
+
* Gets or sets whether to use absolute sizes when calculating effects on the backplate.
|
|
44
|
+
* Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.
|
|
45
|
+
*/
|
|
46
|
+
this.absoluteSizes = false;
|
|
47
|
+
/** @internal */
|
|
48
|
+
this._filterWidth = 1;
|
|
49
|
+
/**
|
|
50
|
+
* Gets or sets the base color of the backplate.
|
|
51
|
+
*/
|
|
52
|
+
this.baseColor = new Color4(0.0392157, 0.0666667, 0.207843, 1);
|
|
53
|
+
/**
|
|
54
|
+
* Gets or sets the line color of the backplate.
|
|
55
|
+
*/
|
|
56
|
+
this.lineColor = new Color4(0.14902, 0.133333, 0.384314, 1);
|
|
57
|
+
/**
|
|
58
|
+
* Gets or sets the intensity of the fluent hover glow effect.
|
|
59
|
+
*/
|
|
60
|
+
this.blobIntensity = 0.98;
|
|
61
|
+
/**
|
|
62
|
+
* Gets or sets the far size of the fluent hover glow effect.
|
|
63
|
+
*/
|
|
64
|
+
this.blobFarSize = 0.04;
|
|
65
|
+
/**
|
|
66
|
+
* Gets or sets the distance considered "near" to the backplate, which controls the size of the fluent hover glow effect (see blobNearSize).
|
|
67
|
+
*/
|
|
68
|
+
this.blobNearDistance = 0;
|
|
69
|
+
/**
|
|
70
|
+
* Gets or sets the distance considered "far" from the backplate, which controls the size of the fluent hover glow effect (see blobFarSize).
|
|
71
|
+
*/
|
|
72
|
+
this.blobFarDistance = 0.08;
|
|
73
|
+
/**
|
|
74
|
+
* Gets or sets the length of the fluent hover glow effect fade.
|
|
75
|
+
*/
|
|
76
|
+
this.blobFadeLength = 0.08;
|
|
77
|
+
/**
|
|
78
|
+
* Gets or sets the size of the fluent hover glow effect when the left pointer is considered "near" to the backplate (see blobNearDistance).
|
|
79
|
+
*/
|
|
80
|
+
this.blobNearSize = 0.22;
|
|
81
|
+
/**
|
|
82
|
+
* Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).
|
|
83
|
+
*/
|
|
84
|
+
this.blobPulse = 0;
|
|
85
|
+
/**
|
|
86
|
+
* Gets or sets the opacity of the fluent hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.
|
|
87
|
+
*/
|
|
88
|
+
this.blobFade = 0;
|
|
89
|
+
/**
|
|
90
|
+
* Gets or sets the size of the fluent hover glow effect when the right pointer is considered "near" to the backplate (see blobNearDistance).
|
|
91
|
+
*/
|
|
92
|
+
this.blobNearSize2 = 0.22;
|
|
93
|
+
/**
|
|
94
|
+
* Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).
|
|
95
|
+
*/
|
|
96
|
+
this.blobPulse2 = 0;
|
|
97
|
+
/**
|
|
98
|
+
* Gets or sets the opacity of the fluent hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 0.
|
|
99
|
+
*/
|
|
100
|
+
this.blobFade2 = 0;
|
|
101
|
+
/** @internal */
|
|
102
|
+
this._rate = 0.135;
|
|
103
|
+
/**
|
|
104
|
+
* Gets or sets the color of the highlights on the backplate line.
|
|
105
|
+
*/
|
|
106
|
+
this.highlightColor = new Color4(0.98, 0.98, 0.98, 1);
|
|
107
|
+
/**
|
|
108
|
+
* Gets or sets the width of the highlights on the backplate line.
|
|
109
|
+
*/
|
|
110
|
+
this.highlightWidth = 0.25;
|
|
111
|
+
/** @internal */
|
|
112
|
+
this._highlightTransform = new Vector4(1, 1, 0, 0);
|
|
113
|
+
/** @internal */
|
|
114
|
+
this._highlight = 1;
|
|
115
|
+
/**
|
|
116
|
+
* Gets or sets the intensity of the iridescence effect.
|
|
117
|
+
*/
|
|
118
|
+
this.iridescenceIntensity = 0;
|
|
119
|
+
/**
|
|
120
|
+
* Gets or sets the intensity of the iridescence effect on the backplate edges.
|
|
121
|
+
*/
|
|
122
|
+
this.iridescenceEdgeIntensity = 1;
|
|
123
|
+
/** @internal */
|
|
124
|
+
this._angle = -45;
|
|
125
|
+
/**
|
|
126
|
+
* Gets or sets the opacity of the backplate (0.0 - 1.0).
|
|
127
|
+
*/
|
|
128
|
+
this.fadeOut = 1;
|
|
129
|
+
/** @internal */
|
|
130
|
+
this._reflected = true;
|
|
131
|
+
/** @internal */
|
|
132
|
+
this._frequency = 1;
|
|
133
|
+
/** @internal */
|
|
134
|
+
this._verticalOffset = 0;
|
|
135
|
+
/**
|
|
136
|
+
* Gets or sets the world-space position of the tip of the left index finger.
|
|
137
|
+
*/
|
|
138
|
+
this.globalLeftIndexTipPosition = Vector3.Zero();
|
|
139
|
+
this._globalLeftIndexTipPosition4 = Vector4.Zero();
|
|
140
|
+
/**
|
|
141
|
+
* Gets or sets the world-space position of the tip of the right index finger.
|
|
142
|
+
*/
|
|
143
|
+
this.globalRightIndexTipPosition = Vector3.Zero();
|
|
144
|
+
this._globalRightIndexTipPosition4 = Vector4.Zero();
|
|
145
|
+
this.alphaMode = Constants.ALPHA_DISABLE;
|
|
146
|
+
this.backFaceCulling = false;
|
|
147
|
+
const blobTextureUrl = Tools.GetAssetUrl(FluentBackplateMaterial.BLOB_TEXTURE_URL);
|
|
148
|
+
const iridescentMapUrl = Tools.GetAssetUrl(FluentBackplateMaterial.IM_TEXTURE_URL);
|
|
149
|
+
this._blobTexture = new Texture(blobTextureUrl, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
|
|
150
|
+
this._iridescentMap = new Texture(iridescentMapUrl, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
|
|
151
|
+
}
|
|
152
|
+
needAlphaBlending() {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
needAlphaTesting() {
|
|
156
|
+
return false;
|
|
157
|
+
}
|
|
158
|
+
getAlphaTestTexture() {
|
|
159
|
+
return null;
|
|
160
|
+
}
|
|
161
|
+
isReadyForSubMesh(mesh, subMesh) {
|
|
162
|
+
const drawWrapper = subMesh._drawWrapper;
|
|
163
|
+
if (this.isFrozen) {
|
|
164
|
+
if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {
|
|
165
|
+
return true;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
if (!this._blobTexture.isReady() || !this._iridescentMap.isReady()) {
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
if (!subMesh.materialDefines) {
|
|
172
|
+
subMesh.materialDefines = new FluentBackplateMaterialDefines();
|
|
173
|
+
}
|
|
174
|
+
const defines = subMesh.materialDefines;
|
|
175
|
+
const scene = this.getScene();
|
|
176
|
+
if (this._isReadyForSubMesh(subMesh)) {
|
|
177
|
+
return true;
|
|
178
|
+
}
|
|
179
|
+
const engine = scene.getEngine();
|
|
180
|
+
// Attribs
|
|
181
|
+
PrepareDefinesForAttributes(mesh, defines, false, false);
|
|
182
|
+
// Get correct effect
|
|
183
|
+
if (defines.isDirty) {
|
|
184
|
+
defines.markAsProcessed();
|
|
185
|
+
scene.resetCachedMaterial();
|
|
186
|
+
// Fallbacks
|
|
187
|
+
const fallbacks = new EffectFallbacks();
|
|
188
|
+
if (defines.FOG) {
|
|
189
|
+
fallbacks.addFallback(1, "FOG");
|
|
190
|
+
}
|
|
191
|
+
HandleFallbacksForShadows(defines, fallbacks);
|
|
192
|
+
defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
|
|
193
|
+
//Attributes
|
|
194
|
+
const attribs = [VertexBuffer.PositionKind];
|
|
195
|
+
if (defines.NORMAL) {
|
|
196
|
+
attribs.push(VertexBuffer.NormalKind);
|
|
197
|
+
}
|
|
198
|
+
if (defines.UV1) {
|
|
199
|
+
attribs.push(VertexBuffer.UVKind);
|
|
200
|
+
}
|
|
201
|
+
if (defines.UV2) {
|
|
202
|
+
attribs.push(VertexBuffer.UV2Kind);
|
|
203
|
+
}
|
|
204
|
+
if (defines.VERTEXCOLOR) {
|
|
205
|
+
attribs.push(VertexBuffer.ColorKind);
|
|
206
|
+
}
|
|
207
|
+
if (defines.TANGENT) {
|
|
208
|
+
attribs.push(VertexBuffer.TangentKind);
|
|
209
|
+
}
|
|
210
|
+
PrepareAttributesForInstances(attribs, defines);
|
|
211
|
+
// Legacy browser patch
|
|
212
|
+
const shaderName = "fluentBackplate";
|
|
213
|
+
const join = defines.toString();
|
|
214
|
+
const uniforms = [
|
|
215
|
+
"world",
|
|
216
|
+
"viewProjection",
|
|
217
|
+
"cameraPosition",
|
|
218
|
+
"_Radius_",
|
|
219
|
+
"_Line_Width_",
|
|
220
|
+
"_Absolute_Sizes_",
|
|
221
|
+
"_Filter_Width_",
|
|
222
|
+
"_Base_Color_",
|
|
223
|
+
"_Line_Color_",
|
|
224
|
+
"_Radius_Top_Left_",
|
|
225
|
+
"_Radius_Top_Right_",
|
|
226
|
+
"_Radius_Bottom_Left_",
|
|
227
|
+
"_Radius_Bottom_Right_",
|
|
228
|
+
"_Blob_Position_",
|
|
229
|
+
"_Blob_Intensity_",
|
|
230
|
+
"_Blob_Near_Size_",
|
|
231
|
+
"_Blob_Far_Size_",
|
|
232
|
+
"_Blob_Near_Distance_",
|
|
233
|
+
"_Blob_Far_Distance_",
|
|
234
|
+
"_Blob_Fade_Length_",
|
|
235
|
+
"_Blob_Pulse_",
|
|
236
|
+
"_Blob_Fade_",
|
|
237
|
+
"_Blob_Texture_",
|
|
238
|
+
"_Blob_Position_2_",
|
|
239
|
+
"_Blob_Near_Size_2_",
|
|
240
|
+
"_Blob_Pulse_2_",
|
|
241
|
+
"_Blob_Fade_2_",
|
|
242
|
+
"_Rate_",
|
|
243
|
+
"_Highlight_Color_",
|
|
244
|
+
"_Highlight_Width_",
|
|
245
|
+
"_Highlight_Transform_",
|
|
246
|
+
"_Highlight_",
|
|
247
|
+
"_Iridescence_Intensity_",
|
|
248
|
+
"_Iridescence_Edge_Intensity_",
|
|
249
|
+
"_Angle_",
|
|
250
|
+
"_Fade_Out_",
|
|
251
|
+
"_Reflected_",
|
|
252
|
+
"_Frequency_",
|
|
253
|
+
"_Vertical_Offset_",
|
|
254
|
+
"_Iridescent_Map_",
|
|
255
|
+
"_Use_Global_Left_Index_",
|
|
256
|
+
"_Use_Global_Right_Index_",
|
|
257
|
+
"Global_Left_Index_Tip_Position",
|
|
258
|
+
"Global_Right_Index_Tip_Position",
|
|
259
|
+
];
|
|
260
|
+
const samplers = ["_Blob_Texture_", "_Iridescent_Map_"];
|
|
261
|
+
const uniformBuffers = [];
|
|
262
|
+
PrepareUniformsAndSamplersList({
|
|
263
|
+
uniformsNames: uniforms,
|
|
264
|
+
uniformBuffersNames: uniformBuffers,
|
|
265
|
+
samplers: samplers,
|
|
266
|
+
defines: defines,
|
|
267
|
+
maxSimultaneousLights: 4,
|
|
268
|
+
shaderLanguage: this._shaderLanguage,
|
|
269
|
+
});
|
|
270
|
+
subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
|
|
271
|
+
attributes: attribs,
|
|
272
|
+
uniformsNames: uniforms,
|
|
273
|
+
uniformBuffersNames: uniformBuffers,
|
|
274
|
+
samplers: samplers,
|
|
275
|
+
defines: join,
|
|
276
|
+
fallbacks: fallbacks,
|
|
277
|
+
onCompiled: this.onCompiled,
|
|
278
|
+
onError: this.onError,
|
|
279
|
+
indexParameters: { maxSimultaneousLights: 4 },
|
|
280
|
+
shaderLanguage: this._shaderLanguage,
|
|
281
|
+
extraInitializationsAsync: this._shadersLoaded
|
|
282
|
+
? undefined
|
|
283
|
+
: async () => {
|
|
284
|
+
if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
|
|
285
|
+
await Promise.all([import("./wgsl/fluentBackplate.vertex.js"), import("./wgsl/fluentBackplate.fragment.js")]);
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
await Promise.all([import("./shaders/fluentBackplate.vertex.js"), import("./shaders/fluentBackplate.fragment.js")]);
|
|
289
|
+
}
|
|
290
|
+
this._shadersLoaded = true;
|
|
291
|
+
},
|
|
292
|
+
}, engine), defines, this._materialContext);
|
|
293
|
+
}
|
|
294
|
+
if (!subMesh.effect || !subMesh.effect.isReady()) {
|
|
295
|
+
return false;
|
|
296
|
+
}
|
|
297
|
+
defines._renderId = scene.getRenderId();
|
|
298
|
+
drawWrapper._wasPreviouslyReady = true;
|
|
299
|
+
return true;
|
|
300
|
+
}
|
|
301
|
+
bindForSubMesh(world, mesh, subMesh) {
|
|
302
|
+
const defines = subMesh.materialDefines;
|
|
303
|
+
if (!defines) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
const effect = subMesh.effect;
|
|
307
|
+
if (!effect) {
|
|
308
|
+
return;
|
|
309
|
+
}
|
|
310
|
+
this._activeEffect = effect;
|
|
311
|
+
// Matrices
|
|
312
|
+
this.bindOnlyWorldMatrix(world);
|
|
313
|
+
this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
|
|
314
|
+
this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera?.position ?? Vector3.ZeroReadOnly);
|
|
315
|
+
// "Round Rect"
|
|
316
|
+
this._activeEffect.setFloat("_Radius_", this.radius);
|
|
317
|
+
this._activeEffect.setFloat("_Line_Width_", this.lineWidth);
|
|
318
|
+
this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1.0 : 0.0);
|
|
319
|
+
this._activeEffect.setFloat("_Filter_Width_", this._filterWidth);
|
|
320
|
+
this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor);
|
|
321
|
+
this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor);
|
|
322
|
+
// "Radii Multipliers"
|
|
323
|
+
this._activeEffect.setFloat("_Radius_Top_Left_", 1);
|
|
324
|
+
this._activeEffect.setFloat("_Radius_Top_Right_", 1.0);
|
|
325
|
+
this._activeEffect.setFloat("_Radius_Bottom_Left_", 1.0);
|
|
326
|
+
this._activeEffect.setFloat("_Radius_Bottom_Right_", 1.0);
|
|
327
|
+
// "Blob"
|
|
328
|
+
//define BLOB_ENABLE true;
|
|
329
|
+
this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
|
|
330
|
+
this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize);
|
|
331
|
+
this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
|
|
332
|
+
this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
|
|
333
|
+
this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
|
|
334
|
+
this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
|
|
335
|
+
this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse);
|
|
336
|
+
this._activeEffect.setFloat("_Blob_Fade_", this.blobFade);
|
|
337
|
+
// "Blob Texture"
|
|
338
|
+
this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture);
|
|
339
|
+
// "Blob 2"
|
|
340
|
+
//define BLOB_ENABLE_2 true;
|
|
341
|
+
this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2);
|
|
342
|
+
this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2);
|
|
343
|
+
this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2);
|
|
344
|
+
// "Line Highlight"
|
|
345
|
+
this._activeEffect.setFloat("_Rate_", this._rate);
|
|
346
|
+
this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor);
|
|
347
|
+
this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth);
|
|
348
|
+
this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform);
|
|
349
|
+
this._activeEffect.setFloat("_Highlight_", this._highlight);
|
|
350
|
+
// "Iridescence"
|
|
351
|
+
this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
|
|
352
|
+
this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity);
|
|
353
|
+
this._activeEffect.setFloat("_Angle_", this._angle);
|
|
354
|
+
// "Fade"
|
|
355
|
+
this._activeEffect.setFloat("_Fade_Out_", this.fadeOut);
|
|
356
|
+
// "Antialiasing"
|
|
357
|
+
//define SMOOTH_EDGES true;
|
|
358
|
+
// "ChooseAngle"
|
|
359
|
+
this._activeEffect.setFloat("_Reflected_", this._reflected ? 1.0 : 0.0);
|
|
360
|
+
// "Multiply"
|
|
361
|
+
this._activeEffect.setFloat("_Frequency_", this._frequency);
|
|
362
|
+
this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset);
|
|
363
|
+
// "Color Texture"
|
|
364
|
+
//define IRIDESCENT_MAP_ENABLE true;
|
|
365
|
+
this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMap);
|
|
366
|
+
// "Global"
|
|
367
|
+
this._activeEffect.setFloat("_Use_Global_Left_Index_", 1.0);
|
|
368
|
+
this._activeEffect.setFloat("_Use_Global_Right_Index_", 1.0);
|
|
369
|
+
this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1.0);
|
|
370
|
+
this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this._globalLeftIndexTipPosition4);
|
|
371
|
+
this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1.0);
|
|
372
|
+
this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this._globalRightIndexTipPosition4);
|
|
373
|
+
this._afterBind(mesh, this._activeEffect, subMesh);
|
|
374
|
+
}
|
|
375
|
+
/**
|
|
376
|
+
* Get the list of animatables in the material.
|
|
377
|
+
* @returns the list of animatables object used in the material
|
|
378
|
+
*/
|
|
379
|
+
getAnimatables() {
|
|
380
|
+
return [];
|
|
381
|
+
}
|
|
382
|
+
/**
|
|
383
|
+
* Disposes the material.
|
|
384
|
+
* @param forceDisposeEffect specifies if effects should be forcefully disposed
|
|
385
|
+
*/
|
|
386
|
+
dispose(forceDisposeEffect) {
|
|
387
|
+
super.dispose(forceDisposeEffect);
|
|
388
|
+
this._blobTexture.dispose();
|
|
389
|
+
this._iridescentMap.dispose();
|
|
390
|
+
}
|
|
391
|
+
clone(name) {
|
|
392
|
+
return SerializationHelper.Clone(() => new FluentBackplateMaterial(name, this.getScene()), this);
|
|
393
|
+
}
|
|
394
|
+
serialize() {
|
|
395
|
+
const serializationObject = super.serialize();
|
|
396
|
+
serializationObject.customType = "BABYLON.FluentBackplateMaterial";
|
|
397
|
+
return serializationObject;
|
|
398
|
+
}
|
|
399
|
+
getClassName() {
|
|
400
|
+
return "FluentBackplateMaterial";
|
|
401
|
+
}
|
|
402
|
+
// Statics
|
|
403
|
+
/**
|
|
404
|
+
* Creates a fluent backplate material from parsed material data.
|
|
405
|
+
* @param source defines the JSON representation of the material
|
|
406
|
+
* @param scene defines the hosting scene
|
|
407
|
+
* @param rootUrl defines the root URL to use to load textures and relative dependencies
|
|
408
|
+
* @returns a new fluent backplate material
|
|
409
|
+
*/
|
|
410
|
+
static Parse(source, scene, rootUrl) {
|
|
411
|
+
return SerializationHelper.Parse(() => new FluentBackplateMaterial(source.name, scene), source, scene, rootUrl);
|
|
412
|
+
}
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* URL pointing to the texture used to define the coloring for the fluent blob effect.
|
|
416
|
+
*/
|
|
417
|
+
FluentBackplateMaterial.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/core/MRTK/mrtk-fluent-backplate-blob.png";
|
|
418
|
+
/**
|
|
419
|
+
* URL pointing to the texture used to define iridescent map.
|
|
420
|
+
*/
|
|
421
|
+
FluentBackplateMaterial.IM_TEXTURE_URL = "https://assets.babylonjs.com/core/MRTK/mrtk-fluent-backplate-iridescence.png";
|
|
422
|
+
__decorate([
|
|
423
|
+
serialize()
|
|
424
|
+
], FluentBackplateMaterial.prototype, "radius", void 0);
|
|
425
|
+
__decorate([
|
|
426
|
+
serialize()
|
|
427
|
+
], FluentBackplateMaterial.prototype, "lineWidth", void 0);
|
|
428
|
+
__decorate([
|
|
429
|
+
serialize()
|
|
430
|
+
], FluentBackplateMaterial.prototype, "absoluteSizes", void 0);
|
|
431
|
+
__decorate([
|
|
432
|
+
serialize()
|
|
433
|
+
], FluentBackplateMaterial.prototype, "baseColor", void 0);
|
|
434
|
+
__decorate([
|
|
435
|
+
serialize()
|
|
436
|
+
], FluentBackplateMaterial.prototype, "lineColor", void 0);
|
|
437
|
+
__decorate([
|
|
438
|
+
serialize()
|
|
439
|
+
], FluentBackplateMaterial.prototype, "blobIntensity", void 0);
|
|
440
|
+
__decorate([
|
|
441
|
+
serialize()
|
|
442
|
+
], FluentBackplateMaterial.prototype, "blobFarSize", void 0);
|
|
443
|
+
__decorate([
|
|
444
|
+
serialize()
|
|
445
|
+
], FluentBackplateMaterial.prototype, "blobNearDistance", void 0);
|
|
446
|
+
__decorate([
|
|
447
|
+
serialize()
|
|
448
|
+
], FluentBackplateMaterial.prototype, "blobFarDistance", void 0);
|
|
449
|
+
__decorate([
|
|
450
|
+
serialize()
|
|
451
|
+
], FluentBackplateMaterial.prototype, "blobFadeLength", void 0);
|
|
452
|
+
__decorate([
|
|
453
|
+
serialize()
|
|
454
|
+
], FluentBackplateMaterial.prototype, "blobNearSize", void 0);
|
|
455
|
+
__decorate([
|
|
456
|
+
serialize()
|
|
457
|
+
], FluentBackplateMaterial.prototype, "blobPulse", void 0);
|
|
458
|
+
__decorate([
|
|
459
|
+
serialize()
|
|
460
|
+
], FluentBackplateMaterial.prototype, "blobFade", void 0);
|
|
461
|
+
__decorate([
|
|
462
|
+
serialize()
|
|
463
|
+
], FluentBackplateMaterial.prototype, "blobNearSize2", void 0);
|
|
464
|
+
__decorate([
|
|
465
|
+
serialize()
|
|
466
|
+
], FluentBackplateMaterial.prototype, "blobPulse2", void 0);
|
|
467
|
+
__decorate([
|
|
468
|
+
serialize()
|
|
469
|
+
], FluentBackplateMaterial.prototype, "blobFade2", void 0);
|
|
470
|
+
__decorate([
|
|
471
|
+
serialize()
|
|
472
|
+
], FluentBackplateMaterial.prototype, "highlightColor", void 0);
|
|
473
|
+
__decorate([
|
|
474
|
+
serialize()
|
|
475
|
+
], FluentBackplateMaterial.prototype, "highlightWidth", void 0);
|
|
476
|
+
__decorate([
|
|
477
|
+
serialize()
|
|
478
|
+
], FluentBackplateMaterial.prototype, "iridescenceIntensity", void 0);
|
|
479
|
+
__decorate([
|
|
480
|
+
serialize()
|
|
481
|
+
], FluentBackplateMaterial.prototype, "iridescenceEdgeIntensity", void 0);
|
|
482
|
+
__decorate([
|
|
483
|
+
serialize()
|
|
484
|
+
], FluentBackplateMaterial.prototype, "fadeOut", void 0);
|
|
485
|
+
__decorate([
|
|
486
|
+
serializeAsVector3()
|
|
487
|
+
], FluentBackplateMaterial.prototype, "globalLeftIndexTipPosition", void 0);
|
|
488
|
+
__decorate([
|
|
489
|
+
serializeAsVector3()
|
|
490
|
+
], FluentBackplateMaterial.prototype, "globalRightIndexTipPosition", void 0);
|
|
491
|
+
let _Registered = false;
|
|
492
|
+
/**
|
|
493
|
+
* Registers the FluentBackplateMaterial class with the type store for serialization support.
|
|
494
|
+
* Safe to call multiple times; only the first call has an effect.
|
|
495
|
+
*/
|
|
496
|
+
export function RegisterFluentBackplateMaterial() {
|
|
497
|
+
if (_Registered) {
|
|
498
|
+
return;
|
|
499
|
+
}
|
|
500
|
+
_Registered = true;
|
|
501
|
+
RegisterClass("BABYLON.GUI.FluentBackplateMaterial", FluentBackplateMaterial);
|
|
502
|
+
}
|
|
503
|
+
//# sourceMappingURL=fluentBackplateMaterial.pure.js.map
|