未验证 提交 c0704df3 编写于 作者: M Mr.doob 提交者: GitHub

Merge pull request #18300 from WestLangley/dev_cube_rt_signature

WebGLCubeRenderTarget: simplify constructor signature
......@@ -24,10 +24,9 @@
<h2>Constructor</h2>
<h3>[name]([param:Number width], [param:Number height], [param:Object options])</h3>
<h3>[name]([param:Number size], param:Object options])</h3>
<p>
[page:Float width] - The width of the renderTarget. <br />
[page:Float height] - The height of the renderTarget. <br />
[page:Float size] - the size, in pixels. <br />
options - (optional) object that holds texture parameters for an auto-generated target
texture and depthBuffer/stencilBuffer booleans.
......
......@@ -24,10 +24,9 @@
<h2>构造器</h2>
<h3>[name]([param:Number width], [param:Number height], [param:Object options])</h3>
<h3>[name]([param:Number size], [param:Object options])</h3>
<p>
[page:Float width] - renderTarget的宽度 <br />
[page:Float height] - renderTarget的高度 <br />
[page:Float size] - the size, in pixels. <br />
options - (可选)一个保存着自动生成的目标纹理的纹理参数以及表示是否使用深度缓存/模板缓存的布尔值的对象。
有关纹理参数的说明,请参阅[page:Texture Texture]. 以下是合理选项:<br /><br />
......
......@@ -53,7 +53,7 @@
magFilter: THREE.LinearFilter
};
scene.background = new THREE.WebGLCubeRenderTarget( 1024, 1024, options ).fromEquirectangularTexture( renderer, texture );
scene.background = new THREE.WebGLCubeRenderTarget( 1024, options ).fromEquirectangularTexture( renderer, texture );
//
......
......@@ -1796,8 +1796,8 @@ Object.defineProperties( WebGLShadowMap.prototype, {
export function WebGLRenderTargetCube( width, height, options ) {
console.warn( 'THREE.WebGLRenderTargetCube has been renamed to WebGLCubeRenderTarget.' );
return new WebGLCubeRenderTarget( width, height, options );
console.warn( 'THREE.WebGLRenderTargetCube( width, height, options ) is now WebGLCubeRenderTarget( size, options ).' );
return new WebGLCubeRenderTarget( width, options );
}
......
......@@ -51,7 +51,7 @@ function CubeCamera( near, far, cubeResolution, options ) {
options = options || { format: RGBFormat, magFilter: LinearFilter, minFilter: LinearFilter };
this.renderTarget = new WebGLCubeRenderTarget( cubeResolution, cubeResolution, options );
this.renderTarget = new WebGLCubeRenderTarget( cubeResolution, options );
this.renderTarget.texture.name = "CubeCamera";
this.update = function ( renderer, scene ) {
......
......@@ -5,8 +5,7 @@ import { Texture } from './../textures/Texture';
export class WebGLCubeRenderTarget extends WebGLRenderTarget {
constructor(
width: number,
height: number,
size: number,
options?: WebGLRenderTargetOptions
);
......
......@@ -12,9 +12,17 @@ import { CubeCamera } from '../cameras/CubeCamera.js';
* @author WestLangley / http://github.com/WestLangley
*/
function WebGLCubeRenderTarget( width, height, options ) {
function WebGLCubeRenderTarget( size, options, dummy ) {
WebGLRenderTarget.call( this, width, height, options );
if ( Number.isInteger( options ) ) {
console.warn( 'THREE.WebGLCubeRenderTarget: constructor signature is now WebGLCubeRenderTarget( size, options )' );
options = dummy;
}
WebGLRenderTarget.call( this, size, size, options );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册