angular-three-postprocessing 4.0.0-next.99 → 4.0.1
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/README.md +80 -21
- package/fesm2022/angular-three-postprocessing-n8ao.mjs +42 -7
- package/fesm2022/angular-three-postprocessing-n8ao.mjs.map +1 -1
- package/fesm2022/angular-three-postprocessing.mjs +1185 -241
- package/fesm2022/angular-three-postprocessing.mjs.map +1 -1
- package/n8ao/README.md +143 -0
- package/package.json +7 -7
- package/types/angular-three-postprocessing-n8ao.d.ts +167 -0
- package/types/angular-three-postprocessing.d.ts +1887 -0
- package/index.d.ts +0 -3
- package/lib/effect-composer.d.ts +0 -38
- package/lib/effect.d.ts +0 -52
- package/lib/effects/ascii.d.ts +0 -24
- package/lib/effects/bloom.d.ts +0 -11
- package/lib/effects/brightness-contrast.d.ts +0 -16
- package/lib/effects/chromatic-abberation.d.ts +0 -17
- package/lib/effects/color-average.d.ts +0 -12
- package/lib/effects/color-depth.d.ts +0 -15
- package/lib/effects/depth-of-field.d.ts +0 -20
- package/lib/effects/depth.d.ts +0 -15
- package/lib/effects/dot-screen.d.ts +0 -16
- package/lib/effects/fxaa.d.ts +0 -14
- package/lib/effects/glitch.d.ts +0 -32
- package/lib/effects/god-rays.d.ts +0 -32
- package/lib/effects/grid.d.ts +0 -18
- package/lib/effects/hue-saturation.d.ts +0 -16
- package/lib/effects/index.d.ts +0 -29
- package/lib/effects/lens-flare.d.ts +0 -94
- package/lib/effects/lut.d.ts +0 -18
- package/lib/effects/noise.d.ts +0 -15
- package/lib/effects/outline.d.ts +0 -73
- package/lib/effects/pixelation.d.ts +0 -17
- package/lib/effects/scanline.d.ts +0 -18
- package/lib/effects/selective-bloom.d.ts +0 -42
- package/lib/effects/sepia.d.ts +0 -15
- package/lib/effects/shock-wave.d.ts +0 -12
- package/lib/effects/smaa.d.ts +0 -16
- package/lib/effects/tilt-shift-2.d.ts +0 -35
- package/lib/effects/tilt-shift.d.ts +0 -23
- package/lib/effects/tone-mapping.d.ts +0 -23
- package/lib/effects/vignette.d.ts +0 -18
- package/lib/effects/water.d.ts +0 -21
- package/n8ao/index.d.ts +0 -1
- package/n8ao/lib/n8ao.d.ts +0 -35
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { inject,
|
|
2
|
+
import { inject, ChangeDetectionStrategy, CUSTOM_ELEMENTS_SCHEMA, Component, input, Directive, computed, viewChild, effect, untracked } from '@angular/core';
|
|
3
3
|
import { injectStore, pick, extend, getInstanceState, beforeRender, NgtArgs, vector2, omit, resolveRef, vector3, is, NgtSelectionApi } from 'angular-three';
|
|
4
4
|
import { createNoopInjectionToken } from 'ngxtension/create-injection-token';
|
|
5
5
|
import { mergeInputs } from 'ngxtension/inject-inputs';
|
|
@@ -9,20 +9,48 @@ import { Group } from 'three';
|
|
|
9
9
|
import { isWebGL2Available } from 'three-stdlib';
|
|
10
10
|
import { easing } from 'maath';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* Injection token for providing default effect options.
|
|
14
|
+
*
|
|
15
|
+
* Use `injectDefaultEffectOptions` to inject default options in effect components.
|
|
16
|
+
* Use `provideDefaultEffectOptions` to provide default options for effects.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```typescript
|
|
20
|
+
* @Component({
|
|
21
|
+
* providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.ADD, opacity: 0.5 })]
|
|
22
|
+
* })
|
|
23
|
+
* export class MyEffect {}
|
|
24
|
+
* ```
|
|
25
|
+
*/
|
|
12
26
|
const [injectDefaultEffectOptions, provideDefaultEffectOptions] = createNoopInjectionToken('Default Effect options');
|
|
27
|
+
/**
|
|
28
|
+
* Component that applies blend mode settings to a postprocessing effect.
|
|
29
|
+
*
|
|
30
|
+
* This component is used internally by effect components to apply `blendFunction`
|
|
31
|
+
* and `opacity` values to the effect's blend mode.
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```html
|
|
35
|
+
* <ngt-bloom-effect *args="[options()]">
|
|
36
|
+
* <ngtp-effect-blend-mode />
|
|
37
|
+
* </ngt-bloom-effect>
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
13
40
|
class NgtpEffectBlendMode {
|
|
14
41
|
constructor() {
|
|
42
|
+
/** Reference to the parent NgtpEffect directive, if available */
|
|
15
43
|
this.effect = inject(NgtpEffect, { optional: true });
|
|
16
44
|
}
|
|
17
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
18
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
45
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpEffectBlendMode, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
46
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.0.6", type: NgtpEffectBlendMode, isStandalone: true, selector: "ngtp-effect-blend-mode", ngImport: i0, template: `
|
|
19
47
|
@if (effect) {
|
|
20
48
|
<ngt-value [rawValue]="effect.blendFunction()" attach="blendMode.blendFunction" />
|
|
21
49
|
<ngt-value [rawValue]="effect.opacity()" attach="blendMode.opacity.value" />
|
|
22
50
|
}
|
|
23
51
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
24
52
|
}
|
|
25
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
53
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpEffectBlendMode, decorators: [{
|
|
26
54
|
type: Component,
|
|
27
55
|
args: [{
|
|
28
56
|
selector: 'ngtp-effect-blend-mode',
|
|
@@ -36,21 +64,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
36
64
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
37
65
|
}]
|
|
38
66
|
}] });
|
|
67
|
+
/**
|
|
68
|
+
* Base directive for postprocessing effects that provides common functionality.
|
|
69
|
+
*
|
|
70
|
+
* This directive is used as a host directive by effect components to provide:
|
|
71
|
+
* - `blendFunction`: Controls how the effect blends with the scene
|
|
72
|
+
* - `opacity`: Controls the effect's opacity
|
|
73
|
+
* - Access to the camera and invalidate function from the store
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* ```typescript
|
|
77
|
+
* @Component({
|
|
78
|
+
* hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }]
|
|
79
|
+
* })
|
|
80
|
+
* export class NgtpBloom {}
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
39
83
|
class NgtpEffect {
|
|
40
84
|
constructor() {
|
|
85
|
+
/** Default effect options injected from parent providers */
|
|
41
86
|
this.defaultEffectOptions = injectDefaultEffectOptions({ optional: true });
|
|
42
|
-
|
|
43
|
-
|
|
87
|
+
/**
|
|
88
|
+
* The blend function used to combine this effect with the scene.
|
|
89
|
+
* @see BlendFunction from postprocessing library
|
|
90
|
+
*/
|
|
91
|
+
this.blendFunction = input(this.defaultEffectOptions?.blendFunction, ...(ngDevMode ? [{ debugName: "blendFunction" }] : []));
|
|
92
|
+
/**
|
|
93
|
+
* The opacity of the effect.
|
|
94
|
+
* @default undefined (uses effect's default)
|
|
95
|
+
*/
|
|
96
|
+
this.opacity = input(this.defaultEffectOptions?.opacity, ...(ngDevMode ? [{ debugName: "opacity" }] : []));
|
|
44
97
|
this.store = injectStore();
|
|
98
|
+
/** The current camera from the store */
|
|
45
99
|
this.camera = this.store.camera;
|
|
100
|
+
/** Function to invalidate the render loop, triggering a re-render */
|
|
46
101
|
this.invalidate = this.store.invalidate;
|
|
47
102
|
}
|
|
48
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
49
|
-
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "
|
|
103
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpEffect, deps: [], target: i0.ɵɵFactoryTarget.Directive }); }
|
|
104
|
+
static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "17.1.0", version: "21.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 }); }
|
|
50
105
|
}
|
|
51
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
106
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpEffect, decorators: [{
|
|
52
107
|
type: Directive
|
|
53
|
-
}] });
|
|
108
|
+
}], propDecorators: { blendFunction: [{ type: i0.Input, args: [{ isSignal: true, alias: "blendFunction", required: false }] }], opacity: [{ type: i0.Input, args: [{ isSignal: true, alias: "opacity", required: false }] }] } });
|
|
54
109
|
|
|
55
110
|
const defaultOptions$5 = {
|
|
56
111
|
enabled: true,
|
|
@@ -59,12 +114,46 @@ const defaultOptions$5 = {
|
|
|
59
114
|
multisampling: 8,
|
|
60
115
|
frameBufferType: THREE.HalfFloatType,
|
|
61
116
|
};
|
|
117
|
+
/**
|
|
118
|
+
* Checks if an effect has the convolution attribute.
|
|
119
|
+
*
|
|
120
|
+
* @param effect - The effect to check
|
|
121
|
+
* @returns True if the effect has the convolution attribute
|
|
122
|
+
*/
|
|
62
123
|
function isConvolution(effect) {
|
|
63
124
|
return (effect.getAttributes() & EffectAttribute.CONVOLUTION) === EffectAttribute.CONVOLUTION;
|
|
64
125
|
}
|
|
126
|
+
/**
|
|
127
|
+
* Angular component that manages postprocessing effects for a Three.js scene.
|
|
128
|
+
*
|
|
129
|
+
* The effect composer wraps the postprocessing library's EffectComposer and provides
|
|
130
|
+
* a declarative way to add effects to your scene. Effects are added as children of
|
|
131
|
+
* this component and are automatically composed into an effect pass.
|
|
132
|
+
*
|
|
133
|
+
* @example
|
|
134
|
+
* ```html
|
|
135
|
+
* <ngtp-effect-composer>
|
|
136
|
+
* <ngtp-bloom [options]="{ intensity: 1, luminanceThreshold: 0.9 }" />
|
|
137
|
+
* <ngtp-vignette [options]="{ darkness: 0.5 }" />
|
|
138
|
+
* </ngtp-effect-composer>
|
|
139
|
+
* ```
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```html
|
|
143
|
+
* <!-- With custom options -->
|
|
144
|
+
* <ngtp-effect-composer [options]="{ multisampling: 4, autoClear: false }">
|
|
145
|
+
* <ngtp-smaa />
|
|
146
|
+
* <ngtp-tone-mapping />
|
|
147
|
+
* </ngtp-effect-composer>
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
65
150
|
class NgtpEffectComposer {
|
|
66
151
|
constructor() {
|
|
67
|
-
|
|
152
|
+
/**
|
|
153
|
+
* Configuration options for the effect composer.
|
|
154
|
+
* @see NgtpEffectComposerOptions
|
|
155
|
+
*/
|
|
156
|
+
this.options = input(defaultOptions$5, { ...(ngDevMode ? { debugName: "options" } : {}), transform: mergeInputs(defaultOptions$5) });
|
|
68
157
|
this.store = injectStore();
|
|
69
158
|
this.depthBuffer = pick(this.options, 'depthBuffer');
|
|
70
159
|
this.stencilBuffer = pick(this.options, 'stencilBuffer');
|
|
@@ -74,15 +163,31 @@ class NgtpEffectComposer {
|
|
|
74
163
|
this.resolutionScale = pick(this.options, 'resolutionScale');
|
|
75
164
|
this.enabled = pick(this.options, 'enabled');
|
|
76
165
|
this.renderPriority = pick(this.options, 'renderPriority');
|
|
77
|
-
|
|
78
|
-
|
|
166
|
+
/**
|
|
167
|
+
* The scene used for rendering effects.
|
|
168
|
+
* Uses custom scene from options if provided, otherwise uses the store's scene.
|
|
169
|
+
*/
|
|
170
|
+
this.scene = computed(() => this.options().scene ?? this.store.scene(), ...(ngDevMode ? [{ debugName: "scene" }] : []));
|
|
171
|
+
/**
|
|
172
|
+
* The camera used for rendering effects.
|
|
173
|
+
* Uses custom camera from options if provided, otherwise uses the store's camera.
|
|
174
|
+
*/
|
|
175
|
+
this.camera = computed(() => this.options().camera ?? this.store.camera(), ...(ngDevMode ? [{ debugName: "camera" }] : []));
|
|
79
176
|
this.groupRef = viewChild.required('group');
|
|
177
|
+
/**
|
|
178
|
+
* Computed render priority based on whether the composer is enabled.
|
|
179
|
+
* Returns 0 when disabled, otherwise returns the configured renderPriority.
|
|
180
|
+
*/
|
|
80
181
|
this.priority = computed(() => {
|
|
81
182
|
const enabled = this.enabled();
|
|
82
183
|
if (!enabled)
|
|
83
184
|
return 0;
|
|
84
185
|
return this.renderPriority();
|
|
85
|
-
});
|
|
186
|
+
}, ...(ngDevMode ? [{ debugName: "priority" }] : []));
|
|
187
|
+
/**
|
|
188
|
+
* Creates and configures the effect composer with render pass, normal pass,
|
|
189
|
+
* and depth downsampling pass based on options.
|
|
190
|
+
*/
|
|
86
191
|
this.composerData = computed(() => {
|
|
87
192
|
const webGL2Available = isWebGL2Available();
|
|
88
193
|
const [gl, scene, camera, depthBuffer, stencilBuffer, multisampling, frameBufferType, enableNormalPass, resolutionScale,] = [
|
|
@@ -119,7 +224,11 @@ class NgtpEffectComposer {
|
|
|
119
224
|
}
|
|
120
225
|
}
|
|
121
226
|
return { composer, normalPass, downSamplingPass };
|
|
122
|
-
});
|
|
227
|
+
}, ...(ngDevMode ? [{ debugName: "composerData" }] : []));
|
|
228
|
+
/**
|
|
229
|
+
* The underlying postprocessing EffectComposer instance.
|
|
230
|
+
* Can be used to access the composer directly for advanced use cases.
|
|
231
|
+
*/
|
|
123
232
|
this.effectComposer = pick(this.composerData, 'composer');
|
|
124
233
|
extend({ Group });
|
|
125
234
|
// NOTE: Disable tone mapping because threejs disallows tonemapping on render targets
|
|
@@ -206,14 +315,14 @@ class NgtpEffectComposer {
|
|
|
206
315
|
}
|
|
207
316
|
}, { priority: this.priority });
|
|
208
317
|
}
|
|
209
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
210
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "
|
|
318
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpEffectComposer, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
319
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpEffectComposer, isStandalone: true, selector: "ngtp-effect-composer", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "groupRef", first: true, predicate: ["group"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
211
320
|
<ngt-group #group>
|
|
212
321
|
<ng-content />
|
|
213
322
|
</ngt-group>
|
|
214
323
|
`, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
215
324
|
}
|
|
216
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
325
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpEffectComposer, decorators: [{
|
|
217
326
|
type: Component,
|
|
218
327
|
args: [{
|
|
219
328
|
selector: 'ngtp-effect-composer',
|
|
@@ -225,8 +334,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
225
334
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
226
335
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
227
336
|
}]
|
|
228
|
-
}], ctorParameters: () => [] });
|
|
337
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], groupRef: [{ type: i0.ViewChild, args: ['group', { isSignal: true }] }] } });
|
|
229
338
|
|
|
339
|
+
/**
|
|
340
|
+
* Fragment shader for the ASCII effect.
|
|
341
|
+
* Converts the scene into ASCII character representation based on pixel brightness.
|
|
342
|
+
*/
|
|
230
343
|
const fragment = /* language=glsl glsl */ `
|
|
231
344
|
uniform sampler2D uCharacters;
|
|
232
345
|
uniform float uCharactersCount;
|
|
@@ -267,6 +380,21 @@ void mainImage(const in vec4 inputColor, const in vec2 uv, out vec4 outputColor)
|
|
|
267
380
|
outputColor = asciiCharacter;
|
|
268
381
|
}
|
|
269
382
|
`;
|
|
383
|
+
/**
|
|
384
|
+
* A postprocessing effect that renders the scene as ASCII art.
|
|
385
|
+
*
|
|
386
|
+
* This effect converts the rendered scene into a grid of ASCII characters,
|
|
387
|
+
* where the character used depends on the brightness of the underlying pixels.
|
|
388
|
+
*
|
|
389
|
+
* @example
|
|
390
|
+
* ```typescript
|
|
391
|
+
* const effect = new ASCIIEffect({
|
|
392
|
+
* cellSize: 12,
|
|
393
|
+
* color: '#00ff00',
|
|
394
|
+
* characters: ' .:-=+*#%@'
|
|
395
|
+
* });
|
|
396
|
+
* ```
|
|
397
|
+
*/
|
|
270
398
|
class ASCIIEffect extends Effect {
|
|
271
399
|
constructor({ font = 'arial', characters = ` .:,'-^=*+?!|0#X%WM@`, fontSize = 54, cellSize = 16, color = '#ffffff', invert = false, } = {}) {
|
|
272
400
|
const uniforms = new Map([
|
|
@@ -282,7 +410,17 @@ class ASCIIEffect extends Effect {
|
|
|
282
410
|
charactersTextureUniform.value = this.createCharactersTexture(characters, font, fontSize);
|
|
283
411
|
}
|
|
284
412
|
}
|
|
285
|
-
/**
|
|
413
|
+
/**
|
|
414
|
+
* Creates a texture containing all the ASCII characters.
|
|
415
|
+
*
|
|
416
|
+
* Draws each character in the character set onto a canvas and creates
|
|
417
|
+
* a texture that can be sampled in the shader.
|
|
418
|
+
*
|
|
419
|
+
* @param characters - The character set to render
|
|
420
|
+
* @param font - The font family to use
|
|
421
|
+
* @param fontSize - The font size in pixels
|
|
422
|
+
* @returns A Three.js texture containing the rendered characters
|
|
423
|
+
*/
|
|
286
424
|
createCharactersTexture(characters, font, fontSize) {
|
|
287
425
|
const canvas = document.createElement('canvas');
|
|
288
426
|
const SIZE = 1024;
|
|
@@ -317,21 +455,39 @@ const defaultOptions$4 = {
|
|
|
317
455
|
color: '#ffffff',
|
|
318
456
|
invert: false,
|
|
319
457
|
};
|
|
458
|
+
/**
|
|
459
|
+
* Angular component that applies an ASCII art postprocessing effect to the scene.
|
|
460
|
+
*
|
|
461
|
+
* Renders the scene as ASCII characters, where character selection is based on
|
|
462
|
+
* the brightness of the underlying pixels.
|
|
463
|
+
*
|
|
464
|
+
* @example
|
|
465
|
+
* ```html
|
|
466
|
+
* <ngtp-effect-composer>
|
|
467
|
+
* <ngtp-ascii [options]="{ cellSize: 12, color: '#00ff00' }" />
|
|
468
|
+
* </ngtp-effect-composer>
|
|
469
|
+
* ```
|
|
470
|
+
*/
|
|
320
471
|
class NgtpASCII {
|
|
321
472
|
constructor() {
|
|
322
|
-
|
|
323
|
-
|
|
473
|
+
/**
|
|
474
|
+
* Configuration options for the ASCII effect.
|
|
475
|
+
* @see ASCIIEffectOptions
|
|
476
|
+
*/
|
|
477
|
+
this.options = input(defaultOptions$4, { ...(ngDevMode ? { debugName: "options" } : {}), transform: mergeInputs(defaultOptions$4) });
|
|
478
|
+
/** The underlying ASCIIEffect instance */
|
|
479
|
+
this.effect = computed(() => new ASCIIEffect(this.options()), ...(ngDevMode ? [{ debugName: "effect" }] : []));
|
|
324
480
|
effect((onCleanup) => {
|
|
325
481
|
const effect = this.effect();
|
|
326
482
|
onCleanup(() => effect.dispose());
|
|
327
483
|
});
|
|
328
484
|
}
|
|
329
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
330
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
485
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpASCII, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
486
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NgtpASCII, isStandalone: true, selector: "ngtp-ascii", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
331
487
|
<ngt-primitive *args="[effect()]" />
|
|
332
488
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
333
489
|
}
|
|
334
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
490
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpASCII, decorators: [{
|
|
335
491
|
type: Component,
|
|
336
492
|
args: [{
|
|
337
493
|
selector: 'ngtp-ascii',
|
|
@@ -342,28 +498,59 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
342
498
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
343
499
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
344
500
|
}]
|
|
345
|
-
}], ctorParameters: () => [] });
|
|
501
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
346
502
|
|
|
503
|
+
/**
|
|
504
|
+
* Angular component that applies a bloom postprocessing effect to the scene.
|
|
505
|
+
*
|
|
506
|
+
* The bloom effect creates a glow around bright areas of the scene, simulating
|
|
507
|
+
* the way bright light bleeds in cameras and the human eye.
|
|
508
|
+
*
|
|
509
|
+
* @example
|
|
510
|
+
* ```html
|
|
511
|
+
* <ngtp-effect-composer>
|
|
512
|
+
* <ngtp-bloom [options]="{ intensity: 1, luminanceThreshold: 0.9 }" />
|
|
513
|
+
* </ngtp-effect-composer>
|
|
514
|
+
* ```
|
|
515
|
+
*
|
|
516
|
+
* @example
|
|
517
|
+
* ```html
|
|
518
|
+
* <!-- With custom blend function -->
|
|
519
|
+
* <ngtp-effect-composer>
|
|
520
|
+
* <ngtp-bloom
|
|
521
|
+
* [blendFunction]="BlendFunction.SCREEN"
|
|
522
|
+
* [options]="{ intensity: 0.5, luminanceSmoothing: 0.9 }"
|
|
523
|
+
* />
|
|
524
|
+
* </ngtp-effect-composer>
|
|
525
|
+
* ```
|
|
526
|
+
*/
|
|
347
527
|
class NgtpBloom {
|
|
348
528
|
constructor() {
|
|
349
|
-
|
|
350
|
-
|
|
529
|
+
/**
|
|
530
|
+
* Configuration options for the bloom effect.
|
|
531
|
+
* Accepts all BloomEffectOptions except blendFunction (use the blendFunction input instead).
|
|
532
|
+
* @see BloomEffectOptions from postprocessing library
|
|
533
|
+
*/
|
|
534
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
535
|
+
/** Reference to the host NgtpEffect directive */
|
|
536
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
537
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
351
538
|
extend({ BloomEffect });
|
|
352
539
|
}
|
|
353
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
354
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
355
|
-
<ngt-bloom-effect *args="[options()]" [camera]="
|
|
540
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpBloom, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
541
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.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 })], viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
542
|
+
<ngt-bloom-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
356
543
|
<ngtp-effect-blend-mode />
|
|
357
544
|
<ng-content />
|
|
358
545
|
</ngt-bloom-effect>
|
|
359
546
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
360
547
|
}
|
|
361
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
548
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpBloom, decorators: [{
|
|
362
549
|
type: Component,
|
|
363
550
|
args: [{
|
|
364
551
|
selector: 'ngtp-bloom',
|
|
365
552
|
template: `
|
|
366
|
-
<ngt-bloom-effect *args="[options()]" [camera]="
|
|
553
|
+
<ngt-bloom-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
367
554
|
<ngtp-effect-blend-mode />
|
|
368
555
|
<ng-content />
|
|
369
556
|
</ngt-bloom-effect>
|
|
@@ -374,28 +561,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
374
561
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
375
562
|
providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.ADD })],
|
|
376
563
|
}]
|
|
377
|
-
}], ctorParameters: () => [] });
|
|
564
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
378
565
|
|
|
566
|
+
/**
|
|
567
|
+
* Angular component that applies brightness and contrast adjustments to the scene.
|
|
568
|
+
*
|
|
569
|
+
* This effect allows you to modify the overall brightness and contrast of the
|
|
570
|
+
* rendered scene as a postprocessing step.
|
|
571
|
+
*
|
|
572
|
+
* @example
|
|
573
|
+
* ```html
|
|
574
|
+
* <ngtp-effect-composer>
|
|
575
|
+
* <ngtp-brightness-contrast [options]="{ brightness: 0.1, contrast: 0.2 }" />
|
|
576
|
+
* </ngtp-effect-composer>
|
|
577
|
+
* ```
|
|
578
|
+
*/
|
|
379
579
|
class NgtpBrightnessContrast {
|
|
380
580
|
constructor() {
|
|
381
|
-
|
|
382
|
-
|
|
581
|
+
/**
|
|
582
|
+
* Configuration options for the brightness/contrast effect.
|
|
583
|
+
* @see BrightnessEffectOptions
|
|
584
|
+
*/
|
|
585
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
586
|
+
/** Reference to the host NgtpEffect directive */
|
|
587
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
588
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
383
589
|
extend({ BrightnessContrastEffect });
|
|
384
590
|
}
|
|
385
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
386
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
387
|
-
<ngt-brightness-contrast-effect *args="[options()]" [camera]="
|
|
591
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpBrightnessContrast, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
592
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpBrightnessContrast, isStandalone: true, selector: "ngtp-brightness-contrast", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
593
|
+
<ngt-brightness-contrast-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
388
594
|
<ngtp-effect-blend-mode />
|
|
389
595
|
<ng-content />
|
|
390
596
|
</ngt-brightness-contrast-effect>
|
|
391
597
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
392
598
|
}
|
|
393
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
599
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpBrightnessContrast, decorators: [{
|
|
394
600
|
type: Component,
|
|
395
601
|
args: [{
|
|
396
602
|
selector: 'ngtp-brightness-contrast',
|
|
397
603
|
template: `
|
|
398
|
-
<ngt-brightness-contrast-effect *args="[options()]" [camera]="
|
|
604
|
+
<ngt-brightness-contrast-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
399
605
|
<ngtp-effect-blend-mode />
|
|
400
606
|
<ng-content />
|
|
401
607
|
</ngt-brightness-contrast-effect>
|
|
@@ -405,28 +611,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
405
611
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
406
612
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
407
613
|
}]
|
|
408
|
-
}], ctorParameters: () => [] });
|
|
614
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
409
615
|
|
|
616
|
+
/**
|
|
617
|
+
* Angular component that applies a chromatic aberration effect to the scene.
|
|
618
|
+
*
|
|
619
|
+
* Chromatic aberration simulates the color fringing that occurs in real camera lenses
|
|
620
|
+
* when different wavelengths of light are focused at different distances.
|
|
621
|
+
*
|
|
622
|
+
* @example
|
|
623
|
+
* ```html
|
|
624
|
+
* <ngtp-effect-composer>
|
|
625
|
+
* <ngtp-chromatic-aberration [options]="{ offset: [0.002, 0.002] }" />
|
|
626
|
+
* </ngtp-effect-composer>
|
|
627
|
+
* ```
|
|
628
|
+
*/
|
|
410
629
|
class NgtpChromaticAberration {
|
|
411
630
|
constructor() {
|
|
412
|
-
|
|
413
|
-
|
|
631
|
+
/**
|
|
632
|
+
* Configuration options for the chromatic aberration effect.
|
|
633
|
+
* @see ChromaticAberrationEffectOptions
|
|
634
|
+
*/
|
|
635
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
636
|
+
/** Reference to the host NgtpEffect directive */
|
|
637
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
638
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
414
639
|
extend({ ChromaticAberrationEffect });
|
|
415
640
|
}
|
|
416
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
417
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
418
|
-
<ngt-chromatic-aberration-effect *args="[options()]" [camera]="
|
|
641
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpChromaticAberration, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
642
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpChromaticAberration, isStandalone: true, selector: "ngtp-chromatic-aberration", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
643
|
+
<ngt-chromatic-aberration-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
419
644
|
<ngtp-effect-blend-mode />
|
|
420
645
|
<ng-content />
|
|
421
646
|
</ngt-chromatic-aberration-effect>
|
|
422
647
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
423
648
|
}
|
|
424
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
649
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpChromaticAberration, decorators: [{
|
|
425
650
|
type: Component,
|
|
426
651
|
args: [{
|
|
427
652
|
selector: 'ngtp-chromatic-aberration',
|
|
428
653
|
template: `
|
|
429
|
-
<ngt-chromatic-aberration-effect *args="[options()]" [camera]="
|
|
654
|
+
<ngt-chromatic-aberration-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
430
655
|
<ngtp-effect-blend-mode />
|
|
431
656
|
<ng-content />
|
|
432
657
|
</ngt-chromatic-aberration-effect>
|
|
@@ -436,26 +661,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
436
661
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
437
662
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
438
663
|
}]
|
|
439
|
-
}], ctorParameters: () => [] });
|
|
664
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
440
665
|
|
|
666
|
+
/**
|
|
667
|
+
* Angular component that applies a color averaging effect to the scene.
|
|
668
|
+
*
|
|
669
|
+
* This effect converts the scene to grayscale by averaging the color channels,
|
|
670
|
+
* which can create a desaturated or monochrome look.
|
|
671
|
+
*
|
|
672
|
+
* @example
|
|
673
|
+
* ```html
|
|
674
|
+
* <ngtp-effect-composer>
|
|
675
|
+
* <ngtp-color-average />
|
|
676
|
+
* </ngtp-effect-composer>
|
|
677
|
+
* ```
|
|
678
|
+
*
|
|
679
|
+
* @example
|
|
680
|
+
* ```html
|
|
681
|
+
* <!-- With custom blend function -->
|
|
682
|
+
* <ngtp-effect-composer>
|
|
683
|
+
* <ngtp-color-average [options]="{ blendFunction: BlendFunction.MULTIPLY }" />
|
|
684
|
+
* </ngtp-effect-composer>
|
|
685
|
+
* ```
|
|
686
|
+
*/
|
|
441
687
|
class NgtpColorAverage {
|
|
442
688
|
constructor() {
|
|
443
|
-
|
|
689
|
+
/**
|
|
690
|
+
* Configuration options for the color average effect.
|
|
691
|
+
* @default { blendFunction: BlendFunction.NORMAL }
|
|
692
|
+
*/
|
|
693
|
+
this.options = input({ blendFunction: BlendFunction.NORMAL }, { ...(ngDevMode ? { debugName: "options" } : {}), transform: mergeInputs({ blendFunction: BlendFunction.NORMAL }) });
|
|
694
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
444
695
|
extend({ ColorAverageEffect });
|
|
445
696
|
}
|
|
446
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
447
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
448
|
-
<ngt-color-average-effect *args="[options().blendFunction]">
|
|
697
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpColorAverage, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
698
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpColorAverage, isStandalone: true, selector: "ngtp-color-average", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], ngImport: i0, template: `
|
|
699
|
+
<ngt-color-average-effect #effect *args="[options().blendFunction]">
|
|
449
700
|
<ng-content />
|
|
450
701
|
</ngt-color-average-effect>
|
|
451
702
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
452
703
|
}
|
|
453
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
704
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpColorAverage, decorators: [{
|
|
454
705
|
type: Component,
|
|
455
706
|
args: [{
|
|
456
707
|
selector: 'ngtp-color-average',
|
|
457
708
|
template: `
|
|
458
|
-
<ngt-color-average-effect *args="[options().blendFunction]">
|
|
709
|
+
<ngt-color-average-effect #effect *args="[options().blendFunction]">
|
|
459
710
|
<ng-content />
|
|
460
711
|
</ngt-color-average-effect>
|
|
461
712
|
`,
|
|
@@ -463,28 +714,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
463
714
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
464
715
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
465
716
|
}]
|
|
466
|
-
}], ctorParameters: () => [] });
|
|
717
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
467
718
|
|
|
719
|
+
/**
|
|
720
|
+
* Angular component that applies a color depth reduction effect to the scene.
|
|
721
|
+
*
|
|
722
|
+
* This effect reduces the number of colors in the scene, creating a posterized
|
|
723
|
+
* or retro look similar to older display hardware with limited color palettes.
|
|
724
|
+
*
|
|
725
|
+
* @example
|
|
726
|
+
* ```html
|
|
727
|
+
* <ngtp-effect-composer>
|
|
728
|
+
* <ngtp-color-depth [options]="{ bits: 4 }" />
|
|
729
|
+
* </ngtp-effect-composer>
|
|
730
|
+
* ```
|
|
731
|
+
*/
|
|
468
732
|
class NgtpColorDepth {
|
|
469
733
|
constructor() {
|
|
470
|
-
|
|
471
|
-
|
|
734
|
+
/**
|
|
735
|
+
* Configuration options for the color depth effect.
|
|
736
|
+
* @see ColorDepthEffectOptions
|
|
737
|
+
*/
|
|
738
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
739
|
+
/** Reference to the host NgtpEffect directive */
|
|
740
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
741
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
472
742
|
extend({ ColorDepthEffect });
|
|
473
743
|
}
|
|
474
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
475
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
476
|
-
<ngt-color-depth-effect *args="[options()]" [camera]="
|
|
744
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpColorDepth, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
745
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpColorDepth, isStandalone: true, selector: "ngtp-color-depth", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
746
|
+
<ngt-color-depth-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
477
747
|
<ngtp-effect-blend-mode />
|
|
478
748
|
<ng-content />
|
|
479
749
|
</ngt-color-depth-effect>
|
|
480
750
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
481
751
|
}
|
|
482
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
752
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpColorDepth, decorators: [{
|
|
483
753
|
type: Component,
|
|
484
754
|
args: [{
|
|
485
755
|
selector: 'ngtp-color-depth',
|
|
486
756
|
template: `
|
|
487
|
-
<ngt-color-depth-effect *args="[options()]" [camera]="
|
|
757
|
+
<ngt-color-depth-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
488
758
|
<ngtp-effect-blend-mode />
|
|
489
759
|
<ng-content />
|
|
490
760
|
</ngt-color-depth-effect>
|
|
@@ -494,28 +764,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
494
764
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
495
765
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
496
766
|
}]
|
|
497
|
-
}], ctorParameters: () => [] });
|
|
767
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
498
768
|
|
|
769
|
+
/**
|
|
770
|
+
* Angular component that visualizes the scene's depth buffer.
|
|
771
|
+
*
|
|
772
|
+
* This effect renders the depth information of the scene, which can be useful
|
|
773
|
+
* for debugging or creating stylized depth-based visualizations.
|
|
774
|
+
*
|
|
775
|
+
* @example
|
|
776
|
+
* ```html
|
|
777
|
+
* <ngtp-effect-composer>
|
|
778
|
+
* <ngtp-depth [options]="{ inverted: true }" />
|
|
779
|
+
* </ngtp-effect-composer>
|
|
780
|
+
* ```
|
|
781
|
+
*/
|
|
499
782
|
class NgtpDepth {
|
|
500
783
|
constructor() {
|
|
501
|
-
|
|
502
|
-
|
|
784
|
+
/**
|
|
785
|
+
* Configuration options for the depth effect.
|
|
786
|
+
* @see DepthEffectOptions
|
|
787
|
+
*/
|
|
788
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
789
|
+
/** Reference to the host NgtpEffect directive */
|
|
790
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
791
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
503
792
|
extend({ DepthEffect });
|
|
504
793
|
}
|
|
505
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
506
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
507
|
-
<ngt-depth-effect *args="[options()]" [camera]="
|
|
794
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpDepth, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
795
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpDepth, isStandalone: true, selector: "ngtp-depth", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
796
|
+
<ngt-depth-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
508
797
|
<ngtp-effect-blend-mode />
|
|
509
798
|
<ng-content />
|
|
510
799
|
</ngt-depth-effect>
|
|
511
800
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
512
801
|
}
|
|
513
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
802
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpDepth, decorators: [{
|
|
514
803
|
type: Component,
|
|
515
804
|
args: [{
|
|
516
805
|
selector: 'ngtp-depth',
|
|
517
806
|
template: `
|
|
518
|
-
<ngt-depth-effect *args="[options()]" [camera]="
|
|
807
|
+
<ngt-depth-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
519
808
|
<ngtp-effect-blend-mode />
|
|
520
809
|
<ng-content />
|
|
521
810
|
</ngt-depth-effect>
|
|
@@ -525,12 +814,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
525
814
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
526
815
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
527
816
|
}]
|
|
528
|
-
}], ctorParameters: () => [] });
|
|
817
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
529
818
|
|
|
819
|
+
/**
|
|
820
|
+
* Angular component that applies a depth of field effect to the scene.
|
|
821
|
+
*
|
|
822
|
+
* This effect simulates the focus behavior of real camera lenses, blurring
|
|
823
|
+
* objects that are outside the focal range. Can be configured for autofocus
|
|
824
|
+
* by providing a target position.
|
|
825
|
+
*
|
|
826
|
+
* @example
|
|
827
|
+
* ```html
|
|
828
|
+
* <ngtp-effect-composer>
|
|
829
|
+
* <ngtp-depth-of-field [options]="{ focusDistance: 0, focalLength: 0.02, bokehScale: 2 }" />
|
|
830
|
+
* </ngtp-effect-composer>
|
|
831
|
+
* ```
|
|
832
|
+
*
|
|
833
|
+
* @example
|
|
834
|
+
* ```html
|
|
835
|
+
* <!-- With autofocus target -->
|
|
836
|
+
* <ngtp-effect-composer>
|
|
837
|
+
* <ngtp-depth-of-field [options]="{ target: [0, 0, 5], bokehScale: 3 }" />
|
|
838
|
+
* </ngtp-effect-composer>
|
|
839
|
+
* ```
|
|
840
|
+
*/
|
|
530
841
|
class NgtpDepthOfField {
|
|
531
842
|
constructor() {
|
|
532
|
-
|
|
843
|
+
/**
|
|
844
|
+
* Configuration options for the depth of field effect.
|
|
845
|
+
* @see DOFOptions
|
|
846
|
+
*/
|
|
847
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
533
848
|
this.effectComposer = inject(NgtpEffectComposer);
|
|
849
|
+
/**
|
|
850
|
+
* Creates the DepthOfFieldEffect instance with the configured options.
|
|
851
|
+
* Enables autofocus if a target is provided and applies depth texture settings.
|
|
852
|
+
*/
|
|
534
853
|
this.effect = computed(() => {
|
|
535
854
|
const [camera, options] = [this.effectComposer.camera(), this.options()];
|
|
536
855
|
const autoFocus = options.target != null;
|
|
@@ -546,18 +865,18 @@ class NgtpDepthOfField {
|
|
|
546
865
|
const maskPass = effect['maskPass'];
|
|
547
866
|
maskPass.maskFunction = MaskFunction.MULTIPLY_RGB_SET_ALPHA;
|
|
548
867
|
return effect;
|
|
549
|
-
});
|
|
868
|
+
}, ...(ngDevMode ? [{ debugName: "effect" }] : []));
|
|
550
869
|
effect((onCleanup) => {
|
|
551
870
|
const depthOfFieldEffect = this.effect();
|
|
552
871
|
onCleanup(() => depthOfFieldEffect.dispose());
|
|
553
872
|
});
|
|
554
873
|
}
|
|
555
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
556
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
874
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpDepthOfField, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
875
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NgtpDepthOfField, isStandalone: true, selector: "ngtp-depth-of-field", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
557
876
|
<ngt-primitive *args="[effect()]" />
|
|
558
877
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
559
878
|
}
|
|
560
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
879
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpDepthOfField, decorators: [{
|
|
561
880
|
type: Component,
|
|
562
881
|
args: [{
|
|
563
882
|
selector: 'ngtp-depth-of-field',
|
|
@@ -568,28 +887,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
568
887
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
569
888
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
570
889
|
}]
|
|
571
|
-
}], ctorParameters: () => [] });
|
|
890
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
572
891
|
|
|
892
|
+
/**
|
|
893
|
+
* Angular component that applies a dot screen effect to the scene.
|
|
894
|
+
*
|
|
895
|
+
* This effect overlays a pattern of dots on the scene, creating a halftone
|
|
896
|
+
* or comic book style appearance.
|
|
897
|
+
*
|
|
898
|
+
* @example
|
|
899
|
+
* ```html
|
|
900
|
+
* <ngtp-effect-composer>
|
|
901
|
+
* <ngtp-dot-screen [options]="{ scale: 1.5, angle: Math.PI * 0.25 }" />
|
|
902
|
+
* </ngtp-effect-composer>
|
|
903
|
+
* ```
|
|
904
|
+
*/
|
|
573
905
|
class NgtpDotScreen {
|
|
574
906
|
constructor() {
|
|
575
|
-
|
|
576
|
-
|
|
907
|
+
/**
|
|
908
|
+
* Configuration options for the dot screen effect.
|
|
909
|
+
* @see DotScreenEffectOptions
|
|
910
|
+
*/
|
|
911
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
912
|
+
/** Reference to the host NgtpEffect directive */
|
|
913
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
914
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
577
915
|
extend({ DotScreenEffect });
|
|
578
916
|
}
|
|
579
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
580
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
581
|
-
<ngt-dot-screen-effect *args="[options()]" [camera]="
|
|
917
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpDotScreen, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
918
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpDotScreen, isStandalone: true, selector: "ngtp-dot-screen", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
919
|
+
<ngt-dot-screen-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
582
920
|
<ngtp-effect-blend-mode />
|
|
583
921
|
<ng-content />
|
|
584
922
|
</ngt-dot-screen-effect>
|
|
585
923
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
586
924
|
}
|
|
587
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
925
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpDotScreen, decorators: [{
|
|
588
926
|
type: Component,
|
|
589
927
|
args: [{
|
|
590
928
|
selector: 'ngtp-dot-screen',
|
|
591
929
|
template: `
|
|
592
|
-
<ngt-dot-screen-effect *args="[options()]" [camera]="
|
|
930
|
+
<ngt-dot-screen-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
593
931
|
<ngtp-effect-blend-mode />
|
|
594
932
|
<ng-content />
|
|
595
933
|
</ngt-dot-screen-effect>
|
|
@@ -599,28 +937,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
599
937
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
600
938
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
601
939
|
}]
|
|
602
|
-
}], ctorParameters: () => [] });
|
|
940
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
603
941
|
|
|
942
|
+
/**
|
|
943
|
+
* Angular component that applies Fast Approximate Anti-Aliasing (FXAA) to the scene.
|
|
944
|
+
*
|
|
945
|
+
* FXAA is a fast, single-pass anti-aliasing technique that smooths jagged edges
|
|
946
|
+
* in the rendered image. It's less demanding than multisampling but may blur
|
|
947
|
+
* some fine details.
|
|
948
|
+
*
|
|
949
|
+
* @example
|
|
950
|
+
* ```html
|
|
951
|
+
* <ngtp-effect-composer [options]="{ multisampling: 0 }">
|
|
952
|
+
* <ngtp-fxaa />
|
|
953
|
+
* </ngtp-effect-composer>
|
|
954
|
+
* ```
|
|
955
|
+
*/
|
|
604
956
|
class NgtpFXAA {
|
|
605
957
|
constructor() {
|
|
606
|
-
|
|
607
|
-
|
|
958
|
+
/**
|
|
959
|
+
* Configuration options for the FXAA effect.
|
|
960
|
+
* @see FXAAEffectOptions
|
|
961
|
+
*/
|
|
962
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
963
|
+
/** Reference to the host NgtpEffect directive */
|
|
964
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
965
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
608
966
|
extend({ FXAAEffect });
|
|
609
967
|
}
|
|
610
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
611
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
612
|
-
<ngt-fXAA-effect *args="[options()]" [camera]="
|
|
968
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpFXAA, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
969
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpFXAA, isStandalone: true, selector: "ngtp-fxaa", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
970
|
+
<ngt-fXAA-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
613
971
|
<ngtp-effect-blend-mode />
|
|
614
972
|
<ng-content />
|
|
615
973
|
</ngt-fXAA-effect>
|
|
616
974
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
617
975
|
}
|
|
618
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
976
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpFXAA, decorators: [{
|
|
619
977
|
type: Component,
|
|
620
978
|
args: [{
|
|
621
979
|
selector: 'ngtp-fxaa',
|
|
622
980
|
template: `
|
|
623
|
-
<ngt-fXAA-effect *args="[options()]" [camera]="
|
|
981
|
+
<ngt-fXAA-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
624
982
|
<ngtp-effect-blend-mode />
|
|
625
983
|
<ng-content />
|
|
626
984
|
</ngt-fXAA-effect>
|
|
@@ -630,11 +988,38 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
630
988
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
631
989
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
632
990
|
}]
|
|
633
|
-
}], ctorParameters: () => [] });
|
|
991
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
634
992
|
|
|
993
|
+
/**
|
|
994
|
+
* Angular component that applies a glitch effect to the scene.
|
|
995
|
+
*
|
|
996
|
+
* This effect simulates digital glitches with customizable timing, strength,
|
|
997
|
+
* and chromatic aberration. Can be toggled on/off and configured for different
|
|
998
|
+
* glitch modes.
|
|
999
|
+
*
|
|
1000
|
+
* @example
|
|
1001
|
+
* ```html
|
|
1002
|
+
* <ngtp-effect-composer>
|
|
1003
|
+
* <ngtp-glitch [options]="{ delay: [1.5, 3.5], duration: [0.6, 1.0] }" />
|
|
1004
|
+
* </ngtp-effect-composer>
|
|
1005
|
+
* ```
|
|
1006
|
+
*
|
|
1007
|
+
* @example
|
|
1008
|
+
* ```html
|
|
1009
|
+
* <!-- Constant glitch mode -->
|
|
1010
|
+
* <ngtp-effect-composer>
|
|
1011
|
+
* <ngtp-glitch [options]="{ mode: GlitchMode.CONSTANT_MILD, active: true }" />
|
|
1012
|
+
* </ngtp-effect-composer>
|
|
1013
|
+
* ```
|
|
1014
|
+
*/
|
|
635
1015
|
class NgtpGlitch {
|
|
636
1016
|
constructor() {
|
|
637
|
-
|
|
1017
|
+
/**
|
|
1018
|
+
* Configuration options for the glitch effect.
|
|
1019
|
+
* @default { active: true }
|
|
1020
|
+
* @see GlitchOptions
|
|
1021
|
+
*/
|
|
1022
|
+
this.options = input({ active: true }, { ...(ngDevMode ? { debugName: "options" } : {}), transform: mergeInputs({ active: true }) });
|
|
638
1023
|
this.active = pick(this.options, 'active');
|
|
639
1024
|
this.mode = pick(this.options, 'mode');
|
|
640
1025
|
this.ratio = pick(this.options, 'ratio');
|
|
@@ -647,6 +1032,10 @@ class NgtpGlitch {
|
|
|
647
1032
|
this.chromaticAberrationOffset = vector2(this.options, 'chromaticAberrationOffset');
|
|
648
1033
|
this.strength = vector2(this.options, 'strength');
|
|
649
1034
|
this.store = injectStore();
|
|
1035
|
+
/**
|
|
1036
|
+
* The underlying GlitchEffect instance.
|
|
1037
|
+
* Created with the configured options and vector2 parameters.
|
|
1038
|
+
*/
|
|
650
1039
|
this.effect = computed(() => new GlitchEffect({
|
|
651
1040
|
ratio: this.ratio(),
|
|
652
1041
|
dtSize: this.dtSize(),
|
|
@@ -657,7 +1046,7 @@ class NgtpGlitch {
|
|
|
657
1046
|
duration: this.duration(),
|
|
658
1047
|
chromaticAberrationOffset: this.chromaticAberrationOffset(),
|
|
659
1048
|
strength: this.strength(),
|
|
660
|
-
}));
|
|
1049
|
+
}), ...(ngDevMode ? [{ debugName: "effect" }] : []));
|
|
661
1050
|
effect(() => {
|
|
662
1051
|
const [glitchEffect, invalidate, mode, active] = [
|
|
663
1052
|
this.effect(),
|
|
@@ -673,12 +1062,12 @@ class NgtpGlitch {
|
|
|
673
1062
|
onCleanup(() => effect.dispose());
|
|
674
1063
|
});
|
|
675
1064
|
}
|
|
676
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
677
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
1065
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpGlitch, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1066
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NgtpGlitch, isStandalone: true, selector: "ngtp-glitch", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
678
1067
|
<ngt-primitive *args="[effect()]" />
|
|
679
1068
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
680
1069
|
}
|
|
681
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1070
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpGlitch, decorators: [{
|
|
682
1071
|
type: Component,
|
|
683
1072
|
args: [{
|
|
684
1073
|
selector: 'ngtp-glitch',
|
|
@@ -689,24 +1078,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
689
1078
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
690
1079
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
691
1080
|
}]
|
|
692
|
-
}], ctorParameters: () => [] });
|
|
1081
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
693
1082
|
|
|
1083
|
+
/**
|
|
1084
|
+
* Angular component that applies a god rays (volumetric lighting) effect to the scene.
|
|
1085
|
+
*
|
|
1086
|
+
* This effect creates light shafts emanating from a light source, simulating
|
|
1087
|
+
* the way light scatters through atmospheric particles. Requires a sun/light
|
|
1088
|
+
* source mesh to generate the rays from.
|
|
1089
|
+
*
|
|
1090
|
+
* @example
|
|
1091
|
+
* ```html
|
|
1092
|
+
* <ngt-mesh #sun [position]="[0, 5, -10]">
|
|
1093
|
+
* <ngt-sphere-geometry />
|
|
1094
|
+
* <ngt-mesh-basic-material color="yellow" />
|
|
1095
|
+
* </ngt-mesh>
|
|
1096
|
+
*
|
|
1097
|
+
* <ngtp-effect-composer>
|
|
1098
|
+
* <ngtp-god-rays [options]="{ sun: sunRef, density: 0.96 }" />
|
|
1099
|
+
* </ngtp-effect-composer>
|
|
1100
|
+
* ```
|
|
1101
|
+
*/
|
|
694
1102
|
class NgtpGodRays {
|
|
695
1103
|
constructor() {
|
|
696
|
-
|
|
1104
|
+
/**
|
|
1105
|
+
* Configuration options for the god rays effect.
|
|
1106
|
+
* Must include a `sun` property with the light source reference.
|
|
1107
|
+
* @see GodRaysOptions
|
|
1108
|
+
*/
|
|
1109
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
697
1110
|
this.effectComposer = inject(NgtpEffectComposer);
|
|
698
1111
|
this.effectOptions = omit(this.options, ['sun']);
|
|
699
1112
|
this.sun = pick(this.options, 'sun');
|
|
1113
|
+
/**
|
|
1114
|
+
* Resolves the sun reference to the actual Three.js object.
|
|
1115
|
+
* Handles both direct references and function references.
|
|
1116
|
+
*/
|
|
700
1117
|
this.sunElement = computed(() => {
|
|
701
1118
|
const sun = this.sun();
|
|
702
1119
|
if (typeof sun === 'function')
|
|
703
1120
|
return resolveRef(sun());
|
|
704
1121
|
return resolveRef(sun);
|
|
705
|
-
});
|
|
1122
|
+
}, ...(ngDevMode ? [{ debugName: "sunElement" }] : []));
|
|
1123
|
+
/**
|
|
1124
|
+
* The underlying GodRaysEffect instance.
|
|
1125
|
+
* Created with the camera, sun element, and configured options.
|
|
1126
|
+
*/
|
|
706
1127
|
this.effect = computed(() => {
|
|
707
1128
|
const [camera, sunElement, options] = [this.effectComposer.camera(), this.sunElement(), this.effectOptions()];
|
|
708
1129
|
return new GodRaysEffect(camera, sunElement, options);
|
|
709
|
-
});
|
|
1130
|
+
}, ...(ngDevMode ? [{ debugName: "effect" }] : []));
|
|
710
1131
|
effect(() => {
|
|
711
1132
|
const sunElement = this.sunElement();
|
|
712
1133
|
if (!sunElement)
|
|
@@ -719,12 +1140,12 @@ class NgtpGodRays {
|
|
|
719
1140
|
onCleanup(() => effect.dispose());
|
|
720
1141
|
});
|
|
721
1142
|
}
|
|
722
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
723
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
1143
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpGodRays, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1144
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NgtpGodRays, isStandalone: true, selector: "ngtp-god-rays", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
724
1145
|
<ngt-primitive *args="[effect()]" />
|
|
725
1146
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
726
1147
|
}
|
|
727
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1148
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpGodRays, decorators: [{
|
|
728
1149
|
type: Component,
|
|
729
1150
|
args: [{
|
|
730
1151
|
selector: 'ngtp-god-rays',
|
|
@@ -735,14 +1156,32 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
735
1156
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
736
1157
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
737
1158
|
}]
|
|
738
|
-
}], ctorParameters: () => [] });
|
|
1159
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
739
1160
|
|
|
1161
|
+
/**
|
|
1162
|
+
* Angular component that applies a grid overlay effect to the scene.
|
|
1163
|
+
*
|
|
1164
|
+
* This effect overlays a grid pattern on the rendered scene, which can be
|
|
1165
|
+
* useful for technical visualization or stylized effects.
|
|
1166
|
+
*
|
|
1167
|
+
* @example
|
|
1168
|
+
* ```html
|
|
1169
|
+
* <ngtp-effect-composer>
|
|
1170
|
+
* <ngtp-grid [options]="{ scale: 1.5, lineWidth: 0.5 }" />
|
|
1171
|
+
* </ngtp-effect-composer>
|
|
1172
|
+
* ```
|
|
1173
|
+
*/
|
|
740
1174
|
class NgtpGrid {
|
|
741
1175
|
constructor() {
|
|
742
|
-
|
|
1176
|
+
/**
|
|
1177
|
+
* Configuration options for the grid effect.
|
|
1178
|
+
* @see GridOptions
|
|
1179
|
+
*/
|
|
1180
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
743
1181
|
this.effectOptions = omit(this.options, ['size']);
|
|
744
1182
|
this.size = pick(this.options, 'size');
|
|
745
|
-
|
|
1183
|
+
/** The underlying GridEffect instance */
|
|
1184
|
+
this.effect = computed(() => new GridEffect(this.effectOptions()), ...(ngDevMode ? [{ debugName: "effect" }] : []));
|
|
746
1185
|
effect(() => {
|
|
747
1186
|
const [size, effect] = [this.size(), this.effect()];
|
|
748
1187
|
if (size) {
|
|
@@ -754,12 +1193,12 @@ class NgtpGrid {
|
|
|
754
1193
|
onCleanup(() => effect.dispose());
|
|
755
1194
|
});
|
|
756
1195
|
}
|
|
757
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
758
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
1196
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpGrid, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1197
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NgtpGrid, isStandalone: true, selector: "ngtp-grid", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
759
1198
|
<ngt-primitive *args="[effect()]" />
|
|
760
1199
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
761
1200
|
}
|
|
762
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1201
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpGrid, decorators: [{
|
|
763
1202
|
type: Component,
|
|
764
1203
|
args: [{
|
|
765
1204
|
selector: 'ngtp-grid',
|
|
@@ -770,28 +1209,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
770
1209
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
771
1210
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
772
1211
|
}]
|
|
773
|
-
}], ctorParameters: () => [] });
|
|
1212
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
774
1213
|
|
|
1214
|
+
/**
|
|
1215
|
+
* Angular component that applies hue and saturation adjustments to the scene.
|
|
1216
|
+
*
|
|
1217
|
+
* This effect allows you to shift the hue and adjust the saturation of the
|
|
1218
|
+
* rendered scene as a postprocessing step.
|
|
1219
|
+
*
|
|
1220
|
+
* @example
|
|
1221
|
+
* ```html
|
|
1222
|
+
* <ngtp-effect-composer>
|
|
1223
|
+
* <ngtp-hue-saturation [options]="{ hue: 0.5, saturation: 0.2 }" />
|
|
1224
|
+
* </ngtp-effect-composer>
|
|
1225
|
+
* ```
|
|
1226
|
+
*/
|
|
775
1227
|
class NgtpHueSaturation {
|
|
776
1228
|
constructor() {
|
|
777
|
-
|
|
778
|
-
|
|
1229
|
+
/**
|
|
1230
|
+
* Configuration options for the hue/saturation effect.
|
|
1231
|
+
* @see HueSaturationEffectOptions
|
|
1232
|
+
*/
|
|
1233
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
1234
|
+
/** Reference to the host NgtpEffect directive */
|
|
1235
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
1236
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
779
1237
|
extend({ HueSaturationEffect });
|
|
780
1238
|
}
|
|
781
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
782
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
783
|
-
<ngt-hue-saturation-effect *args="[options()]" [camera]="
|
|
1239
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpHueSaturation, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1240
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpHueSaturation, isStandalone: true, selector: "ngtp-hue-saturation", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
1241
|
+
<ngt-hue-saturation-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
784
1242
|
<ngtp-effect-blend-mode />
|
|
785
1243
|
<ng-content />
|
|
786
1244
|
</ngt-hue-saturation-effect>
|
|
787
1245
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
788
1246
|
}
|
|
789
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1247
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpHueSaturation, decorators: [{
|
|
790
1248
|
type: Component,
|
|
791
1249
|
args: [{
|
|
792
1250
|
selector: 'ngtp-hue-saturation',
|
|
793
1251
|
template: `
|
|
794
|
-
<ngt-hue-saturation-effect *args="[options()]" [camera]="
|
|
1252
|
+
<ngt-hue-saturation-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
795
1253
|
<ngtp-effect-blend-mode />
|
|
796
1254
|
<ng-content />
|
|
797
1255
|
</ngt-hue-saturation-effect>
|
|
@@ -801,10 +1259,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
801
1259
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
802
1260
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
803
1261
|
}]
|
|
804
|
-
}], ctorParameters: () => [] });
|
|
1262
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
805
1263
|
|
|
806
|
-
|
|
807
|
-
|
|
1264
|
+
/**
|
|
1265
|
+
* Lens Flare Effect
|
|
1266
|
+
* Created by Anderson Mancini 2023
|
|
1267
|
+
* React Three Fiber Ultimate LensFlare - Ported to Angular Three
|
|
1268
|
+
*/
|
|
1269
|
+
/**
|
|
1270
|
+
* Shader configuration for the lens flare effect.
|
|
1271
|
+
* Contains the GLSL fragment shader code.
|
|
1272
|
+
*/
|
|
808
1273
|
const LensFlareShader = {
|
|
809
1274
|
fragmentShader: /* language=glsl glsl */ `
|
|
810
1275
|
|
|
@@ -852,7 +1317,46 @@ const LensFlareShader = {
|
|
|
852
1317
|
void mainImage(vec4 v,vec2 r,out vec4 i){vec2 g=r-.5;g.y*=iResolution.y/iResolution.x;vec2 l=lensPosition*.5;l.y*=iResolution.y/iResolution.x;vec3 f=mLs(g,l)*20.*colorGain/256.;if(aditionalStreaks){vec3 o=vec3(.9,.2,.1),p=vec3(.3,.1,.9);for(float n=0.;n<10.;n++)f+=drC(g,pow(rnd(n*2e3)*2.8,.1)+1.41,0.,o+n,p+n,rnd(n*20.)*3.+.2-.5,lensPosition);}if(secondaryGhosts){vec3 n=vec3(0);n+=rHx(g,-lensPosition*.25,ghostScale*1.4,vec3(.25,.35,0));n+=rHx(g,lensPosition*.25,ghostScale*.5,vec3(1,.5,.5));n+=rHx(g,lensPosition*.1,ghostScale*1.6,vec3(1));n+=rHx(g,lensPosition*1.8,ghostScale*2.,vec3(0,.5,.75));n+=rHx(g,lensPosition*1.25,ghostScale*.8,vec3(1,1,.5));n+=rHx(g,-lensPosition*1.25,ghostScale*5.,vec3(.5,.5,.25));n+=fpow(1.-abs(distance(lensPosition*.8,g)-.7),.985)*colorGain/2100.;f+=n;}if(starBurst){vxtC=g+.5;vec4 n=geLD(g);float o=1.-clamp(0.5,0.,.5)*2.;n+=mix(n,pow(n*2.,vec4(2))*.5,o);float s=(g.x+g.y)*(1./6.);vec2 d=mat2(cos(s),-sin(s),sin(s),cos(s))*vxtC;n+=geLS(d)*2.;f+=clamp(n.xyz*strB().xyz,.01,1.);}i=enabled?vec4(mix(f,vec3(0),opacity)+v.xyz,v.w):vec4(v);}
|
|
853
1318
|
`,
|
|
854
1319
|
};
|
|
1320
|
+
/**
|
|
1321
|
+
* A postprocessing effect that simulates camera lens flares.
|
|
1322
|
+
*
|
|
1323
|
+
* Creates realistic lens flare effects including glare, ghosts, star bursts,
|
|
1324
|
+
* and anamorphic flares. Can be animated and positioned dynamically.
|
|
1325
|
+
*
|
|
1326
|
+
* @example
|
|
1327
|
+
* ```typescript
|
|
1328
|
+
* const effect = new LensFlareEffect({
|
|
1329
|
+
* glareSize: 0.3,
|
|
1330
|
+
* starPoints: 8,
|
|
1331
|
+
* animated: true
|
|
1332
|
+
* });
|
|
1333
|
+
* ```
|
|
1334
|
+
*/
|
|
855
1335
|
class LensFlareEffect extends Effect {
|
|
1336
|
+
/**
|
|
1337
|
+
* Creates a new LensFlareEffect instance.
|
|
1338
|
+
*
|
|
1339
|
+
* @param options - Configuration options for the lens flare
|
|
1340
|
+
* @param options.blendFunction - How to blend with the scene
|
|
1341
|
+
* @param options.enabled - Whether the effect is enabled
|
|
1342
|
+
* @param options.glareSize - Size of the glare
|
|
1343
|
+
* @param options.lensPosition - Position of the lens on screen
|
|
1344
|
+
* @param options.iResolution - Resolution of the effect
|
|
1345
|
+
* @param options.starPoints - Number of points in the star pattern
|
|
1346
|
+
* @param options.flareSize - Size of individual flares
|
|
1347
|
+
* @param options.flareSpeed - Animation speed of flares
|
|
1348
|
+
* @param options.flareShape - Shape parameter for flares
|
|
1349
|
+
* @param options.animated - Whether to animate the effect
|
|
1350
|
+
* @param options.anamorphic - Enable anamorphic lens simulation
|
|
1351
|
+
* @param options.colorGain - Color tint for the effect
|
|
1352
|
+
* @param options.lensDirtTexture - Texture for lens dirt overlay
|
|
1353
|
+
* @param options.haloScale - Scale of the halo effect
|
|
1354
|
+
* @param options.secondaryGhosts - Enable secondary ghost images
|
|
1355
|
+
* @param options.aditionalStreaks - Enable additional streak effects
|
|
1356
|
+
* @param options.ghostScale - Scale of ghost images
|
|
1357
|
+
* @param options.opacity - Opacity of the effect
|
|
1358
|
+
* @param options.starBurst - Enable star burst effect
|
|
1359
|
+
*/
|
|
856
1360
|
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, } = {}) {
|
|
857
1361
|
super('LensFlareEffect', LensFlareShader.fragmentShader, {
|
|
858
1362
|
blendFunction,
|
|
@@ -879,6 +1383,13 @@ class LensFlareEffect extends Effect {
|
|
|
879
1383
|
]),
|
|
880
1384
|
});
|
|
881
1385
|
}
|
|
1386
|
+
/**
|
|
1387
|
+
* Updates the effect's time uniform for animation.
|
|
1388
|
+
*
|
|
1389
|
+
* @param _renderer - The WebGL renderer (unused)
|
|
1390
|
+
* @param _inputBuffer - The input render target (unused)
|
|
1391
|
+
* @param deltaTime - Time elapsed since last frame
|
|
1392
|
+
*/
|
|
882
1393
|
update(_renderer, _inputBuffer, deltaTime) {
|
|
883
1394
|
const iTime = this.uniforms.get('iTime');
|
|
884
1395
|
if (iTime) {
|
|
@@ -891,16 +1402,45 @@ const defaultOptions$3 = {
|
|
|
891
1402
|
followMouse: false,
|
|
892
1403
|
smoothTime: 0.7,
|
|
893
1404
|
};
|
|
1405
|
+
/**
|
|
1406
|
+
* Angular component that applies a lens flare effect to the scene.
|
|
1407
|
+
*
|
|
1408
|
+
* This effect simulates realistic camera lens flares with support for
|
|
1409
|
+
* dynamic positioning, mouse following, and occlusion detection.
|
|
1410
|
+
* The flare automatically fades when occluded by scene objects.
|
|
1411
|
+
*
|
|
1412
|
+
* @example
|
|
1413
|
+
* ```html
|
|
1414
|
+
* <ngtp-effect-composer>
|
|
1415
|
+
* <ngtp-lens-flare [options]="{ position: [10, 5, -20], glareSize: 0.3 }" />
|
|
1416
|
+
* </ngtp-effect-composer>
|
|
1417
|
+
* ```
|
|
1418
|
+
*
|
|
1419
|
+
* @example
|
|
1420
|
+
* ```html
|
|
1421
|
+
* <!-- Mouse-following flare -->
|
|
1422
|
+
* <ngtp-effect-composer>
|
|
1423
|
+
* <ngtp-lens-flare [options]="{ followMouse: true, smoothTime: 0.5 }" />
|
|
1424
|
+
* </ngtp-effect-composer>
|
|
1425
|
+
* ```
|
|
1426
|
+
*/
|
|
894
1427
|
class NgtpLensFlare {
|
|
895
1428
|
constructor() {
|
|
896
|
-
|
|
1429
|
+
/**
|
|
1430
|
+
* Configuration options for the lens flare effect.
|
|
1431
|
+
* @see LensFlareOptions
|
|
1432
|
+
*/
|
|
1433
|
+
this.options = input(defaultOptions$3, { ...(ngDevMode ? { debugName: "options" } : {}), transform: mergeInputs(defaultOptions$3) });
|
|
897
1434
|
this.store = injectStore();
|
|
898
1435
|
this.effectComposer = inject(NgtpEffectComposer);
|
|
899
1436
|
this.effectOptions = omit(this.options, ['position', 'followMouse', 'smoothTime']);
|
|
900
1437
|
this.position = vector3(this.options, 'position');
|
|
1438
|
+
/** Cached vector for projecting 3D position to screen space */
|
|
901
1439
|
this.projectedPosition = new THREE.Vector3();
|
|
1440
|
+
/** Cached vector for 2D mouse/raycaster coordinates */
|
|
902
1441
|
this.mouse2d = new THREE.Vector2();
|
|
903
|
-
|
|
1442
|
+
/** The underlying LensFlareEffect instance */
|
|
1443
|
+
this.effect = computed(() => new LensFlareEffect(this.effectOptions()), ...(ngDevMode ? [{ debugName: "effect" }] : []));
|
|
904
1444
|
effect(() => {
|
|
905
1445
|
const [lensFlareEffect, width, height] = [
|
|
906
1446
|
this.effect(),
|
|
@@ -974,12 +1514,12 @@ class NgtpLensFlare {
|
|
|
974
1514
|
easing.damp(uOpacity, 'value', target, smoothTime, delta);
|
|
975
1515
|
});
|
|
976
1516
|
}
|
|
977
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
978
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
1517
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpLensFlare, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1518
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NgtpLensFlare, isStandalone: true, selector: "ngtp-lens-flare", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
979
1519
|
<ngt-primitive *args="[effect()]" [parameters]="{ dispose: null }" />
|
|
980
1520
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
981
1521
|
}
|
|
982
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1522
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpLensFlare, decorators: [{
|
|
983
1523
|
type: Component,
|
|
984
1524
|
args: [{
|
|
985
1525
|
selector: 'ngtp-lens-flare',
|
|
@@ -990,18 +1530,42 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
990
1530
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
991
1531
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
992
1532
|
}]
|
|
993
|
-
}], ctorParameters: () => [] });
|
|
1533
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
994
1534
|
|
|
1535
|
+
/**
|
|
1536
|
+
* Angular component that applies a LUT (Look-Up Table) color grading effect.
|
|
1537
|
+
*
|
|
1538
|
+
* LUTs are used for color grading in film and photography. This effect applies
|
|
1539
|
+
* a 3D LUT texture to transform the colors of the rendered scene.
|
|
1540
|
+
*
|
|
1541
|
+
* @example
|
|
1542
|
+
* ```typescript
|
|
1543
|
+
* // In component
|
|
1544
|
+
* lutTexture = injectLoader(() => LUTCubeLoader, () => 'path/to/lut.cube');
|
|
1545
|
+
* ```
|
|
1546
|
+
*
|
|
1547
|
+
* ```html
|
|
1548
|
+
* <ngtp-effect-composer>
|
|
1549
|
+
* <ngtp-lut [options]="{ lut: lutTexture() }" />
|
|
1550
|
+
* </ngtp-effect-composer>
|
|
1551
|
+
* ```
|
|
1552
|
+
*/
|
|
995
1553
|
class NgtpLUT {
|
|
996
1554
|
constructor() {
|
|
997
|
-
|
|
1555
|
+
/**
|
|
1556
|
+
* Configuration options for the LUT effect.
|
|
1557
|
+
* Must include a `lut` texture.
|
|
1558
|
+
* @see LUTOptions
|
|
1559
|
+
*/
|
|
1560
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
998
1561
|
this.lut = pick(this.options, 'lut');
|
|
999
1562
|
this.tetrahedralInterpolation = pick(this.options, 'tetrahedralInterpolation');
|
|
1000
1563
|
this.store = injectStore();
|
|
1564
|
+
/** The underlying LUT3DEffect instance */
|
|
1001
1565
|
this.effect = computed(() => {
|
|
1002
1566
|
const { lut, ...options } = this.options();
|
|
1003
1567
|
return new LUT3DEffect(lut, options);
|
|
1004
|
-
});
|
|
1568
|
+
}, ...(ngDevMode ? [{ debugName: "effect" }] : []));
|
|
1005
1569
|
effect(() => {
|
|
1006
1570
|
const [effect, lut, tetrahedralInterpolation, invalidate] = [
|
|
1007
1571
|
this.effect(),
|
|
@@ -1020,12 +1584,12 @@ class NgtpLUT {
|
|
|
1020
1584
|
onCleanup(() => effect.dispose());
|
|
1021
1585
|
});
|
|
1022
1586
|
}
|
|
1023
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1024
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
1587
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpLUT, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1588
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NgtpLUT, isStandalone: true, selector: "ngtp-lut", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1025
1589
|
<ngt-primitive *args="[effect()]" [dispose]="null" />
|
|
1026
1590
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1027
1591
|
}
|
|
1028
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1592
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpLUT, decorators: [{
|
|
1029
1593
|
type: Component,
|
|
1030
1594
|
args: [{
|
|
1031
1595
|
selector: 'ngtp-lut',
|
|
@@ -1036,28 +1600,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1036
1600
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
1037
1601
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1038
1602
|
}]
|
|
1039
|
-
}], ctorParameters: () => [] });
|
|
1603
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
1040
1604
|
|
|
1605
|
+
/**
|
|
1606
|
+
* Angular component that applies a noise/grain effect to the scene.
|
|
1607
|
+
*
|
|
1608
|
+
* This effect adds film grain or noise to the rendered image, which can
|
|
1609
|
+
* add a cinematic quality or help hide banding in gradients.
|
|
1610
|
+
*
|
|
1611
|
+
* @example
|
|
1612
|
+
* ```html
|
|
1613
|
+
* <ngtp-effect-composer>
|
|
1614
|
+
* <ngtp-noise [options]="{ premultiply: true }" />
|
|
1615
|
+
* </ngtp-effect-composer>
|
|
1616
|
+
* ```
|
|
1617
|
+
*/
|
|
1041
1618
|
class NgtpNoise {
|
|
1042
1619
|
constructor() {
|
|
1043
|
-
|
|
1044
|
-
|
|
1620
|
+
/**
|
|
1621
|
+
* Configuration options for the noise effect.
|
|
1622
|
+
* @see NoiseEffectOptions
|
|
1623
|
+
*/
|
|
1624
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
1625
|
+
/** Reference to the host NgtpEffect directive */
|
|
1626
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
1627
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
1045
1628
|
extend({ NoiseEffect });
|
|
1046
1629
|
}
|
|
1047
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1048
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1049
|
-
<ngt-noise-effect *args="[options()]" [camera]="
|
|
1630
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpNoise, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1631
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.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 })], viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
1632
|
+
<ngt-noise-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1050
1633
|
<ngtp-effect-blend-mode />
|
|
1051
1634
|
<ng-content />
|
|
1052
1635
|
</ngt-noise-effect>
|
|
1053
1636
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1054
1637
|
}
|
|
1055
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1638
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpNoise, decorators: [{
|
|
1056
1639
|
type: Component,
|
|
1057
1640
|
args: [{
|
|
1058
1641
|
selector: 'ngtp-noise',
|
|
1059
1642
|
template: `
|
|
1060
|
-
<ngt-noise-effect *args="[options()]" [camera]="
|
|
1643
|
+
<ngt-noise-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1061
1644
|
<ngtp-effect-blend-mode />
|
|
1062
1645
|
<ng-content />
|
|
1063
1646
|
</ngt-noise-effect>
|
|
@@ -1068,14 +1651,45 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1068
1651
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1069
1652
|
providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.COLOR_DODGE })],
|
|
1070
1653
|
}]
|
|
1071
|
-
}], ctorParameters: () => [] });
|
|
1654
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
1072
1655
|
|
|
1073
1656
|
const defaultOptions$2 = {
|
|
1074
1657
|
selectionLayer: 10,
|
|
1075
1658
|
};
|
|
1659
|
+
/**
|
|
1660
|
+
* Angular component that applies an outline effect to selected objects.
|
|
1661
|
+
*
|
|
1662
|
+
* This effect draws an outline around specified objects in the scene.
|
|
1663
|
+
* Can be used with NgtSelectionApi for declarative selection or with
|
|
1664
|
+
* manual selection via the options input.
|
|
1665
|
+
*
|
|
1666
|
+
* @example
|
|
1667
|
+
* ```html
|
|
1668
|
+
* <!-- With NgtSelectionApi (recommended) -->
|
|
1669
|
+
* <ngt-group [select]="hovered()" (pointerenter)="hovered.set(true)">
|
|
1670
|
+
* <ngt-mesh>...</ngt-mesh>
|
|
1671
|
+
* </ngt-group>
|
|
1672
|
+
*
|
|
1673
|
+
* <ngtp-effect-composer>
|
|
1674
|
+
* <ngtp-outline [options]="{ edgeStrength: 2.5, blur: true }" />
|
|
1675
|
+
* </ngtp-effect-composer>
|
|
1676
|
+
* ```
|
|
1677
|
+
*
|
|
1678
|
+
* @example
|
|
1679
|
+
* ```html
|
|
1680
|
+
* <!-- With manual selection -->
|
|
1681
|
+
* <ngtp-effect-composer>
|
|
1682
|
+
* <ngtp-outline [options]="{ selection: [meshRef.nativeElement], edgeStrength: 5 }" />
|
|
1683
|
+
* </ngtp-effect-composer>
|
|
1684
|
+
* ```
|
|
1685
|
+
*/
|
|
1076
1686
|
class NgtpOutline {
|
|
1077
1687
|
constructor() {
|
|
1078
|
-
|
|
1688
|
+
/**
|
|
1689
|
+
* Configuration options for the outline effect.
|
|
1690
|
+
* @see NgtpOutlineOptions
|
|
1691
|
+
*/
|
|
1692
|
+
this.options = input(defaultOptions$2, { ...(ngDevMode ? { debugName: "options" } : {}), transform: mergeInputs(defaultOptions$2) });
|
|
1079
1693
|
this.selectionApi = inject(NgtSelectionApi, { optional: true });
|
|
1080
1694
|
this.effectComposer = inject(NgtpEffectComposer);
|
|
1081
1695
|
this.store = injectStore();
|
|
@@ -1105,6 +1719,10 @@ class NgtpOutline {
|
|
|
1105
1719
|
'blur',
|
|
1106
1720
|
'xRay',
|
|
1107
1721
|
]);
|
|
1722
|
+
/**
|
|
1723
|
+
* The underlying OutlineEffect instance.
|
|
1724
|
+
* Created with the scene, camera, and configured options.
|
|
1725
|
+
*/
|
|
1108
1726
|
this.effect = computed(() => {
|
|
1109
1727
|
const [scene, camera, blendFunction, patternTexture, edgeStrength, pulseSpeed, visibleEdgeColor, hiddenEdgeColor, width, height, kernelSize, blur, xRay, restOptions,] = [
|
|
1110
1728
|
this.effectComposer.scene(),
|
|
@@ -1136,7 +1754,7 @@ class NgtpOutline {
|
|
|
1136
1754
|
xRay,
|
|
1137
1755
|
...restOptions,
|
|
1138
1756
|
});
|
|
1139
|
-
});
|
|
1757
|
+
}, ...(ngDevMode ? [{ debugName: "effect" }] : []));
|
|
1140
1758
|
effect((onCleanup) => {
|
|
1141
1759
|
const effect = this.effect();
|
|
1142
1760
|
onCleanup(() => effect.dispose());
|
|
@@ -1173,6 +1791,14 @@ class NgtpOutline {
|
|
|
1173
1791
|
});
|
|
1174
1792
|
});
|
|
1175
1793
|
}
|
|
1794
|
+
/**
|
|
1795
|
+
* Handles changes to the selection and updates the outline effect.
|
|
1796
|
+
*
|
|
1797
|
+
* @param selected - Function returning the currently selected objects
|
|
1798
|
+
* @param _effect - Function returning the OutlineEffect instance
|
|
1799
|
+
* @param _invalidate - Function returning the invalidate callback
|
|
1800
|
+
* @returns Cleanup function to clear the selection
|
|
1801
|
+
*/
|
|
1176
1802
|
handleSelectionChangeEffect(selected, _effect, _invalidate) {
|
|
1177
1803
|
const selection = selected();
|
|
1178
1804
|
if (!selection || selection.length === 0)
|
|
@@ -1194,12 +1820,12 @@ class NgtpOutline {
|
|
|
1194
1820
|
invalidate();
|
|
1195
1821
|
};
|
|
1196
1822
|
}
|
|
1197
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1198
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
1823
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpOutline, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1824
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NgtpOutline, isStandalone: true, selector: "ngtp-outline", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1199
1825
|
<ngt-primitive *args="[effect()]" />
|
|
1200
1826
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1201
1827
|
}
|
|
1202
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1828
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpOutline, decorators: [{
|
|
1203
1829
|
type: Component,
|
|
1204
1830
|
args: [{
|
|
1205
1831
|
selector: 'ngtp-outline',
|
|
@@ -1210,24 +1836,43 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1210
1836
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1211
1837
|
imports: [NgtArgs],
|
|
1212
1838
|
}]
|
|
1213
|
-
}], ctorParameters: () => [] });
|
|
1839
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
1214
1840
|
|
|
1841
|
+
/**
|
|
1842
|
+
* Angular component that applies a pixelation effect to the scene.
|
|
1843
|
+
*
|
|
1844
|
+
* This effect reduces the resolution of the rendered image to create
|
|
1845
|
+
* a retro, 8-bit style appearance.
|
|
1846
|
+
*
|
|
1847
|
+
* @example
|
|
1848
|
+
* ```html
|
|
1849
|
+
* <ngtp-effect-composer>
|
|
1850
|
+
* <ngtp-pixelation [options]="{ granularity: 10 }" />
|
|
1851
|
+
* </ngtp-effect-composer>
|
|
1852
|
+
* ```
|
|
1853
|
+
*/
|
|
1215
1854
|
class NgtpPixelation {
|
|
1216
1855
|
constructor() {
|
|
1217
|
-
|
|
1856
|
+
/**
|
|
1857
|
+
* Configuration options for the pixelation effect.
|
|
1858
|
+
* @default { granularity: 5 }
|
|
1859
|
+
* @see PixelationOptions
|
|
1860
|
+
*/
|
|
1861
|
+
this.options = input({ granularity: 5 }, { ...(ngDevMode ? { debugName: "options" } : {}), transform: mergeInputs({ granularity: 5 }) });
|
|
1218
1862
|
this.granularity = pick(this.options, 'granularity');
|
|
1219
|
-
|
|
1863
|
+
/** The underlying PixelationEffect instance */
|
|
1864
|
+
this.effect = computed(() => new PixelationEffect(this.granularity()), ...(ngDevMode ? [{ debugName: "effect" }] : []));
|
|
1220
1865
|
effect((onCleanup) => {
|
|
1221
1866
|
const effect = this.effect();
|
|
1222
1867
|
onCleanup(() => effect.dispose());
|
|
1223
1868
|
});
|
|
1224
1869
|
}
|
|
1225
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1226
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
1870
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpPixelation, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1871
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NgtpPixelation, isStandalone: true, selector: "ngtp-pixelation", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1227
1872
|
<ngt-primitive *args="[effect()]" />
|
|
1228
1873
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1229
1874
|
}
|
|
1230
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1875
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpPixelation, decorators: [{
|
|
1231
1876
|
type: Component,
|
|
1232
1877
|
args: [{
|
|
1233
1878
|
selector: 'ngtp-pixelation',
|
|
@@ -1238,31 +1883,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1238
1883
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
1239
1884
|
imports: [NgtArgs],
|
|
1240
1885
|
}]
|
|
1241
|
-
}], ctorParameters: () => [] });
|
|
1886
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
1242
1887
|
|
|
1243
1888
|
const defaultOptions$1 = {
|
|
1244
1889
|
density: 1.25,
|
|
1245
1890
|
};
|
|
1891
|
+
/**
|
|
1892
|
+
* Angular component that applies a scanline effect to the scene.
|
|
1893
|
+
*
|
|
1894
|
+
* This effect overlays horizontal scanlines on the image, simulating
|
|
1895
|
+
* the appearance of old CRT monitors or television screens.
|
|
1896
|
+
*
|
|
1897
|
+
* @example
|
|
1898
|
+
* ```html
|
|
1899
|
+
* <ngtp-effect-composer>
|
|
1900
|
+
* <ngtp-scanline [options]="{ density: 2.0 }" />
|
|
1901
|
+
* </ngtp-effect-composer>
|
|
1902
|
+
* ```
|
|
1903
|
+
*/
|
|
1246
1904
|
class NgtpScanline {
|
|
1247
1905
|
constructor() {
|
|
1248
|
-
|
|
1249
|
-
|
|
1906
|
+
/**
|
|
1907
|
+
* Configuration options for the scanline effect.
|
|
1908
|
+
* @default { density: 1.25 }
|
|
1909
|
+
* @see ScanlineEffectOptions
|
|
1910
|
+
*/
|
|
1911
|
+
this.options = input(defaultOptions$1, { ...(ngDevMode ? { debugName: "options" } : {}), transform: mergeInputs(defaultOptions$1) });
|
|
1912
|
+
/** Reference to the host NgtpEffect directive */
|
|
1913
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
1914
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
1250
1915
|
extend({ ScanlineEffect });
|
|
1251
1916
|
}
|
|
1252
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1253
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1254
|
-
<ngt-scanline-effect *args="[options()]" [camera]="
|
|
1917
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpScanline, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1918
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.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 })], viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
1919
|
+
<ngt-scanline-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1255
1920
|
<ngtp-effect-blend-mode />
|
|
1256
1921
|
<ng-content />
|
|
1257
1922
|
</ngt-scanline-effect>
|
|
1258
1923
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1259
1924
|
}
|
|
1260
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
1925
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpScanline, decorators: [{
|
|
1261
1926
|
type: Component,
|
|
1262
1927
|
args: [{
|
|
1263
1928
|
selector: 'ngtp-scanline',
|
|
1264
1929
|
template: `
|
|
1265
|
-
<ngt-scanline-effect *args="[options()]" [camera]="
|
|
1930
|
+
<ngt-scanline-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1266
1931
|
<ngtp-effect-blend-mode />
|
|
1267
1932
|
<ng-content />
|
|
1268
1933
|
</ngt-scanline-effect>
|
|
@@ -1273,20 +1938,53 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1273
1938
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1274
1939
|
providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.OVERLAY })],
|
|
1275
1940
|
}]
|
|
1276
|
-
}], ctorParameters: () => [] });
|
|
1941
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
1277
1942
|
|
|
1278
|
-
// const addLight = (light: Object3D, effect: SelectiveBloomEffect) => light.layers.enable(effect.selection.layer)
|
|
1279
|
-
// const removeLight = (light: Object3D, effect: SelectiveBloomEffect) => light.layers.disable(effect.selection.layer)
|
|
1280
1943
|
const defaultOptions = {
|
|
1281
1944
|
selectionLayer: 10,
|
|
1282
1945
|
inverted: false,
|
|
1283
1946
|
ignoreBackground: false,
|
|
1284
1947
|
};
|
|
1948
|
+
/**
|
|
1949
|
+
* Angular component that applies bloom only to selected objects.
|
|
1950
|
+
*
|
|
1951
|
+
* Unlike the standard bloom effect, selective bloom allows you to specify
|
|
1952
|
+
* which objects should glow. Requires light sources to be provided for
|
|
1953
|
+
* proper rendering.
|
|
1954
|
+
*
|
|
1955
|
+
* Can be used with NgtSelectionApi for declarative selection or with
|
|
1956
|
+
* manual selection via the selection input.
|
|
1957
|
+
*
|
|
1958
|
+
* @example
|
|
1959
|
+
* ```html
|
|
1960
|
+
* <ngtp-effect-composer>
|
|
1961
|
+
* <ngtp-selective-bloom
|
|
1962
|
+
* [lights]="[ambientLightRef, pointLightRef]"
|
|
1963
|
+
* [selection]="[glowingMeshRef]"
|
|
1964
|
+
* [options]="{ intensity: 2, luminanceThreshold: 0 }"
|
|
1965
|
+
* />
|
|
1966
|
+
* </ngtp-effect-composer>
|
|
1967
|
+
* ```
|
|
1968
|
+
*/
|
|
1285
1969
|
class NgtpSelectiveBloom {
|
|
1286
1970
|
constructor() {
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1971
|
+
/**
|
|
1972
|
+
* Light sources that should be included in the bloom calculation.
|
|
1973
|
+
* Required for proper selective bloom rendering.
|
|
1974
|
+
*/
|
|
1975
|
+
this.lights = input.required(...(ngDevMode ? [{ debugName: "lights" }] : []));
|
|
1976
|
+
/**
|
|
1977
|
+
* Objects to apply bloom to.
|
|
1978
|
+
* Can be a single object, array of objects, or ElementRefs.
|
|
1979
|
+
* Not needed if using NgtSelectionApi.
|
|
1980
|
+
* @default []
|
|
1981
|
+
*/
|
|
1982
|
+
this.selection = input([], ...(ngDevMode ? [{ debugName: "selection" }] : []));
|
|
1983
|
+
/**
|
|
1984
|
+
* Configuration options for the selective bloom effect.
|
|
1985
|
+
* @see SelectiveBloomOptions
|
|
1986
|
+
*/
|
|
1987
|
+
this.options = input(defaultOptions, { ...(ngDevMode ? { debugName: "options" } : {}), transform: mergeInputs(defaultOptions) });
|
|
1290
1988
|
this.blendFunction = pick(this.options, 'blendFunction');
|
|
1291
1989
|
this.luminanceThreshold = pick(this.options, 'luminanceThreshold');
|
|
1292
1990
|
this.luminanceSmoothing = pick(this.options, 'luminanceSmoothing');
|
|
@@ -1306,19 +2004,23 @@ class NgtpSelectiveBloom {
|
|
|
1306
2004
|
this.store = injectStore();
|
|
1307
2005
|
this.effectComposer = inject(NgtpEffectComposer);
|
|
1308
2006
|
this.selectionApi = inject(NgtSelectionApi, { optional: true });
|
|
1309
|
-
this.resolvedLights = computed(() => this.lights().map((light) => resolveRef(light)));
|
|
2007
|
+
this.resolvedLights = computed(() => this.lights().map((light) => resolveRef(light)), ...(ngDevMode ? [{ debugName: "resolvedLights" }] : []));
|
|
1310
2008
|
this.resolvedSelected = computed(() => {
|
|
1311
2009
|
const selection = this.selection();
|
|
1312
2010
|
if (!selection)
|
|
1313
2011
|
return [];
|
|
1314
2012
|
const array = Array.isArray(selection) ? selection : [selection];
|
|
1315
2013
|
return array.map((selected) => resolveRef(selected));
|
|
1316
|
-
});
|
|
2014
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedSelected" }] : []));
|
|
1317
2015
|
this.resolvedNgtSelected = computed(() => {
|
|
1318
2016
|
if (!this.selectionApi || !this.selectionApi.enabled)
|
|
1319
2017
|
return [];
|
|
1320
2018
|
return this.selectionApi.selected().map((selected) => resolveRef(selected));
|
|
1321
|
-
});
|
|
2019
|
+
}, ...(ngDevMode ? [{ debugName: "resolvedNgtSelected" }] : []));
|
|
2020
|
+
/**
|
|
2021
|
+
* The underlying SelectiveBloomEffect instance.
|
|
2022
|
+
* Created with the scene, camera, and configured options.
|
|
2023
|
+
*/
|
|
1322
2024
|
this.effect = computed(() => {
|
|
1323
2025
|
const effect = new SelectiveBloomEffect(this.effectComposer.scene(), this.effectComposer.camera(), {
|
|
1324
2026
|
blendFunction: this.blendFunction() || BlendFunction.ADD,
|
|
@@ -1338,7 +2040,7 @@ class NgtpSelectiveBloom {
|
|
|
1338
2040
|
effect.inverted = this.inverted();
|
|
1339
2041
|
effect.ignoreBackground = this.ignoreBackground();
|
|
1340
2042
|
return effect;
|
|
1341
|
-
});
|
|
2043
|
+
}, ...(ngDevMode ? [{ debugName: "effect" }] : []));
|
|
1342
2044
|
effect((onCleanup) => {
|
|
1343
2045
|
// skip input selection altogether if NgtSelection is used
|
|
1344
2046
|
if (this.selectionApi)
|
|
@@ -1388,18 +2090,30 @@ class NgtpSelectiveBloom {
|
|
|
1388
2090
|
});
|
|
1389
2091
|
});
|
|
1390
2092
|
}
|
|
2093
|
+
/**
|
|
2094
|
+
* Enables the selection layer on a light source.
|
|
2095
|
+
*
|
|
2096
|
+
* @param effect - The SelectiveBloomEffect instance
|
|
2097
|
+
* @param light - The light to enable on the selection layer
|
|
2098
|
+
*/
|
|
1391
2099
|
addLight(effect, light) {
|
|
1392
2100
|
light.layers.enable(effect.selection.layer);
|
|
1393
2101
|
}
|
|
2102
|
+
/**
|
|
2103
|
+
* Disables the selection layer on a light source.
|
|
2104
|
+
*
|
|
2105
|
+
* @param effect - The SelectiveBloomEffect instance
|
|
2106
|
+
* @param light - The light to disable from the selection layer
|
|
2107
|
+
*/
|
|
1394
2108
|
removeLight(effect, light) {
|
|
1395
2109
|
light.layers.disable(effect.selection.layer);
|
|
1396
2110
|
}
|
|
1397
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1398
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
2111
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpSelectiveBloom, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2112
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.0.6", type: NgtpSelectiveBloom, isStandalone: true, selector: "ngtp-selective-bloom", inputs: { lights: { classPropertyName: "lights", publicName: "lights", isSignal: true, isRequired: true, transformFunction: null }, selection: { classPropertyName: "selection", publicName: "selection", isSignal: true, isRequired: false, transformFunction: null }, options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
|
|
1399
2113
|
<ngt-primitive *args="[effect()]" [dispose]="null" />
|
|
1400
2114
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1401
2115
|
}
|
|
1402
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2116
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpSelectiveBloom, decorators: [{
|
|
1403
2117
|
type: Component,
|
|
1404
2118
|
args: [{
|
|
1405
2119
|
selector: 'ngtp-selective-bloom',
|
|
@@ -1410,28 +2124,47 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1410
2124
|
schemas: [CUSTOM_ELEMENTS_SCHEMA],
|
|
1411
2125
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1412
2126
|
}]
|
|
1413
|
-
}], ctorParameters: () => [] });
|
|
2127
|
+
}], ctorParameters: () => [], propDecorators: { lights: [{ type: i0.Input, args: [{ isSignal: true, alias: "lights", required: true }] }], selection: [{ type: i0.Input, args: [{ isSignal: true, alias: "selection", required: false }] }], options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }] } });
|
|
1414
2128
|
|
|
2129
|
+
/**
|
|
2130
|
+
* Angular component that applies a sepia tone effect to the scene.
|
|
2131
|
+
*
|
|
2132
|
+
* This effect gives the rendered image a warm, brownish tint similar to
|
|
2133
|
+
* old photographs, creating a vintage or nostalgic appearance.
|
|
2134
|
+
*
|
|
2135
|
+
* @example
|
|
2136
|
+
* ```html
|
|
2137
|
+
* <ngtp-effect-composer>
|
|
2138
|
+
* <ngtp-sepia [options]="{ intensity: 0.5 }" />
|
|
2139
|
+
* </ngtp-effect-composer>
|
|
2140
|
+
* ```
|
|
2141
|
+
*/
|
|
1415
2142
|
class NgtpSepia {
|
|
1416
2143
|
constructor() {
|
|
1417
|
-
|
|
1418
|
-
|
|
2144
|
+
/**
|
|
2145
|
+
* Configuration options for the sepia effect.
|
|
2146
|
+
* @see SepiaEffectOptions
|
|
2147
|
+
*/
|
|
2148
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
2149
|
+
/** Reference to the host NgtpEffect directive */
|
|
2150
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
2151
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
1419
2152
|
extend({ SepiaEffect });
|
|
1420
2153
|
}
|
|
1421
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1422
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1423
|
-
<ngt-sepia-effect *args="[options()]" [camera]="
|
|
2154
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpSepia, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2155
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpSepia, isStandalone: true, selector: "ngtp-sepia", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
2156
|
+
<ngt-sepia-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1424
2157
|
<ngtp-effect-blend-mode />
|
|
1425
2158
|
<ng-content />
|
|
1426
2159
|
</ngt-sepia-effect>
|
|
1427
2160
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1428
2161
|
}
|
|
1429
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2162
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpSepia, decorators: [{
|
|
1430
2163
|
type: Component,
|
|
1431
2164
|
args: [{
|
|
1432
2165
|
selector: 'ngtp-sepia',
|
|
1433
2166
|
template: `
|
|
1434
|
-
<ngt-sepia-effect *args="[options()]" [camera]="
|
|
2167
|
+
<ngt-sepia-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1435
2168
|
<ngtp-effect-blend-mode />
|
|
1436
2169
|
<ng-content />
|
|
1437
2170
|
</ngt-sepia-effect>
|
|
@@ -1441,28 +2174,49 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1441
2174
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
1442
2175
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1443
2176
|
}]
|
|
1444
|
-
}], ctorParameters: () => [] });
|
|
2177
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
1445
2178
|
|
|
2179
|
+
/**
|
|
2180
|
+
* Angular component that applies a shock wave distortion effect.
|
|
2181
|
+
*
|
|
2182
|
+
* This effect creates an expanding ring distortion that simulates a
|
|
2183
|
+
* shock wave or explosion ripple emanating from a point in the scene.
|
|
2184
|
+
*
|
|
2185
|
+
* @example
|
|
2186
|
+
* ```html
|
|
2187
|
+
* <ngtp-effect-composer>
|
|
2188
|
+
* <ngtp-shock-wave
|
|
2189
|
+
* [options]="{ speed: 2, maxRadius: 1, waveSize: 0.2, amplitude: 0.05 }"
|
|
2190
|
+
* />
|
|
2191
|
+
* </ngtp-effect-composer>
|
|
2192
|
+
* ```
|
|
2193
|
+
*/
|
|
1446
2194
|
class NgtpShockWave {
|
|
1447
2195
|
constructor() {
|
|
1448
|
-
|
|
1449
|
-
|
|
2196
|
+
/**
|
|
2197
|
+
* Configuration options for the shock wave effect.
|
|
2198
|
+
* @see ShockWaveEffectOptions
|
|
2199
|
+
*/
|
|
2200
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
2201
|
+
/** Reference to the host NgtpEffect directive */
|
|
2202
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
2203
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
1450
2204
|
extend({ ShockWaveEffect });
|
|
1451
2205
|
}
|
|
1452
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1453
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1454
|
-
<ngt-shock-wave-effect *args="[options()]" [camera]="
|
|
2206
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpShockWave, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2207
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpShockWave, isStandalone: true, selector: "ngtp-shock-wave", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
2208
|
+
<ngt-shock-wave-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1455
2209
|
<ngtp-effect-blend-mode />
|
|
1456
2210
|
<ng-content />
|
|
1457
2211
|
</ngt-shock-wave-effect>
|
|
1458
2212
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1459
2213
|
}
|
|
1460
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2214
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpShockWave, decorators: [{
|
|
1461
2215
|
type: Component,
|
|
1462
2216
|
args: [{
|
|
1463
2217
|
selector: 'ngtp-shock-wave',
|
|
1464
2218
|
template: `
|
|
1465
|
-
<ngt-shock-wave-effect *args="[options()]" [camera]="
|
|
2219
|
+
<ngt-shock-wave-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1466
2220
|
<ngtp-effect-blend-mode />
|
|
1467
2221
|
<ng-content />
|
|
1468
2222
|
</ngt-shock-wave-effect>
|
|
@@ -1472,28 +2226,56 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1472
2226
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
1473
2227
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1474
2228
|
}]
|
|
1475
|
-
}], ctorParameters: () => [] });
|
|
2229
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
1476
2230
|
|
|
2231
|
+
/**
|
|
2232
|
+
* Angular component that applies Subpixel Morphological Anti-Aliasing (SMAA).
|
|
2233
|
+
*
|
|
2234
|
+
* SMAA is a high-quality, efficient anti-aliasing technique that provides
|
|
2235
|
+
* better results than FXAA while being less demanding than multisampling.
|
|
2236
|
+
* It's particularly effective at smoothing edges while preserving sharpness.
|
|
2237
|
+
*
|
|
2238
|
+
* @example
|
|
2239
|
+
* ```html
|
|
2240
|
+
* <ngtp-effect-composer [options]="{ multisampling: 0 }">
|
|
2241
|
+
* <ngtp-smaa />
|
|
2242
|
+
* </ngtp-effect-composer>
|
|
2243
|
+
* ```
|
|
2244
|
+
*
|
|
2245
|
+
* @example
|
|
2246
|
+
* ```html
|
|
2247
|
+
* <!-- With preset -->
|
|
2248
|
+
* <ngtp-effect-composer>
|
|
2249
|
+
* <ngtp-smaa [options]="{ preset: SMAAPreset.ULTRA }" />
|
|
2250
|
+
* </ngtp-effect-composer>
|
|
2251
|
+
* ```
|
|
2252
|
+
*/
|
|
1477
2253
|
class NgtpSMAA {
|
|
1478
2254
|
constructor() {
|
|
1479
|
-
|
|
1480
|
-
|
|
2255
|
+
/**
|
|
2256
|
+
* Configuration options for the SMAA effect.
|
|
2257
|
+
* @see SMAAEffectOptions
|
|
2258
|
+
*/
|
|
2259
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
2260
|
+
/** Reference to the host NgtpEffect directive */
|
|
2261
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
2262
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
1481
2263
|
extend({ SMAAEffect });
|
|
1482
2264
|
}
|
|
1483
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1484
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1485
|
-
<ngt-sMAA-effect *args="[options()]" [camera]="
|
|
2265
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpSMAA, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2266
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpSMAA, isStandalone: true, selector: "ngtp-smaa", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
2267
|
+
<ngt-sMAA-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1486
2268
|
<ngtp-effect-blend-mode />
|
|
1487
2269
|
<ng-content />
|
|
1488
2270
|
</ngt-sMAA-effect>
|
|
1489
2271
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1490
2272
|
}
|
|
1491
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2273
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpSMAA, decorators: [{
|
|
1492
2274
|
type: Component,
|
|
1493
2275
|
args: [{
|
|
1494
2276
|
selector: 'ngtp-smaa',
|
|
1495
2277
|
template: `
|
|
1496
|
-
<ngt-sMAA-effect *args="[options()]" [camera]="
|
|
2278
|
+
<ngt-sMAA-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1497
2279
|
<ngtp-effect-blend-mode />
|
|
1498
2280
|
<ng-content />
|
|
1499
2281
|
</ngt-sMAA-effect>
|
|
@@ -1503,28 +2285,52 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1503
2285
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
1504
2286
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1505
2287
|
}]
|
|
1506
|
-
}], ctorParameters: () => [] });
|
|
2288
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
1507
2289
|
|
|
2290
|
+
/**
|
|
2291
|
+
* Angular component that applies a tilt-shift blur effect.
|
|
2292
|
+
*
|
|
2293
|
+
* This effect simulates the shallow depth of field look from tilt-shift
|
|
2294
|
+
* photography, creating a "miniature" or "diorama" appearance where only
|
|
2295
|
+
* a horizontal band of the image is in focus.
|
|
2296
|
+
*
|
|
2297
|
+
* Uses the postprocessing library's built-in TiltShiftEffect.
|
|
2298
|
+
*
|
|
2299
|
+
* @example
|
|
2300
|
+
* ```html
|
|
2301
|
+
* <ngtp-effect-composer>
|
|
2302
|
+
* <ngtp-tilt-shift [options]="{ blur: 0.5, offset: 0.5 }" />
|
|
2303
|
+
* </ngtp-effect-composer>
|
|
2304
|
+
* ```
|
|
2305
|
+
*
|
|
2306
|
+
* @see NgtpTiltShift2 for an alternative implementation with different parameters
|
|
2307
|
+
*/
|
|
1508
2308
|
class NgtpTiltShift {
|
|
1509
2309
|
constructor() {
|
|
1510
|
-
|
|
1511
|
-
|
|
2310
|
+
/**
|
|
2311
|
+
* Configuration options for the tilt-shift effect.
|
|
2312
|
+
* @see TiltShiftEffectOptions
|
|
2313
|
+
*/
|
|
2314
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
2315
|
+
/** Reference to the host NgtpEffect directive */
|
|
2316
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
2317
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
1512
2318
|
extend({ TiltShiftEffect });
|
|
1513
2319
|
}
|
|
1514
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1515
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1516
|
-
<ngt-tilt-shift-effect *args="[options()]" [camera]="
|
|
2320
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpTiltShift, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2321
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.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 })], viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
2322
|
+
<ngt-tilt-shift-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1517
2323
|
<ngtp-effect-blend-mode />
|
|
1518
2324
|
<ng-content />
|
|
1519
2325
|
</ngt-tilt-shift-effect>
|
|
1520
2326
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1521
2327
|
}
|
|
1522
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2328
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpTiltShift, decorators: [{
|
|
1523
2329
|
type: Component,
|
|
1524
2330
|
args: [{
|
|
1525
2331
|
selector: 'ngtp-tilt-shift',
|
|
1526
2332
|
template: `
|
|
1527
|
-
<ngt-tilt-shift-effect *args="[options()]" [camera]="
|
|
2333
|
+
<ngt-tilt-shift-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1528
2334
|
<ngtp-effect-blend-mode />
|
|
1529
2335
|
<ng-content />
|
|
1530
2336
|
</ngt-tilt-shift-effect>
|
|
@@ -1535,8 +2341,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1535
2341
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1536
2342
|
providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.ADD })],
|
|
1537
2343
|
}]
|
|
1538
|
-
}], ctorParameters: () => [] });
|
|
2344
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
1539
2345
|
|
|
2346
|
+
/**
|
|
2347
|
+
* Custom tilt-shift shader based on Evan Wallace's implementation.
|
|
2348
|
+
* Provides line-based focus control with customizable blur parameters.
|
|
2349
|
+
*/
|
|
1540
2350
|
const TiltShiftShader = {
|
|
1541
2351
|
fragmentShader: /* language=glsl glsl */ `
|
|
1542
2352
|
|
|
@@ -1596,7 +2406,35 @@ const TiltShiftShader = {
|
|
|
1596
2406
|
}
|
|
1597
2407
|
`,
|
|
1598
2408
|
};
|
|
2409
|
+
/**
|
|
2410
|
+
* A custom tilt-shift effect with line-based focus control.
|
|
2411
|
+
*
|
|
2412
|
+
* This effect provides a different approach to tilt-shift compared to
|
|
2413
|
+
* the standard TiltShiftEffect, allowing you to define a focus line
|
|
2414
|
+
* between two screen-space points.
|
|
2415
|
+
*
|
|
2416
|
+
* @example
|
|
2417
|
+
* ```typescript
|
|
2418
|
+
* const effect = new TiltShift2Effect({
|
|
2419
|
+
* blur: 0.2,
|
|
2420
|
+
* start: [0.5, 0.3],
|
|
2421
|
+
* end: [0.5, 0.7]
|
|
2422
|
+
* });
|
|
2423
|
+
* ```
|
|
2424
|
+
*/
|
|
1599
2425
|
class TiltShift2Effect extends Effect {
|
|
2426
|
+
/**
|
|
2427
|
+
* Creates a new TiltShift2Effect instance.
|
|
2428
|
+
*
|
|
2429
|
+
* @param options - Configuration options
|
|
2430
|
+
* @param options.blendFunction - How to blend with the scene
|
|
2431
|
+
* @param options.blur - Blur intensity [0, 1], can exceed 1 for more blur
|
|
2432
|
+
* @param options.taper - Taper of the focus area [0, 1]
|
|
2433
|
+
* @param options.start - Start point of focus line in screen space [x, y]
|
|
2434
|
+
* @param options.end - End point of focus line in screen space [x, y]
|
|
2435
|
+
* @param options.samples - Number of blur samples
|
|
2436
|
+
* @param options.direction - Direction of the blur
|
|
2437
|
+
*/
|
|
1600
2438
|
constructor({ blendFunction = BlendFunction.NORMAL, blur = 0.15, // [0, 1], can go beyond 1 for extra
|
|
1601
2439
|
taper = 0.5, // [0, 1], can go beyond 1 for extra
|
|
1602
2440
|
start = [0.5, 0.0], // [0,1] percentage x,y of screenspace
|
|
@@ -1619,25 +2457,47 @@ class TiltShift2Effect extends Effect {
|
|
|
1619
2457
|
}
|
|
1620
2458
|
}
|
|
1621
2459
|
extend({ TiltShift2Effect });
|
|
2460
|
+
/**
|
|
2461
|
+
* Angular component that applies an alternative tilt-shift effect.
|
|
2462
|
+
*
|
|
2463
|
+
* This effect uses a line-based focus system where you define start and
|
|
2464
|
+
* end points in screen space. The area between these points stays in focus
|
|
2465
|
+
* while the rest of the image is blurred.
|
|
2466
|
+
*
|
|
2467
|
+
* @example
|
|
2468
|
+
* ```html
|
|
2469
|
+
* <ngtp-effect-composer>
|
|
2470
|
+
* <ngtp-tilt-shift2 [options]="{ blur: 0.2, start: [0.5, 0.3], end: [0.5, 0.7] }" />
|
|
2471
|
+
* </ngtp-effect-composer>
|
|
2472
|
+
* ```
|
|
2473
|
+
*
|
|
2474
|
+
* @see NgtpTiltShift for the standard tilt-shift implementation
|
|
2475
|
+
*/
|
|
1622
2476
|
class NgtpTiltShift2 {
|
|
1623
2477
|
constructor() {
|
|
1624
|
-
|
|
1625
|
-
|
|
2478
|
+
/**
|
|
2479
|
+
* Configuration options for the tilt-shift effect.
|
|
2480
|
+
* @see TiltShift2EffectOptions
|
|
2481
|
+
*/
|
|
2482
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
2483
|
+
/** Reference to the host NgtpEffect directive */
|
|
2484
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
2485
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
1626
2486
|
}
|
|
1627
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1628
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1629
|
-
<ngt-tilt-shift2-effect *args="[options()]" [camera]="
|
|
2487
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpTiltShift2, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2488
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.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 })], viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
2489
|
+
<ngt-tilt-shift2-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1630
2490
|
<ngtp-effect-blend-mode />
|
|
1631
2491
|
<ng-content />
|
|
1632
2492
|
</ngt-tilt-shift2-effect>
|
|
1633
2493
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1634
2494
|
}
|
|
1635
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2495
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpTiltShift2, decorators: [{
|
|
1636
2496
|
type: Component,
|
|
1637
2497
|
args: [{
|
|
1638
2498
|
selector: 'ngtp-tilt-shift2',
|
|
1639
2499
|
template: `
|
|
1640
|
-
<ngt-tilt-shift2-effect *args="[options()]" [camera]="
|
|
2500
|
+
<ngt-tilt-shift2-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1641
2501
|
<ngtp-effect-blend-mode />
|
|
1642
2502
|
<ng-content />
|
|
1643
2503
|
</ngt-tilt-shift2-effect>
|
|
@@ -1648,28 +2508,51 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1648
2508
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1649
2509
|
providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.NORMAL })],
|
|
1650
2510
|
}]
|
|
1651
|
-
}] });
|
|
2511
|
+
}], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
1652
2512
|
|
|
2513
|
+
/**
|
|
2514
|
+
* Angular component that applies tone mapping to the scene.
|
|
2515
|
+
*
|
|
2516
|
+
* Tone mapping converts HDR (High Dynamic Range) values to LDR (Low Dynamic
|
|
2517
|
+
* Range) for display. Various tone mapping modes are available including
|
|
2518
|
+
* Reinhard, ACES Filmic, and custom linear options.
|
|
2519
|
+
*
|
|
2520
|
+
* Note: The effect composer disables Three.js's built-in tone mapping,
|
|
2521
|
+
* so this effect should be used if tone mapping is desired.
|
|
2522
|
+
*
|
|
2523
|
+
* @example
|
|
2524
|
+
* ```html
|
|
2525
|
+
* <ngtp-effect-composer>
|
|
2526
|
+
* <ngtp-tone-mapping [options]="{ mode: ToneMappingMode.ACES_FILMIC }" />
|
|
2527
|
+
* </ngtp-effect-composer>
|
|
2528
|
+
* ```
|
|
2529
|
+
*/
|
|
1653
2530
|
class NgtpToneMapping {
|
|
1654
2531
|
constructor() {
|
|
1655
|
-
|
|
1656
|
-
|
|
2532
|
+
/**
|
|
2533
|
+
* Configuration options for the tone mapping effect.
|
|
2534
|
+
* @see ToneMappingEffectOptions
|
|
2535
|
+
*/
|
|
2536
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
2537
|
+
/** Reference to the host NgtpEffect directive */
|
|
2538
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
2539
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
1657
2540
|
extend({ ToneMappingEffect });
|
|
1658
2541
|
}
|
|
1659
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1660
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1661
|
-
<ngt-tone-mapping-effect *args="[options()]" [camera]="
|
|
2542
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpToneMapping, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2543
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpToneMapping, isStandalone: true, selector: "ngtp-tone-mapping", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
2544
|
+
<ngt-tone-mapping-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1662
2545
|
<ngtp-effect-blend-mode />
|
|
1663
2546
|
<ng-content />
|
|
1664
2547
|
</ngt-tone-mapping-effect>
|
|
1665
2548
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1666
2549
|
}
|
|
1667
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2550
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpToneMapping, decorators: [{
|
|
1668
2551
|
type: Component,
|
|
1669
2552
|
args: [{
|
|
1670
2553
|
selector: 'ngtp-tone-mapping',
|
|
1671
2554
|
template: `
|
|
1672
|
-
<ngt-tone-mapping-effect *args="[options()]" [camera]="
|
|
2555
|
+
<ngt-tone-mapping-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1673
2556
|
<ngtp-effect-blend-mode />
|
|
1674
2557
|
<ng-content />
|
|
1675
2558
|
</ngt-tone-mapping-effect>
|
|
@@ -1679,28 +2562,48 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1679
2562
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
1680
2563
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1681
2564
|
}]
|
|
1682
|
-
}], ctorParameters: () => [] });
|
|
2565
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
1683
2566
|
|
|
2567
|
+
/**
|
|
2568
|
+
* Angular component that applies a vignette effect to the scene.
|
|
2569
|
+
*
|
|
2570
|
+
* This effect darkens the corners and edges of the image, drawing the
|
|
2571
|
+
* viewer's attention to the center. It's a common cinematic technique
|
|
2572
|
+
* for creating focus and atmosphere.
|
|
2573
|
+
*
|
|
2574
|
+
* @example
|
|
2575
|
+
* ```html
|
|
2576
|
+
* <ngtp-effect-composer>
|
|
2577
|
+
* <ngtp-vignette [options]="{ darkness: 0.5, offset: 0.3 }" />
|
|
2578
|
+
* </ngtp-effect-composer>
|
|
2579
|
+
* ```
|
|
2580
|
+
*/
|
|
1684
2581
|
class NgtpVignette {
|
|
1685
2582
|
constructor() {
|
|
1686
|
-
|
|
1687
|
-
|
|
2583
|
+
/**
|
|
2584
|
+
* Configuration options for the vignette effect.
|
|
2585
|
+
* @see VignetteEffectOptions
|
|
2586
|
+
*/
|
|
2587
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
2588
|
+
/** Reference to the host NgtpEffect directive */
|
|
2589
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
2590
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
1688
2591
|
extend({ VignetteEffect });
|
|
1689
2592
|
}
|
|
1690
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1691
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1692
|
-
<ngt-vignette-effect *args="[options()]" [camera]="
|
|
2593
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpVignette, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2594
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.0.6", type: NgtpVignette, isStandalone: true, selector: "ngtp-vignette", inputs: { options: { classPropertyName: "options", publicName: "options", isSignal: true, isRequired: false, transformFunction: null } }, viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
2595
|
+
<ngt-vignette-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1693
2596
|
<ngtp-effect-blend-mode />
|
|
1694
2597
|
<ng-content />
|
|
1695
2598
|
</ngt-vignette-effect>
|
|
1696
2599
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1697
2600
|
}
|
|
1698
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2601
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpVignette, decorators: [{
|
|
1699
2602
|
type: Component,
|
|
1700
2603
|
args: [{
|
|
1701
2604
|
selector: 'ngtp-vignette',
|
|
1702
2605
|
template: `
|
|
1703
|
-
<ngt-vignette-effect *args="[options()]" [camera]="
|
|
2606
|
+
<ngt-vignette-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1704
2607
|
<ngtp-effect-blend-mode />
|
|
1705
2608
|
<ng-content />
|
|
1706
2609
|
</ngt-vignette-effect>
|
|
@@ -1710,8 +2613,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1710
2613
|
imports: [NgtArgs, NgtpEffectBlendMode],
|
|
1711
2614
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1712
2615
|
}]
|
|
1713
|
-
}], ctorParameters: () => [] });
|
|
2616
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
1714
2617
|
|
|
2618
|
+
/**
|
|
2619
|
+
* Shader configuration for the water distortion effect.
|
|
2620
|
+
* Creates a rippling, underwater-like distortion.
|
|
2621
|
+
*/
|
|
1715
2622
|
const WaterShader = {
|
|
1716
2623
|
fragmentShader: /* language=glsl glsl */ `
|
|
1717
2624
|
uniform float factor;
|
|
@@ -1727,7 +2634,25 @@ const WaterShader = {
|
|
|
1727
2634
|
outputColor = rgba;
|
|
1728
2635
|
}`,
|
|
1729
2636
|
};
|
|
2637
|
+
/**
|
|
2638
|
+
* A postprocessing effect that simulates an underwater/water distortion.
|
|
2639
|
+
*
|
|
2640
|
+
* Creates animated rippling distortion that makes the scene appear as if
|
|
2641
|
+
* viewed through water or a heat haze.
|
|
2642
|
+
*
|
|
2643
|
+
* @example
|
|
2644
|
+
* ```typescript
|
|
2645
|
+
* const effect = new WaterEffect({ factor: 0.5 });
|
|
2646
|
+
* ```
|
|
2647
|
+
*/
|
|
1730
2648
|
class WaterEffect extends Effect {
|
|
2649
|
+
/**
|
|
2650
|
+
* Creates a new WaterEffect instance.
|
|
2651
|
+
*
|
|
2652
|
+
* @param options - Configuration options
|
|
2653
|
+
* @param options.blendFunction - How to blend with the scene
|
|
2654
|
+
* @param options.factor - Intensity of the water effect (0 = no effect)
|
|
2655
|
+
*/
|
|
1731
2656
|
constructor({ blendFunction = BlendFunction.NORMAL, factor = 0 } = {}) {
|
|
1732
2657
|
super('WaterEffect', WaterShader.fragmentShader, {
|
|
1733
2658
|
blendFunction,
|
|
@@ -1736,26 +2661,45 @@ class WaterEffect extends Effect {
|
|
|
1736
2661
|
});
|
|
1737
2662
|
}
|
|
1738
2663
|
}
|
|
2664
|
+
/**
|
|
2665
|
+
* Angular component that applies a water/ripple distortion effect.
|
|
2666
|
+
*
|
|
2667
|
+
* This effect creates an animated underwater-like distortion that can
|
|
2668
|
+
* simulate viewing through water, heat haze, or a dream-like state.
|
|
2669
|
+
*
|
|
2670
|
+
* @example
|
|
2671
|
+
* ```html
|
|
2672
|
+
* <ngtp-effect-composer>
|
|
2673
|
+
* <ngtp-water [options]="{ factor: 0.5 }" />
|
|
2674
|
+
* </ngtp-effect-composer>
|
|
2675
|
+
* ```
|
|
2676
|
+
*/
|
|
1739
2677
|
class NgtpWater {
|
|
1740
2678
|
constructor() {
|
|
1741
|
-
|
|
1742
|
-
|
|
2679
|
+
/**
|
|
2680
|
+
* Configuration options for the water effect.
|
|
2681
|
+
* @see WaterEffectOptions
|
|
2682
|
+
*/
|
|
2683
|
+
this.options = input({}, ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
2684
|
+
/** Reference to the host NgtpEffect directive */
|
|
2685
|
+
this.hostEffect = inject(NgtpEffect, { host: true });
|
|
2686
|
+
this.effectRef = viewChild('effect', ...(ngDevMode ? [{ debugName: "effectRef" }] : []));
|
|
1743
2687
|
extend({ WaterEffect });
|
|
1744
2688
|
}
|
|
1745
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
1746
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.
|
|
1747
|
-
<ngt-water-effect *args="[options()]" [camera]="
|
|
2689
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpWater, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2690
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.2.0", version: "21.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 })], viewQueries: [{ propertyName: "effectRef", first: true, predicate: ["effect"], descendants: true, isSignal: true }], hostDirectives: [{ directive: NgtpEffect, inputs: ["blendFunction", "blendFunction", "opacity", "opacity"] }], ngImport: i0, template: `
|
|
2691
|
+
<ngt-water-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1748
2692
|
<ngtp-effect-blend-mode />
|
|
1749
2693
|
<ng-content />
|
|
1750
2694
|
</ngt-water-effect>
|
|
1751
2695
|
`, isInline: true, dependencies: [{ kind: "directive", type: NgtArgs, selector: "ng-template[args]", inputs: ["args"] }, { kind: "component", type: NgtpEffectBlendMode, selector: "ngtp-effect-blend-mode" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
1752
2696
|
}
|
|
1753
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
2697
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.0.6", ngImport: i0, type: NgtpWater, decorators: [{
|
|
1754
2698
|
type: Component,
|
|
1755
2699
|
args: [{
|
|
1756
2700
|
selector: 'ngtp-water',
|
|
1757
2701
|
template: `
|
|
1758
|
-
<ngt-water-effect *args="[options()]" [camera]="
|
|
2702
|
+
<ngt-water-effect #effect *args="[options()]" [camera]="hostEffect.camera()">
|
|
1759
2703
|
<ngtp-effect-blend-mode />
|
|
1760
2704
|
<ng-content />
|
|
1761
2705
|
</ngt-water-effect>
|
|
@@ -1766,7 +2710,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.1", ngImpor
|
|
|
1766
2710
|
hostDirectives: [{ directive: NgtpEffect, inputs: ['blendFunction', 'opacity'] }],
|
|
1767
2711
|
providers: [provideDefaultEffectOptions({ blendFunction: BlendFunction.NORMAL })],
|
|
1768
2712
|
}]
|
|
1769
|
-
}], ctorParameters: () => [] });
|
|
2713
|
+
}], ctorParameters: () => [], propDecorators: { options: [{ type: i0.Input, args: [{ isSignal: true, alias: "options", required: false }] }], effectRef: [{ type: i0.ViewChild, args: ['effect', { isSignal: true }] }] } });
|
|
1770
2714
|
|
|
1771
2715
|
/**
|
|
1772
2716
|
* Generated bundle index. Do not edit.
|