phetsims / molecule-shapes

"Molecule Shapes" is an educational simulation in HTML5, by PhET Interactive Simulations.
http://phet.colorado.edu/en/simulation/molecule-shapes
GNU General Public License v3.0
5 stars 6 forks source link

Remove autoclear = false #255

Open samreid opened 4 months ago

samreid commented 4 months ago

Discovered in https://github.com/phetsims/density-buoyancy-common/issues/81 @zepumph and I saw this code in Molecule Shapes:

  render( target ) {
    // render the 3D scene first
    this.threeRenderer.render( this.threeScene, this.threeCamera, target );
    this.threeRenderer.autoClear = false;
    // then render the 2D overlay on top, without clearing the Canvas in-between
    this.threeRenderer.render( this.overlayScene, this.overlayCamera, target );
    this.threeRenderer.autoClear = true;
  }

Can we leave autoclear on? It seems autoclear is only supposed to be used when rendering multiple render calls over one another. Also leaving the autoclear on solved bugs in https://github.com/phetsims/density-buoyancy-common/issues/81

It seemed in density-buoyancy-common that the autoclear was disabled in order to let the background show through, but that can be accomplished with Color.TRANSPARENT background + clear and no rendering artifacts.