Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Shader "Custom/GunShaderVertexLit" {
- Properties{
- _MainTex("Base (RGB)", 2D) = "white" {}
- }
- SubShader
- {
- Tags{ "RenderType" = "Opaque" "Queue" = "Geometry+1" }
- LOD 80
- Pass{
- ZTest Always
- ColorMask 0
- }
- // Non-lightmapped
- Pass{
- Tags{ "LightMode" = "Vertex" }
- Material{
- Diffuse(1,1,1,1)
- Ambient(1,1,1,1)
- }
- Lighting On
- SetTexture[_MainTex]{
- constantColor(1,1,1,1)
- Combine texture * primary DOUBLE, constant // UNITY_OPAQUE_ALPHA_FFP
- }
- }
- // Lightmapped, encoded as dLDR
- Pass{
- Tags{ "LightMode" = "VertexLM" }
- BindChannels{
- Bind "Vertex", vertex
- Bind "normal", normal
- Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
- Bind "texcoord", texcoord1 // main uses 1st uv
- }
- SetTexture[unity_Lightmap]{
- matrix[unity_LightmapMatrix]
- combine texture
- }
- SetTexture[_MainTex]{
- constantColor(1,1,1,1)
- combine texture * previous DOUBLE, constant // UNITY_OPAQUE_ALPHA_FFP
- }
- }
- // Lightmapped, encoded as RGBM
- Pass{
- Tags{ "LightMode" = "VertexLMRGBM" }
- BindChannels{
- Bind "Vertex", vertex
- Bind "normal", normal
- Bind "texcoord1", texcoord0 // lightmap uses 2nd uv
- Bind "texcoord", texcoord1 // main uses 1st uv
- }
- SetTexture[unity_Lightmap]{
- matrix[unity_LightmapMatrix]
- combine texture * texture alpha DOUBLE
- }
- SetTexture[_MainTex]{
- constantColor(1,1,1,1)
- combine texture * previous QUAD, constant // UNITY_OPAQUE_ALPHA_FFP
- }
- }
- UsePass "VertexLit/SHADOWCASTER"
- }
- Fallback "Mobile/VertexLit"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement