private void Render()
        {
            // hackfix because OnTargetEntityChanged is only called when the actual entity changed.
            SetTarget();

            var cam = MyCameraComponent.ActiveCamera;

            if (Graph == null || cam == null)
            {
                return;
            }

            {
                // draw node markers
                var proj = cam.GetProjectionSetup();
                proj.FarPlane = 100;
                var frust = new BoundingFrustumD(cam.GetViewMatrix() * proj.ProjectionMatrix);
                Graph.Nodes.OverlapAllFrustum(ref frust, (Node node, bool intersects) =>
                {
                    var color = _nodeColor;
                    var p1    = node.Position;
                    var p2    = node.Position + _nodeMarkerSize * node.Up;
                    MySimpleObjectDraw.DrawLine(p1, p2, _squareMaterial, ref color, _nodeWidth);
                });
            }

            {
                foreach (var k in _vertices)
                {
                    if (Vector3D.DistanceSquared(cam.GetPosition(), k.Position) < 100 * 100)
                    {
                        var color = _nodeColor;
                        var p1    = k.Position;
                        var p2    = k.Position + _nodeMarkerSize * k.Up;
                        MySimpleObjectDraw.DrawLine(p1, p2, _squareMaterial, ref color, _nodeWidth);
                    }
                }
            }

            if (Holder == null)
            {
                return;
            }

            {
                using (new TemporaryVertex(this))
                {
                    for (var i = 1; i < _vertices.Count; i++)
                    {
                        var nextVert    = _vertices[i];
                        var currentVert = _vertices[i - 1];

                        var nextMatrix    = ComputeVertexMatrix(nextVert, i);
                        var currentMatrix = ComputeVertexMatrix(currentVert, i - 1);

                        var color = PlacedDefinition == null || EdgePlacerSystem.VerifyEdge(PlacedDefinition, currentVert, nextVert, null)
                            ? _edgeColor
                            : _edgeColorBad;
                        const float vertShift = .1f;
                        if (Vector3D.DistanceSquared(currentMatrix.Translation, nextMatrix.Translation) > 30 * 30)
                        {
                            var curve = PrepareSphericalBez(currentMatrix, nextMatrix);
                            curve.Draw(color, upZero: currentVert.Up * vertShift, upOne: nextVert.Up * vertShift);
                        }
                        else
                        {
                            if (Math.Min(Vector3D.DistanceSquared(cam.GetPosition(), nextVert.Position),
                                         Vector3D.DistanceSquared(cam.GetPosition(), currentVert.Position)) > 100 * 100)
                            {
                                continue;
                            }
                            var curve = PrepareNormalBez(currentMatrix, nextMatrix);
                            curve.Draw(color, upZero: currentVert.Up * vertShift, upOne: nextVert.Up * vertShift);
                        }
                    }
                }
            }
        }