7 ms·
Direct3D to OpenGL abstraction layer
- foxhill 13y agokind of preaching to the choir, no? i mean, there are more open source games that use OpenGL than DirectX, and are already cross platform as a result. similarly, i would imagine if a AAA game studio wanted to do such a thing, they would roll their own (or just use GL in the first place). perhaps i'm being too cynical (but this is hacker news..)
- baq 13y agowhy would they roll their own if there's a battle-tested steam-os-compatible library with a BSD(-ish) license?
- icebraining 13y ago"BSD(-ish) license" In fact, it's MIT: http://opensource.org/licenses/MIT http://opensource.org/licenses/MIT
- this_user 13y agoSo far most AAA games are still developed for DirectX only. Those are the games that make or break a platform. Doom 95 was arguably the kind of killer app that established Windows as the primary gaming OS. In the context of Valve's SteamOS strategy it makes perfect sense to encourage more major developers to build games on a portable API like OpenGL or possibly AMD's Mantle by making it as easy as possible. If they fail at this, SteamOS, Steam Boxes and gaming on Linux in general won't have a chance at mainstream success.
- foxhill 13y agosorry if i wasn't clear, but i am aware that most AAA games use DX. the same is not true for open source. there are already DX->GL compatibility layers, although most of them are in house, by companies that produce ports (ala Feral Games). yes, i entirely agree with you.. almost. ideally, i'd like DirectX to.. go away, forever. proprietary APIs that result in lock in to a software or hardware platform are seriously holding back computing in general. and i'd never recommend anyone use AMD's Mantle for the same reason (which is a massive waste of everyone's time)
- AimHere 13y agoWell there are possibly smaller studios and devs who perhaps don't have the resources to roll their own translation layers, for whom this might be a tipping point towards supporting SteamOS and/or Linux. Since Valve has already written this for their own purposes, it'll cost next to nothing for this to be published if they can stop people expecting support, and they might get a few bug reports into the bargain.
- pavanky 13y agoThis was probably done to persuade the people complaining about porting their codebase to OpenGL (and hence Linux / SteamOS).
- Arelius 13y ago> there are already DX->GL compatibility layers, although most of them are in house, by companies that produce ports (ala Feral Games). And this is Valve releasing their particular variant mostly targeted at other major game studios. There is no reason every studio should be forced to create their own in house compatibility layer.
- deleted 13y ago[deleted]
- dimillian 13y agoThis is huge, really huge for anyone who write DirectX games and want to make them run on OSX/Linux. This is basically what a part of Wine do, am I wrong?
- guardian5x 13y agoI don't see why this is so "huge". Maybe you could explain? I think developing OpenGL-Games or porting them was never a big issues. Most 3d engines today even have those abstraction layers included anyway.
- jheriko 13y agoits not a big deal... its just that most game code is hidden and buried so that most of the loud opinions and i have to say its good to see this but i'm mildly disappointed too... DirectX --> OpenGL is one thing, but a properly cross platform rendering interface that will work with DX, its flavour on 360, the novelties of Win8 and Xbone as well as PS3 gcm and gx/gx2 on nintendo platforms whilst dealing with the quirks of desktop vs. es gl? that would still be a pretty run of the mill technical achievement of no particular note. aside from that i don't like the code. singleton class instance? why not use the static keyword so the compiler knows what you want and can optimise accordingly and save you the potential to shoot yourself in the foot. and when did 2500 lines become an acceptable file size for a header? also did we forget that you can nest folders, or name files with modern 1990s style filenames... i need to open source my stuff...
- jheriko 13y agofyi i meant to delete 'so that most of the loud opinions and'
- cwyers 13y agoMost of the big off-the-shelf engines (Unreal/Unity/CryTek/Source) do. If you look at first-party engines, though (Square Enix has Crystal Tools, EA has Frostbite, Monolith has LithTech, Activision has their IW engine for the CoD games), they're likely to be DirectX and console targeting. Valve is giving those kinds of engines the capability of targeting OpenGL through their existing DirectX support.
- kayoone 13y agoNot sure here but don't all major engines already support OpenGL ootb ? Basically any engine thats runs on PS3/PS4 does like UnrealEngine, Cryengine, idTech, Unity and most indie/open source engines are OpenGL anyway. All engines that target Android/iOS are OpenGL too. Even for things like XNA which was Xbox/DirectX only there is MonoGame to port it to *nix platforms easily. So if you have rolled your own DirectX-only engine this is awesome of course, but do people really do that?
- throwaway2048 13y agoPS3/PS4 commercial games do not use OpenGL and never have. This myth needs to die. http://scalibq.wordpress.com/2010/05/15/sony%E2%80%99s-playstation-3%E2%80%99s-main-graphics-api-is-not-opengl/ http://scalibq.wordpress.com/2010/05/15/sony%E2%80%99s-plays...
- jheriko 13y agoyeah, the one time i tried to use psgl as a time saver it was a lesson in how broken, unmaintained and poorly documented it was... i'm pretty sure it would have worked at some point because the docs indicated that it had. however - writing a gl like layer over the top of the rsx stuff is not a particular challenge - the functionality maps extremely well.
- pjmlp 13y agoSomehow the FOSS crowd seems to propagate this myth that only Microsoft has vendor specific graphics APIs and the rest of the world runs on OpenGL. Never understood how it got born.
- sspiff 13y agoIt was probably born out of the fact that this is the truth for PC gaming, where Microsoft uses DirectX and "all" the other platforms use OpenGL. For a long time, console game development was obscure and unaccessible (and to a large extent, this is still the case), so aspiring game developers had somewhat of a tunnel vision when it came to game platforms.
- paraboul 13y agoFor the interested, google's Angle is the opposite : https://code.google.com/p/angleproject/ https://code.google.com/p/angleproject/
- ygra 13y agoOnly for WebGL, though. (Edit: OpenGL ES 2)
- paraboul 13y agoWebGL is just an OpenGL ES 2 binding to JavaScript. OpenGL ES 2/3 is a subset of OpenGL 3/4. Angle translate GLSL shaders and OpenGL calls to DirectX
- pjmlp 13y agoSadly it is a bit more than "just", specially if one needs to write code across plain GL and GL ES.
- kaonashi 13y agoWhat hurts the most? I would think the imperative drawing stuff would be missed least.
- pjmlp 13y agoWhich OpenGL flavor to support 2.x, 3.x or 4.x, followed by which GLSL level to support, and which GL ES flavor to support 1.x, 2.0 or 3.0 and their respective GLSL levels. Not to mention vendor specific extensions and workarounds driver bugs. So one ends with multiple code paths, if several versions are to be supported. Similar to how HTML or POSIX are portable, but then again not so much.
- greggman 13y agoActually it's up to OpenGL ES 3 (which may or may not be good enough for your app)
- bhouston 13y agoThis seems like a new version of this previous effort: http://en.wikipedia.org/wiki/Cedega_(software) http://en.wikipedia.org/wiki/Cedega_(software)
- outworlder 13y agoNot really. Cedega is a version of Wine. This is a library, intended to be used in your application in lieu of calling the APIs directly. You cannot take a full application and ask this library to run it.
- ZoFreX 13y agoWINE does however contain a DirectX -> OpenGL translation layer that can be used separately from the rest of it.
- dimillian 13y agoCedega/Cider is the cheap way to "port" games on OSX. It result of bad performances, yet at lot of companies still pay a lot of money to do it. The sad thing is that you can do it yourself (with Wine), for free, and a lot of time under 30 minutes. Even the latest version of Wine patched with the Command Stream WIP is 5 times faster.
- Keyframe 13y agoLimited subset of Direct3D 9.0c
- ygra 13y agoNow that I'm reading that ... isn't every subset of a finite set itself finite (and thus limited)?
- Demiurge 13y agoI'm not a native English speaker, but I think in colloquial terms, "limited" means "smaller than you might want" or something like that.
- TazeTSchnitzel 13y agoA limited subset would not be a complete implementation, yes.
- Yuioup 13y agoNice. Does this mean that developers can start porting their existing (pre 2013) games over to Linux? Or are we missing a DirectX to SDL translation layer?
- foxhill 13y agowell, SDL will do the job of getting a window from the OS. when used with GL (in the way valve do), it doesn't really do much else.
- Yuioup 13y agoIt handles sound, input and a bunch of other stuff which DirectX also handles besides window management and rendering.
- repsilat 13y agoI wonder if you could use ToGL and Wine... Wire up the D3D graphics stuff at compile time, and translate the rest of DX at runtime.
- orionblastar 13y agoThis is a good start, I'd also like to see a Dotnet and VCRUN conversion to Linux libraries like Mono and GNU C++ to help port even more Windows games to GNU/Linux and Mac OSX.
- slacka 13y agoValve covered how these tools are used in their Porting Source to Linux: Valve’s Lessons Learned talk: https://www.youtube.com/watch?v=btNVfUygvio https://www.youtube.com/watch?v=btNVfUygvio slides here: http://adrienb.fr/blog/wp-content/uploads/2013/04/PortingSourceToLinux.pdf http://adrienb.fr/blog/wp-content/uploads/2013/04/PortingSou...
- archagon 13y agoIn a thread not too long ago, I asked why CS:GO might have such terrible performance in OSX, and olegoandreev hypothesized that it might have to do with poorly compiled shaders. Maybe with enough eyes on the code, this can finally be fixed? We already know that the OSX port of the Source engine can have close-to-Windows performance based on benchmarks done in Parallels, and yet it's still shamefully only half as performant. https://news.ycombinator.com/item?id=7303753 https://news.ycombinator.com/item?id=7303753