* Constructs a new tilt shift Effect * * @param {Object} [options] - The options. * @param {BlendFunction} [options.blendFunction] - The blend function of this effect. * @param {Number} [options.offset=0.0] - The relative offset of the focus area. * @param {Number} [options.rotation=0.0] -
({
blendFunction,
offset = 0.0,
rotation = 0.0,
focusArea = 0.4,
feather = 0.3,
kernelSize = KernelSize.MEDIUM,
resolutionScale = 0.5,
resolutionX = Resolution.AUTO_SIZE,
resolutionY = Resolution.AUTO_SIZE
} = {})
| 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} |
| 72 | * @type {Number} |
| 73 | * @private |
| 74 | */ |
| 75 | |
| 76 | this._feather = feather; |
| 77 | |
| 78 | /** |
| 79 | * A render target. |
| 80 | * |
| 81 | * @type {WebGLRenderTarget} |
| 82 | * @private |
| 83 | */ |
| 84 | |
| 85 | this.renderTarget = new WebGLRenderTarget(1, 1, { depthBuffer: false }); |
| 86 | this.renderTarget.texture.name = "TiltShift.Target"; |
| 87 | this.uniforms.get("map").value = this.renderTarget.texture; |
| 88 | |
| 89 | /** |
nothing calls this directly
no test coverage detected