Hitman Developers Compare DirectX 12 Against DirectX 11; Advanced Visual Effects Showcased

Hitman Developers Compare DirectX 12 Against DirectX 11; Advanced Visual Effects Showcased

IO Interactive hosted a panel at GDC in San Francisco, that DualShockers attended: During the presentation Lead Render Programmer Jonas Meyer explained the pros and cons of using DirectX 12 in the studio’s latest game Hitman, comparing the performance of Microsoft’s new API with DirectX 11.

Meyer also showcased the advanced visual effects applied to each frame in the game, and you can see them in the gallery at the bottom of the post, alongside the full slide presentation. Below you can also read some of the most interesting points he made.

  • Hitman‘s dynamic time of day actually freezes when a level start because the game is so heavily scripted that it wouldn’t make sense to have variable light during the same mission.
  • Probes are used for reflections and ambient light, and are also generated at the start of a level.
  • In the frame showcased below there are 3,500 draw calls (commands to draw an asset or effect) and 8,000 instances. You can also see all the advanced effects added to the frame one by one.
  • The primary focus of using DirectX 12 was to improve the performance of both the CPU and GPU.
  • The developers still wanted to support DirectX 11, since it still has a huge user base that is still on Windows 7.
  • DirectX 12 requires a lot of temporary resources, requiring a fast multithreaded allocator. The developer used one very similar to the one presented at Last Year’s GDC by Naughty Dog’s Christian Gyrling.
  • The interface of the game is still based on DirectX 11. Programmers still prefer it, as it’s significantly easier to implement.
  • Asynchronous compute on the GPU was used for screen space anti aliasing, screen space ambient occlusion and the calculations for the light tiles.
  • Asynchronous compute granted a gain of 5-10% in performance on AMD cards, and unfortunately no gain on Nvidia cards, but the studio is working with the manufacturer to fix that. They’ll keep on trying.
  • The downside of using asynchronous compute is that it’s “super-hard to tune,” and putting too much workload on it can cause a loss in performance.
  • The developers were surprised by how much they needed to be careful about the memory budget on DirectX 12
  • Priorities can’t be set for resources in DirectX 12 (meaning that developers can’t decide what should always remain in GPU memory and never be pushed to system memory if there’s more data than what the GPU memory can hold) besides what is determined by the driver. That is normally enough, but not always. Hopefully that will change in the future.
  • The official guide lines Microsoft provided the developers with instructed to use the MakeResident and Evict commands to ensure that the assets always remained within the memory budget.
  • The Evict command makes a resource unusable, but the memory budget is updated instantly, and that’s a pro. MakeResident makes an evicted resource usable, and the time it uses to execute is proportional to the size of the resource.
  • The problem with this is that it’s complicated, hard to get right and easy to get wrong making the game run worse. The developers spent a really long time to get it right. Unfortunately it also uses a lot of memory (about 1 gigabyte).
  • In the gallery you can see performance comparisons between DirectX 11 and DirectX 12 on two different GPUs (unfortunately the models weren’t mentioned). The bars represent the frame time (milliseconds required to render each frame), with a nearly 20% gain at 720p where the game is mostly CPU-bound, but there’s actually a small loss in 4k, where the game is almost completely reliant on the GPU. The second GPU examined offers a 30% gain at 720p, and more than a 10% gain in 4K.
  • Meyer actually mentioned that he did not know precisely the reason why the first video card is slower in DirectX 12 at 4K resolution, but he clarified that there was a time in which it was much slower, and getting up to par with DirectX 11 required a lot of work. For a few months during development DirectX 12 was 10-20% slower in those conditions.

If you’re a developer who didn’t have a chance to attend GDC, or this specific presentation, and you’re interested in the full audio recording, we’re happy to share. Just contact giuseppe@dualshockers.com, and we’ll send it your way.

[On-location reporting: Steven Santana]