// World Evils - emission on the item sprite, in your hand or on the ground.
//
// The same rules as lib/pbr/blocks/worldevils.glsl, keyed on
// currentRenderedItemId instead of the terrain material. Both files exist
// because Solas keeps the two paths apart for every other light in the game as
// well: blocks/torch_lantern.glsl and items/torch_lantern.glsl are the same
// three lines twice over.
//
// Colour-agnostic on purpose. Solas's own torch test is an ORANGE one -
// (r > 0.8 && g > 0.5 || r > 0.6 && b < 0.2) - which scores a green cursed
// flame and a cyan astral flame at exactly zero.
else if (currentRenderedItemId == 10091 || currentRenderedItemId == 10092) {
    // Shadow Orb / Crimson Heart: lit all over.
    emission = pow3(lAlbedo) * 0.30;
}
else if (currentRenderedItemId >= 10093 && currentRenderedItemId <= 10095) {
    // The three evils' torches, lanterns and campfires: the flame only. The
    // handle is dark wood and the cage is grey iron, so bright-and-saturated
    // separates them without naming a hue.
    float weMx = max(albedo.r, max(albedo.g, albedo.b));
    float weMn = min(albedo.r, min(albedo.g, albedo.b));
    float weSat = weMx > 0.001 ? (weMx - weMn) / weMx : 0.0;
    emission = float(weMx > 0.55 && weSat > 0.30) * pow2(lAlbedo) * 0.20;
}
else if (currentRenderedItemId == 10096) {
    // Astral Beacon and Astral Ore: lit all over, a shade under the orbs.
    emission = pow3(lAlbedo) * 0.24;
}
