Advertisement
Juleru

Internal-Colored2

Oct 29th, 2018
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.20 KB | None | 0 0
  1. Shader "Internal-Colored2" {
  2. Properties {
  3. _Color ("Color", Color) = (1,1,1,1)
  4. _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
  5.  
  6. _SrcBlend ("SrcBlend", Int) = 5.0 // SrcAlpha
  7. _DstBlend ("DstBlend", Int) = 10.0 // OneMinusSrcAlpha
  8. _ZWrite ("ZWrite", Int) = 1.0 // On
  9. _ZTest ("ZTest", Int) = 4.0 // LEqual
  10. _Cull ("Cull", Int) = 0.0 // Off
  11. _ZBias ("ZBias", Float) = 0.0
  12.  
  13. }
  14.  
  15. SubShader {
  16. Tags {"Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent"}
  17. Cull Off
  18.  
  19. // Non-lightmapped
  20. Pass {
  21. Tags { "LightMode" = "Vertex" }
  22. Material {
  23. Diffuse [_Color]
  24. Ambient [_Color]
  25. }
  26. Lighting On
  27. SeparateSpecular On
  28. SetTexture [_MainTex] {
  29. Combine texture * primary DOUBLE, texture * primary
  30. }
  31. }
  32.  
  33. Pass {
  34. Tags{ "LIGHTMODE" = "VertexLM" "QUEUE" = "Transparent" "IGNOREPROJECTOR" = "true" "RenderType" = "Transparent" }
  35.  
  36. Blend [_SrcBlend] [_DstBlend]
  37. ZWrite [_ZWrite]
  38. ZTest [_ZTest]
  39. Cull [_Cull]
  40. Offset [_ZBias], [_ZBias]
  41.  
  42. CGPROGRAM
  43. #pragma vertex vert
  44. #pragma fragment frag
  45. #pragma target 2.0
  46. #pragma multi_compile _ UNITY_SINGLE_PASS_STEREO STEREO_INSTANCING_ON STEREO_MULTIVIEW_ON
  47. #include "UnityCG.cginc"
  48.  
  49. struct appdata_t {
  50. float4 vertex : POSITION;
  51. float4 color : COLOR;
  52. UNITY_VERTEX_INPUT_INSTANCE_ID
  53. };
  54.  
  55. struct v2f {
  56. fixed4 color : COLOR;
  57. float4 vertex : SV_POSITION;
  58. UNITY_VERTEX_OUTPUT_STEREO
  59. };
  60.  
  61. float4 _Color;
  62.  
  63. v2f vert (appdata_t v) {
  64. v2f o;
  65. UNITY_SETUP_INSTANCE_ID(v);
  66. UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(o);
  67. o.vertex = UnityObjectToClipPos(v.vertex);
  68. o.color = v.color * _Color;
  69. return o;
  70. }
  71.  
  72. fixed4 frag (v2f i) : SV_Target {
  73. return i.color;
  74. }
  75.  
  76. ENDCG
  77. }
  78. }
  79. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement