Attention: Here be dragons
This is the latest
(unstable) version of this documentation, which may document features
not available in or compatible with released stable versions of Godot.
Checking the stable version of the documentation...
Illuminazione ad alta gamma dinamica
Introduzione
Di solito, un artista si occupa di tutta la modellazione 3D, poi di tutte le texture, guarda il suo fantastico modello nel software di modellazione 3D e dice "sembra fantastico, pronto per l'integrazione!", quindi passa al gioco, illuminazione preparata e il gioco è avviato.
Quindi, a che punto entra in gioco tutta questa storia dell'"HDR"? Per capire la risposta, dobbiamo esaminare come si comportano gli schermi.
Your display outputs linear light ratios from some maximum to some minimum intensity. Modern game engines perform complex math on linear light values in their respective scenes. So what's the problem?
The display has a limited range of intensity, depending on the display type. The game engine renders to an unlimited range of intensity values, however. While "maximum intensity" means something to an sRGB display, it has no bearing in the game engine; there is only a potentially infinitely wide range of intensity values generated per frame of rendering.
This means that some transformation of the scene light intensity, also known as scene-referred light ratios, need to be transformed and mapped to fit within the particular output range of the chosen display. This can be most easily understood if we consider virtually photographing our game engine scene through a virtual camera. Here, our virtual camera would apply a particular camera rendering transform to the scene data, and the output would be ready for display on a particular display type.
Nota
Godot supports high dynamic range output. You can read more about this on the HDR output page.
For advanced users, it possible to get a non-tonemapped image of the viewport with full HDR data, which can then be saved to an OpenEXR file.
Display dei computer
Quasi tutti i display richiedono una codifica non lineare per i valori di codice inviati. Il display, a sua volta, attraverso la sua caratteristica unica di trasferimento, "decodifica" il valore di codice in rapporti lineari di luce in uscita e proietta tali rapporti dalle luci di colore univoco in ciascun sito di emissione rossastro, verdastro e bluastro.
Per la maggiorità dei display per computer, le specifiche sono definite in conformità alla norma IEC 61966-2-1, nota anche come specifica sRGB del 1996. Questa specifica definisce il comportamento di un display sRGB, inclusi il colore delle luci nei pixel LED e le caratteristiche di trasferimento dell'ingresso (OETF) e dell'uscita (EOTF).
Not all displays use the same OETF and EOTF as a computer display. For example, television broadcast displays use the BT.1886 EOTF. However, Godot only supports sRGB and HDR displays.
Lo standard sRGB si basa sulla relazione non lineare tra la corrente e l'emissione luminosa dei display CRT comuni dei computer desktop.
The mathematics of a scene-referred model require that we multiply the scene by different values to adjust the intensities and exposure to different light ranges. The transfer function of the display can't appropriately render the wider dynamic range of the game engine's scene output using the simple transfer function of the display. A more complex approach to encoding is required.
Scene linear & asset pipelines
Lavorare in sRGB lineare è più complesso che premere un singolo interruttore. Innanzitutto, è necessario convertire le risorse immagine in rapporti di luce lineari al momento della loro importazione. Anche se linearizzate, tali risorse potrebbero non essere perfettamente adatte all'uso come texture, a seconda di come sono state generate.
Ci sono due modi per farlo:
Funzione di trasferimento sRGB per visualizzare i rapporti lineari nell'importazione delle immagini
This is the easiest method of using sRGB assets, but it's not the most ideal. One issue with this is loss of quality. Using 8 bits per channel to represent linear light ratios is not sufficient to quantize the values correctly. These textures may also be compressed later, which can exacerbate the problem.
Hardware sRGB transfer function to display linear conversion
The GPU will do the conversion after reading the texel using floating-point. This works fine on PC and consoles, but most mobile devices don't support it, or they don't support it on compressed texture formats (iOS for example).
Scene linear to display-referred nonlinear
After all the rendering is done, the scene linear render requires transforming to a suitable output such as an sRGB display. To do this, enable sRGB conversion in the current Environment (more on that below).
Keep in mind that the sRGB -> Display Linear and Display Linear -> sRGB conversions must always be both enabled. Failing to enable one of them will result in horrible visuals suitable only for avant-garde experimental indie games.
Parameters of HDR
HDR settings can be found in the Environment resource. Most of the time, these are found inside a WorldEnvironment node or set in a Camera node. For more information, see Environment and post-processing.