imagination XD

realizing dream

Shadowed Transparent Cutout Shader


Want to make a realistic tree but the leaves don’t cast shadows ? Having a problem with built-in Transparent/Cutout/Diffuse or Transparent/Cutout/Soft-edge unlit ?

Well, just use my customized shader named “ALPHARIZED SHADOW”.

Before. Culled!

Before. Culled!

After. Not culled, shadowed.

After. Not culled, shadowed.

Unity - Main.unity - MagicPuppy - PC, Mac & Linux Standalone_5Actually, in this code, Alpharized Shadow, I just disabled the cull on Transparent Cutout Diffuse shader. I’m having a research on making Additively Alpharized Shadow. What does it do ? Well, it’s simple, we enable shadow on Particle/Additive shader. It’ll make a realistic cloud effect.

Here’s the code for Alpharized Shadow

Shader "Alpharized Shadow" {
Properties {
	_Color ("Main Color", Color) = (1, 1, 1, 1)
	_MainTex ("Base (RGB) Alpha (A)", 2D) = "white" {}
	_Cutoff ("Base Alpha cutoff", Range (0,.9)) = .5
	_Multiplier("Color Multiplier",Range(1,10)) = 1.0
SubShader {
	Tags { "Queue"="AlphaTest" "RenderType"="TransparentCutout" }
	LOD 200
	Cull Off Lighting Off

#pragma surface surf Lambert alphatest:_Cutoff

sampler2D _MainTex;
fixed4 _Color;
float _Multiplier;

struct Input {
	float2 uv_MainTex;

void surf (Input IN, inout SurfaceOutput o) {
	fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * _Color * _Multiplier;
	o.Albedo = c.rgb;
	o.Alpha = c.a;


Fallback "Transparent/Cutout/VertexLit"


Started making games since 13 year old. 3D CGI Weeaboo | VFX Otaku | Anime Researcher | Indie Game Dev | VR Chuunibyou

7 thoughts on “Shadowed Transparent Cutout Shader

  1. Thank you for the great shader.
    I changed it a little in order to make toon looking, but the origin one helps me a lot.

  2. Could you please help me? I am having a problem with textures on the palm trees, i have tried several models and everyone i tried does it. The problem is that when i am looking at the leaves of the tree from top it is normal, but when i look from beneath it it looks weird – the leaves are completly transparent. Any ideas how to fix it? Thanks .
    Some pics: ,

  3. ” I just disabled the cull on Transparent Cutout Diffuse shader.”
    Actually no, What you actually did is that you used “Fallback “Transparent/Cutout/VertexLit”” to enable the shadows.
    I have almost exact same code as yours, except my Fallback is pointed at “Legacy Shaders/Transparent/Diffuse”.
    Thank you for the sample code tho :)


Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s