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."
If you want an instant Karma boost, reply to this post!
yayy flappy birds coming to linux
Could this be of use to the Winelib project?
(As the name implies, it's the compile-time analogue of Wine.)
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.
Will there be a performance hit ?
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.
Can someone explain why something like ToGL would be a part of Dota 2?
Spiderman 3 was an awful movie. I wonder why they choose to support that?
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.
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.
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.
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.
DirectX10 / 11 is still better than OpenGL
Could you point to some links stating such a cockup happened?
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.
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.
Doesn't winelib already include DirectX to OpenGL translation? Isn't that half the point of Wine?
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?
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.
Why is this surprising? They need a lot more games for SteamOS.
The Linux Kernel has been more advanced, more secure, more portable, more stable than Microsoft Windows for around 20 years.
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.