Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

I am using Direct3D to draw a tile map to the screen. Why can get the edges to match properly?

0
Posted

I am using Direct3D to draw a tile map to the screen. Why can get the edges to match properly?

0

This is due to the algorithm used to determine what pixels to draw when rendering a triangle, which is determined by whether the center of each pixel is enclosed by the triangle. The pixel centers lie on integer values, so if you are using integer coordinates to define a rectangle the sides will straddle pixels. To account for this, expand your pre-transformed primitives by 0.5 pixels in each direction. For an example of this, look at the source code in A Simple Blit Function for Direct3D.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123