HDR Pipeline

From FlightGear wiki
Jump to navigation Jump to search
HDR Pipeline
HDR pipeline c172p over TFFF.png
Started in 04/2021
Description A modern rendering pipeline that targets relatively powerful systems
Contributor(s) Fernando García Liñán [1]
Status In development
Changelog https://sourceforge.net/u/fgarlin/profile/feed.rss

The HDR Pipeline is a Compositor-based rendering pipeline that attempts to bring modern rendering techniques to FlightGear, namely high dynamic range (HDR) This is a link to a Wikipedia article and physically based rendering (PBR) This is a link to a Wikipedia article. It is implemented entirely in $FG_ROOT using XML for the Compositor pipeline definition and Effects, and GLSL for shaders. The pipeline can be enabled with the command line argument --compositor=Compositor/HDR/hdr.


The Classic Pipeline relies on legacy OpenGL features, so rather than improving or reworking it, the idea of creating an entirely separate rendering pipeline from scratch started taking shape. The Compositor played the biggest role in enabling this effort as it allows the creation of new rendering pipelines entirely in FGData space without any C++ changes whatsoever, greatly reducing the amount of work that had to be done and making the iterative process of testing and debugging much faster.


Last updated: 04/2023

The HDR pipeline is more or less stable, and is currently available on next for anyone adventurous enough to try it. The main issue is that built-in legacy GUI (PUI) is not compatible because it uses old OpenGL code, so there is no in-sim GUI. You will need to configure everything (weather, scenery, etc.) beforehand using the launcher, command line options, or with external tools like Phi.

Keep in mind that the HDR pipeline might not work in your system until we finish moving to the OpenGL core profile. AMD graphics cards (regardless of age) and Intel integrated GPUs are known to be problematic.

Notes for aircraft developers

The HDR pipeline handles lighting in a completely different manner compared to ALS. The pipeline will attempt to "translate" classic Effects so they display correctly by making some assumptions. These assumptions are not always correct, so your aircraft might not display correctly under the HDR pipeline. In this section we describe some steps you can follow to leverage all the power of the HDR pipeline.

PBR and glTF

Physically-based rendering (PBR) refers to the concept of using realistic shading/lighting models along with measured surface values to accurately represent real-world materials. See this webpage for an extensive introduction to PBR and how you can create physically-based assets for your aircraft.

This pipeline introduces a PBR Effect (fgdata/Effects/model-pbr.eff). However, you don't need to assign this Effect manually. You can export your model from Blender to the glTF format and use it directly. The Blender exporter will take care of exporting the necessary textures and the FlightGear parser will automatically assign the PBR Effect to your model. Your model XML file would contain something like this:

<?xml version="1.0" encoding="utf-8"?>

Although not recommended, the PBR effect can be assigned as usual by adding an <effect> tag in the model XML and configuring it like you would configure model-combined.


Lights are defined using the Compositor syntax. However, since we are dealing with physically-based values, the ambient/diffuse/specular values are ignored and the color and intensity parameters are used instead. The attenuation parameter is also ignored.

It is possible to have a light definition that is compatible with both ALS and HDR by defining all parameters at the same time. This might be troublesome though because the same values might yield different results under each pipeline.

An example light definition is shown below:




Related content