Advertisement
Guest User

Untitled

a guest
Aug 1st, 2011
63
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Based on Particles/VertexLit Blended
  2.  
  3. Shader "Custom/VertexLit Blended w Add and Mult" {
  4.  
  5. Properties {
  6.  
  7. // _EmisColor ("Emissive Color", Color) = (.2,.2,.2,0)
  8.  
  9. _Opacity ("Object Opacity", Range(0.0, 1.0) ) = 1.0
  10.  
  11.  
  12.  
  13. _MainTex ("Main Diffuse", 2D) = "white" {}
  14.  
  15. _AddTex ("Hilight Texture", 2D) = "white" {}
  16.  
  17. _MultTex ("Shadow Texture", 2D) = "white" {}
  18.  
  19.  
  20.  
  21. _TintColor ( "Main Tint Color", Color) = (.5, .5, .5, 0)
  22.  
  23. _ATintColor ( "Hilight Tint Color", Color) = (0,0,0,0)
  24.  
  25. _MTintColor ( "Shadow Color", Color) = (1, 1, 1, 1)
  26.  
  27.  
  28.  
  29. }
  30.  
  31.  
  32.  
  33. SubShader {
  34.  
  35. // Preps and Setup
  36.  
  37. Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
  38.  
  39. Tags { "LightMode" = "Vertex" }
  40.  
  41. Cull Off
  42.  
  43. Lighting On
  44.  
  45. Material { } //Emission [_EmisColor] }
  46.  
  47. ColorMaterial AmbientAndDiffuse
  48.  
  49. ZWrite Off
  50.  
  51. ColorMask RGB
  52.  
  53. Blend SrcAlpha OneMinusSrcAlpha
  54.  
  55. AlphaTest Greater .001
  56.  
  57.  
  58.  
  59. Pass {
  60.  
  61. // Set Tint Color and apply main texture's alpha to it.
  62.  
  63. SetTexture [_MainTex]{
  64.  
  65. constantColor [_TintColor]
  66.  
  67. combine constant lerp (constant) texture
  68.  
  69. }
  70.  
  71. // Apply main texture with the Opacity setting included
  72.  
  73. SetTexture [_MainTex]{
  74.  
  75. constantColor(0,0,0,[_Opacity])
  76.  
  77. combine previous, texture * constant
  78.  
  79. }
  80.  
  81. // Apply lighting
  82.  
  83. SetTexture [_MainTex]{
  84.  
  85. combine primary * previous
  86.  
  87. }
  88.  
  89. }
  90.  
  91.  
  92.  
  93. Blend SrcAlpha One
  94.  
  95. Pass {
  96.  
  97. // Apply the Highlights, using the opacity in AddTex.
  98.  
  99. SetTexture [_AddTex]{
  100.  
  101. ConstantColor [_ATintColor]
  102.  
  103. combine constant, texture * constant
  104.  
  105. }
  106.  
  107. }
  108.  
  109.  
  110.  
  111. //Blend SrcAlpha OneMinusSrcAlpha
  112.  
  113. Blend Zero SrcColor
  114.  
  115. Pass {
  116.  
  117. // Apply the Shadows color, using opacity in MultTex
  118.  
  119. SetTexture [_MultTex] {
  120.  
  121. ConstantColor [_MTintColor]
  122.  
  123. combine constant, texture * constant
  124.  
  125. }
  126.  
  127. }
  128.  
  129.  
  130.  
  131. }
  132.  
  133. }
Advertisement
RAW Paste Data Copied
Advertisement