diff --git a/cocos/gfx/webgl/webgl-device.ts b/cocos/gfx/webgl/webgl-device.ts index def742f8f3..f9c2242a63 100644 --- a/cocos/gfx/webgl/webgl-device.ts +++ b/cocos/gfx/webgl/webgl-device.ts @@ -363,11 +363,13 @@ export class WebGLGFXDevice extends GFXDevice { } public resize (width: number, height: number) { - console.log('Device resize: ' + width + 'x' + height); - this._canvas!.width = width; - this._canvas!.height = height; - this._width = width; - this._height = height; + if (this._width !== width && this._height !== height) { + console.log('RESIZING DEVICE: ' + width + 'x' + height); + this._canvas!.width = width; + this._canvas!.height = height; + this._width = width; + this._height = height; + } } public createBuffer (info: IGFXBufferInfo): GFXBuffer { diff --git a/cocos/gfx/webgl2/webgl2-device.ts b/cocos/gfx/webgl2/webgl2-device.ts index 1c0e8bf6b3..50c7b7d3b0 100644 --- a/cocos/gfx/webgl2/webgl2-device.ts +++ b/cocos/gfx/webgl2/webgl2-device.ts @@ -281,11 +281,13 @@ export class WebGL2GFXDevice extends GFXDevice { } public resize (width: number, height: number) { - console.log('Device resize: ' + width + 'x' + height); - this._canvas!.width = width; - this._canvas!.height = height; - this._width = width; - this._height = height; + if (this._width !== width && this._height !== height) { + console.log('RESIZING DEVICE: ' + width + 'x' + height); + this._canvas!.width = width; + this._canvas!.height = height; + this._width = width; + this._height = height; + } } public createBuffer (info: IGFXBufferInfo): GFXBuffer { diff --git a/cocos/pipeline/render-pipeline.ts b/cocos/pipeline/render-pipeline.ts index 74aa709b7b..f625c9f821 100644 --- a/cocos/pipeline/render-pipeline.ts +++ b/cocos/pipeline/render-pipeline.ts @@ -348,6 +348,8 @@ export abstract class RenderPipeline { } } + // this._useSMAA = false; + if (this._device.hasFeature(GFXFeature.FORMAT_D24S8)) { depthStencilFmt = GFXFormat.D24S8; } else { @@ -825,7 +827,7 @@ export abstract class RenderPipeline { this._defaultUboGlobal.view.set(_vec4Array, UBOGlobal.CAMERA_POS_OFFSET); _vec4Array[0] = camera.exposure; - _vec4Array[1] = _vec4Array[0] * this._fpScaleInv; + _vec4Array[1] = 1.0 / camera.exposure; _vec4Array[2] = this._isHDR ? 1.0 : 0.0; _vec4Array[3] = 1.0 / _vec4Array[1]; this._defaultUboGlobal.view.set(_vec4Array, UBOGlobal.EXPOSURE_OFFSET);