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.

53 lines
1.0 KiB

  1. Shader "Oculus/UnlitTransparent" {
  2. Properties{
  3. _MainTex("Base (RGB) Trans (A)", 2D) = "white" {}
  4. }
  5. SubShader{
  6. Tags{ "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
  7. LOD 100
  8. ZWrite Off
  9. Blend SrcAlpha OneMinusSrcAlpha
  10. Pass{
  11. CGPROGRAM
  12. #pragma vertex vert
  13. #pragma fragment frag
  14. #pragma target 2.0
  15. #pragma multi_compile_fog
  16. #include "UnityCG.cginc"
  17. struct appdata_t {
  18. float4 vertex : POSITION;
  19. float2 texcoord : TEXCOORD0;
  20. };
  21. struct v2f {
  22. float4 vertex : SV_POSITION;
  23. half2 texcoord : TEXCOORD0;
  24. UNITY_FOG_COORDS(1)
  25. };
  26. sampler2D _MainTex;
  27. float4 _MainTex_ST;
  28. v2f vert(appdata_t v)
  29. {
  30. v2f o;
  31. o.vertex = UnityObjectToClipPos(v.vertex);
  32. o.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
  33. UNITY_TRANSFER_FOG(o,o.vertex);
  34. return o;
  35. }
  36. fixed4 frag(v2f i) : SV_Target
  37. {
  38. fixed4 col = tex2D(_MainTex, i.texcoord);
  39. UNITY_APPLY_FOG(i.fogCoord, col);
  40. return col;
  41. }
  42. ENDCG
  43. }
  44. }
  45. }