Advertisement
dnnkeeper

GunShaderVertexLit

Feb 19th, 2016
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.60 KB | None | 0 0
  1. Shader "Custom/GunShaderVertexLit" {
  2.     Properties{
  3.         _MainTex("Base (RGB)", 2D) = "white" {}
  4.     }
  5.  
  6.     SubShader
  7.     {
  8.         Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+1" }
  9.         LOD 80
  10.  
  11.         Pass{
  12.             ZTest Always
  13.             ColorMask 0
  14.         }
  15.  
  16.         // Non-lightmapped
  17.         Pass{
  18.             Tags{ "LightMode" = "Vertex" }
  19.  
  20.             Material{
  21.                 Diffuse(1,1,1,1)
  22.                 Ambient(1,1,1,1)
  23.             }
  24.             Lighting On
  25.                 SetTexture[_MainTex]{
  26.                 constantColor(1,1,1,1)
  27.                 Combine texture * primary DOUBLE, constant // UNITY_OPAQUE_ALPHA_FFP
  28.             }
  29.         }
  30.  
  31.         // Lightmapped, encoded as dLDR
  32.         Pass{
  33.             Tags{ "LightMode" = "VertexLM" }
  34.  
  35.             BindChannels{
  36.                 Bind "Vertex", vertex
  37.                 Bind "normal", normal
  38.                 Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
  39.                 Bind "texcoord", texcoord1 // main uses 1st uv
  40.             }
  41.  
  42.             SetTexture[unity_Lightmap]{
  43.                 matrix[unity_LightmapMatrix]
  44.                 combine texture
  45.             }
  46.             SetTexture[_MainTex]{
  47.                 constantColor(1,1,1,1)
  48.                 combine texture * previous DOUBLE, constant // UNITY_OPAQUE_ALPHA_FFP
  49.             }
  50.         }
  51.  
  52.         // Lightmapped, encoded as RGBM
  53.         Pass{
  54.             Tags{ "LightMode" = "VertexLMRGBM" }
  55.  
  56.             BindChannels{
  57.                 Bind "Vertex", vertex
  58.                 Bind "normal", normal
  59.                 Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
  60.                 Bind "texcoord", texcoord1 // main uses 1st uv
  61.             }
  62.  
  63.             SetTexture[unity_Lightmap]{
  64.                 matrix[unity_LightmapMatrix]
  65.                 combine texture * texture alpha DOUBLE
  66.             }
  67.             SetTexture[_MainTex]{
  68.                 constantColor(1,1,1,1)
  69.                 combine texture * previous QUAD, constant // UNITY_OPAQUE_ALPHA_FFP
  70.             }
  71.         }
  72.  
  73.         UsePass "VertexLit/SHADOWCASTER"
  74.     }
  75.     Fallback "Mobile/VertexLit"
  76. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement