- Home /
shader : chroma + edge thin?
Hi...
I use this shader for the chroma
Shader "Chromakey/Mask" {
Properties {
_MainTex ("Base (RGB)", 2D) = "white" {}
_Transparency ("Transparency", Range (0,1.0)) = 0
}
SubShader {
ZWrite Off
Blend SrcAlpha OneMinusSrcAlpha
CGINCLUDE
#include "UnityCG.cginc"
ENDCG
Pass
{
Lighting Off
//Cull Off ZWrite On Lighting Off Fog { Mode off }
//Blend SrcAlpha OneMinusSrcAlpha
CGPROGRAM
#pragma vertex vert_img
#pragma fragment frag
#pragma fragmentoption ARB_precision_hint_fastest
#pragma target 3.0
uniform sampler2D _MainTex;
uniform float _Transparency;
half4 frag (v2f_img i) : COLOR
{
half4 col = tex2D(_MainTex, i.uv);
half4 final = ((col.g - (col.r + col.b)) > _Transparency ) ? half4(col.rgb,0.0) : half4(col.rgb,1.0);
return final;
}
ENDCG
}
}
Fallback off
}
my example to remove the green screen behind the man .
I want to add a new 2 options :
1- after the green screen is gone , make as in after effects "Edge Thin"
2- draw outline over the man.
thank you ...
Comment