Facepunch / garrysmod-requests

Feature requests for Garry's Mod
84 stars 24 forks source link

OpenGL Windows Renderer #796

Open 60percentCaffeine opened 8 years ago

60percentCaffeine commented 8 years ago

It's possible to run other Source Engine games (at least CS:GO) in OpenGL on Windows by adding '-gl' in startup parameters. OpenGL is usually faster then any DirectX version, it can also provide better graphics on old computers, if they don't support new DX versions. You already have OGL renderer on Linux, so why not copy some code and bring it to Windows?

neico commented 8 years ago

About old computers: those usually have either old graphics cards or at least old drivers which usually have bad or worse support towards OGL, especially when it comes to windows in comparison to DX.

Let's just say that M$ had a play in that, modern hardware and drivers however usually have the difference between OGL and DX more balanced up to the point where OGL "can" be better then DX. But that requires a lot of optimizing on the engine renderers (you might want to loop up valve's L4D source engine port to linux blog they've made some years ago to get into more detail)

All source engine games that came after L4D usually have optimized OGL rendering, though I'm not entirely sure where exactly gmod's engine base lies regarding that.

But considering that source1 and therefore gmod still use DX9 (not DX10, or DX11, or even DX12, and let's not even mention Vulkan here) it's highly unlikely that this is ever going to be a concern.

Do note that OGL also requires to use a lot of extensions, especially on older versions where some extensions that are included in today's OGL versions aren't build-in and might even have bugs as vendors aren't required to provide those extensions.

Feel free to dig around this repo if you're interested: https://github.com/ValveSoftware/ToGL

Note: you can always use -dxlevel (I think was it) to turn down to DX8 or I think even DX7 if old computers with slow rendering is a concern to you.

Kefta commented 8 years ago

@neico Just to note, DX8 and below has a lot of texture rendering issues with GM13, but I wouldn't mind OGL support for GMod if it were easy to implement as an alternative. On my NVidia 920 (I think), OGL seems to run a lot smoother than DX9-10 for some reason.

60percentCaffeine commented 8 years ago

@neico, dxlevel 80 is lowest dxlevel possible in GMod. It's because lower dxlevels will cause some very strange bugs to appear, i.e. models drawing in wireframe and ability to see through walls. I think that GMOD Source Engine is based on TF2 engine, which is a mix of all Source Engine versions.

60percentCaffeine commented 8 years ago

@neico, I've forgot that you can use DirectX 11.2 (some people says that they are able to run GMod in DX12, but I don't believe it) in GMod, but it's unlikely that game will take any advantage from it.

Grocel commented 8 years ago

@uRandomAlex You can enter any number you want in the -dxlevel parameter. It has no effect beside using dx9 and saying that you would be running on dx999 or something.