Pixel Shader ps2 for WPF Chroma key
Budget: $10 – $30 USD
At present we have a pixel shader effect that removes background color (Chromakey) it is basic and does not remove color spill around the subject. We need the pixel shader to remove all background color remove color spill and smooth edges. The main color used is green as a background color.
The existing color is as follows.
/// <class>ColorKeyAlphaEffect</class>
/// <description>An effect that makes pixels of a particular color transparent.</description>
sampler2D inputSampler : register(S0);
//sampler2D Texture1 : register(s1);
//-----------------------------------------------------------------------------------------
// Shader constant register mappings (scalars - float, double, Point, Color, Point3D, etc.)
//-----------------------------------------------------------------------------------------
/// <summary>The color that becomes transparent.</summary>
/// <defaultValue>Green</defaultValue>
uniform float4 ColorKey : register(C0);
/// <summary>The tolerance in color differences.</summary>
/// <minValue>0</minValue>
/// <maxValue>1</maxValue>
/// <defaultValue>0.3</defaultValue>
uniform float Tolerance : register(C1);
float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 color = tex2D(inputSampler, uv.xy );
//float4 otherTex = tex2D(Texture1, uv);
// TO THIS
if (all(abs(color.rgb - ColorKey.rgba) < Tolerance ))
{
color.rgba=0;
;
}
return color;
}
This must work 100% with no traces of background color. The color will be changed to transparent. This is not a Unity shader but a pixel shader.
Do not bid on this job if you have no experience.
The existing color is as follows.
/// <class>ColorKeyAlphaEffect</class>
/// <description>An effect that makes pixels of a particular color transparent.</description>
sampler2D inputSampler : register(S0);
//sampler2D Texture1 : register(s1);
//-----------------------------------------------------------------------------------------
// Shader constant register mappings (scalars - float, double, Point, Color, Point3D, etc.)
//-----------------------------------------------------------------------------------------
/// <summary>The color that becomes transparent.</summary>
/// <defaultValue>Green</defaultValue>
uniform float4 ColorKey : register(C0);
/// <summary>The tolerance in color differences.</summary>
/// <minValue>0</minValue>
/// <maxValue>1</maxValue>
/// <defaultValue>0.3</defaultValue>
uniform float Tolerance : register(C1);
float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 color = tex2D(inputSampler, uv.xy );
//float4 otherTex = tex2D(Texture1, uv);
// TO THIS
if (all(abs(color.rgb - ColorKey.rgba) < Tolerance ))
{
color.rgba=0;
;
}
return color;
}
This must work 100% with no traces of background color. The color will be changed to transparent. This is not a Unity shader but a pixel shader.
Do not bid on this job if you have no experience.