PostEffect renderTarget lost after camera component disabled

Hi all,

I’m currently using addEffect to add a post effect on a camera. I noticed some unexpected behavior when disabling and re-enabling the camera component on the entity.

When I disable the camera component, it seems to trigger the this.postEffects.disable() method, which internally calls _destroyOffscreenTarget(), destroying the RenderTarget.

However, when I re-enable the camera component, its this.postEffects.enable() function doesn’t recreate the render target. As a result, the PostEffectQueue ends up missing its colorBuffer inside the _sourceTarget.

I just want to confirm if my understanding of the flow is correct. Is this expected behavior? :thinking:

Thanks in advance!

Could be related to this issue:

If it is, see the workaround mentioned.

1 Like

Yes, it’s the same situation as in the link.
I’ll try the workaround mentioned in the comment. Thank you!