|
From: Fernando G. L. <fer...@gm...> - 2023-09-28 23:16:13
|
Hi all!
After looking at some recent commits by James regarding the Nasal
menubar replacement, I got curious about how far along the process of
switching to the core profile we actually are. And it turns out we are
quite far!
I added a compile time switch for the default HUD (which still relies
on legacy GL code), and I made a few small modifications to allow for
PUI to be disabled entirely. These modifications break font rendering
because (I think) we are still tied to plib for that, although please
correct me if I'm wrong.
The steps I followed for anyone trying to replicate my setup are:
- Compile OSG with GL 3 support and all legacy GL features disabled:
-DOSG_GL3_AVAILABLE=ON
-DOSG_GL1_AVAILABLE=OFF
-DOSG_GL2_AVAILABLE=OFF
-DOSG_GLES1_AVAILABLE=OFF
-DOSG_GLES2_AVAILABLE=OFF
-DOSG_GL_DISPLAYLISTS_AVAILABLE=OFF
-DOSG_GL_FIXED_FUNCTION_AVAILABLE=OFF
-DOSG_GL_MATRICES_AVAILABLE=OFF
-DOSG_GL_VERTEX_ARRAY_FUNCS_AVAILABLE=OFF
-DOSG_GL_VERTEX_FUNCS_AVAILABLE=OFF
- Compile SimGear with ShaderVG enabled:
-DUSE_SHADERVG=ON
- Compile FlightGear with the default HUD disabled and PUI disabled:
-DENABLE_HUD=OFF
Now you can run FlightGear with the following command line options:
--compositor=Compositor/HDR/hdr
--prop:/sim/gui/use-pui=false
--disable-splash-screen
>From the console logs I was very glad to find out that FG was indeed
running under the core profile!
0.19 [INFO]:general NVIDIA Corporation
0.19 [INFO]:general NVIDIA GeForce RTX 4070/PCIe/SSE2
0.19 [INFO]:general 3.3.0 NVIDIA 535.104.05
0.19 [INFO]:general 3.30 NVIDIA via Cg compiler
RenderDoc also recognises FG as a compatible OpenGL application, even
though it warns that the core profile has not been explicitly
requested. I think this is just a matter of requesting the version we
want in the OSG DisplaySettings.
Here is a screenie of the RenderDoc capture:
https://i.imgur.com/0WFKfS0.png
There are many warnings from OSG and the driver complaining about us
using deprecated stuff like alpha testing, fixed-pipeline fog,
GL_LIGHT, etc. It shouldn't be *too* hard to fix these once we have a
more stable thing going on though.
There is still a lot of work to do, but finally seeing something
"tangible" is very encouraging! I know this is not very incredible or
"fancy" - it's a technicality that's completely transparent to the
user. However, the benefits to FlightGear in the long term are clear,
both to users and developers.
Thanks to everyone who collaborated to make this possible, directly or
indirectly. A lot of puzzle pieces had to come together from very
talented people to make it possible. Thanks again!
Kind regards,
Fernando
|