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: 06/2021


Note  FlightGear is currently undergoing a lot of huge changes. More importantly: Adopting OSG 3.6+[1], moving to the OpenGL core profile, WS 3.0, Osm2city buildings, Photoscenery and Compositor shadows & lights.

In addition, adopting OSG 3.6 means that the experimental CompositeViewer Support can be more widely enabled and tested[2] (it is already enabled by default on next).

Also, as part of the CompositeViewer effort, Canvas FBO rendering is in the process of being moved out of the scene graph into dedicated viewer-level cameras, which provides better support/integration with OSG threading and fixes the long-standing issue where Canvas textures were being rendered twice per view unnecessarily due to the original new/far camera scheme.

It is likely the non-shader code path (fixed-function pipeline) will also go away in the next twelve months (~ early/mid 2022). We tried to communicate this: 2020.3 is the last release that will work on really old hardware: 'next' and future releases will need a more modern machine with an OpenGL 4 / DX12 class GPU.[3] 'next' is work-in-progress: likely 12 or 18 months before it becomes a release. In that time the build dependencies, minimum system requirements, performance baseline and basically everything else are going to change (and keep changing). Of course, we'll try to make it work on as wide a range of hardware as possible, but right now we don't know, and it would be incorrect to speculate or promise anything. (Eg, we cannot say 'an Intel 4000 will work but an Intel 3000 won't - we have no idea!)

If 'next' works for someone, that is great, but if you want stability, stable FPS and compatibility with older hardware, there is an easy answer: use 2020.3. That's what we recommend for everyone who wants to fly and enjoy flying. [4] The macOS and Windows nightly builds are now running OSG 3.6.5, so people can hopefully start testing WS3.0 [5] Also, be aware that the binary builds also switched to OSG 3.6, so that may have an FPS impact as well (either higher or lower…)[6]

We’re actively going to switch to Core profile, on next, in the coming months: at least that is James' big goal for 2021 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…)

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.[7]

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

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.[10]

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

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.[13]

Related content

External links

References

References