From fe92dfe1513545e152526eb26d1ec885a2ec4e57 Mon Sep 17 00:00:00 2001 From: zxg0622 <247274249@qq.com> Date: Wed, 8 Jan 2020 18:45:52 +0800 Subject: [PATCH] fix editor scene window is black before scene loaded (#6059) --- cocos/core/gfx/webgl/webgl-device.ts | 3 ++- cocos/core/gfx/webgl2/webgl2-device.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/cocos/core/gfx/webgl/webgl-device.ts b/cocos/core/gfx/webgl/webgl-device.ts index 50fe6b87bf..5a16c00bbe 100644 --- a/cocos/core/gfx/webgl/webgl-device.ts +++ b/cocos/core/gfx/webgl/webgl-device.ts @@ -1,3 +1,4 @@ +import { macro } from '../../platform'; import sys from '../../platform/sys'; import { GFXBindingLayout, IGFXBindingLayoutInfo } from '../binding-layout'; import { GFXBuffer, IGFXBufferInfo } from '../buffer'; @@ -201,7 +202,7 @@ export class WebGLGFXDevice extends GFXDevice { try { const webGLCtxAttribs: WebGLContextAttributes = { - alpha: false, + alpha: macro.ENABLE_TRANSPARENT_CANVAS, antialias: this._isAntialias, depth: true, stencil: true, diff --git a/cocos/core/gfx/webgl2/webgl2-device.ts b/cocos/core/gfx/webgl2/webgl2-device.ts index b3e51bb207..3d96936521 100644 --- a/cocos/core/gfx/webgl2/webgl2-device.ts +++ b/cocos/core/gfx/webgl2/webgl2-device.ts @@ -1,3 +1,4 @@ +import { macro } from '../../platform'; import { GFXBindingLayout, IGFXBindingLayoutInfo } from '../binding-layout'; import { GFXBuffer, IGFXBufferInfo } from '../buffer'; import { GFXCommandAllocator, IGFXCommandAllocatorInfo } from '../command-allocator'; @@ -135,7 +136,7 @@ export class WebGL2GFXDevice extends GFXDevice { try { const webGLCtxAttribs: WebGLContextAttributes = { - alpha: false, + alpha: macro.ENABLE_TRANSPARENT_CANVAS, antialias: this._isAntialias, depth: true, stencil: true,