Problem with Blob Shadow and Vertex alpha blending

Hi everyone, I have a problem when rendering blob shadow on top of vertex blend geometry. If the shadow is above the part of the geometry that has alpha = 0 (fully transparent), the shadow renders and is fully opaque. But if I move the shadow to the part where alpha = 1, the shadow disappear.

The shader used for the shadow blob is the standard FX/Projector Multiply

Shader "FX/Projector Multiply" { 
	Properties {
		_ShadowTex ("Cookie", 2D) = "gray" { TexGen ObjectLinear }
		_FalloffTex ("FallOff", 2D) = "white" { TexGen ObjectLinear	}
	}

	Subshader {
		Tags { "RenderType"="Transparent" }
		Pass {
			ZWrite Off
			Offset -1, -1

			Fog { Color (1, 1, 1) }
			AlphaTest Greater 0
			ColorMask RGB
			Blend DstColor Zero
			SetTexture [_ShadowTex] {
				combine texture, ONE - texture
				Matrix [_Projector]
			}
			SetTexture [_FalloffTex] {
				constantColor (1,1,1,0)
				combine previous lerp (texture) constant
				Matrix [_ProjectorClip]
			}
		}
	}
}

And the one used to render the semi transparent geometry is this one (simple alpha blending with “Blend SrcAlpha OneMinusSrcAlpha”):

Shader "LinearFog/Maya Vertexlit/Alpha VertexLit" {

Properties {
    _Color ("Main Color", Color) = (1,1,1,1)
    _SpecColor ("Spec Color", Color) = (1,1,1,0)
    _Emission ("Emmisive Color", Color) = (0,0,0,0)
    _Shininess ("Shininess", Range (0.01, 1)) = 0.7
    _MainTex ("Base (RGB) Trans (A)", 2D) = "white" {}
}

SubShader {
    Fog { Mode Linear Range  [_FogNear], [_FogFar] }
    ZWrite Off
    Alphatest Greater 0
    Tags {Queue=Transparent}
    Blend SrcAlpha OneMinusSrcAlpha 
    ColorMask RGB
    Pass {
        Material {
            Shininess [_Shininess]
            Specular [_SpecColor]
            Emission [_Emission]    
        }
        ColorMaterial AmbientAndDiffuse
        Lighting On
        SeperateSpecular On
        SetTexture [_MainTex] {
            Combine texture * primary, texture * primary
        }
        SetTexture [_MainTex] {
            constantColor [_Color]
            Combine previous * constant DOUBLE, previous * constant
        } 
    }
}

Fallback "Alpha/VertexLit", 1


}

Now, I’ve played with pretty much all value possible (blend equation, combine parameter, etc) but I just can’t seem to be able to render the shadow on top of the opaque part (alpha seem to be inverted). Also, if I modify the shadow shader so that it projects on all the scene, everything is black except the part where vertex alpha is 1. Anyone have any idea why? Here some screenshots so that you guys can have a better idea of what I’m talking about …any help is greatly appreciated.


Hi, I finally fixed the issue, here’s the solution for those interested:

  1. The shader projector shader does not have render queue assigned, so it is rendered before all semi-transparent geometry. So first the shadow blobs are rendered, and then the vertex-colored decals are rendered on top.
    Add this to the projector shader:
    Tags { “RenderType”=“Transparent” “Queue”=“Transparent+100” }

  2. The shadow projector affects both the ground mesh the vertex-colored decals. This creates both double-darkening is not good for performance. Add this to the vertex lit alpha shader (instead of current Tags{Queue=Transparent}):
    Tags {“Queue”=“Transparent” “IgnoreProjector”=“True”}