Problem with D3DXMatrixOrthoLH, graphic glitch.

Started by
9 comments, last by unbird 9 years, 2 months ago
The reason is Bilinear Texture Filtering. Unless you have the above mentioned pixel perfect match (one pixel samples exactly one texel) one pixel is an weighted average of four texels (or even eight if you have mipmaps and trilinear filtering).

Even when using nearest point sampling it can happen you sample the "wrong" texel , meaning a pixel from a neighbour tile. The solution is this gap/extrusion of tiles (you now sample texels with the same color, so the average is this color again).

You're using ID3DXSprite, a convenience interface which simplifies things. The downside of this is that's not obvious what underlying mechanisms are going. Nonetheless ID3DXSprite doesn't do anything magic (it just uses bare D3D functionality) so they still apply.

Welcome to low-level graphics programming: Lots of things are new, complicated and veeeery often counterintuitive. But it's also very rewarding if you get the hang of hit (e.g. performance, which was the whole point of atlassing your tiles). Have fun wink.png

This topic is closed to new replies.

Advertisement