=?UTF-8?Q?Stefan=20D=C3=B6singer=20?=: d3d9/tests: Relax the fog range test a bit.

Alexandre Julliard julliard at wine.codeweavers.com
Fri Mar 13 08:44:25 CDT 2015


Module: wine
Branch: master
Commit: c5fdc1670b46dd4c1836b296559abe60e5dab1ec
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=c5fdc1670b46dd4c1836b296559abe60e5dab1ec

Author: Stefan Dösinger <stefan at codeweavers.com>
Date:   Thu Mar 12 10:55:17 2015 +0100

d3d9/tests: Relax the fog range test a bit.

---

 dlls/d3d9/tests/visual.c | 23 ++++++++++-------------
 1 file changed, 10 insertions(+), 13 deletions(-)

diff --git a/dlls/d3d9/tests/visual.c b/dlls/d3d9/tests/visual.c
index 34ba3da..a345af1 100644
--- a/dlls/d3d9/tests/visual.c
+++ b/dlls/d3d9/tests/visual.c
@@ -1009,10 +1009,10 @@ static void fog_test(void)
     },
     untransformed_3[] =
     {
-        {-1.0f, -1.0f, 0.4999f, 0xffff0000, 0xff000000},
-        {-1.0f,  1.0f, 0.4999f, 0xffff0000, 0xff000000},
-        { 1.0f, -1.0f, 0.4999f, 0xffff0000, 0xff000000},
-        { 1.0f,  1.0f, 0.4999f, 0xffff0000, 0xff000000},
+        {-1.0f, -1.0f, 0.5f,    0xffff0000, 0xff000000},
+        {-1.0f,  1.0f, 0.5f,    0xffff0000, 0xff000000},
+        { 1.0f, -1.0f, 0.5f,    0xffff0000, 0xff000000},
+        { 1.0f,  1.0f, 0.5f,    0xffff0000, 0xff000000},
     },
     far_quad1[] =
     {
@@ -1429,15 +1429,12 @@ static void fog_test(void)
         hr = IDirect3DDevice9_SetRenderState(device, D3DRS_RANGEFOGENABLE, TRUE);
         ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderState failed, hr %#x.\n", hr);
 
-        /* z=0.4999, set the fogstart to 0.5 and fogend slightly higher. If range fog
-         * is not used, the fog coordinate will be equal to fogstart and the quad not
-         * fogged. If range fog is used the fog coordinate will be slightly higher and
-         * the fog coordinate will be > fogend, so we get a fully fogged quad. The fog
-         * is calculated per vertex and interpolated, so even the center of the screen
-         * where the difference doesn't matter will be fogged, but check the corners in
-         * case a d3d/gl implementation decides to calculate the fog factor per fragment */
-        start = 0.5f;
-        end = 0.50001f;
+        /* z=0.5, x = +/- 1.0, y = +/- 1.0. In case of z fog the fog coordinate is
+         * 0.5. With range fog it is sqrt(x*x + y*y + z*z) = 1.5 for all vertices.
+         * Note that the fog coordinate is interpolated linearly across the vertices,
+         * so the different eye distance at the screen center should not matter. */
+        start = 0.75f;
+        end = 0.75001f;
         hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGSTART, *((DWORD *) &start));
         ok(SUCCEEDED(hr), "IDirect3DDevice9_SetRenderState failed, hr %#x.\n", hr);
         hr = IDirect3DDevice9_SetRenderState(device, D3DRS_FOGEND, *((DWORD *) &end));




More information about the wine-cvs mailing list