OverlayTransOccluder.shader 976 B

12345678910111213141516171819202122232425262728293031323334
  1. /*
  2. Code for transparent object in front of the overlay
  3. The keepalpha option is important to let unity maintain the alpha we return from the shader
  4. */
  5. Shader "NRSDK/OverlayTransOccluder" {
  6. Properties{
  7. _Color("Main Color", Color) = (1,1,1,1)
  8. _MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
  9. }
  10. SubShader{
  11. Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
  12. Blend SrcAlpha OneMinusSrcAlpha
  13. ZWrite Off
  14. CGPROGRAM
  15. #pragma surface surf Lambert keepalpha
  16. fixed4 _Color;
  17. sampler2D _MainTex;
  18. struct Input {
  19. float4 color : COLOR;
  20. float2 uv_MainTex;
  21. };
  22. void surf(Input IN, inout SurfaceOutput o) {
  23. float4 texVal = tex2D (_MainTex, IN.uv_MainTex).rgba * _Color;
  24. o.Albedo = texVal.rgb;
  25. o.Alpha = texVal.a;
  26. }
  27. ENDCG
  28. }
  29. Fallback "Transparent/VertexLit"
  30. }