Fractal Softworks Forum

Please login or register.

Login with username, password and session length

Author Topic: a question for Alex regarding LWJGL and OpenGL  (Read 2020 times)

jlrperkins

  • Ensign
  • *
  • Posts: 46
    • View Profile
a question for Alex regarding LWJGL and OpenGL
« on: December 21, 2020, 08:19:41 AM »

Given that the current OpenGL drivers for the newer AMD cards are absolute turds when it comes to supporting the older OpenGL standards, that said drivers are very unlikely to get better, and that as time progresses, more and more users will inevitably upgrade their graphic cards, and some of them will choose an AMD card, and will be experiencing this problem...

... does Alex have any future plans for addressing this issue? How would he rate the difficulty of moving from OpenGL LWJGL to, say, Vulkan LWJGL?

(Sorry if this has been discussed somewhere else and I'm beating a dead horse here...)

Edit: I might be mistaken here, please correct me if that's the case: is Starsector built using LWJGL version 2? The current state of the art is LWJGL version 3, there's a migration tutorial in the LWJGL site (https://www.lwjgl.org/), and a compatibility layer for version 2 to version 3 (http://forum.lwjgl.org/index.php?topic=5610.0) that apparently allows for gradual migration. Might be interesting.
« Last Edit: December 21, 2020, 09:47:30 AM by jlrperkins »
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: a question for Alex regarding LWJGL and OpenGL
« Reply #1 on: December 21, 2020, 09:49:57 AM »

I'm cautiously optimistic that AMD support may in fact get better; I forget exactly why but some time ago it seemed that there were some indications it might. Some people are also working on a layer emulating OpenGL via Vulkan; not sure how mature that is at this point but it may become an option.

As far as porting Starsector from OpenGL to any other graphics API, that's not really a viable option effort-wise, unfortunately. I mean, if say OpenGL literally stopped working across the board, I'd have to explore something, but we're probably talking a year plus of dev effort just for that.
Logged

jlrperkins

  • Ensign
  • *
  • Posts: 46
    • View Profile
Re: a question for Alex regarding LWJGL and OpenGL
« Reply #2 on: December 21, 2020, 09:57:39 AM »

I made an edit to my original post literally a minute before you posted your answer Alex. Any comments on that?

I'm cautiously optimistic that AMD support may in fact get better; I forget exactly why but some time ago it seemed that there were some indications it might. Some people are also working on a layer emulating OpenGL via Vulkan; not sure how mature that is at this point but it may become an option.

As far as porting Starsector from OpenGL to any other graphics API, that's not really a viable option effort-wise, unfortunately. I mean, if say OpenGL literally stopped working across the board, I'd have to explore something, but we're probably talking a year plus of dev effort just for that.
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: a question for Alex regarding LWJGL and OpenGL
« Reply #3 on: December 21, 2020, 09:59:51 AM »

Ah - LWJGL 3 requires using a different version of Java, so it's a more extensive thing than it seems at first glance. I don't think it'd factor into the AMD question since LWJGL is mostly a pass-through layer in any case.
Logged

jlrperkins

  • Ensign
  • *
  • Posts: 46
    • View Profile
Re: a question for Alex regarding LWJGL and OpenGL
« Reply #4 on: December 21, 2020, 10:24:10 AM »

Welp, looks like we're stuck waiting for a proper OpenGL-to-(DirectX/Vulkan) wrapper then. Current work looks promising, but it's still early days. (Windows already implemented a layer for this exact scenario, but it requires an up-to-date Win10, and seems to be centered around specific productivity apps, not gaming). Then again, as soon as a opengl32.dll Vulkan wrapper pops in, I'm putting it to work (last week I managed to force the game into using a software OpenGL renderer, so I'm optimistic)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: a question for Alex regarding LWJGL and OpenGL
« Reply #5 on: December 21, 2020, 10:44:16 AM »

If you get it working with the Vulkan wrapper at some point, would you mind letting me know?

(last week I managed to force the game into using a software OpenGL renderer, so I'm optimistic)

(... so, using the latest AMD drivers. I kid, I kid - but not really, I'm pretty sure that those are doing software emulation at least on some cards.)
Logged

jlrperkins

  • Ensign
  • *
  • Posts: 46
    • View Profile
Re: a question for Alex regarding LWJGL and OpenGL
« Reply #6 on: December 21, 2020, 10:49:17 AM »

Getting to play this game with decent FPS is the whole reason I started looking into the whole OpenGL-to-Vulkan wrapper thing. If I ever manage to get a wrapper working, you can bet I will post the info here in a skinny second.
If you get it working with the Vulkan wrapper at some point, would you mind letting me know?

(last week I managed to force the game into using a software OpenGL renderer, so I'm optimistic)

(... so, using the latest AMD drivers. I kid, I kid - but not really, I'm pretty sure that those are doing software emulation at least on some cards.)
Logged

Alex

  • Administrator
  • Admiral
  • *****
  • Posts: 24118
    • View Profile
Re: a question for Alex regarding LWJGL and OpenGL
« Reply #7 on: December 21, 2020, 10:53:23 AM »

Thank you! And, ah, my apologies.
Logged

pairedeciseaux

  • Captain
  • ****
  • Posts: 340
    • View Profile
Re: a question for Alex regarding LWJGL and OpenGL
« Reply #8 on: December 21, 2020, 03:26:49 PM »

FYI, an actual in-development OpenGL(/Gallium) driver sitting on top of Vulkan: Zink (part of Mesa).

Not sure about Windows support, but it is developed on Linux and also has support for MoltenVK, which lets it target Metal/macOS.

Documentation: https://docs.mesa3d.org/drivers/zink.html and https://gitlab.freedesktop.org/kusma/mesa/-/wikis/zink
Issue tracker: https://gitlab.freedesktop.org/mesa/mesa/-/issues (filter on Label=zink)
Source code: https://gitlab.freedesktop.org/mesa/mesa/-/tree/master/src/gallium/drivers/zink
Blog of a developer: http://www.supergoodcode.com
Logged

jlrperkins

  • Ensign
  • *
  • Posts: 46
    • View Profile
Re: a question for Alex regarding LWJGL and OpenGL
« Reply #9 on: December 22, 2020, 07:47:48 AM »

Yeah, those are all things I've come across in my hunt for an OpenGL wrapper. Problem is, all those things are currently focused on Linux. That's not an issue here, since the current AMD Mesa drivers are good enough to run Starsector with no problems. What is needed is a Windows implementation of that same thing, basically an Opengl.dll library that exposes the base OpenGL library methods and uses the Vulkan (or DirectX) drivers for the actual processing; the .dll methods would just be translation steps to convevrt the arguments from the OpenGL method call to the undelying API method arguments.

I have actually found a few variations on this theme, but they are all pretty old and/or incomplete. If anyone here wants to do some experimentation, feel free.

https://sourceforge.net/projects/gldirect/
https://github.com/crystice-softworks/QindieGL

The following is the current Microsoft take on this particular issue. Haven't managed to get it working since it requires an up-to-date Windows version, and I'm not currently in position to do a reinstall/update.

https://devblogs.microsoft.com/directx/in-the-works-opencl-and-opengl-mapping-layers-to-directx/
https://www.microsoft.com/en-us/p/opencl-and-opengl-compatibility-pack/9nqpsl29bfff#activetab=pivot:overviewtab

FYI, an actual in-development OpenGL(/Gallium) driver sitting on top of Vulkan: Zink (part of Mesa).

Not sure about Windows support, but it is developed on Linux and also has support for MoltenVK, which lets it target Metal/macOS.

Documentation: https://docs.mesa3d.org/drivers/zink.html and https://gitlab.freedesktop.org/kusma/mesa/-/wikis/zink
Issue tracker: https://gitlab.freedesktop.org/mesa/mesa/-/issues (filter on Label=zink)
Source code: https://gitlab.freedesktop.org/mesa/mesa/-/tree/master/src/gallium/drivers/zink
Blog of a developer: http://www.supergoodcode.com
Logged

Schwartz

  • Admiral
  • *****
  • Posts: 1453
    • View Profile
Re: a question for Alex regarding LWJGL and OpenGL
« Reply #10 on: December 23, 2020, 05:54:51 AM »

Not so optimistic myself.

AMD pretty much came out and said that they'll only work on and fix the major library for each platform for lack of manpower and funding. They focus on DirectX on Windows, OpenGL on Linux. They also said, for example, that they are not going to fix Dx9 issues with their latest cards because Dx9 is legacy. Go figure where old OpenGL stands.

With how closely related OpenGL and Vulkan are, that would probably be the easiest to port and also the nicest in regards to an open library that will perform well everywhere. If you ever feel that you don't have enough work to do, I think this would be worthwhile. ;)
« Last Edit: December 23, 2020, 05:56:39 AM by Schwartz »
Logged