Files
cocos4/editor/assets/chunks/cc-global.chunk
T
jk20012001 d5f172b782 Fix fog accumulated error with multiple local lights (#10445)
* Fix fog accumulated error with multiple local lights

* add standard exposure value for lightmap
2022-03-23 17:43:43 +08:00

33 lines
1.7 KiB
Plaintext

// Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd.
// have to specify precisions explicitly
// if shared among stages with different precisions
#pragma builtin(global)
layout(set = 0, binding = 0) uniform CCGlobal {
highp vec4 cc_time; // x: global time since started in seconds, y: delta time for current frame, z: total frames since started
mediump vec4 cc_screenSize; // xy: screen size, zw: inverse screen size
mediump vec4 cc_nativeSize; // xy: shading size, zw: inverse shading size
};
#pragma builtin(global)
layout(set = 0, binding = 1) uniform CCCamera {
highp mat4 cc_matView; // view matrix
highp mat4 cc_matViewInv; // inverse view matrix
highp mat4 cc_matProj; // projection matrix
highp mat4 cc_matProjInv; // inverse projection matrix
highp mat4 cc_matViewProj; // view-projection matrix
highp mat4 cc_matViewProjInv; // inverse view-projection matrix
highp vec4 cc_cameraPos; // xyz: camera position
mediump vec4 cc_screenScale; // xy: screen scale, zw: inverse screen scale
mediump vec4 cc_exposure; // x: exposure, y: inverse exposure, z: HDR flag, w: inverse standard exposure value
mediump vec4 cc_mainLitDir; // xyz: main direcitonal light direction, w: enable shadow
mediump vec4 cc_mainLitColor; // xyz: main direcitonal light color, w: intensity
mediump vec4 cc_ambientSky; //xyz: sky illumination color, w: intensity
mediump vec4 cc_ambientGround; // xyz: ground albedo color, w: envmap LOD
mediump vec4 cc_fogColor; // xyz: global fog color
mediump vec4 cc_fogBase; // xyz: fogStart, fogEnd, fogDensity
mediump vec4 cc_fogAdd; // xyz: fogTop, fogRange, fogAtten
mediump vec4 cc_nearFar; // xy: frustum near, frustum far
mediump vec4 cc_viewPort; // xyzw: camera view port, default(0, 0, 1, 1)
};