Setting clearColor to black doesn’t work if sprites are in scene

Description of the problem

If Sprites are in the scene, the clear color cannot be changed back to black

http://jsfiddle.net/ak35o645/7/

uncomment out the //scene.add( sprite ); to see bug

Three.js version
  • [ X ] Dev
  • [ X ] r84
Browser
  • All of them
  • Chrome
  • Firefox
  • Internet Explorer
OS
  • All of them
  • Windows
  • macOS
  • Linux
  • Android
  • iOS
Hardware Requirements (graphics card, VR Device, …)

Author: Fantashit

2 thoughts on “Setting clearColor to black doesn’t work if sprites are in scene

  1. Nice find.

    Simpler fiddle: http://jsfiddle.net/ak35o645/11/

    SpritePlugin calls renderer.resetGLState() which calls state.reset() which does this:

    currentColorClear.set( 0, 0, 0, 1 );
    

    That prevents state.buffers.color.setClear( ) from working properly in the special case in which the desired color is black and the desired alpha is 1.

  2. @lojjic It is best to restrict the gl call to one place, and call it only when necessary. Thanks for bringing this issue to the forefront, though.

    And thanks, @Neesnu.

Comments are closed.