Skip to content

Latest commit

 

History

22 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

W3DNext

A Direct3D 11 renderer backend for the GPL-released Command & Conquer: Generals — Zero Hour engine, replacing the original DirectX 8 renderer.

The W3D engine (Westwood 3D / WW3D2) is a fixed-function-era renderer: FVF vertex formats, the multitexture cascade, fixed-function transform & lighting, indexed vertex blending for GPU skinning. D3D11 has none of that, so this project implements a fixed-function-emulation layer — HLSL shaders, constant buffers, and state objects that reproduce the DX8 pipeline's behavior behind the engine's existing DX8Wrapper abstraction. The game code above the wrapper is unchanged.

Status

Working. The D3D11 backend plays real skirmish games at frame-rate parity with the original DX8 path (29.36 vs 29.38 FPS on the internal fps-capped benchmark scene; both backends sit at the engine's frame cap). Menu rendering is frame-matched to 99.78% byte-identical against DX8. The backend ships off by default — the game starts on the original DX8 renderer unless you opt in.

Run with the new backend:

generalszh.exe -d3d11

(-dx11 is an alias; -dx8 forces the original backend and wins if both are given.)

Known open defects and the full DX8-vs-D3D11 A/B history are documented in docs/architecture/d3d11-parity-log.md. The port design deep-dive — what the DX8 surface is and how each piece maps to D3D11 — is RENDERER_PORT.md.

Building

Windows, 32-bit target. You need:

  • Visual Studio 2022 or later with the MSVC toolset and C++ ATL (x86) — see docs/runbooks/build-vs2026.md for VS2026-specific notes and the ATL install gotchas
  • CMake and Ninja (the generator is Ninja Multi-Config)
cmake --preset win32-vcpkg
cmake --build build/win32-vcpkg --config Release --target z_generals

The Debug config and other presets are listed in CMakePresets.json. As with all Generals source ports, you need a retail installation of Zero Hour for the game data — no game assets are included in or distributed with this repository.

Lineage

License

GPL v3, with Electronic Arts' additional terms under GPL section 7 — see LICENSE.md, carried verbatim from EA's source release.

In particular: this project claims no right, title, or interest in "Command & Conquer" or any other Electronic Arts trademark, and no affiliation or association with Electronic Arts Inc. This is a modified version of the GPL-released source and is marked as such. No game assets (models, textures, audio, INI data) are included.

Contributing

See CONTRIBUTING.md. Renderer work is reviewed against the parity discipline used so far: changes to the D3D11 backend should come with an A/B observation against the DX8 path (screenshot pair, frame-dump diff, or fps measurement) rather than an assertion that it looks right.

Maintenance level

This is a working reference implementation, maintained casually by one person. Issues are triaged weekly, but may sit; pull requests are reviewed when time permits. Forks and downstream use are encouraged — that's what the GPL is for. If the project grows, co-maintainers are welcome.

Questions, design discussion, and bug reports all belong here on GitHub — issues for anything actionable, discussions for the open-ended kind. That's where I'm most reliably reachable.

About

D3D11 renderer backend for the GPL-released C&C Generals / Zero Hour engine

Resources

Contributing

Security policy

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages