Log inGet started
Package

heatSignatures.package

README.md

HeatPass (module)

Per-object heat on the GPU, for thermal looks. While a block reads the heatObj input, HeatPass draws every heat source heatSignatures knows (name rules, HeatSource components, Heat.give, player bodies) into a screen image, the heat buffer. It uses geometry passes, one per temperature band and kind of surface, and writes only where the surface is the one the camera actually sees. The thermal blocks read the buffer through hk_temp in the heatField shader module, so a hot object reads hot with its exact outline, and nothing behind a wall shows through.

heatSignatures's render feature calls HeatPass.frame(ctx) every frame; a game never needs to. Which source goes in which pass is regrouped four times a second, and whenever the set of sources changes. The scripts never read positions to draw heat, which is what keeps a thermal look cheap with hundreds of warm and cold things in the scene.

local HeatPass = require("~heatSignatures.HeatPass")
print(HeatPass.status().passes) -- passes drawn this frame

Known limits

  • One temperature per object: a running engine's top and its base read alike.
  • Temperatures are quantised into bands (1.5 deg C below 60 deg C, 8% above). A thermal palette does not show the steps.
  • More than 32 bands in view merge neighbouring bands two at a time.
  • A heat source with no mesh (an invisible heat volume from Heat.give with size) is drawn as a soft shape by HeatField instead, as before.