File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
Assets/Klak/Hap/Resources Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,16 @@ Shader "Klak/HAP Q"
14
14
15
15
half3 CoCgSY2RGB (half4 i)
16
16
{
17
+ #if !defined (UNITY_COLORSPACE_GAMMA)
18
+ i.xyz = LinearToGammaSpace (i.xyz);
19
+ #endif
17
20
i.xy -= half2 (0.50196078431373 , 0.50196078431373 );
18
21
half s = 1 / ((i.z * (255.0 / 8 )) + 1 );
19
- return half3 (i.x - i.y, i.y, -i.x - i.y) * s + i.w;
22
+ half3 rgb = half3 (i.x - i.y, i.y, -i.x - i.y) * s + i.w;
23
+ #if !defined (UNITY_COLORSPACE_GAMMA)
24
+ rgb = GammaToLinearSpace (rgb);
25
+ #endif
26
+ return rgb;
20
27
}
21
28
22
29
float4 Vertex (
@@ -45,6 +52,7 @@ Shader "Klak/HAP Q"
45
52
Pass
46
53
{
47
54
CGPROGRAM
55
+ #pragma multi_compile _ UNITY_COLORSPACE_GAMMA
48
56
#pragma vertex Vertex
49
57
#pragma fragment Fragment
50
58
ENDCG
You can’t perform that action at this time.
0 commit comments