@tresjs/post-processing 2.1.0 → 2.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/core/pmndrs/BloomPmndrs.vue.d.ts +1 -1
- package/dist/core/pmndrs/BrightnessContrastPmndrs.vue.d.ts +20 -0
- package/dist/core/pmndrs/ColorDepthPmndrs.vue.d.ts +20 -0
- package/dist/core/pmndrs/DepthOfFieldPmndrs.vue.d.ts +1 -1
- package/dist/core/pmndrs/DepthPickingPassPmndrs.vue.d.ts +18 -0
- package/dist/core/pmndrs/FishEyePmndrs.vue.d.ts +30 -0
- package/dist/core/pmndrs/GodRaysPmndrs.vue.d.ts +65 -0
- package/dist/core/pmndrs/GridPmndrs.vue.d.ts +20 -0
- package/dist/core/pmndrs/OutlinePmndrs.vue.d.ts +0 -3
- package/dist/core/pmndrs/composables/useEffectPmndrs.d.ts +6 -1
- package/dist/core/pmndrs/custom/fish-eye/index.d.ts +44 -0
- package/dist/core/pmndrs/index.d.ts +7 -1
- package/dist/core/three/composables/useEffect.d.ts +2 -1
- package/dist/tres-post-processing.js +810 -491
- package/dist/tres-post-processing.umd.cjs +38 -16
- package/dist/util/prop.d.ts +1 -1
- package/package.json +6 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BlendFunction, KernelSize, BloomEffect } from 'postprocessing';
|
|
2
2
|
export interface BloomPmndrsProps {
|
|
3
3
|
/**
|
|
4
|
-
* The blend function of this effect.
|
|
4
|
+
* The blend function of this effect.
|
|
5
5
|
* @default BlendFunction.SCREEN
|
|
6
6
|
* @type {BlendFunction}
|
|
7
7
|
* @memberof BloomPmndrsProps
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BlendFunction, BrightnessContrastEffect } from 'postprocessing';
|
|
2
|
+
export interface BrightnessContrastPmndrsProps {
|
|
3
|
+
/**
|
|
4
|
+
* The blend function.
|
|
5
|
+
*/
|
|
6
|
+
blendFunction?: BlendFunction;
|
|
7
|
+
/**
|
|
8
|
+
* The brightness of the effect.
|
|
9
|
+
*/
|
|
10
|
+
brightness?: number;
|
|
11
|
+
/**
|
|
12
|
+
* The contrast of the effect.
|
|
13
|
+
*/
|
|
14
|
+
contrast?: number;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: import('vue').DefineComponent<BrightnessContrastPmndrsProps, {
|
|
17
|
+
pass: import('vue').ShallowRef<import('postprocessing').EffectPass | null>;
|
|
18
|
+
effect: import('vue').ShallowRef<BrightnessContrastEffect | null>;
|
|
19
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<BrightnessContrastPmndrsProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BlendFunction, ColorDepthEffect } from 'postprocessing';
|
|
2
|
+
export interface ColorDepthPmndrsProps {
|
|
3
|
+
/**
|
|
4
|
+
* The blend function.
|
|
5
|
+
*/
|
|
6
|
+
blendFunction?: BlendFunction;
|
|
7
|
+
/**
|
|
8
|
+
* The color bit depth.
|
|
9
|
+
*/
|
|
10
|
+
bits?: number;
|
|
11
|
+
/**
|
|
12
|
+
* The opacity of the effect.
|
|
13
|
+
*/
|
|
14
|
+
opacity?: number;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: import('vue').DefineComponent<ColorDepthPmndrsProps, {
|
|
17
|
+
pass: import('vue').ShallowRef<import('postprocessing').EffectPass | null>;
|
|
18
|
+
effect: import('vue').ShallowRef<ColorDepthEffect | null>;
|
|
19
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<ColorDepthPmndrsProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
export default _default;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { BlendFunction, DepthOfFieldEffect } from 'postprocessing';
|
|
2
2
|
export interface DepthOfFieldPmndrsProps {
|
|
3
3
|
/**
|
|
4
|
-
* The blend function of this effect.
|
|
4
|
+
* The blend function of this effect.
|
|
5
5
|
*/
|
|
6
6
|
blendFunction?: BlendFunction;
|
|
7
7
|
/**
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DepthPackingStrategies } from 'three';
|
|
2
|
+
import { DepthCopyMode, DepthPickingPass } from 'postprocessing';
|
|
3
|
+
export interface DepthPickingPassPmndrsProps {
|
|
4
|
+
/**
|
|
5
|
+
* The depth packing strategy.
|
|
6
|
+
* Default: RGBADepthPacking
|
|
7
|
+
*/
|
|
8
|
+
depthPacking?: DepthPackingStrategies;
|
|
9
|
+
/**
|
|
10
|
+
* The depth copy mode.
|
|
11
|
+
* Default: DepthCopyMode.SINGLE
|
|
12
|
+
*/
|
|
13
|
+
mode?: DepthCopyMode;
|
|
14
|
+
}
|
|
15
|
+
declare const _default: import('vue').DefineComponent<DepthPickingPassPmndrsProps, {
|
|
16
|
+
pass: DepthPickingPass;
|
|
17
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<DepthPickingPassPmndrsProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
18
|
+
export default _default;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { BlendFunction } from 'postprocessing';
|
|
2
|
+
import { Vector2 } from 'three';
|
|
3
|
+
import { FishEyeEffect } from './custom/fish-eye/index';
|
|
4
|
+
export interface FishEyePmndrsProps {
|
|
5
|
+
/**
|
|
6
|
+
* The blend function for the effect.
|
|
7
|
+
* Determines how this effect blends with other effects.
|
|
8
|
+
*/
|
|
9
|
+
blendFunction?: BlendFunction;
|
|
10
|
+
/**
|
|
11
|
+
* The lens scale.
|
|
12
|
+
* A Vector2 value or an array of two numbers.
|
|
13
|
+
*/
|
|
14
|
+
lensS?: Vector2 | [number, number];
|
|
15
|
+
/**
|
|
16
|
+
* The lens factor.
|
|
17
|
+
* A Vector2 value or an array of two numbers.
|
|
18
|
+
*/
|
|
19
|
+
lensF?: Vector2 | [number, number];
|
|
20
|
+
/**
|
|
21
|
+
* The scale of the effect.
|
|
22
|
+
* A number value.
|
|
23
|
+
*/
|
|
24
|
+
scale?: number;
|
|
25
|
+
}
|
|
26
|
+
declare const _default: import('vue').DefineComponent<FishEyePmndrsProps, {
|
|
27
|
+
pass: import('vue').ShallowRef<import('postprocessing').EffectPass | null>;
|
|
28
|
+
effect: import('vue').ShallowRef<FishEyeEffect | null>;
|
|
29
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<FishEyePmndrsProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
30
|
+
export default _default;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { BlendFunction, KernelSize, GodRaysEffect } from 'postprocessing';
|
|
2
|
+
import { Mesh, Points } from 'three';
|
|
3
|
+
export interface GodRaysPmndrsProps {
|
|
4
|
+
/**
|
|
5
|
+
* The blend function of this effect.
|
|
6
|
+
*/
|
|
7
|
+
blendFunction?: BlendFunction;
|
|
8
|
+
/**
|
|
9
|
+
* The light source. Must not write depth and has to be flagged as transparent.
|
|
10
|
+
*/
|
|
11
|
+
lightSource?: Mesh | Points;
|
|
12
|
+
/**
|
|
13
|
+
* The opacity of the God Rays.
|
|
14
|
+
*/
|
|
15
|
+
opacity?: number;
|
|
16
|
+
/**
|
|
17
|
+
* The density of the light rays.
|
|
18
|
+
*/
|
|
19
|
+
density?: number;
|
|
20
|
+
/**
|
|
21
|
+
* The decay of the light rays.
|
|
22
|
+
*/
|
|
23
|
+
decay?: number;
|
|
24
|
+
/**
|
|
25
|
+
* The blur kernel size. Has no effect if blur is disabled.
|
|
26
|
+
*/
|
|
27
|
+
kernelSize?: KernelSize;
|
|
28
|
+
/**
|
|
29
|
+
* The resolution scale.
|
|
30
|
+
*/
|
|
31
|
+
resolutionScale?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Whether the god rays should be blurred to reduce artifacts.
|
|
34
|
+
*/
|
|
35
|
+
blur?: boolean;
|
|
36
|
+
/**
|
|
37
|
+
* The horizontal resolution.
|
|
38
|
+
*/
|
|
39
|
+
resolutionX?: number;
|
|
40
|
+
/**
|
|
41
|
+
* The vertical resolution.
|
|
42
|
+
*/
|
|
43
|
+
resolutionY?: number;
|
|
44
|
+
/**
|
|
45
|
+
* The weight of the light rays.
|
|
46
|
+
*/
|
|
47
|
+
weight?: number;
|
|
48
|
+
/**
|
|
49
|
+
* A constant attenuation coefficient.
|
|
50
|
+
*/
|
|
51
|
+
exposure?: number;
|
|
52
|
+
/**
|
|
53
|
+
* The number of samples per pixel.
|
|
54
|
+
*/
|
|
55
|
+
samples?: number;
|
|
56
|
+
/**
|
|
57
|
+
* An upper bound for the saturation of the overall effect.
|
|
58
|
+
*/
|
|
59
|
+
clampMax?: number;
|
|
60
|
+
}
|
|
61
|
+
declare const _default: import('vue').DefineComponent<GodRaysPmndrsProps, {
|
|
62
|
+
pass: import('vue').ShallowRef<import('postprocessing').EffectPass | null>;
|
|
63
|
+
effect: import('vue').ShallowRef<GodRaysEffect | null>;
|
|
64
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<GodRaysPmndrsProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
65
|
+
export default _default;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { BlendFunction, GridEffect } from 'postprocessing';
|
|
2
|
+
export interface GridPmndrsProps {
|
|
3
|
+
/**
|
|
4
|
+
* The blend function.
|
|
5
|
+
*/
|
|
6
|
+
blendFunction?: BlendFunction;
|
|
7
|
+
/**
|
|
8
|
+
* The scale.
|
|
9
|
+
*/
|
|
10
|
+
scale?: number;
|
|
11
|
+
/**
|
|
12
|
+
* The line width.
|
|
13
|
+
*/
|
|
14
|
+
lineWidth?: number;
|
|
15
|
+
}
|
|
16
|
+
declare const _default: import('vue').DefineComponent<GridPmndrsProps, {
|
|
17
|
+
pass: import('vue').ShallowRef<import('postprocessing').EffectPass | null>;
|
|
18
|
+
effect: import('vue').ShallowRef<GridEffect | null>;
|
|
19
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<GridPmndrsProps> & Readonly<{}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
20
|
+
export default _default;
|
|
@@ -27,9 +27,6 @@ export interface OutlinePmndrsProps {
|
|
|
27
27
|
* The number of samples used for multisample antialiasing. Requires WebGL 2.
|
|
28
28
|
*/
|
|
29
29
|
multisampling?: number;
|
|
30
|
-
/**
|
|
31
|
-
* The blend function. Use `BlendFunction.ALPHA` for dark outlines.
|
|
32
|
-
*/
|
|
33
30
|
blendFunction?: BlendFunction;
|
|
34
31
|
patternTexture?: Texture;
|
|
35
32
|
resolutionScale?: number;
|
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
import { Effect, EffectPass } from 'postprocessing';
|
|
2
2
|
import { Reactive, ShallowRef } from 'vue';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* @param newEffectFunction - A function that returns a new effect instance.
|
|
5
|
+
* @param passDependencies - A reactive object that the pass depends on (usually props). Changes to this object will trigger re-rendering.
|
|
6
|
+
* @param dependencyFieldsTriggeringRecreation - fields in passDependencies that require effect recreation when changed
|
|
7
|
+
*/
|
|
8
|
+
export declare const useEffectPmndrs: <T extends Effect, D extends Record<PropertyKey, any>>(newEffectFunction: () => T, passDependencies: Reactive<D>, dependencyFieldsTriggeringRecreation?: (keyof D)[]) => {
|
|
4
9
|
pass: ShallowRef<EffectPass | null>;
|
|
5
10
|
effect: ShallowRef<T | null>;
|
|
6
11
|
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { Vector2 } from 'three';
|
|
2
|
+
import { BlendFunction, Effect } from 'postprocessing';
|
|
3
|
+
/**
|
|
4
|
+
* FishEyeEffect - A custom effect for applying a fish-eye distortion
|
|
5
|
+
*/
|
|
6
|
+
export declare class FishEyeEffect extends Effect {
|
|
7
|
+
/**
|
|
8
|
+
* Creates a new FishEyeEffect instance.
|
|
9
|
+
*
|
|
10
|
+
* @param {object} [options] - Configuration options for the effect.
|
|
11
|
+
* @param {BlendFunction} [options.blendFunction] - Blend mode.
|
|
12
|
+
* @param {Vector2} [options.lensS] - Lens scale.
|
|
13
|
+
* @param {Vector2} [options.lensF] - Lens factor.
|
|
14
|
+
* @param {number} [options.scale] - Scale.
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
constructor({ blendFunction, lensS, lensF, scale }?: {
|
|
18
|
+
blendFunction?: BlendFunction | undefined;
|
|
19
|
+
lensS?: Vector2 | undefined;
|
|
20
|
+
lensF?: Vector2 | undefined;
|
|
21
|
+
scale?: number | undefined;
|
|
22
|
+
});
|
|
23
|
+
/**
|
|
24
|
+
* The lensS.
|
|
25
|
+
*
|
|
26
|
+
* @type {Vector2}
|
|
27
|
+
*/
|
|
28
|
+
get lensS(): any;
|
|
29
|
+
set lensS(value: any);
|
|
30
|
+
/**
|
|
31
|
+
* The lensF.
|
|
32
|
+
*
|
|
33
|
+
* @type {Vector2}
|
|
34
|
+
*/
|
|
35
|
+
get lensF(): any;
|
|
36
|
+
set lensF(value: any);
|
|
37
|
+
/**
|
|
38
|
+
* The scale.
|
|
39
|
+
*
|
|
40
|
+
* @type {number}
|
|
41
|
+
*/
|
|
42
|
+
get scale(): any;
|
|
43
|
+
set scale(value: any);
|
|
44
|
+
}
|
|
@@ -20,4 +20,10 @@ import { default as TiltShiftPmndrs, TiltShiftPmndrsProps } from './TiltShiftPmn
|
|
|
20
20
|
import { default as DotScreenPmndrs, DotScreenPmndrsProps } from './DotScreenPmndrs.vue';
|
|
21
21
|
import { default as SepiaPmndrs, SepiaPmndrsProps } from './SepiaPmndrs.vue';
|
|
22
22
|
import { default as LinocutPmndrs, LinocutPmndrsProps } from './LinocutPmndrs.vue';
|
|
23
|
-
|
|
23
|
+
import { default as DepthPickingPassPmndrs, DepthPickingPassPmndrsProps } from './DepthPickingPassPmndrs.vue';
|
|
24
|
+
import { default as GodRaysPmndrs, GodRaysPmndrsProps } from './GodRaysPmndrs.vue';
|
|
25
|
+
import { default as ColorDepthPmndrs, ColorDepthPmndrsProps } from './ColorDepthPmndrs.vue';
|
|
26
|
+
import { default as GridPmndrs, GridPmndrsProps } from './GridPmndrs.vue';
|
|
27
|
+
import { default as FishEyePmndrs, FishEyePmndrsProps } from './FishEyePmndrs.vue';
|
|
28
|
+
import { default as BrightnessContrastPmndrs, BrightnessContrastPmndrsProps } from './BrightnessContrastPmndrs.vue';
|
|
29
|
+
export { BloomPmndrs, DepthOfFieldPmndrs, EffectComposerPmndrs, GlitchPmndrs, NoisePmndrs, OutlinePmndrs, PixelationPmndrs, useEffectPmndrs, VignettePmndrs, BarrelBlurPmndrs, HueSaturationPmndrs, ToneMappingPmndrs, ChromaticAberrationPmndrs, ScanlinePmndrs, KuwaharaPmndrs, ColorAveragePmndrs, LensDistortionPmndrs, ShockWavePmndrs, TiltShiftPmndrs, DotScreenPmndrs, SepiaPmndrs, LinocutPmndrs, DepthPickingPassPmndrs, GodRaysPmndrs, ColorDepthPmndrs, GridPmndrs, FishEyePmndrs, BrightnessContrastPmndrs, BloomPmndrsProps, DepthOfFieldPmndrsProps, EffectComposerPmndrsProps, GlitchPmndrsProps, NoisePmndrsProps, OutlinePmndrsProps, PixelationPmndrsProps, VignettePmndrsProps, BarrelBlurPmndrsProps, ToneMappingPmndrsProps, ChromaticAberrationPmndrsProps, HueSaturationPmndrsProps, ScanlinePmndrsProps, KuwaharaPmndrsProps, ColorAveragePmndrsProps, LensDistortionPmndrsProps, ShockWavePmndrsProps, TiltShiftPmndrsProps, DotScreenPmndrsProps, SepiaPmndrsProps, LinocutPmndrsProps, DepthPickingPassPmndrsProps, GodRaysPmndrsProps, ColorDepthPmndrsProps, GridPmndrsProps, FishEyePmndrsProps, BrightnessContrastPmndrsProps, };
|
|
@@ -3,7 +3,8 @@ import { Reactive, ShallowRef } from 'vue';
|
|
|
3
3
|
/**
|
|
4
4
|
* @param newPassFunction - A function that returns a new pass instance.
|
|
5
5
|
* @param passDependencies - A reactive object that the pass depends on (usually props). Changes to this object will trigger re-rendering.
|
|
6
|
+
* @param dependencyFieldsTriggeringRecreation - fields in passDependencies that require effect recreation when changed
|
|
6
7
|
*/
|
|
7
|
-
export declare const useEffect: <T extends Pass
|
|
8
|
+
export declare const useEffect: <T extends Pass, D extends Record<PropertyKey, any>>(newPassFunction: () => T, passDependencies?: Reactive<D>, dependencyFieldsTriggeringRecreation?: (keyof D)[]) => {
|
|
8
9
|
pass: ShallowRef<T>;
|
|
9
10
|
};
|