Skip to main content
GameDev.net gamedev.net
🔒 Locked

Postprocess defects

Started by akhin Mar 20, 2011 at 12:28 AM 0 replies 1.3k views
Original Post
akhin
akhin
As I use my postprocessing by rendering a single quad

1. When I dont apply any 2d effects in pixel shader , there are very slight
defects in borders of the screen , I am not giving any screenshot because
it is very hard to see in screenshots.

2. When I apply a simple blur effect , there is a clear problem on the right side of the screen :

Original Defect appears with blur



You can see simple blur code as below :



float4 BlurPS(in V2P IN) : COLOR0
{
float4 Color = tex2D(ColorSampler, IN.TexCoord);
Color += tex2D(ColorSampler, IN.TexCoord + float2(0.010f, 0.0f));
Color += tex2D(ColorSampler, IN.TexCoord + float2(0.020f, 0.0f));
return Color/3;
}



And the color sampler :



sampler ColorSampler = sampler_state
{

Texture = <diffuseTexture>;

MinFilter = LINEAR;

MagFilter = LINEAR;

MipFilter = LINEAR;

};
Aqua Costa
Aqua Costa
Thats because you are only sampling texels right of the current pixel...

You should sample texels around the current pixel...

Google "Gaussian Blur"

Also you should blur your scene horizontal and vertically...

At least do something like this:

float4 Color = tex2D(ColorSampler, IN.TexCoord);
Color += tex2D(ColorSampler, IN.TexCoord + float2(0.010f, 0.0f));
Color += tex2D(ColorSampler, IN.TexCoord + float2(0.020f, 0.0f));
Color += tex2D(ColorSampler, IN.TexCoord + float2(-0.010f, 0.0f));
Color += tex2D(ColorSampler, IN.TexCoord + float2(-0.020f, 0.0f));
return Color/5;

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.