forked from three-types/three-ts-types
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
change: Add new render target types for 3D and array textures
See: mrdoob/three.js#23498 ### Description - Add new classes: - `WebGL3DRenderTarget` - `WebGLArrayRenderTarget` - `Data3DTexture` - `DataArrayTexture` - Made them deprecated: - `DataTexture2DArray` - `DataTexture3D` - Removed `WebGLRenderTarget.setTexture` - Fixed related classes - Fixed related examples ### What I didn't do - changes applied to `examples/jsm/renderers/webgpu/WebGPUTextures` , since it does not exist in this repository.
- Loading branch information
Showing
16 changed files
with
160 additions
and
90 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
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 |
---|---|---|
@@ -1,13 +1,13 @@ | ||
import { DataTexture, DataTexture3D } from '../../../src/Three'; | ||
import { DataTexture, Data3DTexture } from '../../../src/Three'; | ||
import { ShaderPass } from './ShaderPass'; | ||
|
||
export interface LUTPassParameters { | ||
lut?: DataTexture | DataTexture3D; | ||
lut?: DataTexture | Data3DTexture; | ||
intensity?: number; | ||
} | ||
|
||
export class LUTPass extends ShaderPass { | ||
lut?: DataTexture | DataTexture3D; | ||
lut?: DataTexture | Data3DTexture; | ||
intensity?: number; | ||
constructor(params: LUTPassParameters); | ||
} |
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,28 @@ | ||
import { Data3DTexture } from '../textures/Data3DTexture'; | ||
import { WebGLRenderTarget } from './WebGLRenderTarget'; | ||
|
||
/** | ||
* Represents a three-dimensional render target. | ||
*/ | ||
export class WebGL3DRenderTarget extends WebGLRenderTarget { | ||
/** | ||
* Creates a new WebGL3DRenderTarget. | ||
* | ||
* @param width the width of the render target, in pixels. | ||
* @param height the height of the render target, in pixels. | ||
* @param depth the depth of the render target. | ||
*/ | ||
constructor(width: number, height: number, depth: number); | ||
|
||
/** | ||
* The depth of the render target. | ||
*/ | ||
depth: number; | ||
|
||
/** | ||
* The texture property is overwritten with an instance of {@link Data3DTexture}. | ||
*/ | ||
texture: Data3DTexture; | ||
|
||
readonly isWebGL3DRenderTarget: true; | ||
} |
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,28 @@ | ||
import { DataArrayTexture } from '../textures/DataArrayTexture'; | ||
import { WebGLRenderTarget } from './WebGLRenderTarget'; | ||
|
||
/** | ||
* This type of render target represents an array of textures. | ||
*/ | ||
export class WebGLArrayRenderTarget extends WebGLRenderTarget { | ||
/** | ||
* Creates a new WebGLArrayRenderTarget. | ||
* | ||
* @param width the width of the render target, in pixels. | ||
* @param height the height of the render target, in pixels. | ||
* @param depth the depth/layer count of the render target. | ||
*/ | ||
constructor(width: number, height: number, depth: number); | ||
|
||
/** | ||
* The depth of the render target. | ||
*/ | ||
depth: number; | ||
|
||
/** | ||
* The texture property is overwritten with an instance of {@link DataArrayTexture}. | ||
*/ | ||
texture: DataArrayTexture; | ||
|
||
readonly isWebGLArrayRenderTarget: true; | ||
} |
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
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,33 @@ | ||
import { Texture } from './Texture'; | ||
import { TextureFilter } from '../constants'; | ||
|
||
export class Data3DTexture extends Texture { | ||
constructor(data: BufferSource, width: number, height: number, depth: number); | ||
|
||
/** | ||
* @default THREE.NearestFilter | ||
*/ | ||
magFilter: TextureFilter; | ||
|
||
/** | ||
* @default THREE.NearestFilter | ||
*/ | ||
minFilter: TextureFilter; | ||
|
||
/** | ||
* @default THREE.ClampToEdgeWrapping | ||
*/ | ||
wrapR: boolean; | ||
|
||
/** | ||
* @default false | ||
*/ | ||
flipY: boolean; | ||
|
||
/** | ||
* @default false | ||
*/ | ||
generateMipmaps: boolean; | ||
|
||
readonly isData3DTexture: true; | ||
} |
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,33 @@ | ||
import { Texture } from './Texture'; | ||
import { TextureFilter } from '../constants'; | ||
|
||
export class DataArrayTexture extends Texture { | ||
constructor(data?: BufferSource, width?: number, height?: number, depth?: number); | ||
|
||
/** | ||
* @default THREE.NearestFilter | ||
*/ | ||
magFilter: TextureFilter; | ||
|
||
/** | ||
* @default THREE.NearestFilter | ||
*/ | ||
minFilter: TextureFilter; | ||
|
||
/** | ||
* @default THREE.ClampToEdgeWrapping | ||
*/ | ||
wrapR: boolean; | ||
|
||
/** | ||
* @default false | ||
*/ | ||
flipY: boolean; | ||
|
||
/** | ||
* @default false | ||
*/ | ||
generateMipmaps: boolean; | ||
|
||
readonly isDataArrayTexture: true; | ||
} |
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,33 +1,6 @@ | ||
import { Texture } from './Texture'; | ||
import { TextureFilter } from '../constants'; | ||
import { DataArrayTexture } from './DataArrayTexture'; | ||
|
||
export class DataTexture2DArray extends Texture { | ||
constructor(data?: BufferSource, width?: number, height?: number, depth?: number); | ||
|
||
/** | ||
* @default THREE.NearestFilter | ||
*/ | ||
magFilter: TextureFilter; | ||
|
||
/** | ||
* @default THREE.NearestFilter | ||
*/ | ||
minFilter: TextureFilter; | ||
|
||
/** | ||
* @default THREE.ClampToEdgeWrapping | ||
*/ | ||
wrapR: boolean; | ||
|
||
/** | ||
* @default false | ||
*/ | ||
flipY: boolean; | ||
|
||
/** | ||
* @default false | ||
*/ | ||
generateMipmaps: boolean; | ||
|
||
readonly isDataTexture2DArray: true; | ||
} | ||
/** | ||
* @deprecated THREE.DataTexture2DArray has been renamed to DataArrayTexture. | ||
*/ | ||
export class DataTexture2DArray extends DataArrayTexture {} |
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,33 +1,6 @@ | ||
import { Texture } from './Texture'; | ||
import { TextureFilter } from '../constants'; | ||
import { Data3DTexture } from './Data3DTexture'; | ||
|
||
export class DataTexture3D extends Texture { | ||
constructor(data: BufferSource, width: number, height: number, depth: number); | ||
|
||
/** | ||
* @default THREE.NearestFilter | ||
*/ | ||
magFilter: TextureFilter; | ||
|
||
/** | ||
* @default THREE.NearestFilter | ||
*/ | ||
minFilter: TextureFilter; | ||
|
||
/** | ||
* @default THREE.ClampToEdgeWrapping | ||
*/ | ||
wrapR: boolean; | ||
|
||
/** | ||
* @default false | ||
*/ | ||
flipY: boolean; | ||
|
||
/** | ||
* @default false | ||
*/ | ||
generateMipmaps: boolean; | ||
|
||
readonly isDataTexture3D: true; | ||
} | ||
/** | ||
* @deprecated THREE.DataTexture3D has been renamed to Data3DTexture. | ||
*/ | ||
export class DataTexture3D extends Data3DTexture {} |
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
Oops, something went wrong.