mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-05 19:12:40 +08:00
a6dfddc780
* fix spotlight shadow matrix, lineardepth, selfbias error (#8483) * Spotlight shadows: Added depthbias in viewspace units * Remove now unnecessary UBO constants * Add support for directional lights * fix spotlight shadow matrix, lineardepth, selfbias error (#8483) * Fix Spotlight light leaking in backface and compiling error * fix dirlightview matrix error * more accuracy for spotlight shadow bias * Fix face normal bias * Fix DirLight Soft/Soft2X * improve performance for ShadowUBO divid op * remove spotshadow linear mode(can't work with new shadow bias), fix spotshadow linear mode * fix spot shadow linear mode * directional light packing mode and disable linear mode * compiled effects Co-authored-by: Jamie Anthony Morris <Jamie.Morris@cocos.com>
16 lines
1.1 KiB
Plaintext
16 lines
1.1 KiB
Plaintext
// Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd.
|
|
|
|
#pragma builtin(global)
|
|
layout(set = 0, binding = 2) uniform CCShadow {
|
|
highp mat4 cc_matLightPlaneProj;
|
|
highp mat4 cc_matLightView;
|
|
highp mat4 cc_matLightViewProj;
|
|
highp vec4 cc_shadowInvProjDepthInfo; // x -> cc_matLightInvProj[10]([2][2]); y -> cc_matLightInvProj[14]([2][3]); z -> cc_matLightInvProj[11]([3][2]); w -> cc_matLightInvProj[15]([3][3]);
|
|
highp vec4 cc_shadowProjDepthInfo; // x -> cc_matLightProj[10]([2][2]); y -> cc_matLightProj[14]([2][3]); z -> cc_matLightProj[11]([3][2]); w -> cc_matLightProj[15]([3][3]);
|
|
highp vec4 cc_shadowProjInfo; // x -> cc_matLightProj[0]; y -> cc_matLightProj[5]; z -> 1.0 / cc_matLightProj[0]; w -> 1.0 / cc_matLightProj[5];
|
|
lowp vec4 cc_shadowNFLSInfo; // x -> near(N); y -> far(F); z -> isLinear(L); w -> shadow saturation(S);
|
|
lowp vec4 cc_shadowWHPBInfo; // x -> width(W); y -> height(H); z -> pcf(P); w -> bias(B);
|
|
lowp vec4 cc_shadowLPNNInfo; // x -> lightType(L); y -> isPacking(P); z -> normalBias(N); w -> null(N);
|
|
lowp vec4 cc_shadowColor;
|
|
};
|