MobileOcclusion.shader 724 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. Shader "Custom/MobileOcclusion"
  2. {
  3. SubShader {
  4. Pass {
  5. // Render the Occlusion shader before all
  6. // opaque geometry to prime the depth buffer.
  7. Tags { "Queue"="Geometry" }
  8. ZWrite On
  9. ZTest LEqual
  10. ColorMask 0
  11. CGPROGRAM
  12. #pragma vertex vert
  13. #pragma fragment frag
  14. #include "UnityCG.cginc"
  15. struct appdata
  16. {
  17. float4 vertex : POSITION;
  18. };
  19. struct v2f
  20. {
  21. float4 position : SV_POSITION;
  22. };
  23. v2f vert (appdata input)
  24. {
  25. v2f output;
  26. output.position = UnityObjectToClipPos(input.vertex);
  27. return output;
  28. }
  29. fixed4 frag (v2f input) : SV_Target
  30. {
  31. return fixed4(0.5, 0.3, 0.0, 1.0);
  32. }
  33. ENDCG
  34. }
  35. }
  36. }