Ver código fonte

Merge pull request #19926 from WestLangley/dev_rt_stencil_default

WebGLRenderTarget: Disable stencil buffer by default
Mr.doob 5 anos atrás
pai
commit
dd7c0d7e63

+ 1 - 1
docs/api/en/renderers/WebGLCubeRenderTarget.html

@@ -42,7 +42,7 @@
 		[page:Number anisotropy] - default is *1*. See [page:Texture.anistropy]<br />
 		[page:Constant encoding] - default is [page:Textures LinearEncoding]. <br />
 		[page:Boolean depthBuffer] - default is *true*. Set this to false if you don't need it. <br />
-		[page:Boolean stencilBuffer] - default is *true*. Set this to false if you don't need it.<br /><br />
+		[page:Boolean stencilBuffer] - default is *false*. Set this to true if you need it.<br /><br />
 
 		Creates a new [name]
 		</p>

+ 2 - 2
docs/api/en/renderers/WebGLRenderTarget.html

@@ -41,7 +41,7 @@
 		[page:Number anisotropy] - default is *1*. See [page:Texture.anisotropy]<br />
 		[page:Constant encoding] - default is [page:Textures LinearEncoding]. <br />
 		[page:Boolean depthBuffer] - default is *true*. Set this to false if you don't need it. <br />
-		[page:Boolean stencilBuffer] - default is *true*. Set this to false if you don't need it.<br /><br />
+		[page:Boolean stencilBuffer] - default is *false*. Set this to true if you need it.<br /><br />
 
 		Creates a new [name]
 		</p>
@@ -85,7 +85,7 @@
 
 		<h3>[property:boolean stencilBuffer]</h3>
 		<p>
-		Renders to the stencil buffer. Default is true.
+		Renders to the stencil buffer. Default is false.
 		</p>
 
 		<h3>[property:DepthTexture depthTexture]</h3>

+ 1 - 1
docs/api/zh/renderers/WebGLCubeRenderTarget.html

@@ -39,7 +39,7 @@
 		[page:Number anisotropy] - 默认是 *1*. 参见[page:Texture.anistropy]<br />
 		[page:Constant encoding] - 默认是[page:Textures LinearEncoding]. <br />
 		[page:Boolean depthBuffer] - 默认是*true*.如果不需要就设为false <br />
-		[page:Boolean stencilBuffer] - 默认是*true*.如果不需要就设为false<br /><br />
+		[page:Boolean stencilBuffer] - default is *false*. Set this to true if you need it.<br /><br />
 
 		创建一个新[name]
 		</p>

+ 2 - 2
docs/api/zh/renderers/WebGLRenderTarget.html

@@ -37,7 +37,7 @@
 		[page:Number anisotropy] - 默认是*1*. 参见[page:Texture.anistropy]<br />
 		[page:Constant encoding] - 默认是[page:Textures LinearEncoding]. <br />
 		[page:Boolean depthBuffer] - 默认是*true*. 如果不需要就设为false <br />
-		[page:Boolean stencilBuffer] - 默认是*true*. 如果不需要就设为false <br /><br />
+		[page:Boolean stencilBuffer] - default is *false*. Set this to true if you need it.<br /><br />
 
 		创建一个新[name]
 		</p>
@@ -81,7 +81,7 @@
 
 		<h3>[property:boolean stencilBuffer]</h3>
 		<p>
-		渲染到模板缓冲区。默认true.
+		Renders to the stencil buffer. Default is false.
 		</p>
 
 		<h3>[property:DepthTexture depthTexture]</h3>

+ 1 - 1
src/renderers/WebGLRenderTarget.d.ts

@@ -13,7 +13,7 @@ export interface WebGLRenderTargetOptions {
 	type?: TextureDataType; // UnsignedByteType;
 	anisotropy?: number; // 1;
 	depthBuffer?: boolean; // true;
-	stencilBuffer?: boolean; // true;
+	stencilBuffer?: boolean; // false;
 	generateMipmaps?: boolean; // true;
 	depthTexture?: DepthTexture;
 	encoding?: TextureEncoding;

+ 1 - 1
src/renderers/WebGLRenderTarget.js

@@ -30,7 +30,7 @@ function WebGLRenderTarget( width, height, options ) {
 	this.texture.minFilter = options.minFilter !== undefined ? options.minFilter : LinearFilter;
 
 	this.depthBuffer = options.depthBuffer !== undefined ? options.depthBuffer : true;
-	this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : true;
+	this.stencilBuffer = options.stencilBuffer !== undefined ? options.stencilBuffer : false;
 	this.depthTexture = options.depthTexture !== undefined ? options.depthTexture : null;
 
 }