|
|
@@ -433,9 +433,17 @@ class WebGLBackend extends Backend {
|
|
|
|
|
|
if ( descriptor === null ) {
|
|
|
|
|
|
+ const clearColor = this.getClearColor();
|
|
|
+
|
|
|
+ // premultiply alpha
|
|
|
+
|
|
|
+ clearColor.r *= clearColor.a;
|
|
|
+ clearColor.g *= clearColor.a;
|
|
|
+ clearColor.b *= clearColor.a;
|
|
|
+
|
|
|
descriptor = {
|
|
|
textures: null,
|
|
|
- clearColorValue: this.getClearColor()
|
|
|
+ clearColorValue: clearColor
|
|
|
};
|
|
|
|
|
|
}
|
|
|
@@ -450,13 +458,23 @@ class WebGLBackend extends Backend {
|
|
|
|
|
|
if ( clear !== 0 ) {
|
|
|
|
|
|
- const clearColor = descriptor.clearColorValue || this.getClearColor();
|
|
|
+ let clearColor;
|
|
|
|
|
|
- // premultiply alpha
|
|
|
+ if ( descriptor.clearColorValue ) {
|
|
|
|
|
|
- clearColor.r *= clearColor.a;
|
|
|
- clearColor.g *= clearColor.a;
|
|
|
- clearColor.b *= clearColor.a;
|
|
|
+ clearColor = descriptor.clearColorValue;
|
|
|
+
|
|
|
+ } else {
|
|
|
+
|
|
|
+ clearColor = this.getClearColor();
|
|
|
+
|
|
|
+ // premultiply alpha
|
|
|
+
|
|
|
+ clearColor.r *= clearColor.a;
|
|
|
+ clearColor.g *= clearColor.a;
|
|
|
+ clearColor.b *= clearColor.a;
|
|
|
+
|
|
|
+ }
|
|
|
|
|
|
if ( depth ) this.state.setDepthMask( true );
|
|
|
|