mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 07:42:38 +08:00
fix rendering error
This commit is contained in:
Vendored
+16
-18
File diff suppressed because one or more lines are too long
@@ -55,6 +55,7 @@ export class ForwardStage extends RenderStage {
|
||||
|
||||
if (camera.clearFlag & GFXClearFlag.COLOR) {
|
||||
colors[0] = camera.clearColor;
|
||||
/*
|
||||
if (this._pipeline.isHDR) {
|
||||
colors[0] = SRGBToLinear(colors[0]);
|
||||
const scale = 1.0 / (camera.exposure * this._pipeline.fpScaleInv);
|
||||
@@ -62,6 +63,7 @@ export class ForwardStage extends RenderStage {
|
||||
colors[0].g *= scale;
|
||||
colors[0].b *= scale;
|
||||
}
|
||||
*/
|
||||
colors.length = 1;
|
||||
}
|
||||
|
||||
|
||||
@@ -526,7 +526,7 @@ export abstract class RenderPipeline {
|
||||
|
||||
_vec4Array[0] = camera.exposure;
|
||||
_vec4Array[1] = _vec4Array[0] * this._fpScaleInv;
|
||||
_vec4Array[2] = 0.0;
|
||||
_vec4Array[2] = this._isHDR ? 1.0 : 0.0;
|
||||
_vec4Array[3] = 1.0 / _vec4Array[1];
|
||||
this._defaultUboGlobal!.view.set(_vec4Array, UBOGlobal.EXPOSURE_OFFSET);
|
||||
|
||||
|
||||
@@ -1,10 +1,11 @@
|
||||
import { Root } from '../../core/root';
|
||||
import { RenderPassStage, UBOGlobal } from '../define';
|
||||
import { UBOGlobal } from '../define';
|
||||
import { RenderPipeline, IRenderPipelineInfo } from '../render-pipeline';
|
||||
import { RenderView } from '../render-view';
|
||||
import { UIFlow } from './ui-flow';
|
||||
import { mat4 } from '../../core/vmath';
|
||||
|
||||
const _vec4Array = new Float32Array(4);
|
||||
const _mat4Array = new Float32Array(16);
|
||||
|
||||
export class UIPipeline extends RenderPipeline {
|
||||
@@ -39,6 +40,12 @@ export class UIPipeline extends RenderPipeline {
|
||||
const camera = view.camera;
|
||||
mat4.array(_mat4Array, camera.matViewProj);
|
||||
this._defaultUboGlobal!.view.set(_mat4Array, UBOGlobal.MAT_VIEW_PROJ_OFFSET);
|
||||
|
||||
_vec4Array[0] = camera.exposure;
|
||||
_vec4Array[1] = _vec4Array[0] * this._fpScaleInv;
|
||||
_vec4Array[2] = 0.0;
|
||||
_vec4Array[3] = 1.0 / _vec4Array[1];
|
||||
this._defaultUboGlobal!.view.set(_vec4Array, UBOGlobal.EXPOSURE_OFFSET);
|
||||
// update ubos
|
||||
this._globalBindings.get(UBOGlobal.BLOCK.name)!.buffer!.update(this._defaultUboGlobal!.view.buffer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user