-
-
Notifications
You must be signed in to change notification settings - Fork 36.2k
Description
Description
Cloning a RenderTarget does not create a new Source for the new DepthTexture.
I've encountered this bug while using EffectComposer. If you pass a RenderTarget with depthTexture into EffectComposer, it will clone the depthTexture, but will not update its Source. This results in GL_INVALID_OPERATION: Feedback loop formed between Framebuffer and active Texture if you use passes that use depth texture.
I've found two very similar issues: one two
Reproduction steps
- Create RenderTarget
- Create DepthTexture for ithe RenderTarget
- Clone RenderTarget
- Compare sources of depth textures of new and old RenderTargets
Code
const fbo = new THREE.WebGLRenderTarget(640, 480);
fbo.texture.format = THREE.RGBFormat;
fbo.texture.generateMipmaps = false;
fbo.depthBuffer = true;
fbo.depthTexture = new THREE.DepthTexture(640, 480);
fbo.depthTexture.format = THREE.DepthFormat;
console.log(fbo.depthTexture.source);
console.log(fbo.depthTexture.clone().source);See jsfiddle for the example where that breaks EffectComposer
Live example
https://jsfiddle.net/teu61qyj/3/
P.S. jsfiddle does not print the feedback error for me, but the rendering still breaks
Screenshots
No response
Version
r173
Device
Desktop
Browser
Chrome
OS
Windows
Mugen87