← Home SEEBIE90 DOCS
Download PDF
The GTG Thermal Framework mod is published under the Arma Public License (APL)Example code is free to useSuggestions: Discord to the author

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.

In plain wordsFour palettes with ten temperature windows each. A window shows one slice of the temperature range, so what you look for gets the full contrast. The numbers on the scale read true to skin.

Palettes

IndexPaletteLookName in code
0White HotGreyscale. Hot things are white.WHITE HOT
1Black HotGreyscale, inverted. Hot things are black.BLACK HOT
2IronbowColour scale. Cold in dark tones, hot in orange to yellow and white.IRONBOW
3RainbowColour 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).

WindowEngine rangeShown asTagUse
00 – 607 – 67WIDEOverview, everything at once
10 – 307 – 37Cold scenes
210 – 4017 – 47INFInfantry on cold ground: night and morning
320 – 5027 – 57INFInfantry on warm ground: afternoon
430 – 6037 – 67
540 – 6047 – 67Hot things
640 – 7047 – 77VEHVehicles: hood, engine bay, exhaust
750 – 8057 – 87Hot spots
860 – 9067 – 97Hot spots
970 – 10077 – 107Fires, 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.

Example code – free to useGTG_SOFLAM_VisionModeComponent.c (excerpt)
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.

Example code – free to useGTG_SOFLAM_VisionModeComponent.c (excerpt)
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;
}
Numbers, not physicsThe engine’s temperatures are not absolute. The same material shows ground at 20 degrees at night and above 60 at noon in clear weather, depending on the heat simulation. The labels are calibrated for skin and for what was measured, not for physical truth. State that in your own documentation if you show the numbers to players.

The materialsChanged

The files are in Assets/Thermal and are named after palette and window:

PaletteWide materialWindow materials
White HotGTG_ThermalFilter_WhiteAsHot.ematGTG_ThermalFilter_WhiteAsHot_<min>_<max>.emat, for example _10_40
Black HotGTG_ThermalFilter_BlackAsHot.ematGTG_ThermalFilter_BlackAsHot_<min>_<max>.emat
IronbowGTG_ThermalFilter_Ironbow_Wide.ematGTG_ThermalFilter_Ironbow_<min>_<max>.emat
RainbowGTG_ThermalFilter_Rainbow_Wide.ematGTG_ThermalFilter_Rainbow_<min>_<max>.emat

Each one is a ThermalImagingEffect material. The three lines that give a window its character:

Example code – free to useGTG_ThermalFilter_WhiteAsHot_10_40.emat (excerpt)
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"
}
LineEffect
TempConversionTexThe 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 / MaxThe window. Below Min dark, above Max the hottest colour.
TemperatureRangeMin / MaxA fixed range for the contrast calculation. A fixed range does not flicker; the automatic ones did.
GhostingAmountSmooths 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.

LineSince 1.2.1Effect
FogRelStart / FogRelEnd1 / 1The haze starts only at the very end of the view distance, so in practice never.
SkyHeightStart / SkyHeightEnd10000 / 10000The sky only takes over 10 km up.
SkyVirtualDistance100000The sky counts as very far away.
Test at distanceIf you make thermal materials of your own, copy these five lines. With a fog or sky start of 0, everything beyond a few hundred metres washes out, and on a small test map you will not notice it.

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:

Example code – free to useMyOptic.et (own materials)
GTG_SOFLAM_VisionModeComponent "{<unique id>}" {
 m_aThermalFilters {
  "{<GUID>}MyOptic/Assets/Thermal/MyOptic_Thermal_Cold.emat"
  "{<GUID>}MyOptic/Assets/Thermal/MyOptic_Thermal_Hot.emat"
 }
}
What you loseWith your own list there are no windows and no ramp: 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.
Example code on this page is free to use in your own projects (credit appreciated). The GTG Thermal Framework mod is published under the Arma Public License (APL). Suggestions: Discord. Arma Reforger / Enfusion are trademarks of Bohemia Interactive.
Impressum · Privacy Policy