fix shading error

This commit is contained in:
jerrywwl
2019-04-02 01:11:31 +08:00
parent da44c98e7b
commit a8682cd289
3 changed files with 17 additions and 11 deletions
+7 -5
View File
@@ -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 {
+7 -5
View File
@@ -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 {
+3 -1
View File
@@ -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);