Files
cocos4/editor/assets/chunks/cc-shadow-map-vs.chunk
T
jk20012001 c559cab440 Fix instancing performance issue with new chips on metal (#10765)
* Fix instancing performance issue with new chips on metal

* Fix shadow bias with Batching
Update compiled shaders
2022-04-14 17:02:55 +08:00

23 lines
661 B
Plaintext

// Copyright (c) 2017-2020 Xiamen Yaji Software Co., Ltd.
out highp vec4 v_shadowPos;
#include <cc-shadow>
#include <cc-shadow-map-base>
#pragma define CC_SHADOW_POSITION v_shadowPos
#pragma define CC_TRANSFER_SHADOW(worldPos) CC_TRANSFER_SHADOW_BASE(worldPos, v_shadowPos)
#if CC_RECEIVE_SHADOW
vec2 CCGetShadowBias()
{
#if USE_INSTANCING
return vec2(a_localShadowBias.x + cc_shadowWHPBInfo.w, a_localShadowBias.y + cc_shadowLPNNInfo.z);
#elif !USE_BATCHING
return vec2(cc_localShadowBias.x + cc_shadowWHPBInfo.w, cc_localShadowBias.y + cc_shadowLPNNInfo.z);
#else
return vec2(cc_shadowWHPBInfo.w, cc_shadowLPNNInfo.z);
#endif
}
#endif