1- import { sRGBEncoding , Uniform , Vector2 , Vector4 , WebGLRenderTarget } from "three" ;
1+ import { sRGBEncoding , Uniform , Vector2 , WebGLRenderTarget } from "three" ;
22import { Resolution } from "../core" ;
33import { KernelSize } from "../enums" ;
44import { TiltShiftBlurPass } from "../passes" ;
@@ -22,7 +22,7 @@ export class TiltShiftEffect extends Effect {
2222 * @param {Number } [options.rotation=0.0] - The rotation of the focus area in radians.
2323 * @param {Number } [options.focusArea=0.4] - The relative size of the focus area.
2424 * @param {Number } [options.feather=0.3] - The softness of the focus area edges.
25- * @param {Number } [options.bias=0.06] - A blend bias .
25+ * @param {Number } [options.bias=0.06] - Deprecated .
2626 * @param {KernelSize } [options.kernelSize=KernelSize.MEDIUM] - The blur kernel size.
2727 * @param {Number } [options.resolutionScale=0.5] - The resolution scale.
2828 * @param {Number } [options.resolutionX=Resolution.AUTO_SIZE] - The horizontal resolution.
@@ -35,7 +35,6 @@ export class TiltShiftEffect extends Effect {
3535 rotation = 0.0 ,
3636 focusArea = 0.4 ,
3737 feather = 0.3 ,
38- bias = 0.06 ,
3938 kernelSize = KernelSize . MEDIUM ,
4039 resolutionScale = 0.5 ,
4140 resolutionX = Resolution . AUTO_SIZE ,
@@ -47,7 +46,7 @@ export class TiltShiftEffect extends Effect {
4746 blendFunction,
4847 uniforms : new Map ( [
4948 [ "rotation" , new Uniform ( new Vector2 ( ) ) ] ,
50- [ "maskParams" , new Uniform ( new Vector4 ( ) ) ] ,
49+ [ "maskParams" , new Uniform ( new Vector2 ( ) ) ] ,
5150 [ "map" , new Uniform ( null ) ]
5251 ] )
5352 } ) ;
@@ -76,14 +75,6 @@ export class TiltShiftEffect extends Effect {
7675
7776 this . _feather = feather ;
7877
79- /**
80- * @see {@link bias }
81- * @type {Number }
82- * @private
83- */
84-
85- this . _bias = bias ;
86-
8778 /**
8879 * A render target.
8980 *
@@ -129,21 +120,16 @@ export class TiltShiftEffect extends Effect {
129120 }
130121
131122 /**
132- * The relative offset of the focus area .
123+ * Updates the mask params .
133124 *
134125 * @private
135126 */
136127
137128 updateParams ( ) {
138129
139130 const params = this . uniforms . get ( "maskParams" ) . value ;
140- const a = Math . max ( this . focusArea - this . bias , 0.0 ) ;
141- const b = Math . max ( a - Math . max ( this . feather - this . bias , 0.0 ) , 0.0 ) ;
142-
143- params . set (
144- this . offset - a , this . offset - b ,
145- this . offset + a , this . offset + b
146- ) ;
131+ const x = Math . max ( this . focusArea - this . feather , 0.0 ) ;
132+ params . set ( this . offset - x , this . offset + x ) ;
147133
148134 }
149135
@@ -230,20 +216,11 @@ export class TiltShiftEffect extends Effect {
230216 * A blend bias.
231217 *
232218 * @type {Number }
219+ * @deprecated
233220 */
234221
235- get bias ( ) {
236-
237- return this . _bias ;
238-
239- }
240-
241- set bias ( value ) {
242-
243- this . _bias = value ;
244- this . updateParams ( ) ;
245-
246- }
222+ get bias ( ) { return 0 ; }
223+ set bias ( value ) { }
247224
248225 /**
249226 * Updates this effect.
0 commit comments