Direct3D

From Valve Developer Community
(Redirected from DirectX)
Jump to navigation Jump to search
English (en)Português do Brasil (pt-br)Translate (Translate)
This article or section is a stub. You can help by expanding it.

Direct3D is a graphics application programming interface (API) for Windows Microsoft Windows. It is part of DirectX.

GoldSrc GoldSrc engines ships with a software renderer, OpenGL and initially, Direct3D 6, prior to it being removed in 2013 after SteamPipe update. Unlike OpenGL (since detail textures support was added in 2004 with the release of CS:CZ) and like the Software renderer, it doesn't seems to have issues with overbright lighting. In James Bond 007: Nightfire James Bond 007: Nightfire, a heavily modified GoldSrc game, it used Direct3D 8 instead. With the Half-Life 25th Anniversary Update, all GoldSrc games also uses Direct3D 9 but only for startup videos when software renderer is used.

Source Source primarily used Direct3D 9, initially Shader Model 2.0, which later was upgraded to support Shader Model 3.0 (in all games since Source 2004 as of 2005), but offers backward compatibility with older GPUs (that predates DirectX 9) using DirectX feature levels as low as DirectX 8 (or DirectX 7 and 6 in previous version of Source before Orange Box branch). Left 4 Dead engine branch Left 4 Dead engine branch requires GPUs with Shader Model 3.0 support in order to run.

Some third-party engine branch like Titanfall branch Titanfall branch and Strata Source Strata Source use Direct3D 11 instead. As of 2024, nearly all of Valve games also added support for Vulkan renderer on Windows, using third-party wrapper DXVK to translates D3D9 to Vulkan. Enabling Vulkan translation will require the "-vulkan" launch option (except in Portal with RTX and upcoming Half-Life 2 RTX (boots up to Vulkan, using RTX Remix's own copy of DXVK which was then translated again to (or outputted as) Direct3D 12), and in Team Fortress 2 branch games which boots to Vulkan by default on Linux).

Source 2 Source 2 primarily uses Direct3D 11, and previously provided support for Direct3D 9, but also has options to use the Vulkan renderer.

GoldSrc GoldSrc Direct3D

Direct3D 6

Features

  • Colored lighting - Quake simply had monotone lighting
  • Transparent textures - Glass can now be used in maps
  • Texture Filtering - Quake (GLQuake) simply Texture Filtering
  • Detailed textures

Direct3D 8

Direct3D 8 is used only on Counter-Strike (Xbox) Counter-Strike (Xbox) and James Bond 007: Nightfire James Bond 007: Nightfire.

Features

  • Dynamic iris simulation - automatically adjust brightness, similar to HDR Rendering (only in Counter-Strike (Xbox))

Direct3D 9

Since Half-Life 25th Anniversary Update, Direct3D 9 is used to display startup videos when software renderer is used.

Source Source Direct3D

  • Primarily runs on Direct3D 9.0. Some third-party engine branches use Direct3D 11 or 12.
    • Prior to Left 4 Dead engine branch, Source supports DirectX compatibility levels (or feature level, dxlevel for short) for older graphics card (such as DirectX 8 level card) that only support some, but not all DX9 features (or works poorly when run on DirectX 9 level).
    • After Left 4 Dead branch, the DirectX level system (dxlevel, or feature level system) alongside support for DirectX 8 GPUs (which uses Direct3D 9 with DirectX level system) has been deprecated in favor of automatic CPU & GPU model & performance detection (via cpu_level and gpu_level), and it's console command "mat_dxlevel" was hidden by default and marked as launcher-only, meaning that the command can be only changed via command line argument (attempting to enter the command in the console normally would result in "Unknown command"), but using VScript or SourceMod server plugin, or by using mat_info instead, it is revealed that Left 4 Dead branch (aswell as Portal 2 branch and the original release of Dota 2, but not CS:GO) runs on dxlevel 100 (DirectX level 10.0), however the actual renderer is still being rendered in Direct3D 9. The Source engine never officially support Direct3D 10 given Direct3D 9 is still sufficient, according to Valve (Doug Lombardi).
    • In all games since Source Multiplayer (since 2011)[1], Source 2013 and Counter-Strike: Global Offensive, also support D3D9Ex (labeled as Windows Aero DirectX extensions in game options), which can improve performance on some GPUs, and reduces CPU usage up to 40%. It also improves Alt + Tab and windowed mode support. Requires Windows Vista or later. Can be disabled using -nod3d9ex (-disable_d3d9ex for CS:GO).
      • Icon-Bug.pngBug:Despite Valve claiming that the issue has been fixed,[1] you cannot disable D3D9Ex (Windows Aero DirectX extensions) via in-game Advanced Video Options. Valve later eventually removed the D3D9Ex toggle in Team Fortress 2 branch.
  • Support Shader Model 2.0 (and 3.0 after updates to Source 2004 since Day of Defeat: Source).
    • Shader Model 5.0 and 6.0 if Direct3D 11 or 12 is used.
  • Support for both forward, deferred and clustered rendering pipelines.
    • Source primarily uses the forward renderer, while Dota 2, as well as some third-party Source games (Titanfall, Black Mesa, etc.) use the deferred renderer (shading or lighting).
    • Deferred rendering is a rendering technique that allows games to render many dynamic lights with little performance impact. Deferred rendering is commonly used in most modern titles (this include some third-party Source games). Dota 2 is the only official Source game to use this technique.
    • Other titles such as Portal 2: Community Edition also use the Clustered shading technique, resulting in similar lighting performance as the deferred renderer (both clustered, forward & deferred), but unlike deferred, clustered works with both forward & deferred rendering pipelines.
  • LDR (SDR) and HDR (in all games since Day of Defeat: Source) rendering
    • HDR rendering (High Dynamic Range rendering) is introduced with the release of Day of Defeat: Source (and Half-Life 2: Lost Coast a month later), running on updated version of Source 2004. HDR rendering is the process of generating computer graphics scenes using lighting calculations done in high dynamic range (HDR). It works by automatically adjust exposure and "blooming" colors above 100% brightness into neighboring areas, mimicking the way cameras and even eyes handle light exposure, then collapsing the image into SDR color range (tonemapping), resulting an image appears to have higher color saturation, more bloom and improved contrast while still technically being limited by the SDR color range. Assets such as skyboxes have HDR versions with higher color range (16 or 32-bits/channel) than LDR skyboxes (8-bits/channel RGB).
    • LDR rendering (or SDR rendering) is the old way the game was rendered, using standard dynamic range lighting. It has been deprecated since Left 4 Dead engine branch Left 4 Dead engine branch. This does not apply to some games such as the original release of Dota 2, for example, which always use LDR.
    • Warning.pngRisk of Confusion:Not to be confused with "HDR display output", which can display HDR images (including HDR rendering) natively on HDR monitors, resulting in higher brightness & more color range and contrast than a SDR monitor is capable of, and can significantly reduce or eliminate tonemapping. The Source engine, using Direct3D 9 by default, doesn't support native HDR output to HDR-capable displays, except in Apex Legends Apex Legends on consoles (PlayStation 5 and Xbox Series X/S only).
  • See Source page for more features.

Source 2 Source 2 Direct3D

  • Runs on Direct3D 11
    • Available in all Source 2 games except s&box.
    • Previously also support Direct3D 9 in Dota 2 (Reborn) before it was dropped in 2021.
  • Shader Model 5.0
  • Multithreaded rendering
  • See Source 2 page for features.

See also

External links

1. The earliest changelog to mention D3D9Ex (Windows Aero DirectX Extensions) was in Dec 15, 2011. This change applies to all Source MP games. Team Fortress 2, Counter-Strike: Source, Day of Defeat: Source and Half-Life 2: Deathmatch Updates Released.

Source Engine Changes (TF2, DoD:S, HL2:DM)
- Fixed a bug which caused Windows Aero Extensions video option to always be enabled, regardless of setting. Disabling this can improve compatibility with third-party programs and overlays, but may also affect performance.

. Retrieved on July 20, 2025.