`WebGLRenderer#clear` does not always clear main framebuffer

Description of the problem

WebGLRenderer#clear does not always clear main framebuffer. When clearTarget it calls setRenderTarget and doesn’t revert back to the previous (i.e. default) one. If clear is called next, it will clear again WebGLRenderTarget provided to clearTarget, not main framebuffer as expected.

Expected behavior: clear always clears main framebuffer (canvas), while clearTarget clears provided render target.

Revelant code:

Three.js version
  • Dev
  • r79
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
  • All of them
  • Windows
  • Linux
  • Android
  • IOS
Hardware Requirements (graphics card, VR Device, …)


Author: Fantashit

1 thought on “`WebGLRenderer#clear` does not always clear main framebuffer

  1. I do not think that is a work around — it is intended behavior.

    renderer.clear() clears the currently bound framebuffer.

Comments are closed.