三国卡牌客户端基础资源仓库
yyl
2025-05-07 28c068825ca4ed2b7017204d1fb3d613467db7cb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef SKELETON_TINT_COMMON_INCLUDED
#define SKELETON_TINT_COMMON_INCLUDED
 
float4 fragTintedColor(float4 texColor, float3 darkTintColor, float4 lightTintColorPMA, float lightColorAlpha, float darkColorAlpha) {
 
    float a = texColor.a * lightTintColorPMA.a;
 
#if !defined(_STRAIGHT_ALPHA_INPUT)
    float3 texDarkColor = texColor.a - texColor.rgb;
#else
    float3 texDarkColor = (1 - texColor.rgb);
#endif
    float3 darkColor = texDarkColor * darkTintColor.rgb * lightColorAlpha;
    float3 lightColor = texColor.rgb * lightTintColorPMA.rgb;
 
    float4 fragColor = float4(darkColor + lightColor, a);
#if defined(_STRAIGHT_ALPHA_INPUT)
    fragColor.rgb *= texColor.a;
#endif
 
#if defined(_DARK_COLOR_ALPHA_ADDITIVE)
    fragColor.a = a * (1 - darkColorAlpha);
#endif
    return fragColor;
}
 
#endif