Skip to content

Commit 1aeaf82

Browse files
committed
feat: add effects
1 parent 7c5e03e commit 1aeaf82

File tree

24 files changed

+549
-31
lines changed

24 files changed

+549
-31
lines changed

libs/angular-three-postprocessing/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
"@angular-eslint/directive-class-suffix": "off",
1010
"@angular-eslint/component-selector": "off",
1111
"@angular-eslint/component-class-suffix": "off",
12+
"@angular-eslint/no-inputs-metadata-property": "off",
13+
"@angular-eslint/no-outputs-metadata-property": "off",
14+
"@angular-eslint/no-output-native": "off",
1215
"@typescript-eslint/no-empty-function": "off",
1316
"@typescript-eslint/ban-ts-comment": "off",
1417
"@typescript-eslint/no-explicit-any": "off",
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# angular-three-postprocessing/effects
2+
3+
Secondary entry point of `angular-three-postprocessing`. It can be used by importing from `angular-three-postprocessing/effects`.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"lib": {
3+
"entryFile": "src/index.ts"
4+
}
5+
}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
export * from './lib/bloom/bloom';
2+
export * from './lib/brightness-contrast/brightness-contrast';
3+
export * from './lib/color-depth/color-depth';
4+
export * from './lib/depth/depth';
5+
export * from './lib/dot-screen/dot-screen';
6+
export * from './lib/hue-saturation/hue-saturation';
7+
export * from './lib/lut/lut';
8+
export * from './lib/noise/noise';
9+
export * from './lib/scanline/scanline';
10+
export * from './lib/sepia/sepia';
11+
export * from './lib/ssao/ssao';
12+
export * from './lib/tilt-shift/tilt-shift';
13+
export * from './lib/tone-mapping/tone-mapping';
14+
export * from './lib/vignette/vignette';
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgtArgs } from 'angular-three';
3+
import { NgtpEffect } from 'angular-three-postprocessing';
4+
import { BlendFunction, BloomEffect } from 'postprocessing';
5+
6+
@Component({
7+
selector: 'ngtp-bloom',
8+
standalone: true,
9+
template: `
10+
<ngt-primitive *args="[get('effect')]" ngtCompound />
11+
`,
12+
imports: [NgtArgs],
13+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
14+
inputs: [
15+
'mipmapBlur',
16+
'luminanceThreshold',
17+
'luminanceSmoothing',
18+
'intensity',
19+
'resolutionScale',
20+
'resolutionX',
21+
'resolutionY',
22+
'width',
23+
'height',
24+
'kernelSize',
25+
],
26+
})
27+
export class NgtpBloom extends NgtpEffect<BloomEffect> {
28+
override get effectConstructor() {
29+
return BloomEffect;
30+
}
31+
32+
override defaultBlendMode: BlendFunction = BlendFunction.ADD;
33+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgtArgs } from 'angular-three';
3+
import { NgtpEffect } from 'angular-three-postprocessing';
4+
import { BrightnessContrastEffect } from 'postprocessing';
5+
6+
@Component({
7+
selector: 'ngtp-brightness-contrast',
8+
standalone: true,
9+
template: `
10+
<ngt-primitive *args="[get('effect')]" ngtCompound />
11+
`,
12+
imports: [NgtArgs],
13+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
14+
inputs: ['brightness', 'contrast'],
15+
})
16+
export class NgtpBrightnessContrast extends NgtpEffect<BrightnessContrastEffect> {
17+
override get effectConstructor() {
18+
return BrightnessContrastEffect;
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgtArgs } from 'angular-three';
3+
import { NgtpEffect } from 'angular-three-postprocessing';
4+
import { ColorDepthEffect } from 'postprocessing';
5+
6+
@Component({
7+
selector: 'ngtp-color-depth',
8+
standalone: true,
9+
template: `
10+
<ngt-primitive *args="[get('effect')]" ngtCompound />
11+
`,
12+
imports: [NgtArgs],
13+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
14+
inputs: ['bits'],
15+
})
16+
export class NgtpColorDepth extends NgtpEffect<ColorDepthEffect> {
17+
override get effectConstructor() {
18+
return ColorDepthEffect;
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgtArgs } from 'angular-three';
3+
import { NgtpEffect } from 'angular-three-postprocessing';
4+
import { DepthEffect } from 'postprocessing';
5+
6+
@Component({
7+
selector: 'ngtp-depth',
8+
standalone: true,
9+
template: `
10+
<ngt-primitive *args="[get('effect')]" ngtCompound />
11+
`,
12+
imports: [NgtArgs],
13+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
14+
inputs: ['inverted'],
15+
})
16+
export class NgtpDepth extends NgtpEffect<DepthEffect> {
17+
override get effectConstructor() {
18+
return DepthEffect;
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgtArgs } from 'angular-three';
3+
import { NgtpEffect } from 'angular-three-postprocessing';
4+
import { DotScreenEffect } from 'postprocessing';
5+
6+
@Component({
7+
selector: 'ngtp-dot-screen',
8+
standalone: true,
9+
template: `
10+
<ngt-primitive *args="[get('effect')]" ngtCompound />
11+
`,
12+
imports: [NgtArgs],
13+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
14+
inputs: ['angle', 'scale'],
15+
})
16+
export class NgtpDotScreen extends NgtpEffect<DotScreenEffect> {
17+
override get effectConstructor() {
18+
return DotScreenEffect;
19+
}
20+
}
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import { Component, CUSTOM_ELEMENTS_SCHEMA } from '@angular/core';
2+
import { NgtArgs } from 'angular-three';
3+
import { NgtpEffect } from 'angular-three-postprocessing';
4+
import { HueSaturationEffect } from 'postprocessing';
5+
6+
@Component({
7+
selector: 'ngtp-hue-saturation',
8+
standalone: true,
9+
template: `
10+
<ngt-primitive *args="[get('effect')]" ngtCompound />
11+
`,
12+
imports: [NgtArgs],
13+
schemas: [CUSTOM_ELEMENTS_SCHEMA],
14+
inputs: ['hue', 'saturation'],
15+
})
16+
export class NgtpHueSaturation extends NgtpEffect<HueSaturationEffect> {
17+
override get effectConstructor() {
18+
return HueSaturationEffect;
19+
}
20+
}

0 commit comments

Comments
 (0)