Emission
Target API: 5 · Target build:
bbb6l5(2026-11-20, production and preprod) · Status: Verified (ported to the current API — on-device re-check recommended)emissionis added after the lighting calculation, but the default process attenuates it with the fog amount (fogAlpha). In fully fogged distance, emission disappears too. To keep glowing at distance, don’t add to emission — add directly asout.colour += ...inside the light hook (the default output is already fogged, so light lands on top of the fog color at distance)
Pulsing lamps (breathing torches)
fn bloxdTerrainLight(s: BloxdSurface, l: BloxdLightIn) -> BloxdLight {
var out = bloxdDefaultLight(s, l);
if (bloxdLit()) {
let glow = max(l.blockLight.r, max(l.blockLight.g, l.blockLight.b));
let pulse = 0.5 + 0.5 * sin(bloxdSeconds() * 2.3 + l.position.x * 0.8);
out.colour += vec3f(1.0, 0.62, 0.25) * glow * 0.25 * (0.6 + 0.4 * pulse);
}
return out;
}Glowing-ore look (bright materials emit)
// surface side: the brighter (whiter) the material, the more emission
fn bloxdTerrainSurface(s: BloxdSurfaceIn) -> BloxdSurface {
var out = bloxdDefaultSurface(s);
let luma = dot(out.colour, vec3f(0.299, 0.587, 0.114));
let shine = smoothstep(0.75, 0.9, luma);
out.emission += out.colour * shine * 0.5;
return out;
}Firefly-swarm look (drifting light points over time)
fn bloxdTerrainLight(s: BloxdSurface, l: BloxdLightIn) -> BloxdLight {
var out = bloxdDefaultLight(s, l);
let world = bloxdWorldPosition(l.position);
// a few "light orbs" drifting slowly; glow by inverse distance
let t = bloxdSeconds() * 0.15;
let p1 = vec3f(sin(t) * 40.0, 20.0 + sin(t * 1.3) * 6.0, cos(t * 0.7) * 40.0);
let d1 = distance(world, p1);
let firefly = clamp(1.0 - d1 / 6.0, 0.0, 1.0);
let flicker = 0.6 + 0.4 * sin(bloxdSeconds() * 9.0 + d1);
out.colour += vec3f(0.9, 1.0, 0.4) * firefly * firefly * flicker * 0.6;
return out;
}