Assignment for RMIT Mixed Reality in 2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
968 B

  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 "Oculus/Underlay Transparent Occluder" {
  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. // extra pass that renders to depth buffer only
  14. Pass{
  15. ZWrite On
  16. ColorMask 0
  17. }
  18. CGPROGRAM
  19. #pragma surface surf Lambert keepalpha
  20. fixed4 _Color;
  21. struct Input {
  22. float4 color : COLOR;
  23. };
  24. void surf(Input IN, inout SurfaceOutput o) {
  25. o.Albedo = _Color.rgb;
  26. o.Alpha = _Color.a;
  27. }
  28. ENDCG
  29. }
  30. Fallback "Transparent/VertexLit"
  31. }