Forgot your password?
typodupeerror
Open Source Games

Valve Open Sources Their DirectX To OpenGL Layer 130

Posted by Unknown Lamer
from the please-port-mame-hlsl-shader-to-sdlmame-kthx dept.
jones_supa writes "A bit surprisingly, Valve Software has uploaded their Direct3D to OpenGL translation layer onto GitHub as open source. It is provided as-is and with no support, under the MIT license allowing you to do pretty much anything with it. Taken directly from the DOTA2 source tree, the translation layer supports limited subset of D3D 9.0c, bytecode-level HLSL to GLSL translator, and some SM3 support. It will require some tinkering to get it to compile, and there is some hardcoded Source-specific stuff included. The project might bring some value to developers who are planning to port their product from Windows to Linux."
This discussion has been archived. No new comments can be posted.

Valve Open Sources Their DirectX To OpenGL Layer

Comments Filter:
  • by Anonymous Coward on Tuesday March 11, 2014 @08:58AM (#46453757)

    With a big company (in terms of money) like Valve pushing OpenGL there is a real chance DirectX will face serious and permanent competition. We will finally have a serious alternative to the suffocating model of forcing a new operating system down peoples throat through software. It worked great with the browser, now lets hope Valve can make it happen for games.

  • Re:Makes sense (Score:5, Insightful)

    by RaceProUK (1137575) on Tuesday March 11, 2014 @09:17AM (#46453879) Homepage
    If only it was MIT-licensed so people could club together and add support for the rest of Dx9 (and 10 and 11 while they're at it)...
  • by CastrTroy (595695) on Tuesday March 11, 2014 @09:20AM (#46453899) Homepage
    I think that only worked so well for the browser because MS let IE stagnate for so long. I don't think they are doing the same with DirectX. DirectX continues to evolve and stay up to date. It's one thing to convince the non-programmer, general computer user to keep using mediocre tools, it's a whole other story to try and get developers to do the same.
  • Re:Winelib (Score:3, Insightful)

    by Anonymous Coward on Tuesday March 11, 2014 @09:28AM (#46453963)

    Could this be of use to the Winelib [winehq.org] project?

    (As the name implies, it's the compile-time analogue of Wine.)

    Probably not. The wine guys tend to be more or less anti toward anything that they didn't write and thus can assert that it's not infringement on Microsoft's source code. Accepting that much code from Valve sounds very risky for them.

  • by Anonymous Coward on Tuesday March 11, 2014 @09:48AM (#46454111)

    In light of the fact that OpenGL's more portable to more platforms, it's not as hard a sell as you'd think. Esp. for more casual games. Want to target iOS and Android? You'll be doing OpenGL ES 2.x. The same game will target PS3, PS4, OSX, Linux, and Steam/SteamBox with only a few modifications.

  • by Anonymous Coward on Tuesday March 11, 2014 @09:54AM (#46454149)

    Since OpenGL is the only language to run on mobile, and Mac, and Linux plus it's available on all the consoles it seems kind of crazy to target anything else if your code is expected to survive for any length of time given the decline of the Windows PC market.

  • Re:question (Score:4, Insightful)

    by Cley Faye (1123605) on Tuesday March 11, 2014 @10:03AM (#46454201) Homepage

    My guess it that they were doing a "two birds with one stone" strategy - using this project as an excuse (and test-case) for the translation layer, hoping that some devs would take this opportunity to port their DX9 games to Linux because of it, thereby improving the value of SteamOS.

    Another option is that they didn't write DOTA2 from scratch, but reused an existing engine. Which in turn was based on some previous works, and at some point Direct3D was used, and remained there the whole time.

  • by bloodhawk (813939) on Tuesday March 11, 2014 @10:05AM (#46454211)
    It was a garbage rumor back then that was only believed by those with a heavy anti MS bias and is even more so now given the next version has been announced.
  • Re:Winelib (Score:5, Insightful)

    by JDG1980 (2438906) on Tuesday March 11, 2014 @10:20AM (#46454337)

    Probably not. The wine guys tend to be more or less anti toward anything that they didn't write and thus can assert that it's not infringement on Microsoft's source code. Accepting that much code from Valve sounds very risky for them.

    Valve isn't some fly-by-night operation. They almost certainly have more exposure to legal liability than the Wine project would.

  • by LoRdTAW (99712) on Tuesday March 11, 2014 @10:42AM (#46454475)

    OpenGL is pretty much used everywhere but Microsoft targeted games (Windows and Xbox). Using DirectX on Windows games allowed them to be portable between PC and the Xbox so more and more games went the D3D route to remain portable between the two.

    I believe almost all CAD and 3D modelling software are OpenGL based. Android and iOS use OpenGL ES while any non Windows OS such as Linux and OSX use OpenGL for 3D graphics. With the big push to mobile and Microsoft left in the dust, OpenGL is the dominant player.

  • Re:Winelib (Score:5, Insightful)

    by LoRdTAW (99712) on Tuesday March 11, 2014 @10:48AM (#46454527)

    Hold on, The subset of DX9.0c is probably the Xbox360 native API: http://en.wikipedia.org/wiki/Comparison_of_OpenGL_and_Direct3D#Gaming [wikipedia.org]

    The original Xbox supported Direct3D 8.1 as its native API while the Xbox 360 supports a modified version of Direct3D 9.0c as its native API.

    This could be useful for studios looking to port Xbox360 titles to the Steam Box platform. It makes sense as there are a lot of titles that could see a sort of resurrection on Steam and bring in some more money. It is also possibly the same D3D API subset used for Windows Phone 8.

  • by Anonymous Coward on Tuesday March 11, 2014 @11:08AM (#46454681)

    They don't offer more functionality, though. DirectX 11 eats OpenCL; XAudio2 eats OpenAL; Collada isn't even an API, it's a file format. Kronos offer more-or-less equivalent functionality to Windows, except there's no common math library, the OpenGL/OpenCL APIs are inherently lower-performance than the Direct3D 11 API, and OpenGL continues to lag behind DirectX 11 on features like surface format aliasing and memory-mapped resources. Also, none of the Kronos APIs handle video mode switching or vsync events or window painting. And if you look at how OGL has evolved over the last 10 years it's obvious they're just copying D3D a generation later. Not once has OGL moved ahead of the curve. Not once. DirectX is and will continue to be the bleeding edge giving the best support for the latest hardware. It's ridiculous to claim the Kronos APIs have more functionality. And with DirectX 12 being announced in a few weeks, Kronos will be busy for a year speccing Open GL 5 to match it.

Mathemeticians stand on each other's shoulders while computer scientists stand on each other's toes. -- Richard Hamming

Working...