OpenGL: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
m (status update)
m (→‎Status: https://sourceforge.net/p/flightgear/mailman/message/37881226/)
 
(29 intermediate revisions by the same user not shown)
Line 4: Line 4:


Currently FlightGear requires OpenGL 1.2, but more likely 2.0, and recommends 2.1 or above.
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 ==
== Status ==
Last updated: 11/2020
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 2021 development, personally.
<!--
{{Disclaimer|id=final-fixed-function-release}}
-->
 
We’re actively going to switch to [https://www.khronos.org/opengl/wiki/OpenGL_Context 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 Scene Graph|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…)
Maybe not getting as far as [[Vulkan Scene Graph|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.<ref>https://sourceforge.net/p/flightgear/mailman/message/37881226/</ref>
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.<ref>https://sourceforge.net/p/flightgear/mailman/message/37883795/</ref>
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. <ref>https://sourceforge.net/p/flightgear/mailman/message/39000474/</ref>


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.
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.<ref>https://sourceforge.net/p/flightgear/mailman/message/37146847/</ref>
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.<ref>https://sourceforge.net/p/flightgear/mailman/message/37146847/</ref>
{{See also|2022.X Release Plan#Rendering}}
{{Note|01/2023: As part of the [[Unifying the 2D rendering backend via canvas|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 <ref>https://sourceforge.net/p/flightgear/mailman/message/37147065/</ref>:
Scott has been working on preparing to make the switch to OpenGL Core Profile <ref>https://sourceforge.net/p/flightgear/mailman/message/37147065/</ref>:
* Compile OSG with Core - {{Done}}
* Compile OSG with Core - {{Done}}
* Disable (a.k.a hack) SG/FG [[FlightGear_and_OpenGL_ES#Affected_features_and_sources|features requiring compatibility profile]] {{Done}}
* Disable (a.k.a hack) SG/FG [[FlightGear_and_OpenGL_ES#Affected_features_and_sources|features requiring compatibility profile]] {{Done}}
** [[PUI#2022]] (new Canvas based UI expected around June 2023)
** [[FlightGear_and_OpenGL_ES#Affected_features_and_sources|HUD]]
** [[Shiva Alternatives|Canvas.Path]] (replace Shiva probably using Erik's ShaderVG work )
** [[Post_FlightGear_2020.2_LTS_changes#2D_Panels|2D Panels]]
* Review GLSL shaders to identify where changes are required - {{Done}}
* Review GLSL shaders to identify where changes are required - {{Done}}
* Refactor GLSL shaders  {{Progressbar|90}}
* Refactor GLSL shaders  {{Progressbar|90}} <ref>https://sourceforge.net/p/flightgear/mailman/message/37230099/</ref>
 
== 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.<ref>https://sourceforge.net/p/flightgear/mailman/message/37261504/</ref>
 
Open GL 4.1 seems to be the latest supported version on macOS <ref>https://support.apple.com/en-us/HT202823</ref>, and that means shaders targeting 410 might be the best supported version for macOS users <ref>https://sourceforge.net/p/flightgear/mailman/message/37261554/</ref>
 
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.<ref>https://sourceforge.net/p/flightgear/mailman/message/37262096/</ref>


== Related content ==
== Related content ==

Latest revision as of 06:22, 2 October 2023

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