Skip to content

WebGLBackend: copyTextureToTexture doesn't copy all layers of 3D render targets #31807

@shotamatsuda

Description

@shotamatsuda

Description

In WebGL fallback, copyTextureToTexture doesn't copy all layers of 3D render target textures.

I noticed the implementation of copyTextureToTexture in WebGLBackend deviates from the one in WebGLRenderer. I can make a PR if those can be made the same (there are a couple of differences in the conditionals which I don't fully understand).

Reproduction steps

  1. Copy a 3D render target texture to another 3D render target texture using copyTextureToTexture in WebGL fallback.

Code

const rt1 = new RenderTarget3D(size, size, size)
// Draw the contents of "rt1"

const rt2 = new RenderTarget3D(size, size, size)
renderer.setRenderTarget(rt2)
void renderer.clear()
renderer.setRenderTarget(null)

renderer.copyTextureToTexture(
  rt1.texture,
  rt2.texture,
  new Box3(new Vector3(), new Vector3().setScalar(size))
)

Live example

https://jsfiddle.net/shotamatsuda/xu8zs0g2/

Screenshots

Image

Version

r179

Device

Desktop

Browser

Chrome

OS

MacOS

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions