OpenGL

From FlightGear wiki
Jump to navigation Jump to search

OpenGL (Open Graphics Library) is a graphics API used by FlightGear. It was developed by Silicon Graphics and first released in 1992.

Currently FlightGear requires OpenGL 1.2, but more likely 2.0, and recommends 2.1 or above. However, over the course of the next 12-18 months, this in the process of changing (see #Status for details).

Status

Last updated: 10/2023


We’re actively going to switch to Core profile, on next, in the coming months: at least that is James' big goal for 2023 development, personally.

Maybe not getting as far as Vulkan/VSG (it would be nice but a lot more work….) but certainly getting our use of the OSG API as modern as possible, and getting the shaders into a OpenGL 4.x variant. (Eg, if MoltenGL can host us, that would be good for macOS…)

The problem is macOS: there is no compatibility profile.[1] So, the main motivation for Core profile is macOS, where OpenGL 2 won’t help us : it needs to be Open 3.2, that’s what you get when you request a core profile.[2]

Fernando added a compile time switch for the default HUD (which still relies on legacy GL code), and made a few small modifications to allow for PUI to be disabled entirely. These modifications break font rendering currently. [3]

James would expect as a result of that, we would require OpenGL 4.1 or 4.2 on next: we could do 3.3 at a push but why bother? Apple supports 4.2 [1] and everyone else can update their drivers. Writing clean shaders will be so much easier if we can rely on 4.2 features as a baseline.

That would imply 2020.3 is the last OpenGL 2.x / non-shader release, but James also suspects on plenty of lower-spec machines, using OpenGL 4 and shaders will give us *better* FPS than our current fixed-function code. Given lower-spec machines have Intel graphics and the Intel drivers are terrible bad at fixed-function.[4]

Note  01/2023: As part of the Core profile migration, we need to replace ShivaVG (which is the functional guts of CanvasPath.cxx) with a shader based implementation

Scott has been working on preparing to make the switch to OpenGL Core Profile [5]:

Shaders

All the shaders are *330 core* compatible at the moment. Scott has been declaring *460 core*, but that will not be the final targeted version. We've discussed *420 core* as a potential soft target.[7]

Open GL 4.1 seems to be the latest supported version on macOS [8], and that means shaders targeting 410 might be the best supported version for macOS users [9]

For the time being, we should probably target 410 at most. We will have to decide if we want to remain at 330 or we want to push to 410. The changes are not too significant, the main differences seem to be that 410 supports 32 bit floating point textures and tessellation shaders.[10]

Related content

External links

References

References