﻿Shader "TES Unity/Standard Blended"
{
	Properties
	{
		_Color ("Color", Color) = (1,1,1,1)
		_MainTex ("Albedo (RGB)", 2D) = "white" {}
		_Glossiness ("Smoothness", Range(0,1)) = 0.5
		_Metallic ("Metallic", Range(0,1)) = 0.0

		[HideInInspector] _SrcBlend("__src", Float) = 1.0
		[HideInInspector] _DstBlend("__dst", Float) = 0.0
	}
	SubShader
	{
		Tags { "RenderType"="Transparent" "Queue"="Transparent" }
		Blend[_SrcBlend][_DstBlend]
		ZWrite Off

		CGPROGRAM
		#pragma surface surf Standard alpha:fade
		#pragma target 3.0

		sampler2D _MainTex;

		struct Input
		{
			float2 uv_MainTex;
		};
		
		fixed _Cutoff;
		half _Glossiness;
		half _Metallic;
		half4 _Color;

		void surf (Input i, inout SurfaceOutputStandard o)
		{
			half4 c = tex2D (_MainTex, i.uv_MainTex) * _Color;

			//if ( c.a <= 0.0 ) discard;

			o.Albedo = c.rgb;
			o.Metallic = _Metallic;
			o.Smoothness = _Glossiness;
			o.Alpha = c.a;
		}
		ENDCG
	}
	FallBack "Diffuse"
}
﻿Shader "TES Unity/Standard Blended"
{
	Properties
	{
		_Color ("Color", Color) = (1,1,1,1)
		_MainTex ("Albedo (RGB)", 2D) = "white" {}
		_Glossiness ("Smoothness", Range(0,1)) = 0.5
		_Metallic ("Metallic", Range(0,1)) = 0.0

		[HideInInspector] _SrcBlend("__src", Float) = 1.0
		[HideInInspector] _DstBlend("__dst", Float) = 0.0
		[HideInInspector]_Cutoff("cutoff", Float) = 0.5
	}
	SubShader
	{
		Tags { "RenderType"="Transparent" "Queue"="Transparent" }
		Blend[_SrcBlend][_DstBlend]
		ZWrite Off

		CGPROGRAM
		#pragma surface surf Standard alpha:fade
		#pragma target 3.0

		sampler2D _MainTex;

		struct Input
		{
			float2 uv_MainTex;
		};
		
		half _Glossiness;
		half _Metallic;
		half4 _Color;

		void surf (Input i, inout SurfaceOutputStandard o)
		{
			half4 c = tex2D (_MainTex, i.uv_MainTex) * _Color;

			o.Albedo = c.rgb;
			o.Metallic = _Metallic;
			o.Smoothness = _Glossiness;
			o.Alpha = c.a;
		}
		ENDCG
	}
	FallBack "Transparent/Cutout/Diffuse"
}
Fix for transparent material shadows. Alpha blended material + alpha tested shadows
Fix for transparent material shadows. Alpha blended material + alpha tested shadows
