MCPcopy Create free account
hub / github.com/pmndrs/postprocessing / TiltShiftEffect

Class TiltShiftEffect

src/effects/TiltShiftEffect.js:14–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12 */
13
14export class TiltShiftEffect extends Effect {
15
16 /**
17 * Constructs a new tilt shift Effect
18 *
19 * @param {Object} [options] - The options.
20 * @param {BlendFunction} [options.blendFunction] - The blend function of this effect.
21 * @param {Number} [options.offset=0.0] - The relative offset of the focus area.
22 * @param {Number} [options.rotation=0.0] - The rotation of the focus area in radians.
23 * @param {Number} [options.focusArea=0.4] - The relative size of the focus area.
24 * @param {Number} [options.feather=0.3] - The softness of the focus area edges.
25 * @param {Number} [options.bias=0.06] - Deprecated.
26 * @param {KernelSize} [options.kernelSize=KernelSize.MEDIUM] - The blur kernel size.
27 * @param {Number} [options.resolutionScale=0.5] - The resolution scale.
28 * @param {Number} [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.
29 * @param {Number} [options.resolutionY=Resolution.AUTO_SIZE] - The vertical resolution.
30 */
31
32 constructor({
33 blendFunction,
34 offset = 0.0,
35 rotation = 0.0,
36 focusArea = 0.4,
37 feather = 0.3,
38 kernelSize = KernelSize.MEDIUM,
39 resolutionScale = 0.5,
40 resolutionX = Resolution.AUTO_SIZE,
41 resolutionY = Resolution.AUTO_SIZE
42 } = {}) {
43
44 super("TiltShiftEffect", fragmentShader, {
45 vertexShader,
46 blendFunction,
47 uniforms: new Map([
48 ["rotation", new Uniform(new Vector2())],
49 ["maskParams", new Uniform(new Vector2())],
50 ["map", new Uniform(null)]
51 ])
52 });
53
54 /**
55 * @see {@link offset}
56 * @type {Number}
57 * @private
58 */
59
60 this._offset = offset;
61
62 /**
63 * @see {@link focusArea}
64 * @type {Number}
65 * @private
66 */
67
68 this._focusArea = focusArea;
69
70 /**
71 * @see {@link feather}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…