Advertisement
Guest User

Vertex Color Unlit - Unity Shader

a guest
Jul 26th, 2015
906
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.63 KB | None | 0 0
  1. Shader "Custom/VertexColorUnlit" {
  2. Category {
  3. Tags { "RenderType"="Opaque" }
  4. Lighting Off
  5.  
  6. SubShader {
  7. Pass {
  8.  
  9. CGPROGRAM
  10. #pragma vertex vert
  11. #pragma fragment frag
  12.  
  13. #include "UnityCG.cginc"
  14.  
  15. struct appdata_t {
  16. float4 vertex : POSITION;
  17. fixed4 color : COLOR;
  18. };
  19.  
  20. struct v2f {
  21. float4 vertex : SV_POSITION;
  22. fixed4 color : COLOR;
  23. };
  24.  
  25. v2f vert (appdata_t v)
  26. {
  27. v2f o;
  28. o.vertex = mul(UNITY_MATRIX_MVP, v.vertex);
  29. o.color = v.color;
  30. return o;
  31. }
  32.  
  33. fixed4 frag (v2f i) : SV_Target
  34. {
  35. return i.color;
  36. }
  37. ENDCG
  38. }
  39. }
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement