summaryrefslogtreecommitdiff
path: root/VRCSDK3AvatarsLegacy/Assets/Avatars/Auri/materials/OptimizedShaders/auri poiyomi pro dps toy2/Includes/CGI_PoiBlackLight.cginc
blob: 8948e973ba8f31332bc8325ade187849902a687e (plain)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
#ifndef POI_BLACKLIGHT
    #define POI_BLACKLIGHT
    
    float4 _BlackLightMaskStart;
    float4 _BlackLightMaskEnd;
    float4 _BlackLightMaskKeys;
    float _BlackLightMaskDebug;
    float _BlackLightMaskDissolve;
    float _BlackLightAdjustDissolve;
    float _BlackLightMaskMetallic;
    float _BlackLightMaskClearCoat;
    float _BlackLightMaskMatcap;
    float _BlackLightMaskMatcap2;
    float _BlackLightMaskEmission;
    float _BlackLightMaskEmission2;
    float _BlackLightMaskFlipbook;
    float _BlackLightMaskPanosphere;
    float _BlackLightMaskIridescence;
    float _BlackLightMove;
    
    half _BlackLightMaskGlitter;
    
    half4 blackLightMask;
    
    void createBlackLightMask()
    {
        blackLightMask = 0;
        #ifdef VERTEXLIGHT_ON
            
            for (int lightIndex = 0; lightIndex < 4; lightIndex ++)
            {
                float3 lightPos = float3(unity_4LightPosX0[lightIndex], unity_4LightPosY0[lightIndex], unity_4LightPosZ0[lightIndex]);
                if (!distance(unity_LightColor[lightIndex].rgb, float3(0, 0, 0)))
                {
                    for (int maskIndex = 0; maskIndex < 4; maskIndex ++)
                    {
                        float4 comparison = float4(2,3,4,5);
                        if(unity_LightColor[lightIndex].a == comparison[maskIndex])
                        {
                            blackLightMask[maskIndex] = max(blackLightMask[maskIndex], smoothstep(float4(1,1,1,1)[maskIndex], float4(0,0,0,0)[maskIndex], distance(poiMesh.worldPos, lightPos)));
                        }
                    }
                }
            }
        #endif
    }
#endif

/*
#ifdef POI_BLACKLIGHT
    if (float(4) != 4)
    {
        blackLightMask[mask];
    }
#endif
*/