Ok, I'm making a tree! I have several flat planes with alpha chaneled textures. I am using this shader to render both side of the planes. Shader "Vegetation" { Properties { _Color ("Main Color", Color) = (.5, .5, .5, .5) _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} _Cutoff ("Base Alpha cutoff", Range (0,.9)) = .5 } SubShader { // Set up basic lighting Material { Diffuse [_Color] Ambient [_Color] } Lighting On // Render both front and back facing polygons. Cull Off // first pass: // render any pixels that are more than [_Cutoff] opaque Pass { AlphaTest Greater [_Cutoff] SetTexture [_MainTex] { combine texture * primary, texture } } // Second pass: // render in the semitransparent details. Pass { // Dont write to the depth buffer ZWrite off // Only render pixels less or equal to the value AlphaTest LEqual [_Cutoff] // Set up alpha blending Blend SrcAlpha OneMinusSrcAlpha SetTexture [_MainTex] { combine texture * primary, texture } } } } However, when I rotate a tree branch so that one of the far faces of a plane is facing at the lightsource, that whole plane is black, no matter what angle you look at it from. This can be fixed by having lightsources on both sides, but I would rather not do this. Here is a image showing the branch looking normal, and what it looks like after it is rotated in a certain way.
First off, please put your code inside code tags, so we don't lose formatting ;-) Apart from that, two-sided lighting is pretty expensive. The recommended approach is to either use a custom vertex program, add an emissive color so it doesn't become completely dark, or turn on culling, double the duplicate the planes in you 3D app flip the normals... To add the emission color, try this: Code (csharp): Shader "Vegetation" { Properties { _Color ("Main Color", Color) = (.5, .5, .5, .5) _MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {} _Cutoff ("Base Alpha cutoff", Range (0,.9)) = .5 } SubShader { // Set up basic lighting Material { Diffuse [_Color] Ambient [_Color] } Lighting On // Render both front and back facing polygons. Cull Off // first pass: // render any pixels that are more than [_Cutoff] opaque Pass { AlphaTest Greater [_Cutoff] SetTexture [_MainTex] { combine texture * primary, texture } } // Second pass: // render in the semitransparent details. Pass { // Dont write to the depth buffer ZWrite off // Don't write pixels we have already written. ZTest Less // Only render pixels less or equal to the value AlphaTest LEqual [_Cutoff] // Set up alpha blending Blend SrcAlpha OneMinusSrcAlpha SetTexture [_MainTex] { combine texture * primary, texture } } } } Basically, you add a color property, which you then use with the emission keyword in your lighting setup. (I've also changed the Depth testing of the 2nd pass to optimize fillrate a bit)