@playcanvas/web-components 0.2.4 → 0.2.5
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/dist/components/light-component.d.ts +12 -0
- package/dist/pwc.cjs +25 -2
- package/dist/pwc.cjs.map +1 -1
- package/dist/pwc.js +25 -2
- package/dist/pwc.js.map +1 -1
- package/dist/pwc.min.js +1 -1
- package/dist/pwc.min.js.map +1 -1
- package/dist/pwc.mjs +25 -2
- package/dist/pwc.mjs.map +1 -1
- package/package.json +9 -9
- package/src/asset.ts +1 -1
- package/src/components/light-component.ts +28 -2
|
@@ -23,6 +23,7 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
23
23
|
private _shadowType;
|
|
24
24
|
private _type;
|
|
25
25
|
private _vsmBias;
|
|
26
|
+
private _vsmBlurSize;
|
|
26
27
|
/** @ignore */
|
|
27
28
|
constructor();
|
|
28
29
|
getInitialComponentData(): {
|
|
@@ -40,6 +41,7 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
40
41
|
shadowType: number | undefined;
|
|
41
42
|
type: string;
|
|
42
43
|
vsmBias: number;
|
|
44
|
+
vsmBlurSize: number;
|
|
43
45
|
};
|
|
44
46
|
/**
|
|
45
47
|
* Gets the underlying PlayCanvas light component.
|
|
@@ -196,6 +198,16 @@ declare class LightComponentElement extends ComponentElement {
|
|
|
196
198
|
* @returns The VSM bias.
|
|
197
199
|
*/
|
|
198
200
|
get vsmBias(): number;
|
|
201
|
+
/**
|
|
202
|
+
* Sets the VSM blur size of the light. Minimum is 1, maximum is 25. Default is 11.
|
|
203
|
+
* @param value - The VSM blur size.
|
|
204
|
+
*/
|
|
205
|
+
set vsmBlurSize(value: number);
|
|
206
|
+
/**
|
|
207
|
+
* Gets the VSM blur size of the light.
|
|
208
|
+
* @returns The VSM blur size.
|
|
209
|
+
*/
|
|
210
|
+
get vsmBlurSize(): number;
|
|
199
211
|
static get observedAttributes(): string[];
|
|
200
212
|
attributeChangedCallback(name: string, _oldValue: string, newValue: string): void;
|
|
201
213
|
}
|
package/dist/pwc.cjs
CHANGED
|
@@ -2352,6 +2352,7 @@ class LightComponentElement extends ComponentElement {
|
|
|
2352
2352
|
this._shadowType = 'pcf3-32f';
|
|
2353
2353
|
this._type = 'directional';
|
|
2354
2354
|
this._vsmBias = 0.01;
|
|
2355
|
+
this._vsmBlurSize = 11;
|
|
2355
2356
|
}
|
|
2356
2357
|
getInitialComponentData() {
|
|
2357
2358
|
return {
|
|
@@ -2368,7 +2369,8 @@ class LightComponentElement extends ComponentElement {
|
|
|
2368
2369
|
shadowResolution: this._shadowResolution,
|
|
2369
2370
|
shadowType: shadowTypes.get(this._shadowType),
|
|
2370
2371
|
type: this._type,
|
|
2371
|
-
vsmBias: this._vsmBias
|
|
2372
|
+
vsmBias: this._vsmBias,
|
|
2373
|
+
vsmBlurSize: this._vsmBlurSize
|
|
2372
2374
|
};
|
|
2373
2375
|
}
|
|
2374
2376
|
/**
|
|
@@ -2631,6 +2633,23 @@ class LightComponentElement extends ComponentElement {
|
|
|
2631
2633
|
get vsmBias() {
|
|
2632
2634
|
return this._vsmBias;
|
|
2633
2635
|
}
|
|
2636
|
+
/**
|
|
2637
|
+
* Sets the VSM blur size of the light. Minimum is 1, maximum is 25. Default is 11.
|
|
2638
|
+
* @param value - The VSM blur size.
|
|
2639
|
+
*/
|
|
2640
|
+
set vsmBlurSize(value) {
|
|
2641
|
+
this._vsmBlurSize = value;
|
|
2642
|
+
if (this.component) {
|
|
2643
|
+
this.component.vsmBlurSize = value;
|
|
2644
|
+
}
|
|
2645
|
+
}
|
|
2646
|
+
/**
|
|
2647
|
+
* Gets the VSM blur size of the light.
|
|
2648
|
+
* @returns The VSM blur size.
|
|
2649
|
+
*/
|
|
2650
|
+
get vsmBlurSize() {
|
|
2651
|
+
return this._vsmBlurSize;
|
|
2652
|
+
}
|
|
2634
2653
|
static get observedAttributes() {
|
|
2635
2654
|
return [
|
|
2636
2655
|
...super.observedAttributes,
|
|
@@ -2647,7 +2666,8 @@ class LightComponentElement extends ComponentElement {
|
|
|
2647
2666
|
'shadow-resolution',
|
|
2648
2667
|
'shadow-type',
|
|
2649
2668
|
'type',
|
|
2650
|
-
'vsm-bias'
|
|
2669
|
+
'vsm-bias',
|
|
2670
|
+
'vsm-blur-size'
|
|
2651
2671
|
];
|
|
2652
2672
|
}
|
|
2653
2673
|
attributeChangedCallback(name, _oldValue, newValue) {
|
|
@@ -2695,6 +2715,9 @@ class LightComponentElement extends ComponentElement {
|
|
|
2695
2715
|
case 'vsm-bias':
|
|
2696
2716
|
this.vsmBias = Number(newValue);
|
|
2697
2717
|
break;
|
|
2718
|
+
case 'vsm-blur-size':
|
|
2719
|
+
this.vsmBlurSize = Number(newValue);
|
|
2720
|
+
break;
|
|
2698
2721
|
}
|
|
2699
2722
|
}
|
|
2700
2723
|
}
|