Particle Cutout that cast shadow ?

What shader is required to cast shadows with particle cutout (in 3.x)?

Here is the shader I use :

    Shader "Particles/Cutout" {
Properties {
    _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
    _MainTex ("Particle Texture", 2D) = "white"
}

SubShader {
    Tags { "Queue" = "Transparent" }
    Cull Off
    Lighting Off
    ZWrite On
    //Fog { color (0,0,0,0) }
    AlphaTest Greater .5
    ColorMask RGB
    BindChannels {
        Bind "Color", color
        Bind "Vertex", vertex
        Bind "TexCoord", texcoord
    }
    Pass {
        SetTexture [_MainTex] {
            constantColor [_TintColor]
            combine constant * primary DOUBLE
        }
        SetTexture [_MainTex] {
            combine previous * texture
        }
    }
}
}

This Shader is transparent and transparent object cant cast shadows in unity
try making this shader and cutout shader it can casta nd recive shadows

try sumthing like this

_Cutoff (“Alpha cutoff”, Range(0,1)) = 0.5

Tags {“Queue”=“AlphaTest” “IgnoreProjector”=“True” “RenderType”=“Transparentcutout”}

#pragma surface surf Lambert alphatest:_Cutoff

and it should work
i hope it helps :slight_smile:

If you don’t want to turn the shader into a surface shader, you could add another pass which takes care of the shadow casting, like so.

Shader "JM/CutoffShadowCast" {
Properties {
	_Cutoff ("Outline Thickness", Range(0.0,1.0)) = 0.5
    _TintColor ("Tint Color", Color) = (0.5,0.5,0.5,0.5)
    _MainTex ("Particle Texture", 2D) = "white"
}
 
SubShader {
    Cull Off
    Lighting Off
    ZWrite On
    //Fog { color (0,0,0,0) }
    AlphaTest Greater [_Cutoff]
    ColorMask RGB
    BindChannels {
        Bind "Color", color
        Bind "Vertex", vertex
        Bind "TexCoord", texcoord
    }

	Pass{
	Tags {  "LightMode" = "ShadowCaster" }
	SetTexture [_MainTex]
	}


    Pass {

	Tags { "Queue" = "AlphaTest" "RenderType"="Transparentcutout" }

        SetTexture [_MainTex] {
            constantColor [_TintColor]
            combine constant * primary DOUBLE
        }
        SetTexture [_MainTex] {
            combine previous * texture
        }
    }
}
Fallback "VertexLit"
}

Best Regards