Valve has released its 'ToGL' Direct3D to OpenGL translation layer software. Previously used in its DOTA2 game, it is thought that Valve's move will make it easy for other developers to port games from DirectX-based games engines to OpenGL for Linux, SteamOS and Mac OS X.
Valve's ToGL source has been posted to GitHub and includes some release notes about its scope and implementation. There the firm notes that the code was plucked "directly from the DOTA2 source tree," and is supplied as-is and unsupported. As DOTA2 is a Valve Source Engine game potential users of this code are also told to "be wary that some parts are hardcoded to match Source Engine behavior; see CentroidMaskFromName() and ShadowDepthSamplerMaskFromName() in dxabstract.cpp".
Looking at the positives, the ToGL translation layer supports:
- Limited subset of Direct3D 9.0c
- Bytecode-level HLSL -> GLSL translator
- Some SM3 (Shader Model 3) support: Multiple Render Targets, no Vertex Texture Fetch
As mentioned in the intro we would guess Valve's motive for releasing its code is to help games developers port old and make new games that run on more platforms. The ToGL implementation as it intercepts DirectX calls and replaces them with OpenGL equivalent will mean the performance quite as good using this translation layer but players of DOTA2 and Left 4 Dead 2 on Mac haven't been complaining.
It is thought that we might see a re-release of some older big name titles on OS X and Linux/SteamOS. Also indie developers who only did DirectX games might find a wider audience. Hopefully Valve will be working on a ToGL with support for more modern versions of DirectX. Interestingly ExtremeTech notes in its story about the ToGL release that Titanfall is the first Xbox One title to use the Source Engine.