Advertisement
Guest User

Untitled

a guest
Jul 31st, 2018
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.88 KB | None | 0 0
  1. Shader "Unlit/ColorReplacement" {
  2. Properties{
  3. _Color("Main Color", Color) = (1,0,0,1)
  4. }
  5.  
  6. SubShader{
  7. Tags{ "RenderType" = "Opaque" }
  8. LOD 100
  9.  
  10. Pass{
  11. CGPROGRAM
  12. #pragma vertex vert
  13. #pragma fragment frag
  14. #pragma target 2.0
  15. #pragma multi_compile_fog
  16.  
  17. #include "UnityCG.cginc"
  18.  
  19. struct appdata_t {
  20. float4 vertex : POSITION;
  21. UNITY_VERTEX_INPUT_INSTANCE_ID
  22. };
  23.  
  24. struct v2f {
  25. float4 vertex : SV_POSITION;
  26. UNITY_FOG_COORDS(0)
  27. UNITY_VERTEX_OUTPUT_STEREO
  28. };
  29.  
  30. fixed4 _Color;
  31.  
  32. v2f vert(appdata_t v)
  33. {
  34. v2f o;
  35. UNITY_SETUP_INSTANCE_ID(v);
  36. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  37. o.vertex = UnityObjectToClipPos(v.vertex);
  38. UNITY_TRANSFER_FOG(o,o.vertex);
  39. return o;
  40. }
  41.  
  42. fixed4 frag(v2f i) : COLOR
  43. {
  44. fixed4 col = _Color;
  45. UNITY_APPLY_FOG(i.fogCoord, col);
  46. UNITY_OPAQUE_ALPHA(col.a);
  47. return col;
  48. }
  49. ENDCG
  50. }
  51. }
  52.  
  53. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement