playcanvas / engine

JavaScript game engine built on WebGL, WebGPU, WebXR and glTF
https://playcanvas.com
MIT License
9.55k stars 1.34k forks source link

Post effect scripts error when toggling camera component enabled state #5793

Closed lucaheft closed 10 months ago

lucaheft commented 10 months ago

Description

Post effects throw errors, when camera component is disabled and enabled again. I only tested this with posteffect-brightnesscontrast.js but this propably applies to all post effects.

Error:

ASSERT FAILED:

Framebuffer creation failed with error code FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT, render target: Camera-posteffect-0

[object Object]

Shader [Shader Id 0 BrightnessContrastShader] requires texture sampler [uColorBuffer] which has not been set, while rendering [Pass:Postprocess | BrightnessContrastEffect | Pass:RenderPass-drawQuadWithShaderFramebuffer | drawQuadWithShader | QuadRender]

Steps to Reproduce

  1. Go to: https://playcanvas.com/project/1159639/overview/bug-post-effect-enabledisable
  2. Press play
  3. Disable camera component in editor
  4. Enable camera component in editor
  5. Post effect errors and gets stuck at current value
mvaligursky commented 10 months ago

most likely a duplicate of https://github.com/playcanvas/engine/issues/4787 - see the workaround there. I'll close this for now, but please reopen if this is not the same issue.