- Home /
 
               Question by 
               r_chevallier · Oct 10, 2018 at 06:18 AM · 
                shadermobilelightmapalphatransparent  
              
 
              Mobile Diffuse Shader with transparent support and Lightmap support
Hello, Looking for mobile shader code that has a Diffuse Texture with Lightmap support that can be faded to 0 alpha. I want both the game object material along with the lightmap to fade to 0 alpha simultaneously.
The Below Code that I found is almost what I need but does not have lightmap support. I am not sure how to add it. This code is nice because it prevents incorrect layering of the transparency. A little more expensive because if has two passes.
 Shader "Transparent/VertexLit with Z" {
 Properties {
     _Color ("Main Color", Color) = (1,1,1,1)
     _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
 }
  
 SubShader {
     Tags {"RenderType"="Transparent" "Queue"="Transparent"}
     // Render into depth buffer only
     Pass {
         ColorMask 0
     }
     // Render normally
     Pass {
         ZWrite Off
         Blend SrcAlpha OneMinusSrcAlpha
         ColorMask RGB
         Material {
             Diffuse [_Color]
             Ambient [_Color]
         }
         Lighting On
         SetTexture [_MainTex] {
             Combine texture * primary
             //Combine texture * primary DOUBLE, texture * primary
             } 
         }
     }
 }
The above code was found at: http://wiki.unity3d.com/index.php?title=AlphaVertexLitZ
Any Help would be greatly appreciated
               Comment
              
 
               
              Your answer
 
 
             Follow this Question
Related Questions
shader for tree leaves + lightmap 1 Answer
Shader bug or code fault? 1 Answer
 koobas.hobune.stream
koobas.hobune.stream 
                       
                
                       
			     
			 
                