-FwG- ^ Bucky Mar 11, 2014 @ 8:44am
ToGL source code was just released on GitHub.
https://github.com/ValveSoftware/ToGL

If you don't know what this is, this is the D3D>OpenGL abstraciton layer that Valve has used, and still is using to port their most popular Source games to Linux.

It works by decompiling the shaders into GLSL, then recompiling them with the driver. It's also a whole implementation of Direct3D 9.0c over OpenGL. The result is slightly longer load times but better performance overall due to the lack of OS overhead on Linux vs. Windows.

Discuss!
Last edited by -FwG- ^ Bucky; Mar 11, 2014 @ 8:53am
Showing 1-13 of 13 comments
< >
Fibbles Mar 11, 2014 @ 9:48am 
I remember Valve saying they'd open-source this when they first started porting their games and then we heard nothing more about it for a very long time.

I'm really happy they've done this. Hopefully more developers will port their games now that a large portion of the work has been done for them.
CrisFigueira Mar 11, 2014 @ 10:57am 
Nice!
-FwG- ^ Bucky Mar 11, 2014 @ 11:04am 
Originally posted by Fibbles:
I remember Valve saying they'd open-source this when they first started porting their games and then we heard nothing more about it for a very long time.

I'm really happy they've done this. Hopefully more developers will port their games now that a large portion of the work has been done for them.
Yeah, it'd be awesome to see Tactical Intervention, and all those other 3rd party Source games get ported.
kiwii Mar 11, 2014 @ 5:11pm 
Originally posted by -FwG- ^ Player:
https://github.com/ValveSoftware/ToGL
It works by decompiling the shaders into GLSL, then recompiling them with the driver. It's also a whole implementation of Direct3D 9.0c over OpenGL. The result is slightly longer load times [...]
Discuss!
That recompilation process takes three minutes on each start of the game for me. I guess the recompiled shaders are supposed to be cached on disk but somehow the game doesn't cache it for people running Radeon cards with Catalyst. I filed a bug report nine month ago but I didn't get a response. If somebody who understands this stuff could take a look at it now that the code is open, that would be great.

https://github.com/ValveSoftware/Source-1-Games/issues/978
-FwG- ^ Bucky Mar 11, 2014 @ 6:16pm 
Originally posted by kiwii :3:
Originally posted by -FwG- ^ Player:
https://github.com/ValveSoftware/ToGL
It works by decompiling the shaders into GLSL, then recompiling them with the driver. It's also a whole implementation of Direct3D 9.0c over OpenGL. The result is slightly longer load times [...]
Discuss!
That recompilation process takes three minutes on each start of the game for me. I guess the recompiled shaders are supposed to be cached on disk but somehow the game doesn't cache it for people running Radeon cards with Catalyst. I filed a bug report nine month ago but I didn't get a response. If somebody who understands this stuff could take a look at it now that the code is open, that would be great.

https://github.com/ValveSoftware/Source-1-Games/issues/978

If it's an AMD/Catalyst-only bug then it sounds like a driver issue more than an abstraction layer bug.

I'll look at it sometime in the next few days.
Letalis Sonus Mar 12, 2014 @ 4:06am 
So... anyone took a look at getting rid of the OpenGL 3 specific stuff?
Fibbles Mar 12, 2014 @ 8:36am 
Originally posted by Letalis Sonus:
So... anyone took a look at getting rid of the OpenGL 3 specific stuff?

To what end? I assume you're hoping this would allow Source games on Linux to run using older hardware. AFAIK without the sourcecode for the games themselves this would be impossible to achieve.
Last edited by Fibbles; Mar 12, 2014 @ 8:37am
Letalis Sonus Mar 12, 2014 @ 11:04am 
That would imply that those games are directly calling OpenGL functions, which is exactly what this project aims to prevent.

The MIT license has no copyleft, there's nothing that would keep Valve from just taking over a working patch that takes care about this issue. Eventually they might even keep developing it directly on github now.
-FwG- ^ Bucky Mar 12, 2014 @ 11:44am 
Originally posted by Fibbles:
AFAIK without the sourcecode for the games themselves this would be impossible to achieve.

Yeah what's on the repository is labeled as "uncompilable in current state."
Fibbles Mar 12, 2014 @ 9:05pm 
Originally posted by Letalis Sonus:
That would imply that those games are directly calling OpenGL functions, which is exactly what this project aims to prevent.

The MIT license has no copyleft, there's nothing that would keep Valve from just taking over a working patch that takes care about this issue. Eventually they might even keep developing it directly on github now.

There's nothing to stop Valve using a user developed patch but my point is that without the source code for the game you'd be coding in the dark. There'd be no way to test if your ToGL fork worked with Source games whilst developing because you couldn't compile it.

At best you could develop an OpenGL 2.1 (for example) version of ToGL for your own game and hope it shares enough in common with Source that Valve could use parts.
Pocket Mar 23, 2014 @ 3:49pm 
So, wait, does this thing actually decompile and recompile code on the fly when my game is running? Because that would explain why performance on Source games is so much worse in Linux...
-FwG- ^ Bucky Mar 23, 2014 @ 5:03pm 
Originally posted by Pocket:
So, wait, does this thing actually decompile and recompile code on the fly when my game is running? Because that would explain why performance on Source games is so much worse in Linux...
No, only on first run.

The recompiled shaders are supposed to be cached but it seems fglrx drivers don't do this for some reason.
El bakyyy Mar 24, 2014 @ 4:10am 
For me the map loading times cause a headache. It's so boring to wait for the game to load a map for 3 minutes, while on Windows on the same machine it takes only 1 minute :/
Showing 1-13 of 13 comments
< >
Per page: 15 30 50
Date Posted: Mar 11, 2014 @ 8:44am
Posts: 13