Skip to content

Commit f27c0e8

Browse files
author
Trygve Wastvedt
authored
SAOPass: Fix depthTexture initialization. (#22502)
* Fix depthTexture initialization * Don't reassign constructor argument.
1 parent 3877bba commit f27c0e8

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

examples/jsm/postprocessing/SAOPass.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ import { UnpackDepthRGBAShader } from '../shaders/UnpackDepthRGBAShader.js';
3232

3333
class SAOPass extends Pass {
3434

35-
constructor( scene, camera, depthTexture, useNormals, resolution ) {
35+
constructor( scene, camera, useDepthTexture, useNormals, resolution ) {
3636

3737
super();
3838

@@ -42,7 +42,7 @@ class SAOPass extends Pass {
4242
this.clear = true;
4343
this.needsSwap = false;
4444

45-
this.supportsDepthTextureExtension = ( depthTexture !== undefined ) ? depthTexture : false;
45+
this.supportsDepthTextureExtension = ( useDepthTexture !== undefined ) ? useDepthTexture : false;
4646
this.supportsNormalTexture = ( useNormals !== undefined ) ? useNormals : false;
4747

4848
this.originalClearColor = new Color();
@@ -78,10 +78,12 @@ class SAOPass extends Pass {
7878
format: RGBAFormat
7979
} );
8080
this.depthRenderTarget = this.normalRenderTarget.clone();
81+
82+
let depthTexture;
8183

8284
if ( this.supportsDepthTextureExtension ) {
8385

84-
const depthTexture = new DepthTexture();
86+
depthTexture = new DepthTexture();
8587
depthTexture.type = UnsignedShortType;
8688

8789
this.beautyRenderTarget.depthTexture = depthTexture;

0 commit comments

Comments
 (0)