summaryrefslogtreecommitdiff
path: root/VRCSDK3Avatars/Assets/_PoiyomiShaders/Shaders/7.3/Includes/CGI_PoiDebug.cginc
blob: 4792487cfd330e651ba9b349feb5b19819d56bdc (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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
#ifndef POI_DEBUG
    #define POI_DEBUG
    
    float _DebugEnabled;
    uint _DebugMeshData;
    uint _DebugLightingData;
    uint _DebugCameraData;
    
    void displayDebugInfo(inout float4 finalColor)
    {
        UNITY_BRANCH
        if (_DebugEnabled != 0)
        {
            //Mesh Data
            if (_DebugMeshData == 1)
            {
                finalColor.rgb = poiMesh.normals[0];
                return;
            }
            else if(_DebugMeshData == 2)
            {
                finalColor.rgb = poiMesh.normals[1];
                return;
            }
            else if(_DebugMeshData == 3)
            {
                finalColor.rgb = poiMesh.tangent;
                return;
            }
            else if(_DebugMeshData == 4)
            {
                finalColor.rgb = poiMesh.binormal;
                return;
            }
            
            #ifdef POI_LIGHTING
                if (_DebugLightingData == 1)
                {
                    finalColor.rgb = poiLight.attenuation;
                    return;
                }
                else if(_DebugLightingData == 2)
                {
                    finalColor.rgb = poiLight.directLighting;
                    return;
                }
                else if(_DebugLightingData == 3)
                {
                    finalColor.rgb = poiLight.indirectLighting;
                    return;
                }
                else if(_DebugLightingData == 4)
                {
                    finalColor.rgb = poiLight.lightMap;
                    return;
                }
                else if(_DebugLightingData == 5)
                {
                    finalColor.rgb = poiLight.rampedLightMap;
                    return;
                }
                else if(_DebugLightingData == 6)
                {
                    finalColor.rgb = poiLight.finalLighting;
                    return;
                }
                else if(_DebugLightingData == 7)
                {
                    finalColor.rgb = poiLight.nDotL;
                    return;
                }
            #endif
            
            if(_DebugCameraData == 1)
            {
                finalColor.rgb = poiCam.viewDir;
                return;
            }
            else if(_DebugCameraData == 2)
            {
                finalColor.rgb = poiCam.tangentViewDir;
                return;
            }
            else if(_DebugCameraData == 3)
            {
                finalColor.rgb = poiCam.forwardDir;
                return;
            }
            else if(_DebugCameraData == 4)
            {
                finalColor.rgb = poiCam.worldPos;
                return;
            }
            else if(_DebugCameraData == 5)
            {
                finalColor.rgb = poiCam.viewDotNormal;
                return;
            }
        }
    }
    
#endif