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();
    }
Beispiel #2
0
void ParabolaPointer::RenderState::ParabolaRenderItem::updateKey() {
    auto builder = _parabolaData.color.a < 1.0f ? render::ItemKey::Builder::transparentShape() : render::ItemKey::Builder::opaqueShape();

    // TODO: parabolas should cast shadows, but they're so thin that the cascaded shadow maps make them look pretty bad
    //builder.withShadowCaster();

    if (_enabled && _visible) {
        builder.withVisible();
    } else {
        builder.withInvisible();
    }

    if (_isVisibleInSecondaryCamera) {
        builder.withTagBits(render::hifi::TAG_ALL_VIEWS);
    } else {
        builder.withTagBits(render::hifi::TAG_MAIN_VIEW);
    }

    if (_drawInFront) {
        builder.withLayer(render::hifi::LAYER_3D_FRONT);
    }

    _key = builder.build();
}