Description
Found during #28281
If you call copyTextureToTexture to copy data into a RenderTarget that hasn't been rendered to, yet, then nothing occurs and an error is logged:
GL_INVALID_VALUE: Offset overflows texture dimensions.
Reproduction steps
- Create a new WebGLRenderTarget
- Create a new data texture
- Copy data texture data into the render target
- Render target is still empty and a warning is logged
Code
const target = new THREE.WebGLRenderTarget( 16, 16 );
const source = new THREE.DataTexture( new Uint8Array( 16 * 16 * 4 ).fill( 255 ), 16, 16 );
// uncomment these lines initialize the render target and prevent the error for logging
// renderer.setRenderTarget( target );
// renderer.render( scene, camera );
// renderer.setRenderTarget( null );
renderer.copyTextureToTexture( new THREE.Vector2( 0, 0 ), source, target.texture );
// logs warning
Live example
https://jsfiddle.net/2yakmh60/3/
Screenshots
No response
Version
dev
Device
Desktop
Browser
Chrome
OS
MacOS
Description
Found during #28281
If you call
copyTextureToTextureto copy data into a RenderTarget that hasn't been rendered to, yet, then nothing occurs and an error is logged:Reproduction steps
Code
Live example
https://jsfiddle.net/2yakmh60/3/
Screenshots
No response
Version
dev
Device
Desktop
Browser
Chrome
OS
MacOS