Преглед на файлове

SSAARender: Add property to control the stencil buffer. (#29082)

* add an option for stencil buffer in SSAARender

* added semicolon

* remove constructor signature

---------

Co-authored-by: gdu041 <guorong@outerlabs.io>
awe-3d преди 1 година
родител
ревизия
dbc9b46f84
променени са 1 файла, в които са добавени 3 реда и са изтрити 1 реда
  1. 3 1
      examples/jsm/postprocessing/SSAARenderPass.js

+ 3 - 1
examples/jsm/postprocessing/SSAARenderPass.js

@@ -31,6 +31,8 @@ class SSAARenderPass extends Pass {
 		this.sampleLevel = 4; // specified as n, where the number of samples is 2^n, so sampleLevel = 4, is 2^4 samples, 16.
 		this.unbiased = true;
 
+		this.stencilBuffer = false;
+
 		// as we need to clear the buffer in this pass, clearColor must be set to something, defaults to black.
 		this.clearColor = ( clearColor !== undefined ) ? clearColor : 0x000000;
 		this.clearAlpha = ( clearAlpha !== undefined ) ? clearAlpha : 0;
@@ -79,7 +81,7 @@ class SSAARenderPass extends Pass {
 
 		if ( ! this.sampleRenderTarget ) {
 
-			this.sampleRenderTarget = new WebGLRenderTarget( readBuffer.width, readBuffer.height, { type: HalfFloatType } );
+			this.sampleRenderTarget = new WebGLRenderTarget( readBuffer.width, readBuffer.height, { type: HalfFloatType, stencilBuffer: this.stencilBuffer } );
 			this.sampleRenderTarget.texture.name = 'SSAARenderPass.sample';
 
 		}

粤ICP备19079148号