@babylonjs/gui 9.14.0 → 9.16.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/advancedDynamicTexture.d.ts +2 -2
- package/2D/advancedDynamicTexture.js +2 -2
- package/2D/advancedDynamicTexture.js.map +1 -1
- package/2D/controls/checkbox.pure.js +164 -153
- package/2D/controls/checkbox.pure.js.map +1 -1
- package/2D/controls/colorpicker.pure.js +1300 -1289
- package/2D/controls/colorpicker.pure.js.map +1 -1
- package/2D/controls/container.pure.js +597 -582
- package/2D/controls/container.pure.js.map +1 -1
- package/2D/controls/control.pure.js +2474 -2434
- package/2D/controls/control.pure.js.map +1 -1
- package/2D/controls/displayGrid.pure.js +201 -190
- package/2D/controls/displayGrid.pure.js.map +1 -1
- package/2D/controls/ellipse.pure.js +96 -85
- package/2D/controls/ellipse.pure.js.map +1 -1
- package/2D/controls/grid.pure.js +511 -500
- package/2D/controls/grid.pure.js.map +1 -1
- package/2D/controls/image.pure.js +888 -877
- package/2D/controls/image.pure.js.map +1 -1
- package/2D/controls/inputText.pure.js +988 -973
- package/2D/controls/inputText.pure.js.map +1 -1
- package/2D/controls/inputTextArea.pure.js +955 -944
- package/2D/controls/inputTextArea.pure.js.map +1 -1
- package/2D/controls/line.pure.js +237 -226
- package/2D/controls/line.pure.js.map +1 -1
- package/2D/controls/multiLine.pure.js +233 -222
- package/2D/controls/multiLine.pure.js.map +1 -1
- package/2D/controls/radioButton.pure.js +182 -169
- package/2D/controls/radioButton.pure.js.map +1 -1
- package/2D/controls/rectangle.pure.js +211 -200
- package/2D/controls/rectangle.pure.js.map +1 -1
- package/2D/controls/scrollViewers/scrollViewer.pure.js +579 -567
- package/2D/controls/scrollViewers/scrollViewer.pure.js.map +1 -1
- 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 +292 -281
- package/2D/controls/sliders/baseSlider.js.map +1 -1
- package/2D/controls/sliders/imageBasedSlider.pure.js +158 -147
- package/2D/controls/sliders/imageBasedSlider.pure.js.map +1 -1
- package/2D/controls/sliders/imageScrollBar.js +237 -223
- package/2D/controls/sliders/imageScrollBar.js.map +1 -1
- package/2D/controls/sliders/scrollBar.pure.js +169 -158
- package/2D/controls/sliders/scrollBar.pure.js.map +1 -1
- package/2D/controls/sliders/slider.pure.js +251 -240
- package/2D/controls/sliders/slider.pure.js.map +1 -1
- package/2D/controls/stackPanel.pure.js +236 -221
- package/2D/controls/stackPanel.pure.js.map +1 -1
- package/2D/controls/textBlock.pure.js +637 -626
- package/2D/controls/textBlock.pure.js.map +1 -1
- 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/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/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/materials/fluent/fluentMaterial.pure.d.ts +4 -4
- package/3D/materials/fluent/fluentMaterial.pure.js +322 -270
- package/3D/materials/fluent/fluentMaterial.pure.js.map +1 -1
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js +510 -451
- package/3D/materials/fluentBackplate/fluentBackplateMaterial.pure.js.map +1 -1
- package/3D/materials/fluentButton/fluentButtonMaterial.pure.js +612 -526
- package/3D/materials/fluentButton/fluentButtonMaterial.pure.js.map +1 -1
- 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.pure.js +3 -1
- package/3D/materials/handle/handleMaterial.pure.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js +313 -271
- package/3D/materials/mrdl/mrdlBackglowMaterial.pure.js.map +1 -1
- package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js +462 -402
- package/3D/materials/mrdl/mrdlBackplateMaterial.pure.js.map +1 -1
- package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js +583 -498
- package/3D/materials/mrdl/mrdlFrontplateMaterial.pure.js.map +1 -1
- package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js +226 -200
- package/3D/materials/mrdl/mrdlInnerquadMaterial.pure.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js +961 -822
- package/3D/materials/mrdl/mrdlSliderBarMaterial.pure.js.map +1 -1
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js +961 -822
- package/3D/materials/mrdl/mrdlSliderThumbMaterial.pure.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { __esDecorate, __runInitializers } from "@babylonjs/core/tslib.es6.js";
|
|
2
2
|
import { serialize, serializeAsVector3 } from "@babylonjs/core/Misc/decorators.js";
|
|
3
3
|
import { SerializationHelper } from "@babylonjs/core/Misc/decorators.serialization.js";
|
|
4
4
|
import { Vector3, Vector4 } from "@babylonjs/core/Maths/math.vector.pure.js";
|
|
@@ -27,464 +27,523 @@ class FluentBackplateMaterialDefines extends MaterialDefines {
|
|
|
27
27
|
/**
|
|
28
28
|
* Class used to render square buttons with fluent design
|
|
29
29
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
30
|
+
let FluentBackplateMaterial = (() => {
|
|
31
|
+
var _a;
|
|
32
|
+
let _classSuper = PushMaterial;
|
|
33
|
+
let _radius_decorators;
|
|
34
|
+
let _radius_initializers = [];
|
|
35
|
+
let _radius_extraInitializers = [];
|
|
36
|
+
let _lineWidth_decorators;
|
|
37
|
+
let _lineWidth_initializers = [];
|
|
38
|
+
let _lineWidth_extraInitializers = [];
|
|
39
|
+
let _absoluteSizes_decorators;
|
|
40
|
+
let _absoluteSizes_initializers = [];
|
|
41
|
+
let _absoluteSizes_extraInitializers = [];
|
|
42
|
+
let _baseColor_decorators;
|
|
43
|
+
let _baseColor_initializers = [];
|
|
44
|
+
let _baseColor_extraInitializers = [];
|
|
45
|
+
let _lineColor_decorators;
|
|
46
|
+
let _lineColor_initializers = [];
|
|
47
|
+
let _lineColor_extraInitializers = [];
|
|
48
|
+
let _blobIntensity_decorators;
|
|
49
|
+
let _blobIntensity_initializers = [];
|
|
50
|
+
let _blobIntensity_extraInitializers = [];
|
|
51
|
+
let _blobFarSize_decorators;
|
|
52
|
+
let _blobFarSize_initializers = [];
|
|
53
|
+
let _blobFarSize_extraInitializers = [];
|
|
54
|
+
let _blobNearDistance_decorators;
|
|
55
|
+
let _blobNearDistance_initializers = [];
|
|
56
|
+
let _blobNearDistance_extraInitializers = [];
|
|
57
|
+
let _blobFarDistance_decorators;
|
|
58
|
+
let _blobFarDistance_initializers = [];
|
|
59
|
+
let _blobFarDistance_extraInitializers = [];
|
|
60
|
+
let _blobFadeLength_decorators;
|
|
61
|
+
let _blobFadeLength_initializers = [];
|
|
62
|
+
let _blobFadeLength_extraInitializers = [];
|
|
63
|
+
let _blobNearSize_decorators;
|
|
64
|
+
let _blobNearSize_initializers = [];
|
|
65
|
+
let _blobNearSize_extraInitializers = [];
|
|
66
|
+
let _blobPulse_decorators;
|
|
67
|
+
let _blobPulse_initializers = [];
|
|
68
|
+
let _blobPulse_extraInitializers = [];
|
|
69
|
+
let _blobFade_decorators;
|
|
70
|
+
let _blobFade_initializers = [];
|
|
71
|
+
let _blobFade_extraInitializers = [];
|
|
72
|
+
let _blobNearSize2_decorators;
|
|
73
|
+
let _blobNearSize2_initializers = [];
|
|
74
|
+
let _blobNearSize2_extraInitializers = [];
|
|
75
|
+
let _blobPulse2_decorators;
|
|
76
|
+
let _blobPulse2_initializers = [];
|
|
77
|
+
let _blobPulse2_extraInitializers = [];
|
|
78
|
+
let _blobFade2_decorators;
|
|
79
|
+
let _blobFade2_initializers = [];
|
|
80
|
+
let _blobFade2_extraInitializers = [];
|
|
81
|
+
let _highlightColor_decorators;
|
|
82
|
+
let _highlightColor_initializers = [];
|
|
83
|
+
let _highlightColor_extraInitializers = [];
|
|
84
|
+
let _highlightWidth_decorators;
|
|
85
|
+
let _highlightWidth_initializers = [];
|
|
86
|
+
let _highlightWidth_extraInitializers = [];
|
|
87
|
+
let _iridescenceIntensity_decorators;
|
|
88
|
+
let _iridescenceIntensity_initializers = [];
|
|
89
|
+
let _iridescenceIntensity_extraInitializers = [];
|
|
90
|
+
let _iridescenceEdgeIntensity_decorators;
|
|
91
|
+
let _iridescenceEdgeIntensity_initializers = [];
|
|
92
|
+
let _iridescenceEdgeIntensity_extraInitializers = [];
|
|
93
|
+
let _fadeOut_decorators;
|
|
94
|
+
let _fadeOut_initializers = [];
|
|
95
|
+
let _fadeOut_extraInitializers = [];
|
|
96
|
+
let _globalLeftIndexTipPosition_decorators;
|
|
97
|
+
let _globalLeftIndexTipPosition_initializers = [];
|
|
98
|
+
let _globalLeftIndexTipPosition_extraInitializers = [];
|
|
99
|
+
let _globalRightIndexTipPosition_decorators;
|
|
100
|
+
let _globalRightIndexTipPosition_initializers = [];
|
|
101
|
+
let _globalRightIndexTipPosition_extraInitializers = [];
|
|
102
|
+
return _a = class FluentBackplateMaterial extends _classSuper {
|
|
103
|
+
constructor(name, scene) {
|
|
104
|
+
super(name, scene);
|
|
105
|
+
this._shadersLoaded = false;
|
|
106
|
+
/**
|
|
107
|
+
* Gets or sets the corner radius on the backplate. Best to keep this value between 0.01 and 0.5. Default is 0.03.
|
|
108
|
+
*/
|
|
109
|
+
this.radius = __runInitializers(this, _radius_initializers, 0.03);
|
|
110
|
+
/**
|
|
111
|
+
* Gets or sets the line width of the backplate.
|
|
112
|
+
*/
|
|
113
|
+
this.lineWidth = (__runInitializers(this, _radius_extraInitializers), __runInitializers(this, _lineWidth_initializers, 0.01));
|
|
114
|
+
/**
|
|
115
|
+
* Gets or sets whether to use absolute sizes when calculating effects on the backplate.
|
|
116
|
+
* Since desktop and VR/AR have different relative sizes, it's usually best to keep this false.
|
|
117
|
+
*/
|
|
118
|
+
this.absoluteSizes = (__runInitializers(this, _lineWidth_extraInitializers), __runInitializers(this, _absoluteSizes_initializers, false));
|
|
119
|
+
/** @internal */
|
|
120
|
+
this._filterWidth = (__runInitializers(this, _absoluteSizes_extraInitializers), 1);
|
|
121
|
+
/**
|
|
122
|
+
* Gets or sets the base color of the backplate.
|
|
123
|
+
*/
|
|
124
|
+
this.baseColor = __runInitializers(this, _baseColor_initializers, new Color4(0.0392157, 0.0666667, 0.207843, 1));
|
|
125
|
+
/**
|
|
126
|
+
* Gets or sets the line color of the backplate.
|
|
127
|
+
*/
|
|
128
|
+
this.lineColor = (__runInitializers(this, _baseColor_extraInitializers), __runInitializers(this, _lineColor_initializers, new Color4(0.14902, 0.133333, 0.384314, 1)));
|
|
129
|
+
/**
|
|
130
|
+
* Gets or sets the intensity of the fluent hover glow effect.
|
|
131
|
+
*/
|
|
132
|
+
this.blobIntensity = (__runInitializers(this, _lineColor_extraInitializers), __runInitializers(this, _blobIntensity_initializers, 0.98));
|
|
133
|
+
/**
|
|
134
|
+
* Gets or sets the far size of the fluent hover glow effect.
|
|
135
|
+
*/
|
|
136
|
+
this.blobFarSize = (__runInitializers(this, _blobIntensity_extraInitializers), __runInitializers(this, _blobFarSize_initializers, 0.04));
|
|
137
|
+
/**
|
|
138
|
+
* Gets or sets the distance considered "near" to the backplate, which controls the size of the fluent hover glow effect (see blobNearSize).
|
|
139
|
+
*/
|
|
140
|
+
this.blobNearDistance = (__runInitializers(this, _blobFarSize_extraInitializers), __runInitializers(this, _blobNearDistance_initializers, 0));
|
|
141
|
+
/**
|
|
142
|
+
* Gets or sets the distance considered "far" from the backplate, which controls the size of the fluent hover glow effect (see blobFarSize).
|
|
143
|
+
*/
|
|
144
|
+
this.blobFarDistance = (__runInitializers(this, _blobNearDistance_extraInitializers), __runInitializers(this, _blobFarDistance_initializers, 0.08));
|
|
145
|
+
/**
|
|
146
|
+
* Gets or sets the length of the fluent hover glow effect fade.
|
|
147
|
+
*/
|
|
148
|
+
this.blobFadeLength = (__runInitializers(this, _blobFarDistance_extraInitializers), __runInitializers(this, _blobFadeLength_initializers, 0.08));
|
|
149
|
+
/**
|
|
150
|
+
* Gets or sets the size of the fluent hover glow effect when the left pointer is considered "near" to the backplate (see blobNearDistance).
|
|
151
|
+
*/
|
|
152
|
+
this.blobNearSize = (__runInitializers(this, _blobFadeLength_extraInitializers), __runInitializers(this, _blobNearSize_initializers, 0.22));
|
|
153
|
+
/**
|
|
154
|
+
* Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the left pointer (0.0 - 1.0).
|
|
155
|
+
*/
|
|
156
|
+
this.blobPulse = (__runInitializers(this, _blobNearSize_extraInitializers), __runInitializers(this, _blobPulse_initializers, 0));
|
|
157
|
+
/**
|
|
158
|
+
* Gets or sets the opacity of the fluent hover glow effect corresponding to the left pointer (0.0 - 1.0). Default is 0.
|
|
159
|
+
*/
|
|
160
|
+
this.blobFade = (__runInitializers(this, _blobPulse_extraInitializers), __runInitializers(this, _blobFade_initializers, 0));
|
|
161
|
+
/**
|
|
162
|
+
* Gets or sets the size of the fluent hover glow effect when the right pointer is considered "near" to the backplate (see blobNearDistance).
|
|
163
|
+
*/
|
|
164
|
+
this.blobNearSize2 = (__runInitializers(this, _blobFade_extraInitializers), __runInitializers(this, _blobNearSize2_initializers, 0.22));
|
|
165
|
+
/**
|
|
166
|
+
* Gets or sets the progress of the fluent hover glow effect selection animation corresponding to the right pointer (0.0 - 1.0).
|
|
167
|
+
*/
|
|
168
|
+
this.blobPulse2 = (__runInitializers(this, _blobNearSize2_extraInitializers), __runInitializers(this, _blobPulse2_initializers, 0));
|
|
169
|
+
/**
|
|
170
|
+
* Gets or sets the opacity of the fluent hover glow effect corresponding to the right pointer (0.0 - 1.0). Default is 0.
|
|
171
|
+
*/
|
|
172
|
+
this.blobFade2 = (__runInitializers(this, _blobPulse2_extraInitializers), __runInitializers(this, _blobFade2_initializers, 0));
|
|
173
|
+
/** @internal */
|
|
174
|
+
this._rate = (__runInitializers(this, _blobFade2_extraInitializers), 0.135);
|
|
175
|
+
/**
|
|
176
|
+
* Gets or sets the color of the highlights on the backplate line.
|
|
177
|
+
*/
|
|
178
|
+
this.highlightColor = __runInitializers(this, _highlightColor_initializers, new Color4(0.98, 0.98, 0.98, 1));
|
|
179
|
+
/**
|
|
180
|
+
* Gets or sets the width of the highlights on the backplate line.
|
|
181
|
+
*/
|
|
182
|
+
this.highlightWidth = (__runInitializers(this, _highlightColor_extraInitializers), __runInitializers(this, _highlightWidth_initializers, 0.25));
|
|
183
|
+
/** @internal */
|
|
184
|
+
this._highlightTransform = (__runInitializers(this, _highlightWidth_extraInitializers), new Vector4(1, 1, 0, 0));
|
|
185
|
+
/** @internal */
|
|
186
|
+
this._highlight = 1;
|
|
187
|
+
/**
|
|
188
|
+
* Gets or sets the intensity of the iridescence effect.
|
|
189
|
+
*/
|
|
190
|
+
this.iridescenceIntensity = __runInitializers(this, _iridescenceIntensity_initializers, 0);
|
|
191
|
+
/**
|
|
192
|
+
* Gets or sets the intensity of the iridescence effect on the backplate edges.
|
|
193
|
+
*/
|
|
194
|
+
this.iridescenceEdgeIntensity = (__runInitializers(this, _iridescenceIntensity_extraInitializers), __runInitializers(this, _iridescenceEdgeIntensity_initializers, 1));
|
|
195
|
+
/** @internal */
|
|
196
|
+
this._angle = (__runInitializers(this, _iridescenceEdgeIntensity_extraInitializers), -45);
|
|
197
|
+
/**
|
|
198
|
+
* Gets or sets the opacity of the backplate (0.0 - 1.0).
|
|
199
|
+
*/
|
|
200
|
+
this.fadeOut = __runInitializers(this, _fadeOut_initializers, 1);
|
|
201
|
+
/** @internal */
|
|
202
|
+
this._reflected = (__runInitializers(this, _fadeOut_extraInitializers), true);
|
|
203
|
+
/** @internal */
|
|
204
|
+
this._frequency = 1;
|
|
205
|
+
/** @internal */
|
|
206
|
+
this._verticalOffset = 0;
|
|
207
|
+
/**
|
|
208
|
+
* Gets or sets the world-space position of the tip of the left index finger.
|
|
209
|
+
*/
|
|
210
|
+
this.globalLeftIndexTipPosition = __runInitializers(this, _globalLeftIndexTipPosition_initializers, Vector3.Zero());
|
|
211
|
+
this._globalLeftIndexTipPosition4 = (__runInitializers(this, _globalLeftIndexTipPosition_extraInitializers), Vector4.Zero());
|
|
212
|
+
/**
|
|
213
|
+
* Gets or sets the world-space position of the tip of the right index finger.
|
|
214
|
+
*/
|
|
215
|
+
this.globalRightIndexTipPosition = __runInitializers(this, _globalRightIndexTipPosition_initializers, Vector3.Zero());
|
|
216
|
+
this._globalRightIndexTipPosition4 = (__runInitializers(this, _globalRightIndexTipPosition_extraInitializers), Vector4.Zero());
|
|
217
|
+
this.alphaMode = Constants.ALPHA_DISABLE;
|
|
218
|
+
this.backFaceCulling = false;
|
|
219
|
+
const blobTextureUrl = Tools.GetAssetUrl(_a.BLOB_TEXTURE_URL);
|
|
220
|
+
const iridescentMapUrl = Tools.GetAssetUrl(_a.IM_TEXTURE_URL);
|
|
221
|
+
this._blobTexture = new Texture(blobTextureUrl, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
|
|
222
|
+
this._iridescentMap = new Texture(iridescentMapUrl, this.getScene(), true, false, Texture.NEAREST_SAMPLINGMODE);
|
|
223
|
+
}
|
|
224
|
+
needAlphaBlending() {
|
|
225
|
+
return false;
|
|
226
|
+
}
|
|
227
|
+
needAlphaTesting() {
|
|
228
|
+
return false;
|
|
229
|
+
}
|
|
230
|
+
getAlphaTestTexture() {
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
isReadyForSubMesh(mesh, subMesh) {
|
|
234
|
+
const drawWrapper = subMesh._drawWrapper;
|
|
235
|
+
if (this.isFrozen) {
|
|
236
|
+
if (drawWrapper.effect && drawWrapper._wasPreviouslyReady) {
|
|
237
|
+
return true;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
if (!this._blobTexture.isReady() || !this._iridescentMap.isReady()) {
|
|
241
|
+
return false;
|
|
242
|
+
}
|
|
243
|
+
if (!subMesh.materialDefines) {
|
|
244
|
+
subMesh.materialDefines = new FluentBackplateMaterialDefines();
|
|
245
|
+
}
|
|
246
|
+
const defines = subMesh.materialDefines;
|
|
247
|
+
const scene = this.getScene();
|
|
248
|
+
if (this._isReadyForSubMesh(subMesh)) {
|
|
249
|
+
return true;
|
|
250
|
+
}
|
|
251
|
+
const engine = scene.getEngine();
|
|
252
|
+
// Attribs
|
|
253
|
+
PrepareDefinesForAttributes(mesh, defines, false, false);
|
|
254
|
+
// Get correct effect
|
|
255
|
+
if (defines.isDirty) {
|
|
256
|
+
defines.markAsProcessed();
|
|
257
|
+
scene.resetCachedMaterial();
|
|
258
|
+
// Fallbacks
|
|
259
|
+
const fallbacks = new EffectFallbacks();
|
|
260
|
+
if (defines.FOG) {
|
|
261
|
+
fallbacks.addFallback(1, "FOG");
|
|
262
|
+
}
|
|
263
|
+
HandleFallbacksForShadows(defines, fallbacks);
|
|
264
|
+
defines.IMAGEPROCESSINGPOSTPROCESS = scene.imageProcessingConfiguration.applyByPostProcess;
|
|
265
|
+
//Attributes
|
|
266
|
+
const attribs = [VertexBuffer.PositionKind];
|
|
267
|
+
if (defines.NORMAL) {
|
|
268
|
+
attribs.push(VertexBuffer.NormalKind);
|
|
269
|
+
}
|
|
270
|
+
if (defines.UV1) {
|
|
271
|
+
attribs.push(VertexBuffer.UVKind);
|
|
272
|
+
}
|
|
273
|
+
if (defines.UV2) {
|
|
274
|
+
attribs.push(VertexBuffer.UV2Kind);
|
|
275
|
+
}
|
|
276
|
+
if (defines.VERTEXCOLOR) {
|
|
277
|
+
attribs.push(VertexBuffer.ColorKind);
|
|
278
|
+
}
|
|
279
|
+
if (defines.TANGENT) {
|
|
280
|
+
attribs.push(VertexBuffer.TangentKind);
|
|
281
|
+
}
|
|
282
|
+
PrepareAttributesForInstances(attribs, defines);
|
|
283
|
+
// Legacy browser patch
|
|
284
|
+
const shaderName = "fluentBackplate";
|
|
285
|
+
const join = defines.toString();
|
|
286
|
+
const uniforms = [
|
|
287
|
+
"world",
|
|
288
|
+
"viewProjection",
|
|
289
|
+
"cameraPosition",
|
|
290
|
+
"_Radius_",
|
|
291
|
+
"_Line_Width_",
|
|
292
|
+
"_Absolute_Sizes_",
|
|
293
|
+
"_Filter_Width_",
|
|
294
|
+
"_Base_Color_",
|
|
295
|
+
"_Line_Color_",
|
|
296
|
+
"_Radius_Top_Left_",
|
|
297
|
+
"_Radius_Top_Right_",
|
|
298
|
+
"_Radius_Bottom_Left_",
|
|
299
|
+
"_Radius_Bottom_Right_",
|
|
300
|
+
"_Blob_Position_",
|
|
301
|
+
"_Blob_Intensity_",
|
|
302
|
+
"_Blob_Near_Size_",
|
|
303
|
+
"_Blob_Far_Size_",
|
|
304
|
+
"_Blob_Near_Distance_",
|
|
305
|
+
"_Blob_Far_Distance_",
|
|
306
|
+
"_Blob_Fade_Length_",
|
|
307
|
+
"_Blob_Pulse_",
|
|
308
|
+
"_Blob_Fade_",
|
|
309
|
+
"_Blob_Texture_",
|
|
310
|
+
"_Blob_Position_2_",
|
|
311
|
+
"_Blob_Near_Size_2_",
|
|
312
|
+
"_Blob_Pulse_2_",
|
|
313
|
+
"_Blob_Fade_2_",
|
|
314
|
+
"_Rate_",
|
|
315
|
+
"_Highlight_Color_",
|
|
316
|
+
"_Highlight_Width_",
|
|
317
|
+
"_Highlight_Transform_",
|
|
318
|
+
"_Highlight_",
|
|
319
|
+
"_Iridescence_Intensity_",
|
|
320
|
+
"_Iridescence_Edge_Intensity_",
|
|
321
|
+
"_Angle_",
|
|
322
|
+
"_Fade_Out_",
|
|
323
|
+
"_Reflected_",
|
|
324
|
+
"_Frequency_",
|
|
325
|
+
"_Vertical_Offset_",
|
|
326
|
+
"_Iridescent_Map_",
|
|
327
|
+
"_Use_Global_Left_Index_",
|
|
328
|
+
"_Use_Global_Right_Index_",
|
|
329
|
+
"Global_Left_Index_Tip_Position",
|
|
330
|
+
"Global_Right_Index_Tip_Position",
|
|
331
|
+
];
|
|
332
|
+
const samplers = ["_Blob_Texture_", "_Iridescent_Map_"];
|
|
333
|
+
const uniformBuffers = [];
|
|
334
|
+
PrepareUniformsAndSamplersList({
|
|
335
|
+
uniformsNames: uniforms,
|
|
336
|
+
uniformBuffersNames: uniformBuffers,
|
|
337
|
+
samplers: samplers,
|
|
338
|
+
defines: defines,
|
|
339
|
+
maxSimultaneousLights: 4,
|
|
340
|
+
shaderLanguage: this._shaderLanguage,
|
|
341
|
+
});
|
|
342
|
+
subMesh.setEffect(scene.getEngine().createEffect(shaderName, {
|
|
343
|
+
attributes: attribs,
|
|
344
|
+
uniformsNames: uniforms,
|
|
345
|
+
uniformBuffersNames: uniformBuffers,
|
|
346
|
+
samplers: samplers,
|
|
347
|
+
defines: join,
|
|
348
|
+
fallbacks: fallbacks,
|
|
349
|
+
onCompiled: this.onCompiled,
|
|
350
|
+
onError: this.onError,
|
|
351
|
+
indexParameters: { maxSimultaneousLights: 4 },
|
|
352
|
+
shaderLanguage: this._shaderLanguage,
|
|
353
|
+
extraInitializationsAsync: this._shadersLoaded
|
|
354
|
+
? undefined
|
|
355
|
+
: async () => {
|
|
356
|
+
if (this.shaderLanguage === 1 /* ShaderLanguage.WGSL */) {
|
|
357
|
+
await Promise.all([import("./wgsl/fluentBackplate.vertex.js"), import("./wgsl/fluentBackplate.fragment.js")]);
|
|
358
|
+
}
|
|
359
|
+
else {
|
|
360
|
+
await Promise.all([import("./shaders/fluentBackplate.vertex.js"), import("./shaders/fluentBackplate.fragment.js")]);
|
|
361
|
+
}
|
|
362
|
+
this._shadersLoaded = true;
|
|
363
|
+
},
|
|
364
|
+
}, engine), defines, this._materialContext);
|
|
365
|
+
}
|
|
366
|
+
if (!subMesh.effect || !subMesh.effect.isReady()) {
|
|
367
|
+
return false;
|
|
368
|
+
}
|
|
369
|
+
defines._renderId = scene.getRenderId();
|
|
370
|
+
drawWrapper._wasPreviouslyReady = true;
|
|
165
371
|
return true;
|
|
166
372
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
373
|
+
bindForSubMesh(world, mesh, subMesh) {
|
|
374
|
+
const defines = subMesh.materialDefines;
|
|
375
|
+
if (!defines) {
|
|
376
|
+
return;
|
|
377
|
+
}
|
|
378
|
+
const effect = subMesh.effect;
|
|
379
|
+
if (!effect) {
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
this._activeEffect = effect;
|
|
383
|
+
// Matrices
|
|
384
|
+
this.bindOnlyWorldMatrix(world);
|
|
385
|
+
this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
|
|
386
|
+
this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera?.position ?? Vector3.ZeroReadOnly);
|
|
387
|
+
// "Round Rect"
|
|
388
|
+
this._activeEffect.setFloat("_Radius_", this.radius);
|
|
389
|
+
this._activeEffect.setFloat("_Line_Width_", this.lineWidth);
|
|
390
|
+
this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1.0 : 0.0);
|
|
391
|
+
this._activeEffect.setFloat("_Filter_Width_", this._filterWidth);
|
|
392
|
+
this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor);
|
|
393
|
+
this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor);
|
|
394
|
+
// "Radii Multipliers"
|
|
395
|
+
this._activeEffect.setFloat("_Radius_Top_Left_", 1);
|
|
396
|
+
this._activeEffect.setFloat("_Radius_Top_Right_", 1.0);
|
|
397
|
+
this._activeEffect.setFloat("_Radius_Bottom_Left_", 1.0);
|
|
398
|
+
this._activeEffect.setFloat("_Radius_Bottom_Right_", 1.0);
|
|
399
|
+
// "Blob"
|
|
400
|
+
//define BLOB_ENABLE true;
|
|
401
|
+
this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
|
|
402
|
+
this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize);
|
|
403
|
+
this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
|
|
404
|
+
this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
|
|
405
|
+
this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
|
|
406
|
+
this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
|
|
407
|
+
this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse);
|
|
408
|
+
this._activeEffect.setFloat("_Blob_Fade_", this.blobFade);
|
|
409
|
+
// "Blob Texture"
|
|
410
|
+
this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture);
|
|
411
|
+
// "Blob 2"
|
|
412
|
+
//define BLOB_ENABLE_2 true;
|
|
413
|
+
this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2);
|
|
414
|
+
this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2);
|
|
415
|
+
this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2);
|
|
416
|
+
// "Line Highlight"
|
|
417
|
+
this._activeEffect.setFloat("_Rate_", this._rate);
|
|
418
|
+
this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor);
|
|
419
|
+
this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth);
|
|
420
|
+
this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform);
|
|
421
|
+
this._activeEffect.setFloat("_Highlight_", this._highlight);
|
|
422
|
+
// "Iridescence"
|
|
423
|
+
this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
|
|
424
|
+
this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity);
|
|
425
|
+
this._activeEffect.setFloat("_Angle_", this._angle);
|
|
426
|
+
// "Fade"
|
|
427
|
+
this._activeEffect.setFloat("_Fade_Out_", this.fadeOut);
|
|
428
|
+
// "Antialiasing"
|
|
429
|
+
//define SMOOTH_EDGES true;
|
|
430
|
+
// "ChooseAngle"
|
|
431
|
+
this._activeEffect.setFloat("_Reflected_", this._reflected ? 1.0 : 0.0);
|
|
432
|
+
// "Multiply"
|
|
433
|
+
this._activeEffect.setFloat("_Frequency_", this._frequency);
|
|
434
|
+
this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset);
|
|
435
|
+
// "Color Texture"
|
|
436
|
+
//define IRIDESCENT_MAP_ENABLE true;
|
|
437
|
+
this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMap);
|
|
438
|
+
// "Global"
|
|
439
|
+
this._activeEffect.setFloat("_Use_Global_Left_Index_", 1.0);
|
|
440
|
+
this._activeEffect.setFloat("_Use_Global_Right_Index_", 1.0);
|
|
441
|
+
this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1.0);
|
|
442
|
+
this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this._globalLeftIndexTipPosition4);
|
|
443
|
+
this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1.0);
|
|
444
|
+
this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this._globalRightIndexTipPosition4);
|
|
445
|
+
this._afterBind(mesh, this._activeEffect, subMesh);
|
|
190
446
|
}
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
447
|
+
/**
|
|
448
|
+
* Get the list of animatables in the material.
|
|
449
|
+
* @returns the list of animatables object used in the material
|
|
450
|
+
*/
|
|
451
|
+
getAnimatables() {
|
|
452
|
+
return [];
|
|
197
453
|
}
|
|
198
|
-
|
|
199
|
-
|
|
454
|
+
/**
|
|
455
|
+
* Disposes the material.
|
|
456
|
+
* @param forceDisposeEffect specifies if effects should be forcefully disposed
|
|
457
|
+
*/
|
|
458
|
+
dispose(forceDisposeEffect) {
|
|
459
|
+
super.dispose(forceDisposeEffect);
|
|
460
|
+
this._blobTexture.dispose();
|
|
461
|
+
this._iridescentMap.dispose();
|
|
200
462
|
}
|
|
201
|
-
|
|
202
|
-
|
|
463
|
+
clone(name) {
|
|
464
|
+
return SerializationHelper.Clone(() => new _a(name, this.getScene()), this);
|
|
203
465
|
}
|
|
204
|
-
|
|
205
|
-
|
|
466
|
+
serialize() {
|
|
467
|
+
const serializationObject = super.serialize();
|
|
468
|
+
serializationObject.customType = "BABYLON.FluentBackplateMaterial";
|
|
469
|
+
return serializationObject;
|
|
206
470
|
}
|
|
207
|
-
|
|
208
|
-
|
|
471
|
+
getClassName() {
|
|
472
|
+
return "FluentBackplateMaterial";
|
|
209
473
|
}
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
});
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
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
|
-
this._shadersLoaded = true;
|
|
288
|
-
},
|
|
289
|
-
}, engine), defines, this._materialContext);
|
|
290
|
-
}
|
|
291
|
-
if (!subMesh.effect || !subMesh.effect.isReady()) {
|
|
292
|
-
return false;
|
|
293
|
-
}
|
|
294
|
-
defines._renderId = scene.getRenderId();
|
|
295
|
-
drawWrapper._wasPreviouslyReady = true;
|
|
296
|
-
return true;
|
|
297
|
-
}
|
|
298
|
-
bindForSubMesh(world, mesh, subMesh) {
|
|
299
|
-
const defines = subMesh.materialDefines;
|
|
300
|
-
if (!defines) {
|
|
301
|
-
return;
|
|
302
|
-
}
|
|
303
|
-
const effect = subMesh.effect;
|
|
304
|
-
if (!effect) {
|
|
305
|
-
return;
|
|
306
|
-
}
|
|
307
|
-
this._activeEffect = effect;
|
|
308
|
-
// Matrices
|
|
309
|
-
this.bindOnlyWorldMatrix(world);
|
|
310
|
-
this._activeEffect.setMatrix("viewProjection", this.getScene().getTransformMatrix());
|
|
311
|
-
this._activeEffect.setVector3("cameraPosition", this.getScene().activeCamera?.position ?? Vector3.ZeroReadOnly);
|
|
312
|
-
// "Round Rect"
|
|
313
|
-
this._activeEffect.setFloat("_Radius_", this.radius);
|
|
314
|
-
this._activeEffect.setFloat("_Line_Width_", this.lineWidth);
|
|
315
|
-
this._activeEffect.setFloat("_Absolute_Sizes_", this.absoluteSizes ? 1.0 : 0.0);
|
|
316
|
-
this._activeEffect.setFloat("_Filter_Width_", this._filterWidth);
|
|
317
|
-
this._activeEffect.setDirectColor4("_Base_Color_", this.baseColor);
|
|
318
|
-
this._activeEffect.setDirectColor4("_Line_Color_", this.lineColor);
|
|
319
|
-
// "Radii Multipliers"
|
|
320
|
-
this._activeEffect.setFloat("_Radius_Top_Left_", 1);
|
|
321
|
-
this._activeEffect.setFloat("_Radius_Top_Right_", 1.0);
|
|
322
|
-
this._activeEffect.setFloat("_Radius_Bottom_Left_", 1.0);
|
|
323
|
-
this._activeEffect.setFloat("_Radius_Bottom_Right_", 1.0);
|
|
324
|
-
// "Blob"
|
|
325
|
-
//define BLOB_ENABLE true;
|
|
326
|
-
this._activeEffect.setFloat("_Blob_Intensity_", this.blobIntensity);
|
|
327
|
-
this._activeEffect.setFloat("_Blob_Near_Size_", this.blobNearSize);
|
|
328
|
-
this._activeEffect.setFloat("_Blob_Far_Size_", this.blobFarSize);
|
|
329
|
-
this._activeEffect.setFloat("_Blob_Near_Distance_", this.blobNearDistance);
|
|
330
|
-
this._activeEffect.setFloat("_Blob_Far_Distance_", this.blobFarDistance);
|
|
331
|
-
this._activeEffect.setFloat("_Blob_Fade_Length_", this.blobFadeLength);
|
|
332
|
-
this._activeEffect.setFloat("_Blob_Pulse_", this.blobPulse);
|
|
333
|
-
this._activeEffect.setFloat("_Blob_Fade_", this.blobFade);
|
|
334
|
-
// "Blob Texture"
|
|
335
|
-
this._activeEffect.setTexture("_Blob_Texture_", this._blobTexture);
|
|
336
|
-
// "Blob 2"
|
|
337
|
-
//define BLOB_ENABLE_2 true;
|
|
338
|
-
this._activeEffect.setFloat("_Blob_Near_Size_2_", this.blobNearSize2);
|
|
339
|
-
this._activeEffect.setFloat("_Blob_Pulse_2_", this.blobPulse2);
|
|
340
|
-
this._activeEffect.setFloat("_Blob_Fade_2_", this.blobFade2);
|
|
341
|
-
// "Line Highlight"
|
|
342
|
-
this._activeEffect.setFloat("_Rate_", this._rate);
|
|
343
|
-
this._activeEffect.setDirectColor4("_Highlight_Color_", this.highlightColor);
|
|
344
|
-
this._activeEffect.setFloat("_Highlight_Width_", this.highlightWidth);
|
|
345
|
-
this._activeEffect.setVector4("_Highlight_Transform_", this._highlightTransform);
|
|
346
|
-
this._activeEffect.setFloat("_Highlight_", this._highlight);
|
|
347
|
-
// "Iridescence"
|
|
348
|
-
this._activeEffect.setFloat("_Iridescence_Intensity_", this.iridescenceIntensity);
|
|
349
|
-
this._activeEffect.setFloat("_Iridescence_Edge_Intensity_", this.iridescenceEdgeIntensity);
|
|
350
|
-
this._activeEffect.setFloat("_Angle_", this._angle);
|
|
351
|
-
// "Fade"
|
|
352
|
-
this._activeEffect.setFloat("_Fade_Out_", this.fadeOut);
|
|
353
|
-
// "Antialiasing"
|
|
354
|
-
//define SMOOTH_EDGES true;
|
|
355
|
-
// "ChooseAngle"
|
|
356
|
-
this._activeEffect.setFloat("_Reflected_", this._reflected ? 1.0 : 0.0);
|
|
357
|
-
// "Multiply"
|
|
358
|
-
this._activeEffect.setFloat("_Frequency_", this._frequency);
|
|
359
|
-
this._activeEffect.setFloat("_Vertical_Offset_", this._verticalOffset);
|
|
360
|
-
// "Color Texture"
|
|
361
|
-
//define IRIDESCENT_MAP_ENABLE true;
|
|
362
|
-
this._activeEffect.setTexture("_Iridescent_Map_", this._iridescentMap);
|
|
363
|
-
// "Global"
|
|
364
|
-
this._activeEffect.setFloat("_Use_Global_Left_Index_", 1.0);
|
|
365
|
-
this._activeEffect.setFloat("_Use_Global_Right_Index_", 1.0);
|
|
366
|
-
this._globalLeftIndexTipPosition4.set(this.globalLeftIndexTipPosition.x, this.globalLeftIndexTipPosition.y, this.globalLeftIndexTipPosition.z, 1.0);
|
|
367
|
-
this._activeEffect.setVector4("Global_Left_Index_Tip_Position", this._globalLeftIndexTipPosition4);
|
|
368
|
-
this._globalRightIndexTipPosition4.set(this.globalRightIndexTipPosition.x, this.globalRightIndexTipPosition.y, this.globalRightIndexTipPosition.z, 1.0);
|
|
369
|
-
this._activeEffect.setVector4("Global_Right_Index_Tip_Position", this._globalRightIndexTipPosition4);
|
|
370
|
-
this._afterBind(mesh, this._activeEffect, subMesh);
|
|
371
|
-
}
|
|
372
|
-
/**
|
|
373
|
-
* Get the list of animatables in the material.
|
|
374
|
-
* @returns the list of animatables object used in the material
|
|
375
|
-
*/
|
|
376
|
-
getAnimatables() {
|
|
377
|
-
return [];
|
|
378
|
-
}
|
|
379
|
-
/**
|
|
380
|
-
* Disposes the material.
|
|
381
|
-
* @param forceDisposeEffect specifies if effects should be forcefully disposed
|
|
382
|
-
*/
|
|
383
|
-
dispose(forceDisposeEffect) {
|
|
384
|
-
super.dispose(forceDisposeEffect);
|
|
385
|
-
this._blobTexture.dispose();
|
|
386
|
-
this._iridescentMap.dispose();
|
|
387
|
-
}
|
|
388
|
-
clone(name) {
|
|
389
|
-
return SerializationHelper.Clone(() => new FluentBackplateMaterial(name, this.getScene()), this);
|
|
390
|
-
}
|
|
391
|
-
serialize() {
|
|
392
|
-
const serializationObject = super.serialize();
|
|
393
|
-
serializationObject.customType = "BABYLON.FluentBackplateMaterial";
|
|
394
|
-
return serializationObject;
|
|
395
|
-
}
|
|
396
|
-
getClassName() {
|
|
397
|
-
return "FluentBackplateMaterial";
|
|
398
|
-
}
|
|
399
|
-
// Statics
|
|
400
|
-
/**
|
|
401
|
-
* Creates a fluent backplate material from parsed material data.
|
|
402
|
-
* @param source defines the JSON representation of the material
|
|
403
|
-
* @param scene defines the hosting scene
|
|
404
|
-
* @param rootUrl defines the root URL to use to load textures and relative dependencies
|
|
405
|
-
* @returns a new fluent backplate material
|
|
406
|
-
*/
|
|
407
|
-
static Parse(source, scene, rootUrl) {
|
|
408
|
-
return SerializationHelper.Parse(() => new FluentBackplateMaterial(source.name, scene), source, scene, rootUrl);
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
/**
|
|
412
|
-
* URL pointing to the texture used to define the coloring for the fluent blob effect.
|
|
413
|
-
*/
|
|
414
|
-
FluentBackplateMaterial.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/core/MRTK/mrtk-fluent-backplate-blob.png";
|
|
415
|
-
/**
|
|
416
|
-
* URL pointing to the texture used to define iridescent map.
|
|
417
|
-
*/
|
|
418
|
-
FluentBackplateMaterial.IM_TEXTURE_URL = "https://assets.babylonjs.com/core/MRTK/mrtk-fluent-backplate-iridescence.png";
|
|
419
|
-
__decorate([
|
|
420
|
-
serialize()
|
|
421
|
-
], FluentBackplateMaterial.prototype, "radius", void 0);
|
|
422
|
-
__decorate([
|
|
423
|
-
serialize()
|
|
424
|
-
], FluentBackplateMaterial.prototype, "lineWidth", void 0);
|
|
425
|
-
__decorate([
|
|
426
|
-
serialize()
|
|
427
|
-
], FluentBackplateMaterial.prototype, "absoluteSizes", void 0);
|
|
428
|
-
__decorate([
|
|
429
|
-
serialize()
|
|
430
|
-
], FluentBackplateMaterial.prototype, "baseColor", void 0);
|
|
431
|
-
__decorate([
|
|
432
|
-
serialize()
|
|
433
|
-
], FluentBackplateMaterial.prototype, "lineColor", void 0);
|
|
434
|
-
__decorate([
|
|
435
|
-
serialize()
|
|
436
|
-
], FluentBackplateMaterial.prototype, "blobIntensity", void 0);
|
|
437
|
-
__decorate([
|
|
438
|
-
serialize()
|
|
439
|
-
], FluentBackplateMaterial.prototype, "blobFarSize", void 0);
|
|
440
|
-
__decorate([
|
|
441
|
-
serialize()
|
|
442
|
-
], FluentBackplateMaterial.prototype, "blobNearDistance", void 0);
|
|
443
|
-
__decorate([
|
|
444
|
-
serialize()
|
|
445
|
-
], FluentBackplateMaterial.prototype, "blobFarDistance", void 0);
|
|
446
|
-
__decorate([
|
|
447
|
-
serialize()
|
|
448
|
-
], FluentBackplateMaterial.prototype, "blobFadeLength", void 0);
|
|
449
|
-
__decorate([
|
|
450
|
-
serialize()
|
|
451
|
-
], FluentBackplateMaterial.prototype, "blobNearSize", void 0);
|
|
452
|
-
__decorate([
|
|
453
|
-
serialize()
|
|
454
|
-
], FluentBackplateMaterial.prototype, "blobPulse", void 0);
|
|
455
|
-
__decorate([
|
|
456
|
-
serialize()
|
|
457
|
-
], FluentBackplateMaterial.prototype, "blobFade", void 0);
|
|
458
|
-
__decorate([
|
|
459
|
-
serialize()
|
|
460
|
-
], FluentBackplateMaterial.prototype, "blobNearSize2", void 0);
|
|
461
|
-
__decorate([
|
|
462
|
-
serialize()
|
|
463
|
-
], FluentBackplateMaterial.prototype, "blobPulse2", void 0);
|
|
464
|
-
__decorate([
|
|
465
|
-
serialize()
|
|
466
|
-
], FluentBackplateMaterial.prototype, "blobFade2", void 0);
|
|
467
|
-
__decorate([
|
|
468
|
-
serialize()
|
|
469
|
-
], FluentBackplateMaterial.prototype, "highlightColor", void 0);
|
|
470
|
-
__decorate([
|
|
471
|
-
serialize()
|
|
472
|
-
], FluentBackplateMaterial.prototype, "highlightWidth", void 0);
|
|
473
|
-
__decorate([
|
|
474
|
-
serialize()
|
|
475
|
-
], FluentBackplateMaterial.prototype, "iridescenceIntensity", void 0);
|
|
476
|
-
__decorate([
|
|
477
|
-
serialize()
|
|
478
|
-
], FluentBackplateMaterial.prototype, "iridescenceEdgeIntensity", void 0);
|
|
479
|
-
__decorate([
|
|
480
|
-
serialize()
|
|
481
|
-
], FluentBackplateMaterial.prototype, "fadeOut", void 0);
|
|
482
|
-
__decorate([
|
|
483
|
-
serializeAsVector3()
|
|
484
|
-
], FluentBackplateMaterial.prototype, "globalLeftIndexTipPosition", void 0);
|
|
485
|
-
__decorate([
|
|
486
|
-
serializeAsVector3()
|
|
487
|
-
], FluentBackplateMaterial.prototype, "globalRightIndexTipPosition", void 0);
|
|
474
|
+
// Statics
|
|
475
|
+
/**
|
|
476
|
+
* Creates a fluent backplate material from parsed material data.
|
|
477
|
+
* @param source defines the JSON representation of the material
|
|
478
|
+
* @param scene defines the hosting scene
|
|
479
|
+
* @param rootUrl defines the root URL to use to load textures and relative dependencies
|
|
480
|
+
* @returns a new fluent backplate material
|
|
481
|
+
*/
|
|
482
|
+
static Parse(source, scene, rootUrl) {
|
|
483
|
+
return SerializationHelper.Parse(() => new _a(source.name, scene), source, scene, rootUrl);
|
|
484
|
+
}
|
|
485
|
+
},
|
|
486
|
+
(() => {
|
|
487
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
488
|
+
_radius_decorators = [serialize()];
|
|
489
|
+
_lineWidth_decorators = [serialize()];
|
|
490
|
+
_absoluteSizes_decorators = [serialize()];
|
|
491
|
+
_baseColor_decorators = [serialize()];
|
|
492
|
+
_lineColor_decorators = [serialize()];
|
|
493
|
+
_blobIntensity_decorators = [serialize()];
|
|
494
|
+
_blobFarSize_decorators = [serialize()];
|
|
495
|
+
_blobNearDistance_decorators = [serialize()];
|
|
496
|
+
_blobFarDistance_decorators = [serialize()];
|
|
497
|
+
_blobFadeLength_decorators = [serialize()];
|
|
498
|
+
_blobNearSize_decorators = [serialize()];
|
|
499
|
+
_blobPulse_decorators = [serialize()];
|
|
500
|
+
_blobFade_decorators = [serialize()];
|
|
501
|
+
_blobNearSize2_decorators = [serialize()];
|
|
502
|
+
_blobPulse2_decorators = [serialize()];
|
|
503
|
+
_blobFade2_decorators = [serialize()];
|
|
504
|
+
_highlightColor_decorators = [serialize()];
|
|
505
|
+
_highlightWidth_decorators = [serialize()];
|
|
506
|
+
_iridescenceIntensity_decorators = [serialize()];
|
|
507
|
+
_iridescenceEdgeIntensity_decorators = [serialize()];
|
|
508
|
+
_fadeOut_decorators = [serialize()];
|
|
509
|
+
_globalLeftIndexTipPosition_decorators = [serializeAsVector3()];
|
|
510
|
+
_globalRightIndexTipPosition_decorators = [serializeAsVector3()];
|
|
511
|
+
__esDecorate(null, null, _radius_decorators, { kind: "field", name: "radius", static: false, private: false, access: { has: obj => "radius" in obj, get: obj => obj.radius, set: (obj, value) => { obj.radius = value; } }, metadata: _metadata }, _radius_initializers, _radius_extraInitializers);
|
|
512
|
+
__esDecorate(null, null, _lineWidth_decorators, { kind: "field", name: "lineWidth", static: false, private: false, access: { has: obj => "lineWidth" in obj, get: obj => obj.lineWidth, set: (obj, value) => { obj.lineWidth = value; } }, metadata: _metadata }, _lineWidth_initializers, _lineWidth_extraInitializers);
|
|
513
|
+
__esDecorate(null, null, _absoluteSizes_decorators, { kind: "field", name: "absoluteSizes", static: false, private: false, access: { has: obj => "absoluteSizes" in obj, get: obj => obj.absoluteSizes, set: (obj, value) => { obj.absoluteSizes = value; } }, metadata: _metadata }, _absoluteSizes_initializers, _absoluteSizes_extraInitializers);
|
|
514
|
+
__esDecorate(null, null, _baseColor_decorators, { kind: "field", name: "baseColor", static: false, private: false, access: { has: obj => "baseColor" in obj, get: obj => obj.baseColor, set: (obj, value) => { obj.baseColor = value; } }, metadata: _metadata }, _baseColor_initializers, _baseColor_extraInitializers);
|
|
515
|
+
__esDecorate(null, null, _lineColor_decorators, { kind: "field", name: "lineColor", static: false, private: false, access: { has: obj => "lineColor" in obj, get: obj => obj.lineColor, set: (obj, value) => { obj.lineColor = value; } }, metadata: _metadata }, _lineColor_initializers, _lineColor_extraInitializers);
|
|
516
|
+
__esDecorate(null, null, _blobIntensity_decorators, { kind: "field", name: "blobIntensity", static: false, private: false, access: { has: obj => "blobIntensity" in obj, get: obj => obj.blobIntensity, set: (obj, value) => { obj.blobIntensity = value; } }, metadata: _metadata }, _blobIntensity_initializers, _blobIntensity_extraInitializers);
|
|
517
|
+
__esDecorate(null, null, _blobFarSize_decorators, { kind: "field", name: "blobFarSize", static: false, private: false, access: { has: obj => "blobFarSize" in obj, get: obj => obj.blobFarSize, set: (obj, value) => { obj.blobFarSize = value; } }, metadata: _metadata }, _blobFarSize_initializers, _blobFarSize_extraInitializers);
|
|
518
|
+
__esDecorate(null, null, _blobNearDistance_decorators, { kind: "field", name: "blobNearDistance", static: false, private: false, access: { has: obj => "blobNearDistance" in obj, get: obj => obj.blobNearDistance, set: (obj, value) => { obj.blobNearDistance = value; } }, metadata: _metadata }, _blobNearDistance_initializers, _blobNearDistance_extraInitializers);
|
|
519
|
+
__esDecorate(null, null, _blobFarDistance_decorators, { kind: "field", name: "blobFarDistance", static: false, private: false, access: { has: obj => "blobFarDistance" in obj, get: obj => obj.blobFarDistance, set: (obj, value) => { obj.blobFarDistance = value; } }, metadata: _metadata }, _blobFarDistance_initializers, _blobFarDistance_extraInitializers);
|
|
520
|
+
__esDecorate(null, null, _blobFadeLength_decorators, { kind: "field", name: "blobFadeLength", static: false, private: false, access: { has: obj => "blobFadeLength" in obj, get: obj => obj.blobFadeLength, set: (obj, value) => { obj.blobFadeLength = value; } }, metadata: _metadata }, _blobFadeLength_initializers, _blobFadeLength_extraInitializers);
|
|
521
|
+
__esDecorate(null, null, _blobNearSize_decorators, { kind: "field", name: "blobNearSize", static: false, private: false, access: { has: obj => "blobNearSize" in obj, get: obj => obj.blobNearSize, set: (obj, value) => { obj.blobNearSize = value; } }, metadata: _metadata }, _blobNearSize_initializers, _blobNearSize_extraInitializers);
|
|
522
|
+
__esDecorate(null, null, _blobPulse_decorators, { kind: "field", name: "blobPulse", static: false, private: false, access: { has: obj => "blobPulse" in obj, get: obj => obj.blobPulse, set: (obj, value) => { obj.blobPulse = value; } }, metadata: _metadata }, _blobPulse_initializers, _blobPulse_extraInitializers);
|
|
523
|
+
__esDecorate(null, null, _blobFade_decorators, { kind: "field", name: "blobFade", static: false, private: false, access: { has: obj => "blobFade" in obj, get: obj => obj.blobFade, set: (obj, value) => { obj.blobFade = value; } }, metadata: _metadata }, _blobFade_initializers, _blobFade_extraInitializers);
|
|
524
|
+
__esDecorate(null, null, _blobNearSize2_decorators, { kind: "field", name: "blobNearSize2", static: false, private: false, access: { has: obj => "blobNearSize2" in obj, get: obj => obj.blobNearSize2, set: (obj, value) => { obj.blobNearSize2 = value; } }, metadata: _metadata }, _blobNearSize2_initializers, _blobNearSize2_extraInitializers);
|
|
525
|
+
__esDecorate(null, null, _blobPulse2_decorators, { kind: "field", name: "blobPulse2", static: false, private: false, access: { has: obj => "blobPulse2" in obj, get: obj => obj.blobPulse2, set: (obj, value) => { obj.blobPulse2 = value; } }, metadata: _metadata }, _blobPulse2_initializers, _blobPulse2_extraInitializers);
|
|
526
|
+
__esDecorate(null, null, _blobFade2_decorators, { kind: "field", name: "blobFade2", static: false, private: false, access: { has: obj => "blobFade2" in obj, get: obj => obj.blobFade2, set: (obj, value) => { obj.blobFade2 = value; } }, metadata: _metadata }, _blobFade2_initializers, _blobFade2_extraInitializers);
|
|
527
|
+
__esDecorate(null, null, _highlightColor_decorators, { kind: "field", name: "highlightColor", static: false, private: false, access: { has: obj => "highlightColor" in obj, get: obj => obj.highlightColor, set: (obj, value) => { obj.highlightColor = value; } }, metadata: _metadata }, _highlightColor_initializers, _highlightColor_extraInitializers);
|
|
528
|
+
__esDecorate(null, null, _highlightWidth_decorators, { kind: "field", name: "highlightWidth", static: false, private: false, access: { has: obj => "highlightWidth" in obj, get: obj => obj.highlightWidth, set: (obj, value) => { obj.highlightWidth = value; } }, metadata: _metadata }, _highlightWidth_initializers, _highlightWidth_extraInitializers);
|
|
529
|
+
__esDecorate(null, null, _iridescenceIntensity_decorators, { kind: "field", name: "iridescenceIntensity", static: false, private: false, access: { has: obj => "iridescenceIntensity" in obj, get: obj => obj.iridescenceIntensity, set: (obj, value) => { obj.iridescenceIntensity = value; } }, metadata: _metadata }, _iridescenceIntensity_initializers, _iridescenceIntensity_extraInitializers);
|
|
530
|
+
__esDecorate(null, null, _iridescenceEdgeIntensity_decorators, { kind: "field", name: "iridescenceEdgeIntensity", static: false, private: false, access: { has: obj => "iridescenceEdgeIntensity" in obj, get: obj => obj.iridescenceEdgeIntensity, set: (obj, value) => { obj.iridescenceEdgeIntensity = value; } }, metadata: _metadata }, _iridescenceEdgeIntensity_initializers, _iridescenceEdgeIntensity_extraInitializers);
|
|
531
|
+
__esDecorate(null, null, _fadeOut_decorators, { kind: "field", name: "fadeOut", static: false, private: false, access: { has: obj => "fadeOut" in obj, get: obj => obj.fadeOut, set: (obj, value) => { obj.fadeOut = value; } }, metadata: _metadata }, _fadeOut_initializers, _fadeOut_extraInitializers);
|
|
532
|
+
__esDecorate(null, null, _globalLeftIndexTipPosition_decorators, { kind: "field", name: "globalLeftIndexTipPosition", static: false, private: false, access: { has: obj => "globalLeftIndexTipPosition" in obj, get: obj => obj.globalLeftIndexTipPosition, set: (obj, value) => { obj.globalLeftIndexTipPosition = value; } }, metadata: _metadata }, _globalLeftIndexTipPosition_initializers, _globalLeftIndexTipPosition_extraInitializers);
|
|
533
|
+
__esDecorate(null, null, _globalRightIndexTipPosition_decorators, { kind: "field", name: "globalRightIndexTipPosition", static: false, private: false, access: { has: obj => "globalRightIndexTipPosition" in obj, get: obj => obj.globalRightIndexTipPosition, set: (obj, value) => { obj.globalRightIndexTipPosition = value; } }, metadata: _metadata }, _globalRightIndexTipPosition_initializers, _globalRightIndexTipPosition_extraInitializers);
|
|
534
|
+
if (_metadata) Object.defineProperty(_a, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
535
|
+
})(),
|
|
536
|
+
/**
|
|
537
|
+
* URL pointing to the texture used to define the coloring for the fluent blob effect.
|
|
538
|
+
*/
|
|
539
|
+
_a.BLOB_TEXTURE_URL = "https://assets.babylonjs.com/core/MRTK/mrtk-fluent-backplate-blob.png",
|
|
540
|
+
/**
|
|
541
|
+
* URL pointing to the texture used to define iridescent map.
|
|
542
|
+
*/
|
|
543
|
+
_a.IM_TEXTURE_URL = "https://assets.babylonjs.com/core/MRTK/mrtk-fluent-backplate-iridescence.png",
|
|
544
|
+
_a;
|
|
545
|
+
})();
|
|
546
|
+
export { FluentBackplateMaterial };
|
|
488
547
|
let _Registered = false;
|
|
489
548
|
/**
|
|
490
549
|
* Registers the FluentBackplateMaterial class with the type store for serialization support.
|