diff --git a/Assets/uDesktopDuplication/Materials/uDD_Screen_Unlit.mat b/Assets/uDesktopDuplication/Materials/uDD_Screen_Unlit.mat index c4a0400..f8049b6 100644 Binary files a/Assets/uDesktopDuplication/Materials/uDD_Screen_Unlit.mat and b/Assets/uDesktopDuplication/Materials/uDD_Screen_Unlit.mat differ diff --git a/Assets/uDesktopDuplication/Shaders/uDD_Unlit.shader b/Assets/uDesktopDuplication/Shaders/uDD_Unlit.shader index c27d1a7..bea41f3 100644 --- a/Assets/uDesktopDuplication/Shaders/uDD_Unlit.shader +++ b/Assets/uDesktopDuplication/Shaders/uDD_Unlit.shader @@ -5,6 +5,8 @@ Properties { _Color ("Color", Color) = (1, 1, 1, 1) _MainTex ("Texture", 2D) = "white" {} + [Toggle(USE_BEND)] _UseBend("UseBend", Float) = 0 + [PowerSlider(10.0)]_Radius ("Radius", Range(3, 100)) = 10 [KeywordEnum(Off, Front, Back)] _Cull("Culling", Int) = 2 } @@ -20,9 +22,16 @@ CGINCLUDE #include "./uDD_Common.cginc" #include "./uDD_Params.cginc" +fixed _Radius; + v2f vert(appdata v) { v2f o; +#ifdef USE_BEND + half a = v.vertex.x / _Radius; + v.vertex.x = _Radius * sin(a); + v.vertex.y += _Radius * (1 - cos(a)); +#endif o.vertex = UnityObjectToClipPos(v.vertex); o.uv = TRANSFORM_TEX(v.uv, _MainTex); return o; @@ -40,9 +49,10 @@ Pass CGPROGRAM #pragma vertex vert #pragma fragment frag - #pragma multi_compile ___ INVERT_X - #pragma multi_compile ___ INVERT_Y - #pragma multi_compile ___ VERTICAL + #pragma shader_feature ___ INVERT_X + #pragma shader_feature ___ INVERT_Y + #pragma shader_feature ___ VERTICAL + #pragma shader_feature ___ USE_BEND ENDCG }