ScreenshotShader.shader 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. Shader "Imagine/Screenshot"
  2. {
  3. Properties
  4. {
  5. _BaseTexture ("Base Texture", 2D) = "white" {}
  6. _OverlayTexture ("Overlay Texture", 2D) = "white" {}
  7. }
  8. SubShader
  9. {
  10. Tags { "RenderType"="Opaque" }
  11. LOD 100
  12. Pass
  13. {
  14. CGPROGRAM
  15. #pragma vertex vert
  16. #pragma fragment frag
  17. #include "UnityCG.cginc"
  18. struct appdata
  19. {
  20. float4 vertex : POSITION;
  21. float2 uv : TEXCOORD0;
  22. };
  23. struct v2f
  24. {
  25. float2 uv : TEXCOORD0;
  26. float4 vertex : SV_POSITION;
  27. };
  28. sampler2D _BaseTexture;
  29. sampler2D _OverlayTexture;
  30. v2f vert(appdata v)
  31. {
  32. v2f o;
  33. o.vertex = UnityObjectToClipPos(v.vertex);
  34. o.uv = v.uv;
  35. return o;
  36. }
  37. fixed4 frag(v2f i) : SV_Target
  38. {
  39. fixed4 baseColor = tex2D(_BaseTexture, i.uv);
  40. fixed4 overlayColor = tex2D(_OverlayTexture, i.uv);
  41. float a = overlayColor.a;
  42. fixed4 finalColor = baseColor * (1-a) + overlayColor * a;
  43. return finalColor;
  44. }
  45. ENDCG
  46. }
  47. }
  48. }