[Guide] Median XL 2.0 with D2DX: New Glide wrapper

Need help installing the mod?
User avatar
fixer_m
Stygian Watcher
42 | 15
Great Popularity Badge
Has a thread with over 50.000 views
There is a new Glide wrapper for Diablo 2: D2DX. It supports Median XL including latest 2.0 version.
This wrapper translates Glide API calls directly into DirectX API (for instance - Sven's wrapper uses OpenGL).

Features
- Turns the game into a well behaved DirectX 11 title on Windows 10 (also 7, 8 and 8.1).
- High quality scaling to fit modern screen sizes, including widescreen aspect ratios (not supported with MXL).
- High FPS mod using motion prediction, bypassing the internal 25 fps limit. Play at 60 fps and higher! (video)
- Anti-aliasing of specific jagged edges in the game (sprites, walls, some floors).
- Seamless windowed/fullscreen switching with (ALT-Enter).
- Improved fullscreen: instant ALT-TAB and low latency.
- Improved windowed mode.
- Proper gamma/contrast.
- Fixes a few window-related glitches in Diablo II itself.

Installation for MXL
Basically to install D2DX you need to put glide3x.dll file into D2 folder, disable resmod (required!) and run the game with Glide video mode.

1. Install D2LoD and Median XL as usual.
2. Download D2DX. This archive contains config file with disabled resmod and custom build version of D2DX dll that supports floating point scaling for windowed mode. Alternatively, you can download latest official version from D2DX releases page (d2dx.zip file) and prepare config file by yourself (see below).
3. Unpack archive and copy both files (glide3x.dll and d2dx.cfg) to D2 folder overriding old wrapper dll. You may want to keep old wrapper's dll as backup option.
4.1 If you use MXL launcher to run the game, go to settings and set "3DFX Glide" video mode.
4.2 If you use shortcut to run the game add -3dfx option to your target (so it will look like this: "D:\Diablo 2\Game.exe" -3dfx).
5. Run the game. Note: Press ALT-Enter to switch from fullscreen to windowed mode and back.

► Command line options


High FPS (by motion prediction)
Internal game logic only ticks at 25 fps. Rendering at e.g. 120fps won't give a smoother experience normally. D2DX has a feature that predicts unit positions between logic updates, resulting in actual high fps rendering. This is enabled by default, but can be disabled with nomotionprediction=true. Here is how it looks like: video.

Advanced configuration
You can configure D2DX options via config file and command line options (latter has higher priority).
If you are using config file, ensure that it has name d2dx.cfg.

Some important options in d2dx.cfg file:
noresmod=true Disables resmod (high resolution mod). Required to run MXL.
noclipcursor=true Will not lock cursor to the game window.
nocompatmodefix=true Will not block the use of "Windows XP compatibility mode".
nomotionprediction=false If true, will not run the game graphics at high fps.
scale=1.5 Window scaling for windowed mode. Float-point numbers supported only in custom build.

Scaling window by floating-point number
Official version supports scaling window only by 2 and 3 times, but even with x2 it might not fit to your screen. When there is not enough space, D2DX will reduce window size to fit into your screen, but it will leave black borders on sides. I've prepared custom D2DX build that supports window scaling by floating-point number (here is according PR that I used), so you can set any non-integer scaling factor like 1.5.

Screenshots
Image Image Image

F.A.Q.
Q: How to remove side black bars in a fullscreen mode?
A: Unfortunately MXL is locked at 1024x768 (4:3), you can't get real widescreen 16:9. That's why you have to disable built-in D2DX resmod to run MXL. If you really want you can get stretched 16:9 look with 3rd party tools like ReShade. As well as you can replace black bars with some graphics, look at this thread.

Q: How to remove side black bars in a windowed mode?
A: Set some lower scaling factor for window in a config file, like scale=1.2. This option supported only in custom build version.

Q: How to enlarge game window in a windowed mode?
A: Set some higher scaling factor for window in a config file, like scale=1.7. This option supported only in custom build version.

Q: How to fix game crash on "Save and Exit" with Unhandled Exception: Access Violation (c0000005)?
A: Set compatibility mode with Windows XP SP3 to your Game.exe.

Q: How to fix not working mouse scroll?
A: Set compatibility mode with Windows XP SP3 to your Game.exe.

Q: How to take screenshots?
A: Taking screenshots with PrtScr doesn't work with D2DX, it's a bug. However you can use any other tool to take screenshots, like built-in Windows Snipping Tool (Win+Shift+S) or open-source ShareX.

P.S. I'm not an author of this project. If you have discovered a bug, you can create new issue at GitHub page.
Edited by fixer_m 3 years.
User avatar
suntorytime
Monkey King
269 | 6
Black magic fuckery. Game is indeed running at 60fps. Thanks for sharing!
User avatar
humming
Imp
4 | 0
Legendary Supporter Badge
Donated 25 times
Is there a way to make the windowed mode run at different size? Because it's basically unplayable in windowed mode currently (too small), which is sad because otherwise the 60 fps looks insanely good o.o
User avatar
Imperius
Gravedigger
182 | 5
Common Popularity Badge
Has a thread with over 10.000 views
You guys saw any difference while increasing the resolution?
I am playing at 8K and saw no difference in image quality.
User avatar
iwansquall
Gore Crawler
1508 | 71
Common Posting Badge
Posted over 1.000 messages
Legendary Popularity Badge
Has a thread with over 250.000 views
Common Love Badge
Earned over 20 cookies
Common Supporter Badge
Donated 1 time
Wow, pretty cool. This is surely gonna bring some enjoyment abit for me.
As I cant stand janky 25 fps of diablo2 engine.

For me, since i already use sven wrapper stuff, i just run game.exe without needing to adjust anything.

I ran full screen since I dont like windowed "cursor locking" or accidentally clicking while alt-tab
Full screen / alt tab already work well for me in full screen and i dont mind black border at side.

Oh, if you use compatibility setting, you will need to disable it.
galandor
Destroyer
6 | 0
Common Supporter Badge
Donated 1 time
how to remove black borders?
User avatar
aerial
Cow Ninja
1288 | 239
Common Posting Badge
Posted over 1.000 messages
Legendary Popularity Badge
Has a thread with over 250.000 views
Great Love Badge
Earned over 100 cookies
Common Guide Badge
Created a complete character guide
Great Mind Badge
A Median XL guru... a true book of knowledge
Pretty good upgrade to glide, cursor smoothness is glorious.
Is there a way to increase sharpness? If you enlarge window to 1440p, looks significantly blurrier than standard glide. Not in full screen, but windowed. With full screen switch it is sharp.
youtube.com/ae1337
User avatar
Muilpeer
Daystar
670 | 23
Great Popularity Badge
Has a thread with over 50.000 views
Common Love Badge
Earned over 20 cookies
Common Supporter Badge
Donated 1 time
Wow, this works really well, this is my preferred playstyle from now on I think. Only weird thing is to see the characters in selection screen move really fast and all animations play much faster. But I love the smoothness!
User avatar
fixer_m
Stygian Watcher
42 | 15
Great Popularity Badge
Has a thread with over 50.000 views
humming,
humming wrote:Is there a way to make the windowed mode run at different size?

Well, there is an option -dxscale2 (or even -dxscale3), which will increase window size by 2 or 3 times respectively. However during launch window size will be reduced to fit your screen size (so at 4K display dxscale2 will work perfectly, but for FHD and 2K it will not fit and will be slightly reduced).
Unfortunately this option currently supports only integer numbers. But there is pull request which adds support for float numbers like 1.5. I hope it will be merged and we will get this feature soon.

Imperius,
Imperius wrote:You guys saw any difference while increasing the resolution?

No, for MXL it just stretches the game screen, because MXL is locked at 1024x768, so increasing resolution (HD / widescreen) doesn't work.


galandor,
galandor wrote:how to remove black borders?

If you want stretched 16:9 look then this is not supported. If you don't like black bars on sides, you can run it in window. If it's too small, try option -dxscale2, so the window size will be doubled.

aerial,
aerial wrote:Is there a way to increase sharpness? If you enlarge window to 1440p, looks significantly blurrier than standard glide. Not in full screen, but windowed. With full screen switch it is sharp.

Not sure, maybe that's because Sven's wrapper uses supersampling? With all these options available I hope someone will make a screenshots comparison of Glide wrappers and CNC-DDraw to see how it differs.

Anyway - you can try to play a bit with filtering options via config file:
filtering=0
# 0 - will use high quality filtering (sharp, more pixelated)
# 1 - will use bilinear filtering (blurry)
# 2 - will use catmull-rom filtering (higher quality than bilinear)
User avatar
aerial
Cow Ninja
1288 | 239
Common Posting Badge
Posted over 1.000 messages
Legendary Popularity Badge
Has a thread with over 250.000 views
Great Love Badge
Earned over 100 cookies
Common Guide Badge
Created a complete character guide
Great Mind Badge
A Median XL guru... a true book of knowledge
Or if there was a way so it starts in set resolution window, not a small one. I resize this window via ahk script, to 1440p res, and also move it on screen to fixed position. And then it turns blurry.
If I ALT+ENTER it it becomes full screen, also vertical 1440, but then it is sharp correctly.
There is some kind of difference here if you resize window after you launch the game between old glide and this.
youtube.com/ae1337