[renderer] Remove the 1/2 pixel shift of the 2d screen

It seemed like a good idea at the time, but it exacerbates pixel leakage
in atlas textures that have no border pixels (even in nearest sampling
modes).
This commit is contained in:
Bill Currie 2022-11-20 01:17:09 +09:00
parent 7e442a9019
commit e0b9e118a0
3 changed files with 4 additions and 5 deletions

View file

@ -971,7 +971,7 @@ set_2d (int width, int height)
qfglMatrixMode (GL_PROJECTION); qfglMatrixMode (GL_PROJECTION);
qfglLoadIdentity (); qfglLoadIdentity ();
qfglOrtho (-0.5, width - 0.5, height - 0.5, -0.5, -99999, 99999); qfglOrtho (0, width, height, 0, -99999, 99999);
qfglMatrixMode (GL_MODELVIEW); qfglMatrixMode (GL_MODELVIEW);
qfglLoadIdentity (); qfglLoadIdentity ();

View file

@ -785,8 +785,7 @@ set_2d (int width, int height)
qfeglDisable (GL_DEPTH_TEST); qfeglDisable (GL_DEPTH_TEST);
qfeglDisable (GL_CULL_FACE); qfeglDisable (GL_CULL_FACE);
ortho_mat (proj_matrix, -0.5, width - 0.5, height - 0.5, -0.5, ortho_mat (proj_matrix, 0, width, height, 0, -99999, 99999);
-99999, 99999);
qfeglUseProgram (quake_2d.program); qfeglUseProgram (quake_2d.program);
qfeglEnableVertexAttribArray (quake_2d.vertex.location); qfeglEnableVertexAttribArray (quake_2d.vertex.location);

View file

@ -369,8 +369,8 @@ vulkan_set_2d (int scaled)
__auto_type mat = &mctx->matrices; __auto_type mat = &mctx->matrices;
int scale = vulkan_ctx->twod_scale; int scale = vulkan_ctx->twod_scale;
float left = -0.5; float left = 0;
float top = -0.5; float top = 0;
float right = left + vid.width / scale; float right = left + vid.width / scale;
float bottom = top + vid.height / scale; float bottom = top + vid.height / scale;
QFV_Orthographic (mat->Projection2d, left, right, top, bottom, 0, 99999); QFV_Orthographic (mat->Projection2d, left, right, top, bottom, 0, 99999);