1

I've created a pixel shader for Direct2D that blurs along edges with an alpha channel lower then 1.0. For every pixel I sample a blurRadius of pixels up, down, left and right. In the middle (vertically and horizontally) some render errors occur. These go away when i only sample pixels backward of the pixel I'm processing. I think my input image (size 1920x1080) is chopped up and I'm sampling outside the piece it's in. Does anyone have a clue what is going on, if my assumption is right and what to do about it? See below for the resulting image. The dark lines are not supposed to be there and go away when I only sample surrounding pixels at the left or top.

Alpha blur errors

CodeIT
  • 91
  • 10

1 Answers1

0

I finally fixed this and I hope this can help others. I found out that the problem only occurred when using a different input size than the output size. I had created my effect based on the sample effect from Microsoft which can be found here. The problem with this is that it maps the pInputRects[0] tot the pOutputRect in MapOutputRectToInputRects. This messes up the sampling in effect somehow. The fix is to set the pInputRects[0] to the pInputRects[0] from the MapInputRectsToOutputRect function.

CodeIT
  • 91
  • 10