Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WebGLRenderer: Allow for copying 2d targets to and from layers of 3d textures #1355

Merged
merged 2 commits into from
Nov 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 12 additions & 7 deletions types/three/src/renderers/WebGLRenderer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -431,27 +431,32 @@ export class WebGLRenderer implements Renderer {
copyFramebufferToTexture(texture: Texture, position?: Vector2 | null, level?: number): void;

/**
* Copies the pixels of a texture in the bounds `srcRegion` in the destination texture starting from the given
* position. The `depthTexture` and `texture` property of render targets are supported as well.
* Copies the pixels of a texture in the bounds [srcRegion]{@link Box3} in the destination texture starting from the
* given position. 2D Texture, 3D Textures, or a mix of the two can be used as source and destination texture
* arguments for copying between layers of 3d textures
*
* The `depthTexture` and `texture` property of render targets are supported as well.
*
* When using render target textures as `srcTexture` and `dstTexture`, you must make sure both render targets are
* intitialized e.g. via {@link .initRenderTarget}().
* initialized e.g. via {@link .initRenderTarget}().
*
* @param srcTexture Specifies the source texture.
* @param dstTexture Specifies the destination texture.
* @param srcRegion Specifies the bounds
* @param dstPosition Specifies the pixel offset into the dstTexture where the copy will occur.
* @param level Specifies the destination mipmap level of the texture.
* @param dstLevel Specifies the destination mipmap level of the texture.
*/
copyTextureToTexture(
srcTexture: Texture,
dstTexture: Texture,
srcRegion?: Box2 | null,
dstPosition?: Vector2 | null,
level?: number,
srcRegion?: Box2 | Box3 | null,
dstPosition?: Vector2 | Vector3 | null,
dstLevel?: number,
): void;

/**
* @deprecated Use "copyTextureToTexture" instead.
*
* Copies the pixels of a texture in the bounds `srcRegion` in the destination texture starting from the given
* position. The `depthTexture` and `texture` property of 3D render targets are supported as well.
*
Expand Down
Loading