Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Author: peachykeen
- // Title: Sharpen
- // Pack: MGE Shader Library
- // Desc:
- // Sharpens the image slightly
- // Patched for MGE XE by xackoff
- texture lastpass;
- sampler s0 = sampler_state { texture=<lastpass>; minfilter = linear; magfilter = linear; mipfilter = linear; addressu=clamp; addressv = clamp; };
- vector rcpres;
- float4 lSharp(in float2 Tex : TEXCOORD) : COLOR0
- {
- float4 inColor = tex2D(s0, Tex);
- float4 blur = inColor;
- blur += tex2D(s0, float2(Tex.x, Tex.y+rcpres.y)) * 0.25;
- blur += tex2D(s0, float2(Tex.x, Tex.y-rcpres.y)) * 0.25;
- blur += tex2D(s0, float2(Tex.x+rcpres.x, Tex.y)) * 0.25;
- blur += tex2D(s0, float2(Tex.x-rcpres.x, Tex.y)) * 0.25;
- blur += tex2D(s0, float2(Tex.x-rcpres.x, Tex.y+rcpres.y)) * 0.25;
- blur += tex2D(s0, float2(Tex.x-rcpres.x, Tex.y-rcpres.y)) * 0.25;
- blur += tex2D(s0, float2(Tex.x+rcpres.x, Tex.y+rcpres.y)) * 0.25;
- blur += tex2D(s0, float2(Tex.x+rcpres.x, Tex.y-rcpres.y)) * 0.25;
- blur /= 3;
- float4 final = lerp(blur,inColor, 2); // Adjust sharpening strength here
- return final;
- }
- technique T0 < string MGEinterface="MGE XE 0"; >
- {
- pass p0
- {
- PixelShader = compile ps_2_0 lSharp();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement