yzt
2023-05-26 de4278af2fd46705a40bac58ec01122db6b7f3d7
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
void filterByPassType(inout vec3 positionMC, vec4 featureColor)
{
    bool styleTranslucent = (featureColor.a != 1.0);
    // Only render translucent features in the translucent pass (if the style or the original command has translucency).
    if (czm_pass == czm_passTranslucent && !styleTranslucent && !model_commandTranslucent)
    {
        positionMC *= 0.0;
    }
    // If the current pass is not the transluceny pass and the style is not translucent, don't rendeer the feature.
    else if (czm_pass != czm_passTranslucent && styleTranslucent)
    {
        positionMC *= 0.0;
    }
}
 
void cpuStylingStage(inout vec3 positionMC, inout Feature feature)
{
    float show = ceil(feature.color.a);
    positionMC *= show;
 
    filterByPassType(positionMC, feature.color);
}