You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

39 lines
598 B

  1. Shader "Hidden/VertexIdVariableNode"
  2. {
  3. SubShader
  4. {
  5. Pass
  6. {
  7. CGPROGRAM
  8. #include "UnityCG.cginc"
  9. #pragma vertex vert
  10. #pragma fragment frag
  11. struct appdata_custom
  12. {
  13. float4 vertex : POSITION;
  14. uint vertexId : SV_VertexID;
  15. };
  16. struct v2f_custom
  17. {
  18. float4 pos : SV_POSITION;
  19. half vertexId : TEXCOORD0;
  20. };
  21. v2f_custom vert( appdata_custom v )
  22. {
  23. v2f_custom o;
  24. o.pos = UnityObjectToClipPos (v.vertex);
  25. o.vertexId = v.vertexId;
  26. return o;
  27. }
  28. float4 frag( v2f_custom i ) : SV_Target
  29. {
  30. return i.vertexId;
  31. }
  32. ENDCG
  33. }
  34. }
  35. }