diff --git a/Assets/uDesktopDuplication/Examples/Scenes/Shaders.unity b/Assets/uDesktopDuplication/Examples/Scenes/Shaders.unity index 8e233c4..d76cc0d 100644 Binary files a/Assets/uDesktopDuplication/Examples/Scenes/Shaders.unity and b/Assets/uDesktopDuplication/Examples/Scenes/Shaders.unity differ diff --git a/Assets/uDesktopDuplication/Resources/uDesktopDuplication/Shaders/uDD_Cursor.shader b/Assets/uDesktopDuplication/Resources/uDesktopDuplication/Shaders/uDD_Cursor.shader index 39a9a9e..5bab139 100644 --- a/Assets/uDesktopDuplication/Resources/uDesktopDuplication/Shaders/uDD_Cursor.shader +++ b/Assets/uDesktopDuplication/Resources/uDesktopDuplication/Shaders/uDD_Cursor.shader @@ -4,15 +4,17 @@ Properties { _MainTex ("Texture", 2D) = "white" {} + [KeywordEnum(Off, Front, Back)] _Cull("Culling", Int) = 2 } SubShader { -Tags { "RenderType"="Opaque" } +Tags { "RenderType"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" "Queue" = "Transparent+1" } +Cull [_Cull] ZWrite Off -Offset -1, -1 +Offset -0.01, -0.01 CGINCLUDE diff --git a/Assets/uDesktopDuplication/Shaders/uDD_Common.cginc b/Assets/uDesktopDuplication/Shaders/uDD_Common.cginc index 84b073f..c91470e 100644 --- a/Assets/uDesktopDuplication/Shaders/uDD_Common.cginc +++ b/Assets/uDesktopDuplication/Shaders/uDD_Common.cginc @@ -18,7 +18,7 @@ inline void uddInvertUV(inout float2 uv) #endif } -inline void uddToLinearIfNeeded(inout float3 rgb) +inline void uddToLinearIfNeeded(inout fixed3 rgb) { if (!IsGammaSpace()) { rgb = GammaToLinearSpace(rgb); diff --git a/Assets/uDesktopDuplication/Shaders/uDD_Standard.shader b/Assets/uDesktopDuplication/Shaders/uDD_Standard.shader index 930d032..8c9f185 100644 --- a/Assets/uDesktopDuplication/Shaders/uDD_Standard.shader +++ b/Assets/uDesktopDuplication/Shaders/uDD_Standard.shader @@ -7,11 +7,14 @@ Properties _MainTex ("Albedo (RGB)", 2D) = "white" {} _Glossiness ("Smoothness", Range(0, 1)) = 0.5 _Metallic ("Metallic", Range(0, 1)) = 0.0 + [KeywordEnum(Off, Front, Back)] _Cull("Culling", Int) = 2 } SubShader { Tags { "RenderType"="Opaque" } + + Cull [_Cull] CGPROGRAM diff --git a/Assets/uDesktopDuplication/Shaders/uDD_Unlit.shader b/Assets/uDesktopDuplication/Shaders/uDD_Unlit.shader index 578a92c..ad98c4f 100644 --- a/Assets/uDesktopDuplication/Shaders/uDD_Unlit.shader +++ b/Assets/uDesktopDuplication/Shaders/uDD_Unlit.shader @@ -5,6 +5,7 @@ Properties { _Color ("Color", Color) = (1, 1, 1, 1) _MainTex ("Texture", 2D) = "white" {} + [KeywordEnum(Off, Front, Back)] _Cull("Culling", Int) = 2 } SubShader @@ -12,6 +13,8 @@ SubShader Tags { "RenderType"="Opaque" } +Cull [_Cull] + CGINCLUDE #include "UnityCG.cginc" diff --git a/Assets/uDesktopDuplication/Shaders/uDD_Unlit_BlackMask.shader b/Assets/uDesktopDuplication/Shaders/uDD_Unlit_BlackMask.shader index f72bc30..7c517f3 100644 --- a/Assets/uDesktopDuplication/Shaders/uDD_Unlit_BlackMask.shader +++ b/Assets/uDesktopDuplication/Shaders/uDD_Unlit_BlackMask.shader @@ -6,6 +6,7 @@ Properties _Color ("Color", Color) = (1, 1, 1, 1) _MainTex ("Texture", 2D) = "white" {} _Mask ("Mask", Range(0, 1)) = 0.1 + [KeywordEnum(Off, Front, Back)] _Cull("Culling", Int) = 2 } SubShader @@ -13,7 +14,8 @@ SubShader Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } -ZWrite Off +Cull [_Cull] +ZWrite On Blend SrcAlpha OneMinusSrcAlpha CGINCLUDE diff --git a/Assets/uDesktopDuplication/Shaders/uDD_Unlit_Transparent.shader b/Assets/uDesktopDuplication/Shaders/uDD_Unlit_Transparent.shader index d6217be..6fe5b05 100644 --- a/Assets/uDesktopDuplication/Shaders/uDD_Unlit_Transparent.shader +++ b/Assets/uDesktopDuplication/Shaders/uDD_Unlit_Transparent.shader @@ -5,6 +5,7 @@ Properties { _Color ("Color", Color) = (1, 1, 1, 1) _MainTex ("Texture", 2D) = "white" {} + [KeywordEnum(Off, Front, Back)] _Cull("Culling", Int) = 2 } SubShader @@ -12,7 +13,8 @@ SubShader Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" } -ZWrite Off +Cull [_Cull] +ZWrite On Blend SrcAlpha OneMinusSrcAlpha CGINCLUDE