heatSignatures.package
- ..
- .metadata117 B
- README.md1.7 KB
- module.wgsl7.1 KB
README.md
heatField (shader module)
The WGSL piece a thermal style block includes to know the temperature of what each pixel shows. hk_temp(uv) answers in degrees Celsius: the climate's surface temperature (ground or air by facing, warmed where the sun reaches, cooled under an open night sky, leaves near the air, glowing pixels hot) with each heat source heatSignatures knows (drawn into the heat buffer on the GPU by HeatPass, exact outline and occlusion) taking over where it is the surface seen, and the remaining soft shapes (warm prints, radiant warmth, sources with no mesh) laid over that. hk_norm(t, lo, hi) maps it to 0..1 and hk_climate() reads the climate's values.
Used by sensorBlocks' thermal, night vision and spectral shaders; any block of your own can use it.
// block.yaml: reads: [frame, depth, normal, albedo, "input:heat", "input:heatObj"]
// properties.yaml: - { name: in_heat, type: texture, default: black }
// - { name: in_heatObj, type: texture, default: black } (the heat buffer: every heat source drawn on the GPU)
#include "~styleKit.shaders.skCommon"
#include "~heatSignatures.shaders.heatField"
let t = hk_temp(uv); // degrees C
let c = hk_climate();
let v = hk_norm(t, c.low, c.high); // 0..1 across the climate's range
Include it after styleKit's skCommon. With nothing published (a 4 x 4 black dummy) it falls back to a plain temperate night, so a block still draws something sensible.
Known limits
- Transparent surfaces are not in the depth, so it answers with the heat of what is behind them.
- Reflectance and foliage are guessed from base colour, not from real material data.