I've been looking a shader like this. Basically I would apply it to an active object, and the shader would sharpen anything underneath it.
I know one exists for "blur", so I'm sure it's possible for "sharpen" as well. I've been trying to create this shader but so far I haven't succeed.
Though I'll admit, I'm not really good with shaders but hey, I'm learning!
Anyways, this is a shader (.fx) code for "sharpen" by Sphax - Flavien Clermont!
I would only use a single color active, so I wouldn't need a complex code. I've been playing with bkg; and img; but so far no luck.
// Pixel shader input structure
float4 Position : POSITION;
float2 Texture : TEXCOORD0;
// Pixel shader output structure
float4 Color : COLOR0;
// Global variables
PS_OUTPUT ps_main( in PS_INPUT In )
// Output pixel
Out.Color = tex2D(Tex0, In.Texture.xy);
Out.Color -= tex2D(Tex0, In.Texture.xy+0.001)*fCoeff;
Out.Color += tex2D(Tex0, In.Texture.xy-0.001)*fCoeff;
// Effect technique
VertexShader = NULL;
PixelShader = compile ps_2_0 ps_main();
I'll keep trying, and I'll post here if I can figure it out. But, if any of you shader geeks sees this thread and the solution would be rather simple, I'd truly appreciate it if you could point it out!