[vlc-devel] commit: better direct3d image quality (Kaarlo Raiha )

git version control git at videolan.org
Fri Jan 23 23:01:43 CET 2009


vlc | branch: master | Kaarlo Raiha <kaarlo.raiha at tut.fi> | Fri Jan 23 21:29:39 2009 +0200| [6a35aadd72c6a59e471cb965fbcaf2b55b41c359] | committer: Jean-Baptiste Kempf 

better direct3d image quality

Signed-off-by: Jean-Baptiste Kempf <jb at videolan.org>

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=6a35aadd72c6a59e471cb965fbcaf2b55b41c359
---

 modules/video_output/msw/direct3d.c |   22 ++++++++++++----------
 1 files changed, 12 insertions(+), 10 deletions(-)

diff --git a/modules/video_output/msw/direct3d.c b/modules/video_output/msw/direct3d.c
index 96fa829..716b931 100644
--- a/modules/video_output/msw/direct3d.c
+++ b/modules/video_output/msw/direct3d.c
@@ -1387,35 +1387,37 @@ static void Direct3DVoutRenderScene( vout_thread_t *p_vout, picture_t *p_pic )
     }
 
     /* Setup vertices */
-    f_width  = (float)(p_vout->output.i_width) + 1;
-    f_height = (float)(p_vout->output.i_height) + 1;
+    f_width  = (float)(p_vout->output.i_width);
+    f_height = (float)(p_vout->output.i_height);
 
-    p_vertices[0].x       = 0.0f;       // left
-    p_vertices[0].y       = 0.0f;       // top
+    /* -0.5f is a "feature" of DirectX and it seems to apply to Direct3d also */
+    /* http://www.sjbrown.co.uk/2003/05/01/fix-directx-rasterisation/ */
+    p_vertices[0].x       = -0.5f;       // left
+    p_vertices[0].y       = -0.5f;       // top
     p_vertices[0].z       = 0.0f;
     p_vertices[0].diffuse = D3DCOLOR_ARGB(255, 255, 255, 255);
     p_vertices[0].rhw     = 1.0f;
     p_vertices[0].tu      = 0.0f;
     p_vertices[0].tv      = 0.0f;
 
-    p_vertices[1].x       = f_width;    // right
-    p_vertices[1].y       = 0.0f;       // top
+    p_vertices[1].x       = f_width - 0.5f;    // right
+    p_vertices[1].y       = -0.5f;       // top
     p_vertices[1].z       = 0.0f;
     p_vertices[1].diffuse = D3DCOLOR_ARGB(255, 255, 255, 255);
     p_vertices[1].rhw     = 1.0f;
     p_vertices[1].tu      = 1.0f;
     p_vertices[1].tv      = 0.0f;
 
-    p_vertices[2].x       = f_width;    // right
-    p_vertices[2].y       = f_height;   // bottom
+    p_vertices[2].x       = f_width - 0.5f;    // right
+    p_vertices[2].y       = f_height - 0.5f;   // bottom
     p_vertices[2].z       = 0.0f;
     p_vertices[2].diffuse = D3DCOLOR_ARGB(255, 255, 255, 255);
     p_vertices[2].rhw     = 1.0f;
     p_vertices[2].tu      = 1.0f;
     p_vertices[2].tv      = 1.0f;
 
-    p_vertices[3].x       = 0.0f;       // left
-    p_vertices[3].y       = f_height;   // bottom
+    p_vertices[3].x       = -0.5f;       // left
+    p_vertices[3].y       = f_height - 0.5f;   // bottom
     p_vertices[3].z       = 0.0f;
     p_vertices[3].diffuse = D3DCOLOR_ARGB(255, 255, 255, 255);
     p_vertices[3].rhw     = 1.0f;




More information about the vlc-devel mailing list