VOGONS


First post, by eierfrucht

User metadata
Rank Newbie
Rank
Newbie

The 2004 ARPG classic Sacred Gold is targeted by a number of fan-made HD patches (like PureHD or the acclaimed fan remaster Sacred Reborn) that replace the stock 1024x768 mode with a number of 16:9 modes including 1366x768, 1600x1900, and 1920x1080.

However, running the game at resolutions above 1366x768 has drawbacks originating in the tricky nature of the original engine:

1. The higher the resolution, the smaller the UI.

2. Unless you are playing exactly at 768p, some of the 2D isometric tiles (which the engine actually treats as 3D surfaces directly facing the camera!) that make up the background and statics will randomly start flickering or jittering in crazy ways with no apparent cause or pattern.

3. Both the pristine vanilla engine and its fan-patched variant only apply texture filtering to "true" 3D objects like characters, doors, chests, etc. but provide literally zero filtering for the pseudo-2D tiles, despite them actually being 3D surfaces.

4. Stemming from 3., playing while zoomed out as far as possible results in ungodly amounts of the whole game world shimmering because not only there's no filtering for the world, but also zero support for MIP maps.

Luckily, dgVoodoo 2 v2.82.3 solves all of that in a single swoop:

1. First we have to set the viewport resolution to 1366x768 in the fan patch's configuration file for these two reasons: I. make the UI large enough to be readable II. dgVoodoo won't properly handle 1920x1080 for as long as viewport upscaling is at play, and boy are we gonna need that; anyway we don't want 1920x1080 because of how tiny the UI becomes. Alternatively, we might opt to go for 1600x900, but I'll be using 1366x768 in my below example to better illustrate how awesome dgVoodoo's upscaling and downscaling capabilities are.

2. Let's now move on to dgVoodoo.conf. Let the viewport scaling be handled by the wrapper:

ScalingMode = stretched_ar

3. Force the base 1366x768 to be upscaled to 5464x3072:

Resolution = 4x

4. Turn on a good downscaling filter so that 5464x3072 gets properly downscaled to whatever our real display resolution is:

Resampling = lanczos-3

5. Antialiasing does help a lot:

Antialiasing = 8x

6. And most importantly, let us force 16x Anisotropic filtering upon the whole game world including the pseudo-2D background tiles and statics:

Filtering  = 16
KeepFilterIfPointSampled = false

What do we get as a result?

1. That goddamn random world & statics jitter is gone for good and not just in 1366x768, but also in 1600x900 or virtually any custom viewport resolution above 768p. It seems that forcing 16x anisotropic does the trick.

2. The UI is nice, big, and readable.

3. Integer scaling the viewport to 4x its normal size then downscaling it to the real display resolution with Lanczos does away with any trace of shimmering when scrolling the world while zoomed out. Forcing anisotropic filtering mostly handles that, too, but the upscale/downscale trick makes everything look significantly clearer and smoother.

Here are a bunch of screenies pitting a pixel-perfect, native 1920x1080 DX7 output without dgVoodoo against a 1366x768 output upscaled to 1920x1080 with the above listed dgVoodoo tricks:

https://i.postimg.cc/Vfm4Dhy0/dg-Voodoo-3.jpg

https://i.postimg.cc/vbVq8fvB/dg-Voodoo-1.jpg

https://i.postimg.cc/XVQx18n2/dg-Voodoo-2.jpg

Of course a static picture won't tell you how much easier on the eyes world scrolling becomes with dgVoodoo, nor will it give you any idea of how bad the random tile jitter is without dgVoodoo, let alone the overall shimmering while zoomed out and moving...

What's your problem then, you may ask. Here's the deal, there's one bug that dgVoodoo sort of exacerbates.

Without dgVoodoo, a small bunch of tiles throughout the world get these ugly seams at resolutions above 768p: https://i.postimg.cc/h4kfSH12/seam.jpg

With dgVoodoo, the moment you set Filtering = 16 (or any other value besides app-driven, for that matter) the seams become much less noticeable, but they start popping up even at 768p in crazy numbers all across the game world: https://i.postimg.cc/1XwwK6QF/seam2.jpg

Forcing a custom filtering mode in dgVoodoo is vital to resolving the worst issues with the game engine (including the utter lack of filtering that has always been endemic to this game). Just switching it off brings back a lot of problems. Switching it on trades all those problems for one new, much less annoying, problem that still prevents the game from looking nice.

Is there anything that can be done to resolve this on dgVoodoo's end? The game's fan community has been trying to do away with the random tile jitter since like the early 2010s by hacking the executable, but all attempts proved futile. The only existing cure seems to be dgVoodoo but that comes with its own side effect 🙁

Reply 1 of 1, by eierfrucht

User metadata
Rank Newbie
Rank
Newbie

A couple of seemingly dgVoodoo-specific bugs with both vanilla and modded engine:

1. Running at resolution multipliers above 5x results in the game taking up just 1/4 of the screen space in the upper left corner, 5x and below produce expected results: the picture gets downscaled to fit the full screen, Stretch + Keep Aspect Ratio: https://i.postimg.cc/V18WGPBG/Ground-Form.jpg

2. Alt-Tabbing out of the game and back into it--at any resolution multiplier--results in the viewport no longer being downscaled to fit the screen, so we end up seeing just the upper left corner of the much larger, pre-upscaled viewport: https://i.postimg.cc/7qwRpQ8D/Ground-Form-2.jpg

Texture jitter and/or seams can be dealt with by following these steps:

1. Set Antialiasing to explicitly "Off" in dgVoodoo, not just app-driven.
2. Set the game's built-in Anti-Aliasing to "Off" in the game options (this is equally important!)
3. Set Texture Filtering to "App-driven" in dgVoodoo.

This way, there's no jittering or seaming even when running the viewport at resolutions like 1600x900 or 1920x1080. Surprisingly, disabling Anti-Aliasing in your GPU driver settings either for this particular game or on a system-wide scale seems to have no effect on this bad behavior... for some reason.

Setting pre-upscaling to x4 in dgVoodoo pretty much works like anti-aliasing + almost eliminates shimmering when moving through the world with the camera zoomed out.

The pseudo-2D elements are still left unfiltered (which is a shame), and some menus still get seams specifically because of dgVoodoo (like the character selection screen or the protagonist's logbook)