mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
fix shading error
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user