angular-three-postprocessing 2.0.0-beta.254 → 2.0.0-beta.256
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/esm2022/lib/effect-composer.mjs +3 -14
- package/esm2022/lib/effect.mjs +1 -1
- package/esm2022/lib/effects/depth-of-field.mjs +5 -5
- package/esm2022/lib/effects/glitch.mjs +1 -1
- package/esm2022/lib/effects/god-rays.mjs +5 -5
- package/esm2022/lib/effects/grid.mjs +1 -1
- package/esm2022/lib/effects/lens-flare.mjs +7 -6
- package/esm2022/lib/effects/lut.mjs +1 -1
- package/esm2022/lib/effects/pixelation.mjs +1 -1
- package/fesm2022/angular-three-postprocessing.mjs +11 -21
- package/fesm2022/angular-three-postprocessing.mjs.map +1 -1
- package/lib/effect-composer.d.ts +8 -56
- package/lib/effect.d.ts +1 -1
- package/lib/effects/depth-of-field.d.ts +3 -10
- package/lib/effects/glitch.d.ts +9 -9
- package/lib/effects/god-rays.d.ts +2 -9
- package/lib/effects/grid.d.ts +4 -7
- package/lib/effects/lens-flare.d.ts +10 -24
- package/lib/effects/lut.d.ts +4 -4
- package/lib/effects/pixelation.d.ts +1 -1
- package/package.json +1 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, Component, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, input, Directive, Injector, computed, viewChild, afterNextRender } from '@angular/core';
|
|
3
|
-
import { injectStore, extend,
|
|
3
|
+
import { injectStore, extend, pick, injectBeforeRender, getLocalState, NgtArgs, vector2, is } from 'angular-three';
|
|
4
4
|
import { createNoopInjectionToken } from 'ngxtension/create-injection-token';
|
|
5
5
|
import { injectAutoEffect } from 'ngxtension/auto-effect';
|
|
6
6
|
import { mergeInputs } from 'ngxtension/inject-inputs';
|
|
@@ -56,7 +56,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
|
|
|
56
56
|
const NgtpEffectHostDirective = { directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] };
|
|
57
57
|
|
|
58
58
|
extend({ Group });
|
|
59
|
-
const [injectEffectComposerApi, provideEffectComposerApi] = createApiToken(() => NgtpEffectComposer);
|
|
60
59
|
const defaultOptions$3 = {
|
|
61
60
|
enabled: true,
|
|
62
61
|
renderPriority: 1,
|
|
@@ -123,15 +122,6 @@ class NgtpEffectComposer {
|
|
|
123
122
|
}
|
|
124
123
|
return { composer, normalPass, downSamplingPass };
|
|
125
124
|
});
|
|
126
|
-
this.api = computed(() => {
|
|
127
|
-
const [{ composer, normalPass, downSamplingPass }, camera, scene, resolutionScale] = [
|
|
128
|
-
this.composerData(),
|
|
129
|
-
this.camera(),
|
|
130
|
-
this.scene(),
|
|
131
|
-
this.resolutionScale(),
|
|
132
|
-
];
|
|
133
|
-
return { composer, camera, scene, normalPass, downSamplingPass, resolutionScale };
|
|
134
|
-
});
|
|
135
125
|
afterNextRender(() => {
|
|
136
126
|
this.disableToneMapping();
|
|
137
127
|
this.setComposerSize();
|
|
@@ -224,7 +214,7 @@ class NgtpEffectComposer {
|
|
|
224
214
|
});
|
|
225
215
|
}
|
|
226
216
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.0.6", ngImport: i0, type: NgtpEffectComposer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
227
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.0.6", type: NgtpEffectComposer, isStandalone: true, selector: "ngtp-effect-composer", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } },
|
|
217
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "18.0.6", type: NgtpEffectComposer, isStandalone: true, selector: "ngtp-effect-composer", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "group", first: true, predicate: ["group"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
228
218
|
<ngt-group #group>
|
|
229
219
|
<ng-content />
|
|
230
220
|
</ngt-group>
|
|
@@ -240,7 +230,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
|
|
|
240
230
|
<ng-content />
|
|
241
231
|
</ngt-group>
|
|
242
232
|
`,
|
|
243
|
-
providers: [provideEffectComposerApi()],
|
|
244
233
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
245
234
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
246
235
|
}]
|
|
@@ -552,11 +541,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
|
|
|
552
541
|
class NgtpDepthOfField {
|
|
553
542
|
constructor() {
|
|
554
543
|
this.autoEffect = injectAutoEffect();
|
|
555
|
-
this.
|
|
544
|
+
this.effectComposer = inject(NgtpEffectComposer);
|
|
556
545
|
this.options = input({});
|
|
557
546
|
this.autoFocus = computed(() => this.options().target != null);
|
|
558
547
|
this.effect = computed(() => {
|
|
559
|
-
const [
|
|
548
|
+
const [camera, options, autoFocus] = [this.effectComposer.camera(), this.options(), this.autoFocus()];
|
|
560
549
|
const effect = new DepthOfFieldEffect(camera, options);
|
|
561
550
|
// Creating a target enables autofocus, R3F will set via props
|
|
562
551
|
if (autoFocus)
|
|
@@ -722,10 +711,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
|
|
|
722
711
|
class NgtpGodRays {
|
|
723
712
|
constructor() {
|
|
724
713
|
this.autoEffect = injectAutoEffect();
|
|
725
|
-
this.
|
|
714
|
+
this.effectComposer = inject(NgtpEffectComposer);
|
|
726
715
|
this.options = input({});
|
|
727
716
|
this.effect = computed(() => {
|
|
728
|
-
const [
|
|
717
|
+
const [camera, { sun, ...options }] = [this.effectComposer.camera(), this.options()];
|
|
729
718
|
return new GodRaysEffect(camera, is.ref(sun) ? sun.nativeElement : sun, options);
|
|
730
719
|
});
|
|
731
720
|
afterNextRender(() => {
|
|
@@ -920,7 +909,7 @@ class NgtpLensFlare {
|
|
|
920
909
|
this.viewport = this.store.select('viewport');
|
|
921
910
|
this.raycaster = this.store.select('raycaster');
|
|
922
911
|
this.pointer = this.store.select('pointer');
|
|
923
|
-
this.
|
|
912
|
+
this.effectComposer = inject(NgtpEffectComposer);
|
|
924
913
|
this.options = input(defaultOptions$1, { transform: mergeInputs(defaultOptions$1) });
|
|
925
914
|
this.projectedPosition = new Vector3();
|
|
926
915
|
this.mouse2d = new Vector2();
|
|
@@ -942,10 +931,11 @@ class NgtpLensFlare {
|
|
|
942
931
|
const [effect] = [this.effect()];
|
|
943
932
|
if (!effect)
|
|
944
933
|
return;
|
|
945
|
-
const [{ followMouse, position, smoothTime }, pointer,
|
|
934
|
+
const [{ followMouse, position, smoothTime }, pointer, camera, scene, raycaster] = [
|
|
946
935
|
this.options(),
|
|
947
936
|
this.pointer(),
|
|
948
|
-
this.
|
|
937
|
+
this.effectComposer.camera(),
|
|
938
|
+
this.effectComposer.scene(),
|
|
949
939
|
this.raycaster(),
|
|
950
940
|
];
|
|
951
941
|
const uLensPosition = effect.uniforms.get('lensPosition');
|
|
@@ -1485,5 +1475,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.0.6", ngImpor
|
|
|
1485
1475
|
* Generated bundle index. Do not edit.
|
|
1486
1476
|
*/
|
|
1487
1477
|
|
|
1488
|
-
export { ASCIIEffect, LensFlareEffect, NgtpASCII, NgtpBloom, NgtpBrightnessContrast, NgtpChromaticAberration, NgtpColorAverage, NgtpColorDepth, NgtpDepth, NgtpDepthOfField, NgtpDotScreen, NgtpEffect, NgtpEffectBlendMode, NgtpEffectComposer, NgtpEffectHostDirective, NgtpFXAA, NgtpGlitch, NgtpGodRays, NgtpGrid, NgtpHueSaturation, NgtpLUT, NgtpLensFlare, NgtpNoise, NgtpPixelation, NgtpSMAA, NgtpScanline, NgtpSepia, NgtpShockWave, NgtpTiltShift, NgtpTiltShift2, NgtpVignette, NgtpWater, TiltShift2Effect, WaterEffect, injectDefaultEffectOptions,
|
|
1478
|
+
export { ASCIIEffect, LensFlareEffect, NgtpASCII, NgtpBloom, NgtpBrightnessContrast, NgtpChromaticAberration, NgtpColorAverage, NgtpColorDepth, NgtpDepth, NgtpDepthOfField, NgtpDotScreen, NgtpEffect, NgtpEffectBlendMode, NgtpEffectComposer, NgtpEffectHostDirective, NgtpFXAA, NgtpGlitch, NgtpGodRays, NgtpGrid, NgtpHueSaturation, NgtpLUT, NgtpLensFlare, NgtpNoise, NgtpPixelation, NgtpSMAA, NgtpScanline, NgtpSepia, NgtpShockWave, NgtpTiltShift, NgtpTiltShift2, NgtpVignette, NgtpWater, TiltShift2Effect, WaterEffect, injectDefaultEffectOptions, provideDefaultEffectOptions };
|
|
1489
1479
|
//# sourceMappingURL=angular-three-postprocessing.mjs.map
|