Advertisement
Guest User

Untitled

a guest
May 20th, 2019
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.27 KB | None | 0 0
  1.  
  2. Shader "Unlit/VertexColorShader"
  3. {
  4. Properties
  5. {
  6. _MainTex ("Texture", 2D) = "white" {}
  7. }
  8. SubShader
  9. {
  10. Tags { "RenderType"="Opaque" }
  11. LOD 100
  12. CULL off
  13. Pass
  14. {
  15. CGPROGRAM
  16. #pragma vertex vert
  17. #pragma fragment frag
  18. // make fog work
  19. #pragma multi_compile_fog
  20.  
  21. #include "UnityCG.cginc"
  22.  
  23.  
  24.  
  25. struct v2f
  26. {
  27. float2 uv : TEXCOORD0;
  28. UNITY_FOG_COORDS(1)
  29. float4 vertex : SV_POSITION;
  30. float4 color: COLOR;
  31. };
  32.  
  33. sampler2D _MainTex;
  34. float4 _MainTex_ST;
  35.  
  36. v2f vert (appdata_full v)
  37. {
  38. v2f o;
  39. o.vertex = UnityObjectToClipPos(v.vertex);
  40. o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
  41. o.color = v.color;
  42. UNITY_TRANSFER_FOG(o,o.vertex);
  43. return o;
  44. }
  45.  
  46. fixed4 frag (v2f i) : SV_Target
  47. {
  48. // sample the texture
  49. fixed4 col = i.color;
  50. UNITY_APPLY_FOG(i.fogCoord, col);
  51. return col;
  52. }
  53. ENDCG
  54. }
  55. }
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement