未验证 提交 f27c0e8d 编写于 作者: T Trygve Wastvedt 提交者: GitHub

SAOPass: Fix depthTexture initialization. (#22502)

* Fix depthTexture initialization

* Don't reassign constructor argument.
上级 3877bba9
......@@ -32,7 +32,7 @@ import { UnpackDepthRGBAShader } from '../shaders/UnpackDepthRGBAShader.js';
class SAOPass extends Pass {
constructor( scene, camera, depthTexture, useNormals, resolution ) {
constructor( scene, camera, useDepthTexture, useNormals, resolution ) {
super();
......@@ -42,7 +42,7 @@ class SAOPass extends Pass {
this.clear = true;
this.needsSwap = false;
this.supportsDepthTextureExtension = ( depthTexture !== undefined ) ? depthTexture : false;
this.supportsDepthTextureExtension = ( useDepthTexture !== undefined ) ? useDepthTexture : false;
this.supportsNormalTexture = ( useNormals !== undefined ) ? useNormals : false;
this.originalClearColor = new Color();
......@@ -78,10 +78,12 @@ class SAOPass extends Pass {
format: RGBAFormat
} );
this.depthRenderTarget = this.normalRenderTarget.clone();
let depthTexture;
if ( this.supportsDepthTextureExtension ) {
const depthTexture = new DepthTexture();
depthTexture = new DepthTexture();
depthTexture.type = UnsignedShortType;
this.beautyRenderTarget.depthTexture = depthTexture;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册