Texture2D FirstTexture : register(t0);
sampler2D tex0 : register(S0) = sampler_state
{
Texture = <FirstTexture>;
};
float4 main(float2 uv : TEXCOORD) : COLOR
{
// Laplacian edge-enhancement using a 4-connected grid
float4 p10 = tex2D(tex0, float2(uv.x,uv.y-1));
float4 p01 = tex2D(tex0, float2(uv.x-1,uv.y));
float4 p11 = tex2D(tex0, float2(uv.x,uv.y));
float4 p21 = tex2D(tex0, float2(uv.x+1,uv.y));
float4 p12 = tex2D(tex0, float2(uv.x,uv.y+1));
float4 pdiff = p11*4 - p10 - p01 - p21 - p12;
float4 pixelColor = p11 + pdiff*2;
return saturate(pixelColor);
}
When I just display pdiff on the screen , I get a black screen ( obviously something isn't working )