Ogre Version: 4.0.0 (commit 8b7b3d17310c0243c264706cfb9f66424fbaf877)
Operating System: Windows 7 x64
Render System: Direct3D11
Hello!
So, this seems to be a pretty fundamental issue I'm running into - part of what I'm aiming for my project to do is support 2D rendering, with particular consideration made for pixel art assets. Thus far, I've been using an orthographic camera for 2D UI, which has worked fine - but it seems that using a similar setup for more traditional 2D assets isn't working as well.
After digging around a bit, it seems to be some sort of sampling issue - the screenshots below use 4 quads, each sampling a 16x16 section of a 32x32 texture, as a very primitive tilemap implementation (hence only 4 tiles). The issue is that the texture doesn't get rendered correctly onscreen, with a sort of distortion - which seems to be due to how the texture is being sampled. Despite attempting to correct for half-pixel alignments and such (going off of info I found online), I've been unable to get this to work properly and also continue doing so with differing zoom levels (which is done by dividing the size of the viewport based on zoom level, only using whole integers so no 1.5x zoom or anything).
Further, I've also been poking around with bgfx, as there's been a few particularly troublesome issues I've run into and I've potentially considered building my own graphics engine on top of it to work around them - but I'm trying to avoid this if at all possible, seems more likely that I'd be better off using something developed by more knowledgeable folk. However, when getting a basic setup that replicates the setup I had in OGRE (more minimally of course), the issue didn't occur. No zooming, or zooming in at different steps, no issue.
I did also try this under OpenGL (in OGRE) and got the same result, as some info I was finding online suggested this could be a D3D11 quirk.
Any pointers or things to try on my end? I've tried various approaches, including adjusting things by a half-pixel (by translating the projection matrix itself, just moving the camera position, adjusting vertex positions in the tilemap shader), and I've tried changing how the texture gets sampled (using normal UVs or passing direct pixel coords in the UVs and using equivalents to texelFetch) - and given that a basic stripped-down renderer just works without any special consideration, I'm unsure what else to try. I did also try to use bgfx's function for creating the orthographic projection matrix, but not knowing much about the deeper stuff at that point (and the info I found online going over my head a bit), I was unable to get a usable result out of it.
Any information or help is greatly appreciated! I've got a couple images below:








