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,