Implement the exact Direct3D line rasterization algorithm #74
Labels
Enhancement
New feature or request
Graphics
Portability
Porting the game away from 32-bit Windows
~≤1 push
Projected number of pushes needed. Might turn out to get more expensive!
Direct3D, OpenGL, and SDL all have their own and distinct line rasterization algorithms:
pbg's original 16-bit rendering code obviously uses the Direct3D algorithm, and we do opt into that algorithm via SDL's hint system. However, this still makes pixel-perfect rendering exclusive to the combination of the Direct3D 9/11/12 API and framebuffer scaling. But this hint causes the OpenGL backends (and, by extension, the Linux port) to use OpenGL's different line algorithm, whereas geometry scaling on any API has to use the SDL algorithm.
This is a really minor concern because both OpenGL's and SDL's algorithms are at least 97% accurate to the original game and only differ between each other in less than 1% of pixels. But if we ever want the 100% pixel-perfect port of line rendering, there's no way around reverse-engineering and reimplementing the original Direct3D line drawing algorithm as part of our game code.
Bonus points for also adding an option that implements pbg's significantly different 8-bit line drawing algorithm as a point list, but we'd probably only do this together with #67 to maintain parity with circles.
The text was updated successfully, but these errors were encountered: