Drawing to view at runtime with PDI (FPrimitiveDrawInterface)

So last night I finally got around to trying this out and it worked, however it was not exactly what I wanted: The elements I drew to screen were frustum culled; the moment the origin of the object the FPrimitiveSceneProxy was attached to went out of view the PDI would disappear. The elements drawn also seemed to clip through 3D geometry, my assumption is that I have to set up a material that disables depth testing? Code below:



class FEditorGizmoProxy : public FPrimitiveSceneProxy
{

public:

	FEditorGizmoProxy(UEditorGizmoDrawer* Component)
		: FPrimitiveSceneProxy(Cast<UPrimitiveComponent>(Component))
	{}

	virtual FPrimitiveViewRelevance GetViewRelevance(const FSceneView* View) const override
	{
		FPrimitiveViewRelevance Result;
		Result.bDrawRelevance = IsShown(View);
		Result.bShadowRelevance = IsShadowCast(View);
		Result.bDynamicRelevance = true;

		return Result;
	}


	virtual uint32 GetMemoryFootprint(void) const override
	{
		return(sizeof(*this) + GetAllocatedSize());
	}

	virtual bool CanBeOccluded() const override
	{
		return false;
	}

	virtual void GetDynamicMeshElements(const TArray<const FSceneView *>& Views, const FSceneViewFamily& ViewFamily, uint32 VisibilityMap, class FMeshElementCollector& Collector) const override
	{
		for(int32 ViewIndex = 0; ViewIndex < Views.Num(); ViewIndex++)
		{
			FPrimitiveDrawInterface* PDI = Collector.GetPDI(ViewIndex);

			auto Box = FBox{ GetActorPosition() - FVector(1.f, 1.f, 1.f) * 50.f, GetActorPosition() + FVector(1.f, 1.f, 1.f) * 50.f };
			auto Color = FLinearColor::Blue;
			DrawWireBox(PDI, Box, Color, SDPG_World, 2.f, 0.f, false);
			PDI->DrawLine(FVector(0.f, 0.f, 0.f), FVector(50.f, 0.f, 0.f), FColor::Orange, SDPG_World, 2.f, 0, false);
		}
	}

	virtual void DrawDynamicElements(FPrimitiveDrawInterface* PDI, const FSceneView* View)
	{
		
	}

};


I’m getting increasingly frustrated with this, surely someone’s done this successfully before?

I wish to render a simple gizmo to the screen during runtime, in the packaged game.