VertexColor.shader 841 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. // Upgrade NOTE: replaced 'mul(UNITY_MATRIX_MVP,*)' with 'UnityObjectToClipPos(*)'
  2. Shader "Custom/VertexColor" {
  3. SubShader {
  4. Pass {
  5. LOD 200
  6. CGPROGRAM
  7. #pragma vertex vert
  8. #pragma fragment frag
  9. struct VertexInput {
  10. float4 v : POSITION;
  11. float4 color: COLOR;
  12. };
  13. struct VertexOutput {
  14. float4 pos : SV_POSITION;
  15. float4 col : COLOR;
  16. };
  17. VertexOutput vert(VertexInput v) {
  18. VertexOutput o;
  19. o.pos = UnityObjectToClipPos(v.v);
  20. o.col = v.color;
  21. return o;
  22. }
  23. float4 frag(VertexOutput o) : COLOR {
  24. return o.col;
  25. }
  26. ENDCG
  27. }
  28. }
  29. }