12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- //Very simple shader that displays a single color but with transparency and no depth testing.
- //Used on the colored cubes in the Simple Marker Placement sample.
- Shader "Unlit/UnlitTrans"
- {
- Properties
- {
- _Color("Color", Color) = (1,1,1,1)
- }
- SubShader
- {
- Tags { "RenderType"="Transparent" "RenderQueue"="Transparent" }
- Blend SrcAlpha OneMinusSrcAlpha
- ZTest Always
- ZWrite Off
- Pass
- {
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- // make fog work
- #pragma multi_compile_fog
-
- #include "UnityCG.cginc"
- struct appdata
- {
- float4 vertex : POSITION;
- };
- struct v2f
- {
- UNITY_FOG_COORDS(1)
- float4 vertex : SV_POSITION;
- };
- ;
-
- v2f vert (appdata v)
- {
- v2f o;
- o.vertex = UnityObjectToClipPos(v.vertex);
- UNITY_TRANSFER_FOG(o,o.vertex);
- return o;
- }
-
- fixed4 _Color;
- fixed4 frag (v2f i) : SV_Target
- {
- fixed4 col = _Color;
- // apply fog
- UNITY_APPLY_FOG(i.fogCoord, col);
- return _Color;
- }
- ENDCG
- }
- }
- }
|