GTG Thermal Framework
Thermal imaging and night vision for any optic Changed
Thermal imaging that follows the time of day, four palettes, ten temperature windows tuned for soldiers and vehicles, night vision with an infrared gate – as one component you put on your own optic. These pages explain what is in the framework, how to build it into a sight, a camera or a screen, and what the numbers mean. Start with Add it to your optic.
What the framework is
The GTG Thermal Framework is a Workshop addon without weapons, items or vehicles. It is the thermal and night-vision half of the SOFLAM Integration Core, moved into an addon of its own on 2026-11-07, so that other optics can use it as well. It depends on the base game and on nothing else; it compiles and loads alone.
The class names still start with GTG_SOFLAM_. That is on purpose: prefabs and configs that were written against the Core keep working.
The examples on these pages are excerpts of the real code, shortened and commented. Classes that belong to your mod start with MyOptic_.
What is in itChanged
| Piece | What it does |
|---|---|
Assets/Thermal | 40 thermal materials (four palettes, ten temperature windows each) and the colour ramps they use. The heat simulation takes its air, sky and sun values from the world. |
GTG_ThermalClimate, GTG_ThermalClimateConfig | The climate of the world: air temperature from a file on the server, sun and sky set to match, and two sliders for the Game Master. See Climate per server. |
GTG_SOFLAM_VisionModeComponent and the enum GTG_SOFLAM_EVisionMode | The component you add to an optic: modes (normal / night vision / thermal), palette, temperature window, gain, keys. |
GTG_SOFLAM_VisionShared | One shared vision state per player: mode, palette, gain, zoom, and the temperature window of each display. |
GTG_SOFLAM_NVState | “Can this viewer see infrared light?” – decided on each player’s own machine. |
GTG_SOFLAM_ScreenEffects (modded class SCR_ScreenEffectsManager) | Writes and clears the night-vision effects on a camera, on the player camera or on a camera of your own. |
Rules that held upChanged
| Rule | Why |
|---|---|
| The picture is local, the climate is not | Post-process effects and input exist only on a client, and the picture is computed on each player’s machine. The one thing the server does is set the climate of the world at start; the game sends it to every player. |
| The scale is calibrated to skin | The numbers on the scale are shifted by a fixed offset so that a person reads about 37 degrees. The pictures and the materials stay as they are. See Palettes and windows. |
| The window controls the contrast | Each temperature window shows one slice of the range. The thing you look for gets the whole contrast, instead of one grey among many. |
| Give back what you set | Whatever is written to a camera outside a single frame is cleared again on the same camera when the mode is left. See Night vision and the infrared gate. |
| One mod owns the input configuration | Only one addon can override the game’s input configuration. The framework therefore ships no key bindings. See Keys and hooks. |
The pages
Add it to your optic
Dependency, component on the prefab, the two calls from your sight, and the keys – a complete example.
Keys and hooks
Action names, why the framework ships no bindings, how to list your keys in the key menu so that players can rebind them, and the empty hook for the laser keys.
Several displays, one state
A sight, a screen and a camera at the same time: the shared state, a camera of your own and readouts for your HUD.
Palettes and windows
Four palettes, ten windows, the skin offset and the materials behind them.
Fire and explosions
Why fire was nearly invisible in thermal, the three material lines that make a particle hot, and the 45 game materials the framework replaces.
Heat that follows the clock
The simulation settings, the infantry window that picks itself, and what was measured.
Climate per server
The air temperature file on the server, the Game Master sliders, and how a mission sets its own climate.
Night vision and the infrared gate
The vanilla night-vision materials, the infrared gate and the brightness you must give back.
Limits and pitfalls
What the engine cannot do, and the mistakes that cost the most time.