Hey all.
I read in the MS article about differences between DX 9 and 10/11 that you dont need to add half a pixel when placing your polygons now. I was glad to see this gone, but I am having a super hard time aligning everything properly.
For some background, here is how I define the world, view and projection matrices: (Pardon my use of Delphi ;) )
D3DXMatrixIdentity( World );
D3DXMatrixLookAtLH( View, D3DXVector3.Create(0, 0, -10), D3DXVector3.Create(0, 0, 0), D3DXVector3.Create(0, 1, 0) );
D3DXMatrixOrthoOffCenterLH( Projection, 0, DisplaySize.Width, DisplaySize.Height, 0, 1, 100 ); // updated when display size changes.
.
All other objects are setup so that I can draw lines using line lists, draw images using quads, etc. Everything works, except that I seem to have some alignment problem.
My problem is as follow. Say for a viewport of 640 x 480 pixels, I need to provide the vertices coordinates 1-based instead of 0-based. As such, if I want to draw a quad that fills the whole viewport, I need to set it from 1, 1 to 640, 480 instead of 0, 0 to 639, 479.
Am I doing something wrong? Do I really have to subtract 1 from every vector I pass to the API?
I dont want to start fiddling with the projection and move it or kludge my renderer with code that might/can/will break on some platform combo.
I could post more code, but I'm not sure what's relevant and after working on this for five+ days, the mapping of the buffer and vertices assignment is pretty straightforward. And I use generic shaders that do not perform any extra processing, based off the Rastertek tutorials.
Any suggestions?
Thanks!