PLEASE NOTE: As of current, this is only planned for 1.10. This driver replaces D2GFX.dll, but also applies a lot of custom patches to D2Client, D2Common, D2CMP and D2Win. Many of these patches are configurable in the INI for maximum flexibility. In future, support for 1.09d/b and 1.13d will be added, but only once D2GFEx is feature complete.
As of current, D2GFEx will provide the following features:
- A new graphics driver, based on OpenGL 2.1, which will work from Win95 to Win10, providing much better performance and memory usage.
- 100% recreation of D2's graphics output, bar any bugs that existed in original D2 (like the ModRandPalette bug for instance). Perspective will not be supported on initial release.
- Vastly improved limits for mods, mainly to do with the number of concurrent sprites and shadows on screen (this includes both the assertion, memory cache and render slot limits), and removal of the maximum image frame size on DC6 files. DCC files technically have the limit removed as well, but using DC6 for all future graphics bar tiles is preferred.
- Extended resolution support, you can run D2 in 4k, but I wouldn't recommend that unless you want to not be able to see anything. Unlike many of the extended resolution patches, this is done correctly, including expanding of the unit light mapping code, tile rendering, draw culling, render tiling/binning.
- Proper VSync and adaptive VSync support (there is actually no point to render faster than your monitors refresh rate, so just save some power/heat/GPU life). Originally D2 had support for this but no actual setting to turn it on/off; it will now be a setting in the graphics menu, which will be expanded to accommodate the new features, and have useless settings removed (such as lighting quality & blended shadows which are now always at their best setting).
- Windowed mode will now have Gamma & Contrast support, as well as colored light support. Windowed mode also supports borderless mode and borderless full screen mode.
- All units seamlessly support DC6 or DCC animations, this follows on the recommendation to use DC6 files for future graphics, as it allows new features with backwards compatibility. The removal of the limits also mean large monsters need no longer be sliced up, and for modders/coders, new UI drawing can be done with a singular draw call.
- Finishing of poorly coded D2GFX functions: there are a few functions that didn't fully work, one such function is the clipped text drawing, which can't apply palettes to cropped text, it now does (fixing a bug with colored NPC scrolling text). With this also comes extensions to standard D2GFX API, most drawing functions take in an image blend color that is never used, it is now used.
- Many new configurable options, such as cut scenes in windowed mode, disabling screen shake, auto-minimizing, frame-limiting. These will be both put into a config file, and the games UI. the config file will shift all the graphics settings from the registry to the file, meaning multiple mods can each have their own settings.
- Faster file decode for faster act loads and less hitching on slow machines.
- The way tiles are handled are also improved, meaning less memory is consumed; in future tile lookups will be changed and various misc data D2 used will removed to improve tiles even more. This misc data is actually a lot of duplicated data or data that serves as nothing more than an additional layer of indirection.
- Improved /fps display, and in-game graphics debugging tools (profiling, tileset viewer, palette viewer, display modes, DCC & DC6 viewers, Lightmap viewer).
- Better system-cursor toggling support in windowed mode, along with mouse capture support and various fixes to D2Win's buggy mouse bounding.
- Fixes the -ns crash bug (can be disabled for compatibility).
- Improves compatibility with newer Windows versions.
- Expanded TBL parsing for new 32bit color, icon and style embedding (via escape sequences, requires support from Oculus).
- Improved unit outlines; this code also now works in windowed mode too. The mod API will support some additional features, for now this can be configured in the ini to outline+fill or just outline, at a later stage blur support will be added. As this is shader based, ANY image can have an outline applied.
- 32bit color support for non-palshift images; DC6 will become a container format supporting more encoding types. DT1 is also expanded support the same formats for tiles. NOTE: these will need a new encoding tool, but the changes are backwards compatible. Supported formats are:
- RGBA32, both uncompressed and PNG(zlib) compressed.
- 8bit, RLE and non-RLE (non-RLE is good for UI, where the RLE encoding actually adds size when no pixels are skipped), with an optional local palette.
- Block-based HW compressed textures, used in modern day games. Support will be for DXT1, DXT1A, DXT3 & DXT5.
- Image local palettes. NOTE: these will need a new encoding tool.
- Mod API: this will provide an SDK and a lot of additional low level gfx functions for shader support, render-to-texture, sprite and primitive batching, font loading, post processing.
- Debug API: this will extend the game with an easy to use debug API, based of off ImGUI.
- Fixing of various graphics related D2 bugs, such as the improper palette index caching, which breaks when act palettes are changed.
- Game-interactive debug mode, for inspecting sprites and units.
- Blit stretch support, along with quality enhancing shaders like HQx.
- Better CPU usage in the main message loop - this is primarily a power fix, to prevent D2 using 100% of the CPU time. The process is also pinned to the CPU core its launched on, to prevent the system scheduler from shuffling it around which can cause hitches and thread-related instability.
- Actual async file loading (yep, D2's async file loading system is broken...).
- Custom post processing shader support, split into UI and world layers.
- Improved animated tile effects, fading and animation.
- Improved shadows and blending.
- Vastly improved text rendering, supporting 32bit color (based on the Mod API) and new font files. This API will both replace D2's font API, and have an extended API for truetype fonts for better quality, bolding and underlining.
- Vastly improved particle system (rain & snow) that causes far less lag (based on the Mod API) and are correctly batched into a single draw call.
- A new particle and trails system that batches all rendering and allows for new shader-based effects.
- Vastly improved automap system, that doesn't require hundreds of draw calls per frame to render maps (based on the Mod API), this includes expanding the systems to support new features like animated icons/glyphs, full 32-bit colors, ttf fonts (primarily icon fonts)..
Performance is something I have taken great care to try an improve; however, the initial releases are not fully optimized. What does this mean? Well it means that most things are rendered in an immediate mode, wasting a lot of CPU time and causing GPU stalls. At a later stage when the driver is stable and "bug-free", it will transition to more experimental methods of rendering, such as a deferred render queue, al la Quake 3's render architecture.
Currently we are doing some closed Alpha testing, to make sure that all the vanilla D2 rendering is stable and complete. For now, a small teaser from Ogodei:
A public alpha is planned to go live the first week of Jan 2019.
This is where the bulk of the work on Oculus is done, allowing testing of many of the new features so performance regressions and issues can be addressed. I will update this section with information over the course of the next few days. For now here is a teaser of an older build of the tool, showing some DCC processing:
Oculus is currently at the point where it can encoded the required DC6 files for 32bit testing, once a bit more spit and polish is applied, it will be released for testing.
Oculus will be a new graphics tool for D2, designed primarily for use with D2GFEx, but also usable for vanilla D2. It will provide support for all things graphics related: DCC files, DC6 files, COF files, PL2 files, PalShift files, AnimData editing, merging, recoloring, cropping, verification. By unifying the files into one tool, many mismatch bugs can be eliminated, as well as the reduction of work (COF files can be partially built from the DCC info and AnimData info).
Oculus will also support a TBL editor, for applying the D2GFEx specific style and color escapes. In addition it will also supply a DS1 editor, providing full access to any new tile and map features added by D2GFEx.
The purpose of this post currently is to gather a list of features that people are interested in that are not mentioned; but please note: just because you ask doesn't mean it'll be done, it needs to be feasible. To this end, I am currently not planning to support 3D units/tiles, because there are just too many custom formats, and using a standard format like FBX is possible, but then you need to encode a ton of extra info for poses and UV data etc, all for no gain (the model will still need to be lit in 2D, and matched to one the of 64 directions), it ends up being better to just pre-render it.
When the alpha launches, it will be added to this thread.
In no particular order, I'd like to thank:
- SVR for giving me the original motivation to create this, as well as his DCC decoder (which I currently use a highly modified version of).
- Paul SIramy for his awesome file format docs, and for making all his decoding tools open source, giving me a great based-line to test and benchmark against.
- Nefarius and Kingpin for various bits of feedback over the years that helped improve the driver quality tremendously.
- Lectem for helping me decode a ton of the unknown fields in the DC6, DCC and DT1 formats; together we have mapped out every used field.
- Ogodei for doing a ton of testing, providing me with ideas for new features, and generally keeping me motivated.
- fearedbliss for creating a custom build of Alpaca so users can still have an infinite stash.
- To all my alpha testers (names withheld for now).
- HarvestWombs for hosting our PK Discord
This the current know list of mods/tools/plugins that work with D2GFX:
- Dark Alliance
- PlugY (any version)
[07/05/2018] Initial Announcement.
[17/10/2018] Tooling Announcement.
[05/11/2018] Tooling Teaser.
[20/12/2018] Alpha Teaser.