template <> const ItemKey payloadGetKey(const Overlay::Pointer& overlay) { auto builder = ItemKey::Builder().withTypeShape(); if (overlay->is3D()) { if (std::static_pointer_cast<Base3DOverlay>(overlay)->getDrawInFront()) { builder.withLayered(); } if (overlay->getAlphaPulse() != 0.0f || overlay->getAlpha() != 1.0f) { builder.withTransparent(); } } else { builder.withViewSpace(); } return builder.build(); }
template <> const ItemKey payloadGetKey(const Overlay::Pointer& overlay) { auto builder = ItemKey::Builder().withTypeShape(); if (overlay->is3D()) { auto overlay3D = std::static_pointer_cast<Base3DOverlay>(overlay); if (overlay3D->getDrawInFront() || overlay3D->getDrawHUDLayer()) { builder.withLayered(); } if (overlay->isTransparent()) { builder.withTransparent(); } } else { builder.withViewSpace(); } if (!overlay->getVisible()) { builder.withInvisible(); } builder.withTagBits(render::ItemKey::TAG_BITS_0); // Only draw overlays in main view return builder.build(); }