Slashdot Mirror


Valve Open Sources Their DirectX To OpenGL Layer

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."

130 comments

  1. Any replies will be immediately upmodded! by Anonymous Coward · · Score: 0, Troll

    If you want an instant Karma boost, reply to this post!

    1. Re:Any replies will be immediately upmodded! by Anonymous Coward · · Score: 5, Interesting

      Boobs

  2. yayy flappy birds coming to linux by Anonymous Coward · · Score: 0

    yayy flappy birds coming to linux

    1. Re:yayy flappy birds coming to linux by Anonymous Coward · · Score: 0

      Flappy Bird wasn't made using DirectX.

    2. Re:yayy flappy birds coming to linux by kthreadd · · Score: 0

      yayy flappy birds coming to linux

      Technically it was, Android/Linux as opposed to GNU/Linux.

    3. Re:yayy flappy birds coming to linux by ArcadeMan · · Score: 1

      In the meantime you can always play FlappyCoin instead.

  3. Winelib by Wootery · · Score: 5, Interesting

    Could this be of use to the Winelib project?

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

    1. Re:Winelib by Anonymous Coward · · Score: 4, Interesting

      Possibly, I havn't looked at the source yet. But the readme says its a subset of the DirectX 9.0c features, making it not only obsolete, but incomplete. Fortunately, its open source so a bit of wrangling could make it swallow dx10 and 11

    2. Re:Winelib by Anonymous Coward · · Score: 0

      didn't someone already make a dx10 for xp implementation?

    3. Re:Winelib by jones_supa · · Score: 1

      There was one in development, but he didn't finish the project.

    4. Re:Winelib by Anonymous Coward · · Score: 3, Insightful

      Could this be of use to the Winelib 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.

    5. Re:Winelib by JDG1980 · · Score: 4, Insightful

      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.

    6. Re:Winelib by Richard_at_work · · Score: 4, Informative

      Odd considering their (Wines) last copyright cockup was entirely due to an internal contributor committing decompiles of Microsoft binaries as contributed code...

    7. Re:Winelib by LoRdTAW · · Score: 5, Insightful

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

      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.

    8. Re:Winelib by bhcompy · · Score: 1

      Or, it's just for the Source engine, because that was/is DX9

    9. Re:Winelib by Anonymous Coward · · Score: 0

      Hahaha disregard that, I suck cocks.

      {to mods - this is a joke in response to the parent post}

    10. Re:Winelib by Anonymous Coward · · Score: 0

      Where do you think this policy came from?

    11. Re:WInelib by Anonymous Coward · · Score: 0

      It will probably have greater application in other developers porting their games to Linux -- it's not likely that Wine will use it because most of the functionality is redundant between the two.

    12. Re:Winelib by Anonymous Coward · · Score: 0

      I think they are mainly anti anything reactos, mostly because there was some question that the source might have been contaminated with leaked windows code.

      They have to have a strict firewall, which includes no developers that have seen the leaked windows source.

    13. Re:Winelib by Anonymous Coward · · Score: 0

      Valve also has a lot more money to hire lawyers. Volunteers can't afford that.

    14. Re:Winelib by BetterThanCaesar · · Score: 1

      Odd considering their (Wines) last copyright cockup was entirely due to an internal contributor committing decompiles of Microsoft binaries as contributed code...

      The word you are looking for is the opposite of odd.

      Unsurprising.

      --
      "Stop failing the Turing test!" -- Dilbert
    15. Re:Winelib by Anonymous Coward · · Score: 0

      Wine already has a pretty decent DX9 coverage. I've even fixed a bug in it.

    16. Re:Winelib by Kuberz · · Score: 1

      Could this be the year of Linux Desktop?

    17. Re:Winelib by bcmm · · Score: 1

      This is beside the point, unless Valves wants to indemnify users of the code they released (hint: they won't).

      --
      # cat /dev/mem | strings | grep -i llama
      Damn, my RAM is full of llamas.
    18. Re:Winelib by Richard_at_work · · Score: 1

      I chose my words as I intended it to be taken - the post I was replying to intimated that the Wine people only trust code that originated internally, rather than from an external source such as Valve, because then they can guarantee its heritage. Which is ironic considering the source of the last issue was internal, and thus wouldn't have been prevented by their current stance.

  4. On the road to replacing DirectX by Anonymous Coward · · Score: 5, Insightful

    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.

    1. Re:On the road to replacing DirectX by CastrTroy · · Score: 4, Insightful

      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.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    2. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 0

      Newsflash: IE still has >50% market share.

    3. Re:On the road to replacing DirectX by MBGMorden · · Score: 2

      Newsflash: IE still has >50% market share.

      Um, no. Depending on what site you're looking at it might go up or down, but nobody is ranking IE at over 50% anymore. W3 is actually reporting IE at around 20% these days:

      http://www.w3counter.com/globa...

      --
      "People who think they know everything are very annoying to those of us who do."-Mark Twain
    4. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 3, Insightful

      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.

    5. Re:On the road to replacing DirectX by Immerman · · Score: 1

      Where are you getting your statistics? Various estimates as listed on Wikipedia show IE having at most almost 25%
      Source . . . Chrome IE Firefox Safari Opera Other
      StatCounter 46.60% 24.64% 20.37% 5.06% 1.33% 2.00%
      W3Counter 34.1% 20.3% 18.3% 17.8% 2.7% 6.8%
      Wikimedia 42.69% 18.02% 15.28% 6.06% 2.36% 15.59%

      --
      --- Most topics have many sides worth arguing, allow me to take one opposite you.
    6. Re:On the road to replacing DirectX by Vlado · · Score: 1

      What happened to the news/rumor that there will not be another DirectX version?

      http://tech.slashdot.org/story...

    7. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 2, Insightful

      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.

    8. Re:On the road to replacing DirectX by TyFoN · · Score: 2

      And the reason those 20% still use it is because of company lock-in / legacy web apps.

      Even my almost 70 year old mother is on Firefox without me being involved.

    9. Re:On the road to replacing DirectX by jones_supa · · Score: 3, Informative

      It was only AMD speculation (which also happened to fit nicely with their Mantle strategy). DirectX 12 is now confirmed.

    10. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 0

      DirectX is a lot more than just what OpenGL provides though. Swapping to OpenGL provides significantly less functionality than DirectX as DirectX isn't just a graphics API. So in the hope of picking up the slim pickings on other systems they have to do more work and hence more expense. For many games/developers the benefits simply aren't there, especially if they are already familiar with DirectX.

    11. Re:On the road to replacing DirectX by bloodhawk · · Score: 3, Insightful

      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.

    12. Re:On the road to replacing DirectX by Z80a · · Score: 1

      SDL is quite a match for DirectX.

    13. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 0

      No no source has almost 25% the others have around 20% and 18%.

    14. Re:On the road to replacing DirectX by JDG1980 · · Score: 5, Interesting

      Swapping to OpenGL provides significantly less functionality than DirectX as DirectX isn't just a graphics API.

      Pretty much all aspects of DirectX except for Direct3D have been deprecated by Microsoft. They still work, but aren't recommended for new code, and have been superseded by other APIs.

    15. Re:On the road to replacing DirectX by LoRdTAW · · Score: 4, Insightful

      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.

    16. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 0

      That's because your trying to compare OpenGL with all of Direct X, which isn't even a proper comparison to make. OpenGL is an alternative to Direct3D (the graphics component of Direct X). The Kronos Group also offers: OpenAL, OpenCL, Collada and several other APIs that not only replace the functionality of Direct X but offer far more functionality as a whole.

      I honestly don't remember ever seeing a single project, be it one I worked on or not, which used the entirety of Direct X. At most they tend to use Direct3D, the math stuff and Direct Input. The latter two have faded out over the past several years as there are far better open source alternatives. For awhile XACT was kind of popular for audio, but it has some major limitation (or design flaws) that make it a pretty poor choice for anything more than simple games.

    17. Re:On the road to replacing DirectX by wertigon · · Score: 5, Informative

      If you're going to be nitpicky, then yes, it's SDL+OpenGL.

      However, the only DirectX system still relevant in Win8.1 is Direct3D. Everything else has been removed;

      DirectDraw - Repaced by Direct2D
      DirectInput - Replaced by XInput
      DirectSound - Replaced by XAudio2
      DirectMusic - Legacy MIDI format - also replaced by XAudio2
      DirectPlay - A complete joke, replaced by Games for Windows Live and XB Live.
      DirectX Media/Media Objects: Deprecated and replaced/removed by all of above

      That leaves DirectWrite and Direct2D as the only relevant (and minor) DIrectX components left. So yes, DX is more than a graphics API; these days and for gaming though, the only thing being used is D3D in DX.

      --
      systemd is not an init system. It's a GNU replacement.
    18. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 0, Insightful

      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.

    19. Re:On the road to replacing DirectX by DrXym · · Score: 5, Informative
      OpenGL is definitely more portable than DirectX but that's not to say it's portable with a few modifications. There are various OpenGL and OpenGL ES profiles, and while they are related they can be radically different in important ways. For example OpenGL ES 1.1 and 2.0 are totally incompatible despite what you might think - 1.1. uses a fixed function pipeline and 2.0 expects you to write shaders for basically everything. OpenGL ES 2.x is roughly but not completely a subset of OpenGL 2.1. Every version of OpenGL supports a different selection of extensions.

      Aside from the differences on paper, the actual implementations can be broken, buggy or inefficient. e.g. Some older desktop drivers might not offer an ES 2.x profile, or it could be hopelessly crap.

      There is no GLU / GLUT either for ES 2.x and every platform implements its own equivalent but proprietary set of APIs. So you may discover a lot of work is required to fix that. Then you may discover that one platform or language's bindings are different from another in subtle but annoying ways, e.g. there are several OpenGL ES 2.x bindings for Java and one might return a handle in an int[] array while another expects you to supply a 1-element sized IntBuffer. Annoyances which add up.

      In summary, yes you can port code, and OpenGL is definitely one family of APIs that offers support across a wide selection of devices. But it's not guaranteed to be simple and probably won't be. The best bet is use a good third party library (e.g. libgdx) and let the library hide as much of the work as possible.

    20. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 1

      That would be all true if you completely ignore OpenGL extensions...

    21. Re:On the road to replacing DirectX by unixisc · · Score: 1

      What's the equivalent of DirectSound or XAudio2 in OpenGL? Can OpenGL be enhanced to include sound in addition to visualization, just like DirectX already is?

    22. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 0

      Also, none of the Kronos APIs handle video mode switching or vsync events or window painting.

      Why would they? Those are external concerns, especially vsync.

      Helpful hint: LED display devices theoretically don't need a periodic vsync. You could (in theory) draw to your alternate buffer, perform the buffer swap, which would then initiate the display redraw (basically, vsync on demand as updates are made.)

    23. Re:On the road to replacing DirectX by Ardyvee · · Score: 2

      You want OpenAL for audio.

      --
      I don't care if I'm wrong. I only care about everyone obtaining something from the discussion.
    24. Re:On the road to replacing DirectX by unixisc · · Score: 1

      So does that come as a standard part within either Linux or the BSDs? And if one has it, does one still need ALSA or PulseAudio?

    25. Re:On the road to replacing DirectX by cheesybagel · · Score: 1

      OpenAL can run on top of ALSA or PulseAudio.

    26. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 0

      I'm not sure how different OGL profiles are any different than dealing with different DX versions. The major card manufacturers -- Nvidia, AMD -- support up to (I believe) OpenGL in their closed drivers, and the open source drivers across the board are up to OpenGL 3.3 -- and I'm not familiar with any game that uses a higher standard than 3.3.

      The fact that using DX10/11 requires a certain level of hardware and a minimum version of Windows hasn't stopped games developers from developing for those APIs, so why should OpenGL compliance (or specifically, any lack thereof) stop developers from using OpenGL?

    27. Re:On the road to replacing DirectX by Jakeula · · Score: 2

      You're correct that it seems like OpenGL is playing catch up with D3D, but to assume that it will *NEVER* get ahead of the curve is quite an assumption. The Linux Kernel took years of playing catch up, and now its just as modern as anything else (as a pure kernel). If Valve is moving to OpenGL and others follow Valve, then it stands to reason that Khronos will likely be able to make strides and eventually close the gap. Right now more graphically driven things are done on Windows (gaming), so of course it has the best tools for the job. However, the tides are slowly changing, and if they change in a quality fashion, I see no reason OGL has to stay in the back seat. I say this as someone with limited experience dealing with both OpenGL and Direct3D.

    28. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 1

      This seems kind of moot considering that OpenGL mainly looks like it is catching up to D3D if you look at the normal standards and not the extensions. When the video card makers add a feature for D3D, they can and usually do have an OpenGL extension implementing the same feature since the hard part was making it work on the card. There is something to be said for D3D driving them to implement such features, but they also implement other features not part of D3D updates, and release them as OpenGL extensions. Often it is far easier to test new features by creating an OpenGL extension and testing before it gets included in a new version of D3D.

      But in some sense, it should be no surprise that OpenGL lags behind if only looking at the main standard, and that is working as intended. The standard pulls in extensions that have been tested and shown to work consistently. There is a whole process of creating vender extension, then ARB extensions that are standardized between venders, then the new version of OpenGL pulling in ARB extensions that have been around already. Even in the early stages, many important and/or straightforward exertions are common enough to be incorporated into production code.

    29. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 0

      There's a real big hurdle direct 3D has to get over no matter how good it happens to be.

      It only runs on Microsoft platforms.

      This means, for all practical intents and purposes, it doesn't exist in the very hot and very important mobile markets. (Don't kid yourself. Microsoft share of the tablet and smart phone market amounts to little more than a statistical error and developers know this)

    30. Re:On the road to replacing DirectX by DrGamez · · Score: 1

      Newsflash: AC posts uninformed and incorrect statement, remains AC.

    31. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 0

      It does come standard in the main Linux distros. But whether it does is largely irrelevant since it's open source and thus you can easily bundle it with your game.

    32. Re:On the road to replacing DirectX by DrXym · · Score: 1

      There's nothing to stop you picking an OpenGL profile and using that but obviously if you expect your code to be portable then you're going to have choose very carefully. And if portable includes handheld or mobile devices then the profile has to be ES 2.x or 3.x or you have to write two backends (with all the pain that goes with that). So its not all plain sailing. If you have an existing app then porting it may involve considerable effort.

    33. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 0

      IIRC, DirectInput isn't quite deprecated, it's just not meant to be used for keyboard/mouse or for XBox360 controllers. Keyboard and mouse are now RawInput - which isn't exactly new - XBox 360 controllers (or compatible joysticks) are XInput and "Legacy" Joysticks are DirectInput.

    34. Re:On the road to replacing DirectX by exomondo · · Score: 1

      With a big company (in terms of money) like Valve pushing OpenGL there is a real chance DirectX will face serious and permanent competition.

      Direct3D has almost always faced serious competition from OpenGL, however completely replacing Direct3D with OpenGL and only having one player in that space would be a terrible mistake, the market would stagnate. OpenGL is a follower of Direct3D innovation, and I say this as an OpenGL developer and a staunch advocate of OpenGL. In the last few years the innovation in graphics programming has come from Direct3D with geometry shaders in DX10 (implemented in OpenGL shortly after) and the programmable tessellation pipeline and compute shaders in DX11 (again, implemented in OpenGL shortly after).

    35. Re:On the road to replacing DirectX by exomondo · · Score: 1

      I believe almost all CAD and 3D modelling software are OpenGL based.

      Most support a Direct3D rendering path on Windows (just like we used to do in the 90s when we had to support Direct3D, OpenGL, Glide, S3D, etc...). Nobody ties their application directly to one graphics API.

    36. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 0

      geometry shaders in DX10 (implemented in OpenGL shortly after)

      If by shortly after you mean at pretty much the same time or a little before considering the geometry shader extension already existed by the end of 2006 shortly before the general release of Vista and DX10. OpenGL doesn't need Direct3D to be driven, and can be driven by competition between different video card makers trying to get their new features out.

    37. Re:On the road to replacing DirectX by Lisias · · Score: 1

      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.

      You, obviously, don't have to earn your living using Visual Studio.

      Man, I give up accounting all the wasted hours that thing inflicts me with stupid, annoying and everlasting bugsw "features". The last update to VS2010 was a pain in the ass to install.

      --
      Lisias@Earth.SolarSystem.OrionArm.MilkyWay.Local.Virgo.Universe.org
    38. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 0

      NX, SolidWorks and Vectorworks are all OpenGL only (or internal software rendering). Our in house software is developed in OpenGL only, because because it has to work on Linux and nothing is added by adding a Direct3D rendering path. We've never seen issues with being tied only to OpenGL because it works on every modern desktop OS, and wasn't a hindrance for a brief excursion into mobile devices.

    39. Re:On the road to replacing DirectX by mrbax · · Score: 1

      Pretty much all aspects of DirectX except for Direct3D have been deprecated by Microsoft.

      Except for Direct3D. And Direct2D, DirectCompute, DirectSetup, DirectSound, DirectWrite, DirectXMath, and DirectX Media....

    40. Re:On the road to replacing DirectX by mrbax · · Score: 1

      That leaves DirectWrite and Direct2D as the only relevant (and minor) DIrectX components left

      As well as DirectCompute, DirectSetup, and DirectXMath; half a dozen in all.

    41. Re:On the road to replacing DirectX by CastrTroy · · Score: 1

      Actually, I do. And at work we're still using VS 2008. And I still like it better than anything I've seen from the open source community. Trying to do Android development in Eclipse is a pain compared to doing stuff in Visual Studio. Despite it's problems (and it does have them), I don't think there's an IDE out there that compares to Visual Studio. I haven't tried developing for iOS though, as I don't want to go out and buy a Mac just to try something out for the fun of it.

      --

      Anthropic principle: We see the universe the way it is because if it were different we would not be here to see it.
    42. Re:On the road to replacing DirectX by Anonymous Coward · · Score: 0

      DirectSound, Direct Setup (which just lets you install and check DirectX versions) and DirectX Media are deprecated.

    43. Re:On the road to replacing DirectX by wertigon · · Score: 1

      DirectCompute isn't widely used last time I checked, CUDA and OpenCL has far greater mindshare. It's also more or less equivalent to those two technologies. Though granted you must use it for XBox...

      DirectSetup is only a minor utility library that only makes sense if you're already using DirectX.

      DirectXMath is, likewise, more of a utility library. I consider it a part of D3D, since 90% of the functions only make sense with D3D (and maybe DirectCompute).

      So, yeah, revising that list, Direct3D, Direct2D, DirectCompute and DirectWrite.

      --
      systemd is not an init system. It's a GNU replacement.
    44. Re:On the road to replacing DirectX by Lisias · · Score: 1

      Eclipse is very good. The Android plugin is a piece of sh*t.

      I did some C++ development on Eclipse, and I found it nice. Doing JavaSE, of course, is very good also (but some functionalities for JavaEE needs some serious work). But a lot of the best Eclipse funcionalities are trimmed to Java development, I never had to do refactoring on C++ code using it.

      I did a lot of jobs using Visual Studio 6.0 a long time ago, that was very limited - but once you fill the gaps with the proper plugins, the fact is that that thing used to work fine. 2005 was ok to me, but I didn't too much development on it (I leaved the job at that time).

      Things started to change on 2010 (I jumped over the 2008). Opening a legacy project on your Solution is almost a russian roulette - you never know what that damned thing will decide to merge with your other projects. Man, what a mess it does sometimes.

      The last prick it played on us was last week. From nothing (we thing that was some automatic update) the compiling started to fail on linking ("invalid COFF format" or something). No problem, as MS already published a fix

      But the fix "fixed" something that broke compile time (no big deal, but hell....) and was a huge pain in the ass to install.

      Again, no (really) big deal, but this is exactly the kind of problem that my employer claims to avoid by using Microsoft, instead of doing development using Linux - that it's a bitch to install and configure, but once it starts to work, it works and that's it.

      --
      Lisias@Earth.SolarSystem.OrionArm.MilkyWay.Local.Virgo.Universe.org
    45. Re:On the road to replacing DirectX by Lisias · · Score: 1

      XCode is not bad, but is not good neither.

      If all you ever used in your life was XCode, you will probably be happy with it as it does the job.

      But I found the thing.. weird... to use. I ended up doing C/C++ development on Eclipse on the MacOS - but I don't do COCOA apps (neither iOS).

      --
      Lisias@Earth.SolarSystem.OrionArm.MilkyWay.Local.Virgo.Universe.org
    46. Re:On the road to replacing DirectX by Lisias · · Score: 1

      Where I wrote

      you never know what that damned thing will decide to merge with your other projects

      Please read

      you never know what that damned thing will decide to merge with your other projects' configurations

      instead.

      --
      Lisias@Earth.SolarSystem.OrionArm.MilkyWay.Local.Virgo.Universe.org
    47. Re:On the road to replacing DirectX by metzjtm · · Score: 1

      You put the same PS3 game on a PC and it would play like it was on a PS3. I think that would be a hard sale. Look how well Battlefield 3 & 4 have done on the PC. You would really have to down grade their hit boxes and graphics to step down to a PS3 or any game only platform.

    48. Re:On the road to replacing DirectX by TranquilVoid · · Score: 1

      The last prick it played

      I see you did not feel the need to correct this line :)

    49. Re:On the road to replacing DirectX by TranquilVoid · · Score: 1

      I believe almost all CAD and 3D modelling software are OpenGL based.

      Probably true. I work on software with a CAD focus and we use Direct3D only because of misinformation. The product was converted from a custom language with C (and OpenGL) to .NET, and the designers at the time were given the impression by Microsoft that OpenGL would shortly be deprecated under .NET.

      Ironically, Microsoft actually deprecated Managed DirectX so we rewrote in managed C++.

    50. Re:On the road to replacing DirectX by Lisias · · Score: 1

      The last prick it played

      I see you did not feel the need to correct this line :)

      Yep. It had hurt our feelings deeply. One colleague of mine took 2 days to be back on his seat at work. =D

      (damn, I was certain I had type 'prank'... I don't know if this Freudian slip is mine or automatic corrector's ... =P)

      --
      Lisias@Earth.SolarSystem.OrionArm.MilkyWay.Local.Virgo.Universe.org
    51. Re:On the road to replacing DirectX by qwak23 · · Score: 1

      or because we are lazy.

      though I'm also weird and tend to use different browsers for different things /shrug. But IE tends to be primary go to browser for just looking shit up, at least when I'm on windows.

  5. performance? by invictusvoyd · · Score: 1

    Will there be a performance hit ?

    1. Re:performance? by Xest · · Score: 1

      There's bound to be some hit, but the hit will be so utterly negligible that it's not enough to care. You shouldn't let it be a concern because it's too small to matter.

    2. Re:performance? by Anonymous Coward · · Score: 2, Informative

      Valves presentation on the topic http://adrienb.fr/blog/wp-content/uploads/2013/04/PortingSourceToLinux.pdf states better performance using togl for their games (togl starts at slide 18, performance is mentioned on 23).

    3. Re:performance? by Creepy · · Score: 4, Informative

      Yeah, probably minimal, since it is bytecode level (what HLSL and GLSL compile into)

      The bad - this is DX 9.0c, which is analogous to OpenGL 2.0 (with extensions - note that ATI drivers didn't support extensions at the time, so more like 2.2+ for them) and in console terms, XBox 360/PS3 tech. OTOH, OpenGL went through a major paradigm shift with OpenGL 3 and 4 that make it work more like HLSL, so I expect shader conversion is much easier. When I ported a DX10 shader to OpenGL 3 it was much easier (but much harder was porting the entire OpenGL 2 project to 3).

  6. Makes sense by mwfischer · · Score: 2

    Valve makes money with Steam.

    Valve has hammered out a useful content delivery platform for Linux and OS X.

    Valve makes it easier to translate DX to OGL.

    Collect profit... eventually.

    1. Re:Makes sense by Anonymous Coward · · Score: 0

      "the translation layer supports limited subset of D3D 9.0c"

      So a limited subset of games could be ported with this. Very useful

    2. Re:Makes sense by RaceProUK · · Score: 4, Insightful

      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)...

      --
      No colour or religion ever stopped the bullet from a gun
    3. Re:Makes sense by Carewolf · · Score: 4, Informative

      A limited subset, as in every PC game that still supports WinXP. Which is practically all of them.

    4. Re:Makes sense by Anonymous Coward · · Score: 2, Informative

      The majority of games on Valve's catalogue use D3D9.0c. That could be what they're aiming for - the huge collection of DX9 games already there.

    5. Re:Makes sense by Anonymous Coward · · Score: 0

      Quite a few newer games do no longer support DirectX 9, it is only relevant for Windows XP which even on steam only has a share of 5% .

    6. Re:Makes sense by Himmy32 · · Score: 1

      That's the joke.

    7. Re:Makes sense by Anonymous Coward · · Score: 0

      If only there was some way to humorously point out an obvious beneficial detail of an article so readers could move their palm rapidly onto their foreheads and utter "of course".

    8. Re:Makes sense by Cley+Faye · · Score: 1

      If only there was some word to indicate that one missed a glaringly obvious joke in a parent post, like the sound of a gush of wind or something.

    9. Re:Makes sense by jones_supa · · Score: 2

      They probably simply aimed to get the Source engine ported, which happens to be DX9-based. That there are lots of other DX9 games is a nice side effect.

    10. Re:Makes sense by Anonymous Coward · · Score: 0

      gush of wind

      sploosh?

    11. Re:Makes sense by BitZtream · · Score: 1

      Still want to know why their 'useful' content delivery platform won't run on my case-sensitive OSX partition ... but Linux users don't seem to have that problem.

      And no, I don't give a shit that I can make a case sensitive partition and play symlink hell games to get it to work. Its fucking ridiculous that it doesn't support case sensitive filesystems. /End Rant>

      --
      Persistent Volume manager for Kubernetes - https://github.com/dwimsey/openshift-pvmanager
    12. Re:Makes sense by Threni · · Score: 1

      Why? Because it affects 1 user who can work around it trivially; I imagine there are other priorities, given that there are limited resources and work has to be prioritized accordingly.

    13. Re:Makes sense by Anonymous Coward · · Score: 0

      Not quite. For Valve, a limited subset probably means the base DirectX 9.0c library. DirectX 9.0c is not just one monolithic library: it is a set of libraries that has had many addons and updates over time. This is why almost every game you install wants to "update/install" DirectX. It is not a matter of updating the library, it is a matter of ensuring all the different dependencies that were compiled into the game are installed on the machine and at the correct versions.

      See: https://support.steampowered.com/kb_article.php?ref=9974-PAXN-6252

  7. question by Anonymous Coward · · Score: 0

    Can someone explain why something like ToGL would be a part of Dota 2?

    1. Re:question by Anonymous Coward · · Score: 0

      Because Dota 2 was created for Windows/DirectX, ToGL is used to port it to Linux/OpenGL

    2. Re:question by Anonymous Coward · · Score: 0

      I think the question is why make a game in Direct3D and translate it to OpenGL rather than simply making it in OpenGL from the start and saving the effort, especially since they most likely wanted the game to be on Linux the whole time.

      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.

    3. Re:question by Creepy · · Score: 2

      It runs on OSX and Linux, neither of which have native DirectX support because Microsoft keeps their graphics technology under tight wraps. All implementations of it not shipped by Microsoft need to be reverse engineered from the API. OpenGL is licensed to hardware manufacturers (which is how development is paid for) and accessing the API is free for software developers.

    4. Re:question by Cley+Faye · · Score: 3, Insightful

      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.

    5. Re:question by petermgreen · · Score: 1

      I think the question is why make a game in Direct3D and translate it to OpenGL rather than simply making it in OpenGL from the start

      Because game developers don't start from scratch with each game, they either buy an engine in or they create and engine and use it for multiple games (and possiblly sell it to third party game developers too). Of course they tweak that engine with each new game but only rarely do they perform a major rewrite.

      The initial release game for the source engine was half life 2 and the initial release platforms for that game was windows, closely followed by xbox (original). It's pretty obvious why they would have built their engine on directx.

      --
      note: i'm known as plugwash most places but i screwd up registering that here somehow in the past and now can't register
    6. Re:question by Anonymous Coward · · Score: 3, Interesting

      Speaking as someone who's written a native D3D 9.0c implementation from scratch (on the PS3), implementing it is not the issue. I probably implemented the exact same subset as Valve did - only the shader-driven part, no fixed-function emulation - and it took maybe 4 weeks total (160 hrs). My implementation was 10x faster (seriously) than the D3D 9.0c implementation on X360. (That's CPU usage of the API; obviously the GPU ran at comparable rates. The X360 port team on the project I was on hit frame rate just issuing too many D3D calls, while the PS3 port was running the exact same D3D calls using 10% of the CPU. It correctly handled locking, sync, cache flushes, etc. so it gave the exact same guarantees as the real D3D; I guess Microsoft's 9.0c still had a lot of Windows cruft in it's X360 incarnation. Probably doing too many kernel transitions - I had zero except at the end of the frame.)

      The reason I never turned this into a product and sold it was because to get the D3D 9.0c headers you have to accept an EULA that says it's all confidential, and my dog simply isn't in that fight. Valve's dog is in that fight now, but they have a much bigger dog than I do. Using their code as a starting point I could in theory release my code now (only to PS3 developers though because of Sony's NDAs ... and that's no click-through EULA, that's a cast iron contract between my company and Sony). A bit late though, who the hell needs D3D 9.0c on PS3 in 2014? Direct3D 12 on PS4, now that might be worth considering ...

    7. Re: question by Anonymous Coward · · Score: 0

      i did super awsome stuff back in the day but i can't and/or won't show you.

    8. Re: question by Anonymous Coward · · Score: 0

      also i did it in no time and it was 10X faster than the competition!

  8. SM3 support by edxwelch · · Score: 0

    Spiderman 3 was an awful movie. I wonder why they choose to support that?

  9. Lessons learned by jones_supa · · Score: 5, Informative

    If you are interested in this stuff, the Porting Source to Linux: Valve's Lessons Learned is also good watch, if you haven't seen it yet.

  10. yes. by Anonymous Coward · · Score: 1

    As far as I can tell it is.

    Here is a professional grade codebase to start from for anyone who wants to complete the compatability.

  11. Going the other way like Microsoft does... by tlambert · · Score: 5, Informative

    Going the other way like Microsoft does is more interesting.

    One of the biggest issues with OpenGL is that you can get shaders that won't run in bounded time. You can see this with a number of games in Flash, or natively in OpenGL, when run on a Mac. If the shader doesn't exit, it eats a channel, and there are a limited number of channels, and once they are gone, the renderer, which is also used for the desktop, basically crashes. There are nice system log messages from the video driver about it, but besically everything ends up restarted, which is pretty useless.

    FWIW: this accounts for the majority of system instabilities in the card specific portions of both Mac OS X and Linux render pipelines.

    DirectX doesn't allow things to run in unbounded time in its OpenGL to DirectX translator; instead, it loop unrolls shaders, and if it can't do that such that they run linearly, and therefore in bounded time, it omits them from the render. So you might not get distance blurring, haze effects, fog effects, rain effect, and so on, but at least the thing doesn't crash, and if the person porting the code to the Windows platform cares about these things, they fix the code so that it'll run using DirectX. Usually, this reduced the perceived "quality" of the final render, but you get at least a crude version of your effect back.

    The other thing DirectX does is, in the video driver, keep a reserve channel for sending commands to the video hardware; the common reason for this is in-band signaling to comply with the DirectX 9 requirement that the video hardware be capable of being reset, without rebooting the system, such that a video card hang doesn't necessitate a reboot.

    While a DirectX to OpenGL translation layer is a nifty idea (I lobbied very hard for a FreeBSD emulator for Linux, rather than a Linux emulator for FreeBSD so that developers would target FreeBSD rather than Linux as their development platform), I don't think that as long as the OpenGL shader looping issues don't also get addressed at the translation layer that translating from DirectX to OpenGL will be in anyway superior to translating from OpenGL to DirectX.

    So basically, it's nice they released this, but the code is of little practical use in the real world, since there are features that will get lost in translation.

    1. Re:Going the other way like Microsoft does... by Megane · · Score: 1

      Very interesting. I think that explains why Minecraft can hose OS X so thoroughly. The current version of Minecraft can reliably crash the graphics on OS X 10.6 when you simply try to change the window size. (The official "workaround, won't fix" is to upgrade to OS X 10.9!)

      --
      #naabhaprzrag, #sverubfr-000, #agi-fcbafberq, negvpyr[pynff*=' negvpyr-ary-'] { qvfcynl: abar !vzcbegnag; }
    2. Re:Going the other way like Microsoft does... by Windwraith · · Score: 2

      Strange, I use and code plenty of games using shaders like that, and I run KDE4 in Linux, in both GL composite and regular X11 mode, and have never experienced any crash like you describe. Is it because I use Nvidia drivers or something, or maybe because I happened to have had the luck to only play games that do it right, and had the luck to never code any shaders triggering that? Seems rather unlikely, but I am genuinely curious here.

    3. Re:Going the other way like Microsoft does... by tlambert · · Score: 1

      Strange, I use and code plenty of games using shaders like that, and I run KDE4 in Linux, in both GL composite and regular X11 mode, and have never experienced any crash like you describe. Is it because I use Nvidia drivers or something, or maybe because I happened to have had the luck to only play games that do it right, and had the luck to never code any shaders triggering that? Seems rather unlikely, but I am genuinely curious here.

      The closed source drivers have some, but not all, workarounds for the issue. They're basically ports of the Windows drivers, and have the reserve channel because of this. You may in fact be lucky, but I'd have to have a huge amount of information in order to tell you for sure (e.g. are you running a compositing window manager, what card are you using (tells me total channels), potentially instrument the GL pipeline connections to see how many of the available ones are in use, etc.. The crashes normally happen when all the channels get used up and you need to do something driven by an event - and can't because of it.

  12. Tools by The+Cat · · Score: 1

    At the very least this will make it possible for some excellent RAD tools to make their way to Linux much faster. Among them Gamemaker, Stencyl, Unity and Construct.

    Then there will be the inevitable FOSS equivalents, which will spinoff their own series of games, making development faster and less buggy on both PCs and mobile devices. The Linux to Android migrations in particular are going to be really exciting.

    The next chapter is going to be amazing for Linux.

    1. Re:Tools by exomondo · · Score: 1

      I doubt it, ATi did this already nearly a decade ago just a couple of years after the release of DirectX 9.0c and open sourced it under the name HLSL2GLSL which was forked a few years ago to add support for OpenGL ES (mainly for porting from DirectX platforms to Android) and is already used in Unity and OGRE. Conversion of the programmable pipeline from DirectX to OpenGL has been done for many years already.

  13. Keyword: D3D 9.0c by Dunge · · Score: 1

    DirectX10 / 11 is still better than OpenGL

  14. References? by Anonymous Coward · · Score: 1

    Could you point to some links stating such a cockup happened?

  15. Actually... by Anonymous Coward · · Score: 0

    ReactOS has the same provision and spent a year doing nothing more than ensuring no possibly contaminated code was in the codebase.

    Honestly this whole thing could be solved by making copyright expire when a product was not longer in 'primary commercial circulation'. If somebody has given up on a product as worth selling, that should also end their (formerly limited) monopoly on the redistribution of the copyrighted material.

  16. The better question is... by Anonymous Coward · · Score: 0

    Do you really want a company founded by a middle manager from Microsoft, who had previously kept close ties with Microsoft, becoming Microsoft v2.0 by cornering the majority of the digital distribution market, starting with, but not ending with, videogames?

    Because that is where the Steam ship is headed. Next stop being an android client and then who knows.

  17. Already there? by thatkid_2002 · · Score: 1

    Doesn't winelib already include DirectX to OpenGL translation? Isn't that half the point of Wine?

    1. Re:Already there? by Wootery · · Score: 1

      Indeed. I was wondering if there'd be anything to gain from another project with a similar goal.

  18. YOTLD! by Anonymous Coward · · Score: 0

    The next chapter is going to be amazing for Linux.

    ah yes, the Year of the Linux Desktop! Tell me, why exactly are you so excited about this? It is a tool that can port shader code (which is the reference to a subset of Direc3D) from a 10 year old version of a 3D graphics API which is something we could already do and already had open source automation tools for. Why is this going to be so amazing?

  19. Get back into the game, Vigoss by iRaze.Raze.Raze · · Score: 1

    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.

    Valve declared back in 2012 that OpenGL is indeed faster than DX11 even on windows - http://www.extremetech.com/gam... "The Valve Linux Team breaks it down on their shiny new blog: With an Nvidia GTX 680, Intel i7-3930k, and 32GB of RAM, Windows 7 and DirectX, Left 4 Dead 2 maxes out at 270.6 fps. With the same hardware, but different software — Ubuntu 12.04 and OpenGL — L4D2 scores 315 fps, almost 20% faster than Windows". The Dota2 community has grown so huge that tinkering these APIs won`t be any hurdle. Albeit,i personally feel that Values is essentially trying to bring back some of the old Russians/Chinese Dota Teams,who have yet not made any appearance in D2 because of the high graphics requirement in D2 compared to D1. All of this may change when Blizzard introduces their own D2.

  20. SteamOS by Mirar · · Score: 1

    Why is this surprising? They need a lot more games for SteamOS.

  21. "The Linux Kernel took years of playing catch up" by Anonymous Coward · · Score: 0

    The Linux Kernel has been more advanced, more secure, more portable, more stable than Microsoft Windows for around 20 years.

  22. to get the D3D 9.0c headers you have to accept an by Anonymous Coward · · Score: 0

    Or you can just read the source code of various games that use those headers, and implement your system to port those games correctly.
    EULA are uniformly unenforceable bunk anyway.