浏览代码

WebGPURenderer: Clean up.

Mugen87 4 年之前
父节点
当前提交
02282931d0
共有 1 个文件被更改,包括 4 次插入1 次删除
  1. 4 1
      examples/jsm/renderers/webgpu/WebGPURenderer.js

+ 4 - 1
examples/jsm/renderers/webgpu/WebGPURenderer.js

@@ -616,7 +616,10 @@ class WebGPURenderer {
 					if ( object.layers.test( camera2.layers ) ) {
 
 						const vp = camera2.viewport;
-						passEncoder.setViewport( vp.x, vp.y, vp.width, vp.height, 0, 1 );
+						const minDepth = ( vp.minDepth === undefined ) ? 0 : vp.minDepth;
+						const maxDepth = ( vp.maxDepth === undefined ) ? 1 : vp.maxDepth;
+
+						passEncoder.setViewport( vp.x, vp.y, vp.width, vp.height, minDepth, maxDepth );
 
 						this._renderObject( object, passEncoder );