-
-
Notifications
You must be signed in to change notification settings - Fork 155
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Core: WebGLRenderTarget extends RenderTarget
- Loading branch information
1 parent
91176c1
commit e415d19
Showing
3 changed files
with
82 additions
and
73 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
import { Vector4 } from '../math/Vector4.js'; | ||
import { Texture } from '../textures/Texture.js'; | ||
import { DepthTexture } from '../textures/DepthTexture.js'; | ||
import { EventDispatcher } from './EventDispatcher.js'; | ||
import { | ||
Wrapping, | ||
TextureDataType, | ||
TextureEncoding, | ||
MinificationTextureFilter, | ||
MagnificationTextureFilter, | ||
ColorSpace, | ||
} from '../constants.js'; | ||
|
||
export interface RenderTargetOptions { | ||
wrapS?: Wrapping | undefined; | ||
wrapT?: Wrapping | undefined; | ||
magFilter?: MagnificationTextureFilter | undefined; | ||
minFilter?: MinificationTextureFilter | undefined; | ||
generateMipmaps?: boolean | undefined; // true; | ||
format?: number | undefined; // RGBAFormat; | ||
type?: TextureDataType | undefined; // UnsignedByteType; | ||
anisotropy?: number | undefined; // 1; | ||
colorSpace?: ColorSpace | undefined; | ||
depthBuffer?: boolean | undefined; // true; | ||
stencilBuffer?: boolean | undefined; // false; | ||
depthTexture?: DepthTexture | undefined; | ||
/** | ||
* Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**. | ||
* @default 0 | ||
*/ | ||
samples?: number; | ||
/** @deprecated Use 'colorSpace' in three.js r152+. */ | ||
encoding?: TextureEncoding | undefined; | ||
} | ||
|
||
export class RenderTarget<TTexture extends Texture | Texture[] = Texture> extends EventDispatcher { | ||
constructor(width?: number, height?: number, options?: RenderTargetOptions); | ||
|
||
readonly isRenderTarget: true; | ||
|
||
width: number; | ||
height: number; | ||
depth: number; | ||
|
||
scissor: Vector4; | ||
/** | ||
* @default false | ||
*/ | ||
scissorTest: boolean; | ||
viewport: Vector4; | ||
texture: TTexture; | ||
|
||
/** | ||
* @default true | ||
*/ | ||
depthBuffer: boolean; | ||
|
||
/** | ||
* @default true | ||
*/ | ||
stencilBuffer: boolean; | ||
|
||
/** | ||
* @default null | ||
*/ | ||
depthTexture: DepthTexture; | ||
|
||
/** | ||
* Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**. | ||
* @default 0 | ||
*/ | ||
samples: number; | ||
|
||
setSize(width: number, height: number, depth?: number): void; | ||
clone(): this; | ||
copy(source: RenderTarget): this; | ||
dispose(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,78 +1,8 @@ | ||
import { Vector4 } from '../math/Vector4.js'; | ||
import { Texture } from '../textures/Texture.js'; | ||
import { DepthTexture } from '../textures/DepthTexture.js'; | ||
import { EventDispatcher } from '../core/EventDispatcher.js'; | ||
import { | ||
Wrapping, | ||
TextureDataType, | ||
TextureEncoding, | ||
MinificationTextureFilter, | ||
MagnificationTextureFilter, | ||
ColorSpace, | ||
} from '../constants.js'; | ||
import { RenderTarget, RenderTargetOptions } from '../core/RenderTarget.js'; | ||
|
||
export interface WebGLRenderTargetOptions { | ||
wrapS?: Wrapping | undefined; | ||
wrapT?: Wrapping | undefined; | ||
magFilter?: MagnificationTextureFilter | undefined; | ||
minFilter?: MinificationTextureFilter | undefined; | ||
generateMipmaps?: boolean | undefined; // true; | ||
format?: number | undefined; // RGBAFormat; | ||
type?: TextureDataType | undefined; // UnsignedByteType; | ||
anisotropy?: number | undefined; // 1; | ||
colorSpace?: ColorSpace | undefined; | ||
depthBuffer?: boolean | undefined; // true; | ||
stencilBuffer?: boolean | undefined; // false; | ||
depthTexture?: DepthTexture | undefined; | ||
/** | ||
* Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**. | ||
* @default 0 | ||
*/ | ||
samples?: number; | ||
/** @deprecated Use 'colorSpace' in three.js r152+. */ | ||
encoding?: TextureEncoding | undefined; | ||
} | ||
|
||
export class WebGLRenderTarget<TTexture extends Texture | Texture[] = Texture> extends EventDispatcher { | ||
constructor(width?: number, height?: number, options?: WebGLRenderTargetOptions); | ||
export class WebGLRenderTarget<TTexture extends Texture | Texture[] = Texture> extends RenderTarget<TTexture> { | ||
constructor(width?: number, height?: number, options?: RenderTargetOptions); | ||
|
||
readonly isWebGLRenderTarget: true; | ||
|
||
width: number; | ||
height: number; | ||
depth: number; | ||
|
||
scissor: Vector4; | ||
/** | ||
* @default false | ||
*/ | ||
scissorTest: boolean; | ||
viewport: Vector4; | ||
texture: TTexture; | ||
|
||
/** | ||
* @default true | ||
*/ | ||
depthBuffer: boolean; | ||
|
||
/** | ||
* @default true | ||
*/ | ||
stencilBuffer: boolean; | ||
|
||
/** | ||
* @default null | ||
*/ | ||
depthTexture: DepthTexture; | ||
|
||
/** | ||
* Defines the count of MSAA samples. Can only be used with WebGL 2. Default is **0**. | ||
* @default 0 | ||
*/ | ||
samples: number; | ||
|
||
setSize(width: number, height: number, depth?: number): void; | ||
clone(): this; | ||
copy(source: WebGLRenderTarget): this; | ||
dispose(): void; | ||
} |