angular-three-postprocessing 3.7.0 → 4.0.0-next.2
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/fesm2022/angular-three-postprocessing-n8ao.mjs.map +1 -1
- package/fesm2022/angular-three-postprocessing.mjs +181 -162
- package/fesm2022/angular-three-postprocessing.mjs.map +1 -1
- package/lib/effect-composer.d.ts +6 -10
- package/lib/effect.d.ts +2 -2
- package/lib/effects/ascii.d.ts +3 -3
- package/lib/effects/bloom.d.ts +2 -1
- package/lib/effects/brightness-contrast.d.ts +2 -1
- package/lib/effects/chromatic-abberation.d.ts +2 -1
- package/lib/effects/color-average.d.ts +1 -0
- package/lib/effects/color-depth.d.ts +2 -1
- package/lib/effects/depth-of-field.d.ts +4 -5
- package/lib/effects/depth.d.ts +2 -1
- package/lib/effects/dot-screen.d.ts +2 -1
- package/lib/effects/fxaa.d.ts +2 -1
- package/lib/effects/glitch.d.ts +5 -1
- package/lib/effects/god-rays.d.ts +6 -3
- package/lib/effects/grid.d.ts +2 -1
- package/lib/effects/hue-saturation.d.ts +2 -1
- package/lib/effects/lens-flare.d.ts +15 -15
- package/lib/effects/lut.d.ts +4 -4
- package/lib/effects/noise.d.ts +2 -1
- package/lib/effects/outline.d.ts +6 -7
- package/lib/effects/pixelation.d.ts +1 -1
- package/lib/effects/scanline.d.ts +2 -1
- package/lib/effects/sepia.d.ts +2 -1
- package/lib/effects/shock-wave.d.ts +2 -1
- package/lib/effects/smaa.d.ts +2 -1
- package/lib/effects/tilt-shift-2.d.ts +1 -1
- package/lib/effects/tilt-shift.d.ts +2 -1
- package/lib/effects/tone-mapping.d.ts +2 -1
- package/lib/effects/vignette.d.ts +2 -1
- package/lib/effects/water.d.ts +2 -1
- package/n8ao/lib/n8ao.d.ts +3 -3
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
2
|
import { inject, Component, CUSTOM_ELEMENTS_SCHEMA, ChangeDetectionStrategy, input, Directive, Injector, computed, viewChild, effect, untracked } from '@angular/core';
|
|
3
|
-
import { injectStore, pick, extend,
|
|
3
|
+
import { injectStore, pick, extend, getInstanceState, injectBeforeRender, NgtArgs, vector2, omit, resolveRef, vector3, is, NgtSelection } from 'angular-three';
|
|
4
4
|
import { createNoopInjectionToken } from 'ngxtension/create-injection-token';
|
|
5
5
|
import { mergeInputs } from 'ngxtension/inject-inputs';
|
|
6
6
|
import { EffectAttribute, EffectComposer, RenderPass, NormalPass, DepthDownsamplingPass, Effect, EffectPass, Pass, BloomEffect, BlendFunction, BrightnessContrastEffect, ChromaticAberrationEffect, ColorAverageEffect, ColorDepthEffect, DepthEffect, DepthOfFieldEffect, MaskFunction, DotScreenEffect, FXAAEffect, GlitchEffect, GlitchMode, GodRaysEffect, GridEffect, HueSaturationEffect, LUT3DEffect, NoiseEffect, OutlineEffect, PixelationEffect, ScanlineEffect, SepiaEffect, ShockWaveEffect, SMAAEffect, TiltShiftEffect, ToneMappingEffect, VignetteEffect } from 'postprocessing';
|
|
7
|
-
import
|
|
7
|
+
import * as THREE from 'three';
|
|
8
|
+
import { Group } from 'three';
|
|
8
9
|
import { isWebGL2Available } from 'three-stdlib';
|
|
9
10
|
import { easing } from 'maath';
|
|
10
11
|
|
|
@@ -41,8 +42,8 @@ class NgtpEffect {
|
|
|
41
42
|
this.blendFunction = input(this.defaultEffectOptions?.blendFunction);
|
|
42
43
|
this.opacity = input(this.defaultEffectOptions?.opacity);
|
|
43
44
|
this.store = injectStore();
|
|
44
|
-
this.camera = this.store.
|
|
45
|
-
this.invalidate = this.store.
|
|
45
|
+
this.camera = this.store.camera;
|
|
46
|
+
this.invalidate = this.store.invalidate;
|
|
46
47
|
}
|
|
47
48
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpEffect, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
48
49
|
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "19.0.6", type: NgtpEffect, isStandalone: true, inputs: { blendFunction: { classPropertyName: "blendFunction", publicName: "blendFunction", isSignal: true, isRequired: false, transformFunction: null }, opacity: { classPropertyName: "opacity", publicName: "opacity", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0 }); }
|
|
@@ -56,7 +57,7 @@ const defaultOptions$4 = {
|
|
|
56
57
|
renderPriority: 1,
|
|
57
58
|
autoClear: true,
|
|
58
59
|
multisampling: 8,
|
|
59
|
-
frameBufferType: HalfFloatType,
|
|
60
|
+
frameBufferType: THREE.HalfFloatType,
|
|
60
61
|
};
|
|
61
62
|
function isConvolution(effect) {
|
|
62
63
|
return (effect.getAttributes() & EffectAttribute.CONVOLUTION) === EffectAttribute.CONVOLUTION;
|
|
@@ -66,10 +67,10 @@ class NgtpEffectComposer {
|
|
|
66
67
|
this.options = input(defaultOptions$4, { transform: mergeInputs(defaultOptions$4) });
|
|
67
68
|
this.injector = inject(Injector);
|
|
68
69
|
this.store = injectStore();
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
// private size = this.store.select('size');
|
|
71
|
+
// private gl = this.store.select('gl');
|
|
72
|
+
// private defaultScene = this.store.select('scene');
|
|
73
|
+
// private defaultCamera = this.store.select('camera');
|
|
73
74
|
this.depthBuffer = pick(this.options, 'depthBuffer');
|
|
74
75
|
this.stencilBuffer = pick(this.options, 'stencilBuffer');
|
|
75
76
|
this.multisampling = pick(this.options, 'multisampling');
|
|
@@ -78,8 +79,8 @@ class NgtpEffectComposer {
|
|
|
78
79
|
this.resolutionScale = pick(this.options, 'resolutionScale');
|
|
79
80
|
this.enabled = pick(this.options, 'enabled');
|
|
80
81
|
this.renderPriority = pick(this.options, 'renderPriority');
|
|
81
|
-
this.scene = computed(() => this.options().scene ?? this.
|
|
82
|
-
this.camera = computed(() => this.options().camera ?? this.
|
|
82
|
+
this.scene = computed(() => this.options().scene ?? this.store.scene());
|
|
83
|
+
this.camera = computed(() => this.options().camera ?? this.store.camera());
|
|
83
84
|
this.groupRef = viewChild.required('group');
|
|
84
85
|
this.priority = computed(() => {
|
|
85
86
|
const enabled = this.enabled();
|
|
@@ -90,7 +91,7 @@ class NgtpEffectComposer {
|
|
|
90
91
|
this.composerData = computed(() => {
|
|
91
92
|
const webGL2Available = isWebGL2Available();
|
|
92
93
|
const [gl, scene, camera, depthBuffer, stencilBuffer, multisampling, frameBufferType, enableNormalPass, resolutionScale,] = [
|
|
93
|
-
this.gl(),
|
|
94
|
+
this.store.gl(),
|
|
94
95
|
this.scene(),
|
|
95
96
|
this.camera(),
|
|
96
97
|
this.depthBuffer(),
|
|
@@ -127,15 +128,15 @@ class NgtpEffectComposer {
|
|
|
127
128
|
extend({ Group });
|
|
128
129
|
// NOTE: Disable tone mapping because threejs disallows tonemapping on render targets
|
|
129
130
|
effect((onCleanup) => {
|
|
130
|
-
const gl = this.gl();
|
|
131
|
+
const gl = this.store.gl();
|
|
131
132
|
const currentTonemapping = gl.toneMapping;
|
|
132
|
-
gl.toneMapping = NoToneMapping;
|
|
133
|
+
gl.toneMapping = THREE.NoToneMapping;
|
|
133
134
|
onCleanup(() => {
|
|
134
135
|
gl.toneMapping = currentTonemapping;
|
|
135
136
|
});
|
|
136
137
|
});
|
|
137
138
|
effect(() => {
|
|
138
|
-
const [{ composer },
|
|
139
|
+
const [{ composer }, width, height] = [this.composerData(), this.store.size.width(), this.store.size.height()];
|
|
139
140
|
if (composer) {
|
|
140
141
|
composer.setSize(width, height);
|
|
141
142
|
}
|
|
@@ -148,10 +149,10 @@ class NgtpEffectComposer {
|
|
|
148
149
|
];
|
|
149
150
|
const passes = [];
|
|
150
151
|
if (composer) {
|
|
151
|
-
const
|
|
152
|
-
if (!
|
|
152
|
+
const instanceState = getInstanceState(group);
|
|
153
|
+
if (!instanceState)
|
|
153
154
|
return;
|
|
154
|
-
const children =
|
|
155
|
+
const children = instanceState.nonObjects();
|
|
155
156
|
for (let i = 0; i < children.length; i++) {
|
|
156
157
|
const child = children[i];
|
|
157
158
|
if (child instanceof Effect) {
|
|
@@ -195,7 +196,7 @@ class NgtpEffectComposer {
|
|
|
195
196
|
const [{ composer }, { enabled, autoClear, stencilBuffer }, gl] = [
|
|
196
197
|
this.composerData(),
|
|
197
198
|
this.options(),
|
|
198
|
-
this.gl
|
|
199
|
+
this.store.snapshot.gl,
|
|
199
200
|
];
|
|
200
201
|
if (enabled) {
|
|
201
202
|
const currentAutoClear = gl.autoClear;
|
|
@@ -273,11 +274,11 @@ void mainImage(const in vec4 inputColor, const in vec2 uv, out vec4 outputColor)
|
|
|
273
274
|
class ASCIIEffect extends Effect {
|
|
274
275
|
constructor({ font = 'arial', characters = ` .:,'-^=*+?!|0#X%WM@`, fontSize = 54, cellSize = 16, color = '#ffffff', invert = false, } = {}) {
|
|
275
276
|
const uniforms = new Map([
|
|
276
|
-
['uCharacters', new Uniform(new Texture())],
|
|
277
|
-
['uCellSize', new Uniform(cellSize)],
|
|
278
|
-
['uCharactersCount', new Uniform(characters.length)],
|
|
279
|
-
['uColor', new Uniform(new Color(color))],
|
|
280
|
-
['uInvert', new Uniform(invert)],
|
|
277
|
+
['uCharacters', new THREE.Uniform(new THREE.Texture())],
|
|
278
|
+
['uCellSize', new THREE.Uniform(cellSize)],
|
|
279
|
+
['uCharactersCount', new THREE.Uniform(characters.length)],
|
|
280
|
+
['uColor', new THREE.Uniform(new THREE.Color(color))],
|
|
281
|
+
['uInvert', new THREE.Uniform(invert)],
|
|
281
282
|
]);
|
|
282
283
|
super('ASCIIEffect', fragment, { uniforms });
|
|
283
284
|
const charactersTextureUniform = this.uniforms.get('uCharacters');
|
|
@@ -292,7 +293,7 @@ class ASCIIEffect extends Effect {
|
|
|
292
293
|
const MAX_PER_ROW = 16;
|
|
293
294
|
const CELL = SIZE / MAX_PER_ROW;
|
|
294
295
|
canvas.width = canvas.height = SIZE;
|
|
295
|
-
const texture = new CanvasTexture(canvas, undefined, RepeatWrapping, RepeatWrapping, NearestFilter, NearestFilter);
|
|
296
|
+
const texture = new THREE.CanvasTexture(canvas, undefined, THREE.RepeatWrapping, THREE.RepeatWrapping, THREE.NearestFilter, THREE.NearestFilter);
|
|
296
297
|
const context = canvas.getContext('2d');
|
|
297
298
|
if (!context) {
|
|
298
299
|
throw new Error('Context not available');
|
|
@@ -347,11 +348,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
347
348
|
}]
|
|
348
349
|
}], ctorParameters: () => [] });
|
|
349
350
|
|
|
350
|
-
extend({ BloomEffect });
|
|
351
351
|
class NgtpBloom {
|
|
352
352
|
constructor() {
|
|
353
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
354
353
|
this.options = input({});
|
|
354
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
355
|
+
extend({ BloomEffect });
|
|
355
356
|
}
|
|
356
357
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpBloom, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
357
358
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpBloom, isStandalone: true, selector: "ngtp-bloom", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.ADD })], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -377,13 +378,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
377
378
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
378
379
|
providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.ADD })],
|
|
379
380
|
}]
|
|
380
|
-
}] });
|
|
381
|
+
}], ctorParameters: () => [] });
|
|
381
382
|
|
|
382
|
-
extend({ BrightnessContrastEffect });
|
|
383
383
|
class NgtpBrightnessContrast {
|
|
384
384
|
constructor() {
|
|
385
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
386
385
|
this.options = input({});
|
|
386
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
387
|
+
extend({ BrightnessContrastEffect });
|
|
387
388
|
}
|
|
388
389
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpBrightnessContrast, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
389
390
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpBrightnessContrast, isStandalone: true, selector: "ngtp-brightness-contrast", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -408,13 +409,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
408
409
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
409
410
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
410
411
|
}]
|
|
411
|
-
}] });
|
|
412
|
+
}], ctorParameters: () => [] });
|
|
412
413
|
|
|
413
|
-
extend({ ChromaticAberrationEffect });
|
|
414
414
|
class NgtpChromaticAberration {
|
|
415
415
|
constructor() {
|
|
416
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
417
416
|
this.options = input({});
|
|
417
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
418
|
+
extend({ ChromaticAberrationEffect });
|
|
418
419
|
}
|
|
419
420
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpChromaticAberration, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
420
421
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpChromaticAberration, isStandalone: true, selector: "ngtp-chromatic-aberration", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -439,12 +440,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
439
440
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
440
441
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
441
442
|
}]
|
|
442
|
-
}] });
|
|
443
|
+
}], ctorParameters: () => [] });
|
|
443
444
|
|
|
444
|
-
extend({ ColorAverageEffect });
|
|
445
445
|
class NgtpColorAverage {
|
|
446
446
|
constructor() {
|
|
447
447
|
this.options = input({ blendFunction: BlendFunction.NORMAL }, { transform: mergeInputs({ blendFunction: BlendFunction.NORMAL }) });
|
|
448
|
+
extend({ ColorAverageEffect });
|
|
448
449
|
}
|
|
449
450
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpColorAverage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
450
451
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpColorAverage, isStandalone: true, selector: "ngtp-color-average", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
@@ -466,13 +467,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
466
467
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
467
468
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
468
469
|
}]
|
|
469
|
-
}] });
|
|
470
|
+
}], ctorParameters: () => [] });
|
|
470
471
|
|
|
471
|
-
extend({ ColorDepthEffect });
|
|
472
472
|
class NgtpColorDepth {
|
|
473
473
|
constructor() {
|
|
474
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
475
474
|
this.options = input({});
|
|
475
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
476
|
+
extend({ ColorDepthEffect });
|
|
476
477
|
}
|
|
477
478
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpColorDepth, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
478
479
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpColorDepth, isStandalone: true, selector: "ngtp-color-depth", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -497,13 +498,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
497
498
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
498
499
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
499
500
|
}]
|
|
500
|
-
}] });
|
|
501
|
+
}], ctorParameters: () => [] });
|
|
501
502
|
|
|
502
|
-
extend({ DepthEffect });
|
|
503
503
|
class NgtpDepth {
|
|
504
504
|
constructor() {
|
|
505
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
506
505
|
this.options = input({});
|
|
506
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
507
|
+
extend({ DepthEffect });
|
|
507
508
|
}
|
|
508
509
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpDepth, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
509
510
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpDepth, isStandalone: true, selector: "ngtp-depth", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -528,19 +529,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
528
529
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
529
530
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
530
531
|
}]
|
|
531
|
-
}] });
|
|
532
|
+
}], ctorParameters: () => [] });
|
|
532
533
|
|
|
533
534
|
class NgtpDepthOfField {
|
|
534
535
|
constructor() {
|
|
535
536
|
this.options = input({});
|
|
536
|
-
this.autoFocus = computed(() => this.options().target != null);
|
|
537
537
|
this.effectComposer = inject(NgtpEffectComposer);
|
|
538
538
|
this.effect = computed(() => {
|
|
539
|
-
const [camera, options
|
|
539
|
+
const [camera, options] = [this.effectComposer.camera(), this.options()];
|
|
540
|
+
const autoFocus = options.target != null;
|
|
540
541
|
const effect = new DepthOfFieldEffect(camera, options);
|
|
541
|
-
// Creating a target enables autofocus,
|
|
542
|
+
// Creating a target enables autofocus, NGT will set via props
|
|
542
543
|
if (autoFocus)
|
|
543
|
-
effect.target = new Vector3();
|
|
544
|
+
effect.target = new THREE.Vector3();
|
|
544
545
|
// Depth texture for depth picking with optional packing strategy
|
|
545
546
|
if (options.depthTexture) {
|
|
546
547
|
effect.setDepthTexture(options.depthTexture.texture, options.depthTexture.packing);
|
|
@@ -573,11 +574,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
573
574
|
}]
|
|
574
575
|
}], ctorParameters: () => [] });
|
|
575
576
|
|
|
576
|
-
extend({ DotScreenEffect });
|
|
577
577
|
class NgtpDotScreen {
|
|
578
578
|
constructor() {
|
|
579
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
580
579
|
this.options = input({});
|
|
580
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
581
|
+
extend({ DotScreenEffect });
|
|
581
582
|
}
|
|
582
583
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpDotScreen, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
583
584
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpDotScreen, isStandalone: true, selector: "ngtp-dot-screen", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -602,13 +603,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
602
603
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
603
604
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
604
605
|
}]
|
|
605
|
-
}] });
|
|
606
|
+
}], ctorParameters: () => [] });
|
|
606
607
|
|
|
607
|
-
extend({ FXAAEffect });
|
|
608
608
|
class NgtpFXAA {
|
|
609
609
|
constructor() {
|
|
610
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
611
610
|
this.options = input({});
|
|
611
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
612
|
+
extend({ FXAAEffect });
|
|
612
613
|
}
|
|
613
614
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpFXAA, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
614
615
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpFXAA, isStandalone: true, selector: "ngtp-fxaa", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -633,35 +634,41 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
633
634
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
634
635
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
635
636
|
}]
|
|
636
|
-
}] });
|
|
637
|
+
}], ctorParameters: () => [] });
|
|
637
638
|
|
|
638
639
|
class NgtpGlitch {
|
|
639
640
|
constructor() {
|
|
640
641
|
this.options = input({ active: true }, { transform: mergeInputs({ active: true }) });
|
|
641
642
|
this.active = pick(this.options, 'active');
|
|
642
643
|
this.mode = pick(this.options, 'mode');
|
|
644
|
+
this.ratio = pick(this.options, 'ratio');
|
|
645
|
+
this.dtSize = pick(this.options, 'dtSize');
|
|
646
|
+
this.columns = pick(this.options, 'columns');
|
|
647
|
+
this.blendFunction = pick(this.options, 'blendFunction');
|
|
648
|
+
this.perturbationMap = pick(this.options, 'perturbationMap');
|
|
643
649
|
this.delay = vector2(this.options, 'delay');
|
|
644
650
|
this.duration = vector2(this.options, 'duration');
|
|
645
651
|
this.chromaticAberrationOffset = vector2(this.options, 'chromaticAberrationOffset');
|
|
646
652
|
this.strength = vector2(this.options, 'strength');
|
|
647
653
|
this.store = injectStore();
|
|
648
|
-
this.
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
chromaticAberrationOffset,
|
|
660
|
-
strength,
|
|
661
|
-
});
|
|
662
|
-
});
|
|
654
|
+
this.effect = computed(() => new GlitchEffect({
|
|
655
|
+
ratio: this.ratio(),
|
|
656
|
+
dtSize: this.dtSize(),
|
|
657
|
+
columns: this.columns(),
|
|
658
|
+
blendFunction: this.blendFunction(),
|
|
659
|
+
perturbationMap: this.perturbationMap(),
|
|
660
|
+
delay: this.delay(),
|
|
661
|
+
duration: this.duration(),
|
|
662
|
+
chromaticAberrationOffset: this.chromaticAberrationOffset(),
|
|
663
|
+
strength: this.strength(),
|
|
664
|
+
}));
|
|
663
665
|
effect(() => {
|
|
664
|
-
const [glitchEffect, invalidate, mode, active] = [
|
|
666
|
+
const [glitchEffect, invalidate, mode, active] = [
|
|
667
|
+
this.effect(),
|
|
668
|
+
this.store.invalidate(),
|
|
669
|
+
this.mode(),
|
|
670
|
+
this.active(),
|
|
671
|
+
];
|
|
665
672
|
glitchEffect.mode = active ? mode || GlitchMode.SPORADIC : GlitchMode.DISABLED;
|
|
666
673
|
invalidate();
|
|
667
674
|
});
|
|
@@ -692,13 +699,24 @@ class NgtpGodRays {
|
|
|
692
699
|
constructor() {
|
|
693
700
|
this.options = input({});
|
|
694
701
|
this.effectComposer = inject(NgtpEffectComposer);
|
|
702
|
+
this.effectOptions = omit(this.options, ['sun']);
|
|
703
|
+
this.sun = pick(this.options, 'sun');
|
|
704
|
+
this.sunElement = computed(() => {
|
|
705
|
+
const sun = this.sun();
|
|
706
|
+
if (typeof sun === 'function')
|
|
707
|
+
return resolveRef(sun());
|
|
708
|
+
return resolveRef(sun);
|
|
709
|
+
});
|
|
695
710
|
this.effect = computed(() => {
|
|
696
|
-
const [camera,
|
|
697
|
-
return new GodRaysEffect(camera,
|
|
711
|
+
const [camera, sunElement, options] = [this.effectComposer.camera(), this.sunElement(), this.effectOptions()];
|
|
712
|
+
return new GodRaysEffect(camera, sunElement, options);
|
|
698
713
|
});
|
|
699
714
|
effect(() => {
|
|
700
|
-
const
|
|
701
|
-
|
|
715
|
+
const sunElement = this.sunElement();
|
|
716
|
+
if (!sunElement)
|
|
717
|
+
return;
|
|
718
|
+
const godRaysEffect = this.effect();
|
|
719
|
+
godRaysEffect.lightSource = sunElement;
|
|
702
720
|
});
|
|
703
721
|
effect((onCleanup) => {
|
|
704
722
|
const effect = this.effect();
|
|
@@ -726,11 +744,9 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
726
744
|
class NgtpGrid {
|
|
727
745
|
constructor() {
|
|
728
746
|
this.options = input({});
|
|
747
|
+
this.effectOptions = omit(this.options, ['size']);
|
|
729
748
|
this.size = pick(this.options, 'size');
|
|
730
|
-
this.effect = computed(() =>
|
|
731
|
-
const { size: _, ...options } = this.options();
|
|
732
|
-
return new GridEffect(options);
|
|
733
|
-
});
|
|
749
|
+
this.effect = computed(() => new GridEffect(this.effectOptions()));
|
|
734
750
|
effect(() => {
|
|
735
751
|
const [size, effect] = [this.size(), this.effect()];
|
|
736
752
|
if (size) {
|
|
@@ -760,11 +776,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
760
776
|
}]
|
|
761
777
|
}], ctorParameters: () => [] });
|
|
762
778
|
|
|
763
|
-
extend({ HueSaturationEffect });
|
|
764
779
|
class NgtpHueSaturation {
|
|
765
780
|
constructor() {
|
|
766
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
767
781
|
this.options = input({});
|
|
782
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
783
|
+
extend({ HueSaturationEffect });
|
|
768
784
|
}
|
|
769
785
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpHueSaturation, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
770
786
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpHueSaturation, isStandalone: true, selector: "ngtp-hue-saturation", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -789,7 +805,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
789
805
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
790
806
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
791
807
|
}]
|
|
792
|
-
}] });
|
|
808
|
+
}], ctorParameters: () => [] });
|
|
793
809
|
|
|
794
810
|
// Created by Anderson Mancini 2023
|
|
795
811
|
// React Three Fiber Ultimate LensFlare
|
|
@@ -841,29 +857,29 @@ const LensFlareShader = {
|
|
|
841
857
|
`,
|
|
842
858
|
};
|
|
843
859
|
class LensFlareEffect extends Effect {
|
|
844
|
-
constructor({ blendFunction = BlendFunction.NORMAL, enabled = true, glareSize = 0.2, lensPosition = [0.01, 0.01], iResolution = [0, 0], starPoints = 6, flareSize = 0.01, flareSpeed = 0.01, flareShape = 0.01, animated = true, anamorphic = false, colorGain = new Color(20, 20, 20), lensDirtTexture = null, haloScale = 0.5, secondaryGhosts = true, aditionalStreaks = true, ghostScale = 0.0, opacity = 1.0, starBurst = false, } = {}) {
|
|
860
|
+
constructor({ blendFunction = BlendFunction.NORMAL, enabled = true, glareSize = 0.2, lensPosition = [0.01, 0.01], iResolution = [0, 0], starPoints = 6, flareSize = 0.01, flareSpeed = 0.01, flareShape = 0.01, animated = true, anamorphic = false, colorGain = new THREE.Color(20, 20, 20), lensDirtTexture = null, haloScale = 0.5, secondaryGhosts = true, aditionalStreaks = true, ghostScale = 0.0, opacity = 1.0, starBurst = false, } = {}) {
|
|
845
861
|
super('LensFlareEffect', LensFlareShader.fragmentShader, {
|
|
846
862
|
blendFunction,
|
|
847
863
|
uniforms: new Map([
|
|
848
|
-
['enabled', new Uniform(enabled)],
|
|
849
|
-
['glareSize', new Uniform(glareSize)],
|
|
850
|
-
['lensPosition', new Uniform(lensPosition)],
|
|
851
|
-
['iTime', new Uniform(0)],
|
|
852
|
-
['iResolution', new Uniform(iResolution)],
|
|
853
|
-
['starPoints', new Uniform(starPoints)],
|
|
854
|
-
['flareSize', new Uniform(flareSize)],
|
|
855
|
-
['flareSpeed', new Uniform(flareSpeed)],
|
|
856
|
-
['flareShape', new Uniform(flareShape)],
|
|
857
|
-
['animated', new Uniform(animated)],
|
|
858
|
-
['anamorphic', new Uniform(anamorphic)],
|
|
859
|
-
['colorGain', new Uniform(colorGain)],
|
|
860
|
-
['lensDirtTexture', new Uniform(lensDirtTexture)],
|
|
861
|
-
['haloScale', new Uniform(haloScale)],
|
|
862
|
-
['secondaryGhosts', new Uniform(secondaryGhosts)],
|
|
863
|
-
['aditionalStreaks', new Uniform(aditionalStreaks)],
|
|
864
|
-
['ghostScale', new Uniform(ghostScale)],
|
|
865
|
-
['starBurst', new Uniform(starBurst)],
|
|
866
|
-
['opacity', new Uniform(opacity)],
|
|
864
|
+
['enabled', new THREE.Uniform(enabled)],
|
|
865
|
+
['glareSize', new THREE.Uniform(glareSize)],
|
|
866
|
+
['lensPosition', new THREE.Uniform(lensPosition)],
|
|
867
|
+
['iTime', new THREE.Uniform(0)],
|
|
868
|
+
['iResolution', new THREE.Uniform(iResolution)],
|
|
869
|
+
['starPoints', new THREE.Uniform(starPoints)],
|
|
870
|
+
['flareSize', new THREE.Uniform(flareSize)],
|
|
871
|
+
['flareSpeed', new THREE.Uniform(flareSpeed)],
|
|
872
|
+
['flareShape', new THREE.Uniform(flareShape)],
|
|
873
|
+
['animated', new THREE.Uniform(animated)],
|
|
874
|
+
['anamorphic', new THREE.Uniform(anamorphic)],
|
|
875
|
+
['colorGain', new THREE.Uniform(colorGain)],
|
|
876
|
+
['lensDirtTexture', new THREE.Uniform(lensDirtTexture)],
|
|
877
|
+
['haloScale', new THREE.Uniform(haloScale)],
|
|
878
|
+
['secondaryGhosts', new THREE.Uniform(secondaryGhosts)],
|
|
879
|
+
['aditionalStreaks', new THREE.Uniform(aditionalStreaks)],
|
|
880
|
+
['ghostScale', new THREE.Uniform(ghostScale)],
|
|
881
|
+
['starBurst', new THREE.Uniform(starBurst)],
|
|
882
|
+
['opacity', new THREE.Uniform(opacity)],
|
|
867
883
|
]),
|
|
868
884
|
});
|
|
869
885
|
}
|
|
@@ -875,7 +891,7 @@ class LensFlareEffect extends Effect {
|
|
|
875
891
|
}
|
|
876
892
|
}
|
|
877
893
|
const defaultOptions$2 = {
|
|
878
|
-
position: new Vector3(-25, 6, -60),
|
|
894
|
+
position: new THREE.Vector3(-25, 6, -60),
|
|
879
895
|
followMouse: false,
|
|
880
896
|
smoothTime: 0.7,
|
|
881
897
|
};
|
|
@@ -883,22 +899,22 @@ class NgtpLensFlare {
|
|
|
883
899
|
constructor() {
|
|
884
900
|
this.options = input(defaultOptions$2, { transform: mergeInputs(defaultOptions$2) });
|
|
885
901
|
this.store = injectStore();
|
|
886
|
-
this.viewport = this.store.select('viewport');
|
|
887
|
-
this.raycaster = this.store.select('raycaster');
|
|
888
|
-
this.pointer = this.store.select('pointer');
|
|
889
902
|
this.effectComposer = inject(NgtpEffectComposer);
|
|
890
|
-
this.
|
|
891
|
-
this.
|
|
892
|
-
this.
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
});
|
|
903
|
+
this.effectOptions = omit(this.options, ['position', 'followMouse', 'smoothTime']);
|
|
904
|
+
this.position = vector3(this.options, 'position');
|
|
905
|
+
this.projectedPosition = new THREE.Vector3();
|
|
906
|
+
this.mouse2d = new THREE.Vector2();
|
|
907
|
+
this.effect = computed(() => new LensFlareEffect(this.effectOptions()));
|
|
896
908
|
effect(() => {
|
|
897
|
-
const [lensFlareEffect,
|
|
909
|
+
const [lensFlareEffect, width, height] = [
|
|
910
|
+
this.effect(),
|
|
911
|
+
this.store.viewport.width(),
|
|
912
|
+
this.store.viewport.height(),
|
|
913
|
+
];
|
|
898
914
|
const iResolution = lensFlareEffect.uniforms.get('iResolution');
|
|
899
915
|
if (iResolution) {
|
|
900
|
-
iResolution.value.x =
|
|
901
|
-
iResolution.value.y =
|
|
916
|
+
iResolution.value.x = width;
|
|
917
|
+
iResolution.value.y = height;
|
|
902
918
|
}
|
|
903
919
|
});
|
|
904
920
|
effect((onCleanup) => {
|
|
@@ -909,12 +925,13 @@ class NgtpLensFlare {
|
|
|
909
925
|
const [effect] = [this.effect()];
|
|
910
926
|
if (!effect)
|
|
911
927
|
return;
|
|
912
|
-
const [{ followMouse,
|
|
928
|
+
const [{ followMouse, smoothTime }, position, pointer, camera, scene, raycaster] = [
|
|
913
929
|
this.options(),
|
|
914
|
-
this.
|
|
930
|
+
this.position(),
|
|
931
|
+
this.store.snapshot.pointer,
|
|
915
932
|
this.effectComposer.camera(),
|
|
916
933
|
this.effectComposer.scene(),
|
|
917
|
-
this.raycaster
|
|
934
|
+
this.store.snapshot.raycaster,
|
|
918
935
|
];
|
|
919
936
|
const uLensPosition = effect.uniforms.get('lensPosition');
|
|
920
937
|
const uOpacity = effect.uniforms.get('opacity');
|
|
@@ -940,12 +957,14 @@ class NgtpLensFlare {
|
|
|
940
957
|
if (object.userData?.['lensflare'] === 'no-occlusion') {
|
|
941
958
|
target = 0;
|
|
942
959
|
}
|
|
943
|
-
else if (object
|
|
944
|
-
if (object.material.uniforms?._transmission?.value > 0.2) {
|
|
960
|
+
else if (is.three(object, 'isMesh')) {
|
|
961
|
+
if (object.material.uniforms?.['_transmission']?.value > 0.2) {
|
|
945
962
|
//Check for MeshTransmissionMaterial
|
|
946
963
|
target = 0.2;
|
|
947
964
|
}
|
|
948
|
-
else if (
|
|
965
|
+
else if ('_transmission' in object.material &&
|
|
966
|
+
typeof object.material._transmission === 'number' &&
|
|
967
|
+
object.material._transmission > 0.2) {
|
|
949
968
|
//Check for MeshPhysicalMaterial with transmission setting
|
|
950
969
|
target = 0.2;
|
|
951
970
|
}
|
|
@@ -981,17 +1000,18 @@ class NgtpLUT {
|
|
|
981
1000
|
constructor() {
|
|
982
1001
|
this.options = input({});
|
|
983
1002
|
this.lut = pick(this.options, 'lut');
|
|
1003
|
+
this.tetrahedralInterpolation = pick(this.options, 'tetrahedralInterpolation');
|
|
984
1004
|
this.store = injectStore();
|
|
985
|
-
this.invalidate = this.store.select('invalidate');
|
|
986
1005
|
this.effect = computed(() => {
|
|
987
|
-
const
|
|
1006
|
+
const { lut, ...options } = this.options();
|
|
988
1007
|
return new LUT3DEffect(lut, options);
|
|
989
1008
|
});
|
|
990
1009
|
effect(() => {
|
|
991
|
-
const [effect,
|
|
1010
|
+
const [effect, lut, tetrahedralInterpolation, invalidate] = [
|
|
992
1011
|
this.effect(),
|
|
993
|
-
this.
|
|
994
|
-
this.
|
|
1012
|
+
this.lut(),
|
|
1013
|
+
this.tetrahedralInterpolation(),
|
|
1014
|
+
this.store.invalidate(),
|
|
995
1015
|
];
|
|
996
1016
|
if (tetrahedralInterpolation)
|
|
997
1017
|
effect.tetrahedralInterpolation = tetrahedralInterpolation;
|
|
@@ -1022,11 +1042,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
1022
1042
|
}]
|
|
1023
1043
|
}], ctorParameters: () => [] });
|
|
1024
1044
|
|
|
1025
|
-
extend({ NoiseEffect });
|
|
1026
1045
|
class NgtpNoise {
|
|
1027
1046
|
constructor() {
|
|
1028
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
1029
1047
|
this.options = input({});
|
|
1048
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
1049
|
+
extend({ NoiseEffect });
|
|
1030
1050
|
}
|
|
1031
1051
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpNoise, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1032
1052
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpNoise, isStandalone: true, selector: "ngtp-noise", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.COLOR_DODGE })], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -1052,7 +1072,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
1052
1072
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1053
1073
|
providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.COLOR_DODGE })],
|
|
1054
1074
|
}]
|
|
1055
|
-
}] });
|
|
1075
|
+
}], ctorParameters: () => [] });
|
|
1056
1076
|
|
|
1057
1077
|
const defaultOptions$1 = {
|
|
1058
1078
|
selectionLayer: 10,
|
|
@@ -1063,7 +1083,6 @@ class NgtpOutline {
|
|
|
1063
1083
|
this.ngtSelection = inject(NgtSelection, { optional: true });
|
|
1064
1084
|
this.effectComposer = inject(NgtpEffectComposer);
|
|
1065
1085
|
this.store = injectStore();
|
|
1066
|
-
this.invalidate = this.store.select('invalidate');
|
|
1067
1086
|
this.selection = pick(this.options, 'selection');
|
|
1068
1087
|
this.selectionLayer = pick(this.options, 'selectionLayer');
|
|
1069
1088
|
this.blendFunction = pick(this.options, 'blendFunction');
|
|
@@ -1127,7 +1146,7 @@ class NgtpOutline {
|
|
|
1127
1146
|
onCleanup(() => effect.dispose());
|
|
1128
1147
|
});
|
|
1129
1148
|
effect(() => {
|
|
1130
|
-
const [effect, invalidate, selectionLayer] = [this.effect(), this.invalidate(), this.selectionLayer()];
|
|
1149
|
+
const [effect, invalidate, selectionLayer] = [this.effect(), this.store.invalidate(), this.selectionLayer()];
|
|
1131
1150
|
effect.selectionLayer = selectionLayer;
|
|
1132
1151
|
invalidate();
|
|
1133
1152
|
});
|
|
@@ -1138,7 +1157,7 @@ class NgtpOutline {
|
|
|
1138
1157
|
if (this.selection() === undefined) {
|
|
1139
1158
|
throw new Error('[NGT PostProcessing]: ngtp-outline requires selection input or use NgtSelection');
|
|
1140
1159
|
}
|
|
1141
|
-
const cleanup = this.handleSelectionChangeEffect(this.selection, this.effect, this.invalidate);
|
|
1160
|
+
const cleanup = this.handleSelectionChangeEffect(this.selection, this.effect, this.store.invalidate);
|
|
1142
1161
|
onCleanup(() => {
|
|
1143
1162
|
cleanup?.();
|
|
1144
1163
|
});
|
|
@@ -1148,7 +1167,7 @@ class NgtpOutline {
|
|
|
1148
1167
|
const selectionEnabled = this.ngtSelection.enabled();
|
|
1149
1168
|
if (!selectionEnabled)
|
|
1150
1169
|
return;
|
|
1151
|
-
const cleanup = this.handleSelectionChangeEffect(this.ngtSelection.selected, this.effect, this.invalidate);
|
|
1170
|
+
const cleanup = this.handleSelectionChangeEffect(this.ngtSelection.selected, this.effect, this.store.invalidate);
|
|
1152
1171
|
onCleanup(() => {
|
|
1153
1172
|
cleanup?.();
|
|
1154
1173
|
});
|
|
@@ -1221,14 +1240,14 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
1221
1240
|
}]
|
|
1222
1241
|
}], ctorParameters: () => [] });
|
|
1223
1242
|
|
|
1224
|
-
extend({ ScanlineEffect });
|
|
1225
1243
|
const defaultOptions = {
|
|
1226
1244
|
density: 1.25,
|
|
1227
1245
|
};
|
|
1228
1246
|
class NgtpScanline {
|
|
1229
1247
|
constructor() {
|
|
1230
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
1231
1248
|
this.options = input(defaultOptions, { transform: mergeInputs(defaultOptions) });
|
|
1249
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
1250
|
+
extend({ ScanlineEffect });
|
|
1232
1251
|
}
|
|
1233
1252
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpScanline, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1234
1253
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpScanline, isStandalone: true, selector: "ngtp-scanline", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.OVERLAY })], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -1254,13 +1273,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
1254
1273
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1255
1274
|
providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.OVERLAY })],
|
|
1256
1275
|
}]
|
|
1257
|
-
}] });
|
|
1276
|
+
}], ctorParameters: () => [] });
|
|
1258
1277
|
|
|
1259
|
-
extend({ SepiaEffect });
|
|
1260
1278
|
class NgtpSepia {
|
|
1261
1279
|
constructor() {
|
|
1262
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
1263
1280
|
this.options = input({});
|
|
1281
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
1282
|
+
extend({ SepiaEffect });
|
|
1264
1283
|
}
|
|
1265
1284
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpSepia, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1266
1285
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpSepia, isStandalone: true, selector: "ngtp-sepia", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -1285,13 +1304,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
1285
1304
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
1286
1305
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1287
1306
|
}]
|
|
1288
|
-
}] });
|
|
1307
|
+
}], ctorParameters: () => [] });
|
|
1289
1308
|
|
|
1290
|
-
extend({ ShockWaveEffect });
|
|
1291
1309
|
class NgtpShockWave {
|
|
1292
1310
|
constructor() {
|
|
1293
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
1294
1311
|
this.options = input({});
|
|
1312
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
1313
|
+
extend({ ShockWaveEffect });
|
|
1295
1314
|
}
|
|
1296
1315
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpShockWave, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1297
1316
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpShockWave, isStandalone: true, selector: "ngtp-shock-wave", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -1316,13 +1335,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
1316
1335
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
1317
1336
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1318
1337
|
}]
|
|
1319
|
-
}] });
|
|
1338
|
+
}], ctorParameters: () => [] });
|
|
1320
1339
|
|
|
1321
|
-
extend({ SMAAEffect });
|
|
1322
1340
|
class NgtpSMAA {
|
|
1323
1341
|
constructor() {
|
|
1324
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
1325
1342
|
this.options = input({});
|
|
1343
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
1344
|
+
extend({ SMAAEffect });
|
|
1326
1345
|
}
|
|
1327
1346
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpSMAA, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1328
1347
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpSMAA, isStandalone: true, selector: "ngtp-smaa", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -1347,13 +1366,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
1347
1366
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
1348
1367
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1349
1368
|
}]
|
|
1350
|
-
}] });
|
|
1369
|
+
}], ctorParameters: () => [] });
|
|
1351
1370
|
|
|
1352
|
-
extend({ TiltShiftEffect });
|
|
1353
1371
|
class NgtpTiltShift {
|
|
1354
1372
|
constructor() {
|
|
1355
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
1356
1373
|
this.options = input({});
|
|
1374
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
1375
|
+
extend({ TiltShiftEffect });
|
|
1357
1376
|
}
|
|
1358
1377
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpTiltShift, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1359
1378
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpTiltShift, isStandalone: true, selector: "ngtp-tilt-shift", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.ADD })], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -1379,7 +1398,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
1379
1398
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1380
1399
|
providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.ADD })],
|
|
1381
1400
|
}]
|
|
1382
|
-
}] });
|
|
1401
|
+
}], ctorParameters: () => [] });
|
|
1383
1402
|
|
|
1384
1403
|
const TiltShiftShader = {
|
|
1385
1404
|
fragmentShader: /* language=glsl glsl */ `
|
|
@@ -1452,12 +1471,12 @@ class TiltShift2Effect extends Effect {
|
|
|
1452
1471
|
blendFunction,
|
|
1453
1472
|
attributes: EffectAttribute.CONVOLUTION,
|
|
1454
1473
|
uniforms: new Map([
|
|
1455
|
-
['blur', new Uniform(blur)],
|
|
1456
|
-
['taper', new Uniform(taper)],
|
|
1457
|
-
['start', new Uniform(start)],
|
|
1458
|
-
['end', new Uniform(end)],
|
|
1459
|
-
['samples', new Uniform(samples)],
|
|
1460
|
-
['direction', new Uniform(direction)],
|
|
1474
|
+
['blur', new THREE.Uniform(blur)],
|
|
1475
|
+
['taper', new THREE.Uniform(taper)],
|
|
1476
|
+
['start', new THREE.Uniform(start)],
|
|
1477
|
+
['end', new THREE.Uniform(end)],
|
|
1478
|
+
['samples', new THREE.Uniform(samples)],
|
|
1479
|
+
['direction', new THREE.Uniform(direction)],
|
|
1461
1480
|
]),
|
|
1462
1481
|
});
|
|
1463
1482
|
}
|
|
@@ -1465,8 +1484,8 @@ class TiltShift2Effect extends Effect {
|
|
|
1465
1484
|
extend({ TiltShift2Effect });
|
|
1466
1485
|
class NgtpTiltShift2 {
|
|
1467
1486
|
constructor() {
|
|
1468
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
1469
1487
|
this.options = input({});
|
|
1488
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
1470
1489
|
}
|
|
1471
1490
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpTiltShift2, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1472
1491
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpTiltShift2, isStandalone: true, selector: "ngtp-tilt-shift2", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.NORMAL })], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -1494,11 +1513,11 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
1494
1513
|
}]
|
|
1495
1514
|
}] });
|
|
1496
1515
|
|
|
1497
|
-
extend({ ToneMappingEffect });
|
|
1498
1516
|
class NgtpToneMapping {
|
|
1499
1517
|
constructor() {
|
|
1500
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
1501
1518
|
this.options = input({});
|
|
1519
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
1520
|
+
extend({ ToneMappingEffect });
|
|
1502
1521
|
}
|
|
1503
1522
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpToneMapping, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1504
1523
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpToneMapping, isStandalone: true, selector: "ngtp-tone-mapping", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -1523,13 +1542,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
1523
1542
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1524
1543
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1525
1544
|
}]
|
|
1526
|
-
}] });
|
|
1545
|
+
}], ctorParameters: () => [] });
|
|
1527
1546
|
|
|
1528
|
-
extend({ VignetteEffect });
|
|
1529
1547
|
class NgtpVignette {
|
|
1530
1548
|
constructor() {
|
|
1531
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
1532
1549
|
this.options = input({});
|
|
1550
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
1551
|
+
extend({ VignetteEffect });
|
|
1533
1552
|
}
|
|
1534
1553
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpVignette, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1535
1554
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpVignette, isStandalone: true, selector: "ngtp-vignette", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -1554,7 +1573,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
1554
1573
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
1555
1574
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1556
1575
|
}]
|
|
1557
|
-
}] });
|
|
1576
|
+
}], ctorParameters: () => [] });
|
|
1558
1577
|
|
|
1559
1578
|
const WaterShader = {
|
|
1560
1579
|
fragmentShader: /* language=glsl glsl */ `
|
|
@@ -1576,15 +1595,15 @@ class WaterEffect extends Effect {
|
|
|
1576
1595
|
super('WaterEffect', WaterShader.fragmentShader, {
|
|
1577
1596
|
blendFunction,
|
|
1578
1597
|
attributes: EffectAttribute.CONVOLUTION,
|
|
1579
|
-
uniforms: new Map([['factor', new Uniform(factor)]]),
|
|
1598
|
+
uniforms: new Map([['factor', new THREE.Uniform(factor)]]),
|
|
1580
1599
|
});
|
|
1581
1600
|
}
|
|
1582
1601
|
}
|
|
1583
|
-
extend({ WaterEffect });
|
|
1584
1602
|
class NgtpWater {
|
|
1585
1603
|
constructor() {
|
|
1586
|
-
this.effect = inject(NgtpEffect, { host: true });
|
|
1587
1604
|
this.options = input({});
|
|
1605
|
+
this.effect = inject(NgtpEffect, { host: true });
|
|
1606
|
+
extend({ WaterEffect });
|
|
1588
1607
|
}
|
|
1589
1608
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.0.6", ngImport: i0, type: NgtpWater, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1590
1609
|
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.0.6", type: NgtpWater, isStandalone: true, selector: "ngtp-water", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.NORMAL })], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
@@ -1610,7 +1629,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.0.6", ngImpor
|
|
|
1610
1629
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1611
1630
|
providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.NORMAL })],
|
|
1612
1631
|
}]
|
|
1613
|
-
}] });
|
|
1632
|
+
}], ctorParameters: () => [] });
|
|
1614
1633
|
|
|
1615
1634
|
/**
|
|
1616
1635
|
* Generated bundle index. Do not edit.
|