• Advertisement
Sign in to follow this  

Distortion on Image Borders

This topic is 871 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm implementing image processing through HLSL pixel shaders. The code is working except a few details.

 

I run the Super-xBR HLSL pixel shader on an image and there is image distortion on the right and bottom of the image.

Super_x_BR_corrupt.png

 

The implementation of the same pixel shader in MediaPlayer .NET (MPDN) doesn't have this problem
Super_x_BR_MPDN.png

 

Someone suggested that this might have to do with texture addressing mode so I added this code after creating the device.

m_pDevice->SetSamplerState(0, D3DSAMP_ADDRESSU, D3DTADDRESS_CLAMP);
m_pDevice->SetSamplerState(0, D3DSAMP_ADDRESSV, D3DTADDRESS_CLAMP);
m_pDevice->SetSamplerState(0, D3DSAMP_ADDRESSW, D3DTADDRESS_CLAMP);

This doesn't help. Any idea how to fix this issue?

Share this post


Link to post
Share on other sites
Advertisement

Maybe it's the DX9 half texel offset giving you grief?

 

http://drilian.com/2008/11/25/understanding-half-pixel-and-half-texel-offsets/

 

That's taken care of here

https://github.com/mysteryx93/AviSynthShader/blob/master/Src/D3D9RenderImpl.cpp#L170

 

Plus other shaders are working fine; I'm only having problem with that one. Most likely because it is using overflow coordinates.

Edited by MysteryX

Share this post


Link to post
Share on other sites

I found the solution ... removing the "return" on the line before the code I wrote above ...

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement