
The First Pixel: Dev Vlog #8 - Half Pixel Offset (MonoGame) render artifact
Jan 17, 2021. Showcases:
- half pixel offset issue with XNA migration to MonoGame
- artifact causes tile layer shimmering: varying distance layers move erratically relative to one another.
- manual correction of 1/2 pixel is required.
- MonoGame website is slightly inaccurate:
https://docs.monogame.net/articles/migrate_xna.html
"XNA uses the DirectX9 graphics API. MonoGame uses the newer DX11 API for DirectX platforms. DirectX9 interprets UV coordinates differently from other graphics API's. This is typically referred to as the half-pixel offset.
...
SpriteBatch rendering is not affected by the flag. Regardless of what value the flag has, SpriteBatch will render things exactly the same as in XNA."
- all rendering is via SpriteBatch using default shader
- half pixel offset correction is implemented CPU side
My playlists:
--------------------
- Voxel: https://youtu.be/watch?v=XCVWEuhCCDM&list=PLjnbT4UISq0bQF1g85tE9jTrKfEtdRYlY
- Road: https://youtu.be/watch?v=ck5ALX11YU4&list=PLjnbT4UISq0bnfd1RC3M4PgTgkmhlkikV
- Ray Casting 3D: https://youtu.be/watch?v=zjswXUTMP2o&list=PLjnbT4UISq0YcFtRFjFQqK0g6ONNCtrvY
- Side-Scroll Shmup: https://youtu.be/watch?v=fF4X8zN-Raw&list=PLjnbT4UISq0Y_7IAN_zUzxgZnfhXxo_0Q
- MonoGame Tutorial: https://youtube.com/watch?v=WW1dJnfXWb0&list=PLjnbT4UISq0adw__Y9B2eXA0LL35TyORU
My websites:
---------------------
- my GitHub: https://github.com/JDoucette
- my company: http://xona.com
- my Blog: http://thefirstpixel.com