GTG Thermal Framework
Palettes and temperature windows Changed
Forty materials: four palettes times ten windows. The window is the real tool – it decides which slice of the range gets the whole contrast.
Palettes
| Index | Palette | Look | Name in code |
|---|---|---|---|
| 0 | White Hot | Greyscale. Hot things are white. | WHITE HOT |
| 1 | Black Hot | Greyscale, inverted. Hot things are black. | BLACK HOT |
| 2 | Ironbow | Colour scale. Cold in dark tones, hot in orange to yellow and white. | IRONBOW |
| 3 | Rainbow | Colour scale from cold to hot. | RAINBOW |
The palette is the look. The material is chosen from palette and window together: index = palette * 10 + window, in a list of 40 entries, palette-major. That is why a window change keeps the palette and a palette change keeps the window.
The ten windows
A window shows a slice of the temperature range: below the lower limit it is dark, above the upper limit it is the hottest colour, and the whole contrast sits in between. The engine values in the second column are what the materials contain; the scale shown to the player is shifted by +7 (next section).
| Window | Engine range | Shown as | Tag | Use |
|---|---|---|---|---|
| 0 | 0 – 60 | 7 – 67 | WIDE | Overview, everything at once |
| 1 | 0 – 30 | 7 – 37 | Cold scenes | |
| 2 | 10 – 40 | 17 – 47 | INF | Infantry on cold ground: night and morning |
| 3 | 20 – 50 | 27 – 57 | INF | Infantry on warm ground: afternoon |
| 4 | 30 – 60 | 37 – 67 | ||
| 5 | 40 – 60 | 47 – 67 | Hot things | |
| 6 | 40 – 70 | 47 – 77 | VEH | Vehicles: hood, engine bay, exhaust |
| 7 | 50 – 80 | 57 – 87 | Hot spots | |
| 8 | 60 – 90 | 67 – 97 | Hot spots | |
| 9 | 70 – 100 | 77 – 107 | Fires, exhausts |
The tables live at one place in the component, three arrays indexed by window. The tag INF is not a fixed entry: it sits on window 2 or 3 depending on the time of day, see Heat that follows the clock.
protected static const int GTG_THERMAL_LEVELS = 10;
protected static const int GTG_THERMAL_PALETTES = 4;
// engine degrees Celsius; the player sees these +7
protected static ref array<int> s_aThermalWindowMin = {0, 0, 10, 20, 30, 40, 40, 50, 60, 70};
protected static ref array<int> s_aThermalWindowMax = {60, 30, 40, 50, 60, 60, 70, 80, 90, 100};
protected static ref array<string> s_aThermalWindowTag = {"WIDE", "", "", "", "", "", "VEH", "", "", ""};
The scale reads true to skin
In the material data of the engine, human skin has 30 degrees. A scale that shows 30 degrees for a person reads wrong. So the labels are shifted by one constant, GTG_THERMAL_LABEL_OFFSET = 7:
skin 30 becomes 37. The picture, the colours and the materials are untouched; only the numbers on the scale are calibrated. There is exactly one place to change it.
protected static const int GTG_THERMAL_LABEL_OFFSET = 7;
int GetThermalWindowMin()
{
return s_aThermalWindowMin[Math.Clamp(m_iThermalLevel, 0, GTG_THERMAL_LEVELS - 1)] + GTG_THERMAL_LABEL_OFFSET;
}
The materialsChanged
The files are in Assets/Thermal and are named after palette and window:
| Palette | Wide material | Window materials |
|---|---|---|
| White Hot | GTG_ThermalFilter_WhiteAsHot.emat | GTG_ThermalFilter_WhiteAsHot_<min>_<max>.emat, for example _10_40 |
| Black Hot | GTG_ThermalFilter_BlackAsHot.emat | GTG_ThermalFilter_BlackAsHot_<min>_<max>.emat |
| Ironbow | GTG_ThermalFilter_Ironbow_Wide.emat | GTG_ThermalFilter_Ironbow_<min>_<max>.emat |
| Rainbow | GTG_ThermalFilter_Rainbow_Wide.emat | GTG_ThermalFilter_Rainbow_<min>_<max>.emat |
Each one is a ThermalImagingEffect material. The three lines that give a window its character:
ThermalImagingEffect {
TempConversionTex "{6A48B5D00000020F}Assets/Thermal/GTG_ThermalRamp_WhiteHotInfGrey.edds"
TemperatureRangeMin -40
TemperatureRangeMax 160
TemperatureDisplayMin 10
TemperatureDisplayMax 40
TemperatureChangeSpeed 0.1
GhostingAmount 0.6
FogRelStart 1
FogRelEnd 1
SkyHeightStart 10000
SkyHeightEnd 10000
SkyVirtualDistance 100000
// ... simulation values: see "Heat that follows the clock"
}
| Line | Effect |
|---|---|
TempConversionTex | The colour ramp: a 256 × 4 texture, left = cold end of the window, right = hot end. White Hot and Black Hot use grey ramps, Ironbow and Rainbow colour ramps. |
TemperatureDisplayMin / Max | The window. Below Min dark, above Max the hottest colour. |
TemperatureRangeMin / Max | A fixed range for the contrast calculation. A fixed range does not flicker; the automatic ones did. |
GhostingAmount | Smooths the noise of the clouds. |
On the window used for infantry (window 2) the ramp is not linear: ground, trees and sky stay dark, and only the top of the range rises to white or to the hot colours. That is what makes soldiers stand out there.
Fog and sky: keep the distance clearNew
The thermal effect can blend distant pixels into the temperature of the sky, as a kind of thermal haze. Two groups of lines control it: FogRelStart / FogRelEnd (where the haze starts and ends, relative to the view distance)
and SkyHeightStart / SkyHeightEnd (from which height the sky takes over). Up to version 1.2.0 the materials had FogRelStart 0, SkyHeightStart 0 and SkyHeightEnd 500.
With those, the haze began right at the camera, and everything far away took the temperature of the sky: about 27 degrees below the coldest air, so for example −19 with a night air of 8 degrees. That is far below the coldest window.
On a large map such as Everon, ground, houses and vehicles a few hundred metres away all turned the same dark colour and could no longer be told apart.
| Line | Since 1.2.1 | Effect |
|---|---|---|
FogRelStart / FogRelEnd | 1 / 1 | The haze starts only at the very end of the view distance, so in practice never. |
SkyHeightStart / SkyHeightEnd | 10000 / 10000 | The sky only takes over 10 km up. |
SkyVirtualDistance | 100000 | The sky counts as very far away. |
Your own materials
If the built-in set does not fit, give the component your own list. The attribute m_aThermalFilters then replaces the whole ladder, one entry per step of Shift + wheel:
GTG_SOFLAM_VisionModeComponent "{<unique id>}" {
m_aThermalFilters {
"{<GUID>}MyOptic/Assets/Thermal/MyOptic_Thermal_Cold.emat"
"{<GUID>}MyOptic/Assets/Thermal/MyOptic_Thermal_Hot.emat"
}
}
HasThermalInfo() returns false, because a list of unknown materials has neither labels nor a colour bar to show. And a material whose picture file changed may not import again under the same name: give a changed ramp a new name and a new GUID.