fabiangreffrath / woof

Woof! is a continuation of the Boom/MBF bloodline of Doom source ports.
GNU General Public License v2.0
209 stars 35 forks source link

Bring back 32:9 aspect ratio #1774

Closed ceski-1 closed 2 months ago

ceski-1 commented 3 months ago

The last time we tried this there were two issues:

  1. HOMs on right side depending on resolution and FOV.
  2. Sprites/voxels at edges missing at high FOV.

(1) needs to be checked with the rendering changes since then. (2) is fixed by this PR, thanks to suggestions by @JNechaevsky.

I may also use this PR to experiment with techniques to reduce edge distortion at high FOV values.

ceski-1 commented 3 months ago

Okay, first issue:

image ![line](https://github.com/fabiangreffrath/woof/assets/56656010/3c1260b0-6e2d-4ab5-86a7-d577037381d7)

orange.zip

And a second issue:

image ![woof0002](https://github.com/fabiangreffrath/woof/assets/56656010/e30b96f9-59e1-4a59-a1a0-e9fbabaa7d98) ![woof0003](https://github.com/fabiangreffrath/woof/assets/56656010/fd1050dc-eb45-4452-a0e8-7fc56e7c71c8)
rfomin commented 3 months ago

orange.zip issue can be fixed with this change:

diff --git a/src/r_draw.c b/src/r_draw.c
index 55e9fe19..2dc7b69b 100644
--- a/src/r_draw.c
+++ b/src/r_draw.c
@@ -927,8 +927,8 @@ void R_DrawViewBorder(void)

     // copy sides
     R_VideoErase(0, scaledviewy, scaledviewx, scaledviewheight);
-    R_VideoErase(scaledviewx + scaledviewwidth, scaledviewy, scaledviewx,
-                 scaledviewheight);
+    int side = scaledviewx + scaledviewwidth;
+    R_VideoErase(side, scaledviewy, video.unscaledw - side, scaledviewheight);

     // copy bottom
     R_VideoErase(0, scaledviewy + scaledviewheight, video.unscaledw,
ceski-1 commented 3 months ago

orange.zip issue can be fixed with this change:

Thank you, fixed here: https://github.com/fabiangreffrath/woof/pull/1774/commits/be678e217a113f3c4a4bc888d3ff36441ca85e96

rfomin commented 3 months ago

And a second issue:

The problem is the positioning of the snapshot? Not sure if we should fix it. It is interesting that it works with 16:10 (the snapshot window is small):

woof0000

ceski-1 commented 3 months ago

I think the elements should be centered regardless of aspect ratio, if possible. It's a little odd right now, but not critical.

fabiangreffrath commented 3 months ago

I think the elements should be centered regardless of aspect ratio, if possible. It's a little odd right now, but not critical.

The list of savegames is moved to the right until the skull is centered:

https://github.com/fabiangreffrath/woof/blob/20db64bff228d79a9b8938bb9cb7fc7d24d562b2/src/mn_menu.c#L1015-L1018

The snapshot is then drawn centered into the area on the left of that:

https://github.com/fabiangreffrath/woof/blob/20db64bff228d79a9b8938bb9cb7fc7d24d562b2/src/mn_menu.c#L765-L769

rfomin commented 3 months ago

The snapshot is then drawn centered into the area on the left of that:

What if we don't centre it?

diff --git a/src/mn_menu.c b/src/mn_menu.c
index 1dbec4ea..aaca680d 100644
--- a/src/mn_menu.c
+++ b/src/mn_menu.c
@@ -763,7 +763,7 @@ static void M_DrawBorderedSnapshot(int n)
     const char *txt = "n/a";

     const int snapshot_x =
-        MAX((video.deltaw + SaveDef.x + SKULLXOFF - snapshot_width) / 2, 8);
+        MAX(video.deltaw + SaveDef.x + SKULLXOFF - snapshot_width - 8, 8);
     const int snapshot_y =
         LoadDef.y
         + MAX((load_end * LINEHEIGHT - snapshot_height) * n / load_end, 0);
ceski-1 commented 3 months ago

What if we don't centre it?

I like it, much better now:

image ![woof0004](https://github.com/fabiangreffrath/woof/assets/56656010/1464873a-d3ab-4504-adf5-70934e76fb8b)
fabiangreffrath commented 3 months ago

Let's do it then.

ceski-1 commented 3 months ago
  1. HOMs on right side depending on resolution and FOV.

(1) needs to be checked with the rendering changes since then

No HOMs with these resolutions:

    { 3840, 1080 },
    { 3840, 1200 },
    { 4320, 1200 },
    { 5120, 1440 },
    { 5120, 1600 },
    { 5760, 1600 },
    { 5760, 1800 },
    { 6400, 1800 },
    { 6480, 1800 },
    { 7680, 2160 },
    { 7680, 2400 },
    { 8640, 2400 },
ceski-1 commented 2 months ago

I may also use this PR to experiment with techniques to reduce edge distortion at high FOV values.

This is going to require a considerable amount of work, so it'll have to be saved for a different PR.

I don't have anything else to add to this PR, so I think it's ready.