Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/Utility/VertColourCheck"
- {
- Properties
- {
- }
- SubShader
- {
- Tags { "RenderType"="Opaque" }
- LOD 100
- Pass
- {
- CGPROGRAM
- #pragma vertex vert
- #pragma fragment frag
- // make fog work
- #pragma multi_compile_fog
- #include "UnityCG.cginc"
- struct appdata
- {
- float4 vertex : POSITION;
- float4 color : COLOR;
- };
- struct VertOut
- {
- UNITY_FOG_COORDS(1)
- float4 vertex : SV_POSITION;
- float4 color : COLOR;
- };
- VertOut vert (appdata v)
- {
- VertOut o;
- o.vertex = UnityObjectToClipPos(v.vertex);
- o.color = v.color;
- UNITY_TRANSFER_FOG(o,o.vertex);
- return o;
- }
- fixed4 frag (VertOut i) : SV_Target
- {
- fixed4 col = i.color;
- // apply fog
- UNITY_APPLY_FOG(i.fogCoord, col);
- return col;
- }
- ENDCG
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement