Skip to content

Commit 0a94879

Browse files
authored
BokehPass: Correctly set aspect in setSize(). (mrdoob#27063)
1 parent 6408765 commit 0a94879

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

examples/jsm/postprocessing/BokehPass.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ class BokehPass extends Pass {
2626
this.camera = camera;
2727

2828
const focus = ( params.focus !== undefined ) ? params.focus : 1.0;
29-
const aspect = ( params.aspect !== undefined ) ? params.aspect : camera.aspect;
3029
const aperture = ( params.aperture !== undefined ) ? params.aperture : 0.025;
3130
const maxblur = ( params.maxblur !== undefined ) ? params.maxblur : 1.0;
3231

@@ -54,7 +53,7 @@ class BokehPass extends Pass {
5453
bokehUniforms[ 'tDepth' ].value = this.renderTargetDepth.texture;
5554

5655
bokehUniforms[ 'focus' ].value = focus;
57-
bokehUniforms[ 'aspect' ].value = aspect;
56+
bokehUniforms[ 'aspect' ].value = camera.aspect;
5857
bokehUniforms[ 'aperture' ].value = aperture;
5958
bokehUniforms[ 'maxblur' ].value = maxblur;
6059
bokehUniforms[ 'nearClip' ].value = camera.near;
@@ -120,6 +119,8 @@ class BokehPass extends Pass {
120119

121120
setSize( width, height ) {
122121

122+
this.materialBokeh.uniforms[ 'aspect' ].value = width / height;
123+
123124
this.renderTargetDepth.setSize( width, height );
124125

125126
}

0 commit comments

Comments
 (0)