Unlit.shader 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. Shader /*ase_name*/ "Hidden/Templates/Unlit" /*end*/
  2. {
  3. Properties
  4. {
  5. /*ase_props*/
  6. }
  7. SubShader
  8. {
  9. /*ase_subshader_options:Name=Additional Options
  10. Option:Vertex Position,InvertActionOnDeselection:Absolute,Relative:Relative
  11. Absolute:SetDefine:ASE_ABSOLUTE_VERTEX_POS 1
  12. Absolute:SetPortName:1,Vertex Position
  13. Relative:SetPortName:1,Vertex Offset
  14. */
  15. Tags { "RenderType"="Opaque" }
  16. LOD 100
  17. /*ase_all_modules*/
  18. /*ase_pass*/
  19. Pass
  20. {
  21. Name "Unlit"
  22. CGPROGRAM
  23. #ifndef UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX
  24. //only defining to not throw compilation error over Unity 5.5
  25. #define UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(input)
  26. #endif
  27. #pragma vertex vert
  28. #pragma fragment frag
  29. #pragma multi_compile_instancing
  30. #include "UnityCG.cginc"
  31. /*ase_pragma*/
  32. struct appdata
  33. {
  34. float4 vertex : POSITION;
  35. float4 color : COLOR;
  36. /*ase_vdata:p=p;c=c*/
  37. UNITY_VERTEX_INPUT_INSTANCE_ID
  38. };
  39. struct v2f
  40. {
  41. float4 vertex : SV_POSITION;
  42. #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
  43. float3 worldPos : TEXCOORD0;
  44. #endif
  45. /*ase_interp(1,):sp=sp.xyzw;wp=tc0*/
  46. UNITY_VERTEX_INPUT_INSTANCE_ID
  47. UNITY_VERTEX_OUTPUT_STEREO
  48. };
  49. /*ase_globals*/
  50. v2f vert ( appdata v /*ase_vert_input*/)
  51. {
  52. v2f o;
  53. UNITY_SETUP_INSTANCE_ID(v);
  54. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  55. UNITY_TRANSFER_INSTANCE_ID(v, o);
  56. /*ase_vert_code:v=appdata;o=v2f*/
  57. float3 vertexValue = float3(0, 0, 0);
  58. #if ASE_ABSOLUTE_VERTEX_POS
  59. vertexValue = v.vertex.xyz;
  60. #endif
  61. vertexValue = /*ase_vert_out:Vertex Offset;Float3*/vertexValue/*end*/;
  62. #if ASE_ABSOLUTE_VERTEX_POS
  63. v.vertex.xyz = vertexValue;
  64. #else
  65. v.vertex.xyz += vertexValue;
  66. #endif
  67. o.vertex = UnityObjectToClipPos(v.vertex);
  68. #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
  69. o.worldPos = mul(unity_ObjectToWorld, v.vertex).xyz;
  70. #endif
  71. return o;
  72. }
  73. fixed4 frag (v2f i /*ase_frag_input*/) : SV_Target
  74. {
  75. UNITY_SETUP_INSTANCE_ID(i);
  76. UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(i);
  77. fixed4 finalColor;
  78. #ifdef ASE_NEEDS_FRAG_WORLD_POSITION
  79. /*ase_local_var:wp*/float3 WorldPosition = i.worldPos;
  80. #endif
  81. /*ase_frag_code:i=v2f*/
  82. finalColor = /*ase_frag_out:Frag Color;Float4*/fixed4(1,1,1,1)/*end*/;
  83. return finalColor;
  84. }
  85. ENDCG
  86. }
  87. }
  88. CustomEditor "AmplifyShaderEditor.MaterialInspector"
  89. }