Selaa lähdekoodia

WebGPURenderer: Clean up.

Mugen87 4 vuotta sitten
vanhempi
commit
02282931d0
1 muutettua tiedostoa jossa 4 lisäystä ja 1 poistoa
  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 );