From f04ab549401881e8c06f962072e3a0b130499fb4 Mon Sep 17 00:00:00 2001 From: Michalis Kamburelis Date: Sun, 21 Jan 2018 07:20:27 +0100 Subject: [PATCH] Control SceneDebugEdges.Exists, avoid costly UpdateEdges every frame --- code/view3dscene.lpr | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/view3dscene.lpr b/code/view3dscene.lpr index 9fdb01b8..90aa171e 100644 --- a/code/view3dscene.lpr +++ b/code/view3dscene.lpr @@ -737,7 +737,7 @@ procedure TV3DSceneManager.RenderFromView3D(const Params: TRenderParams); { do not render GetMainScene if SceneDebugEdges is to be visible } GetMainScene.Visible := FillMode <> fmSilhouetteBorderEdges; - SceneDebugEdges.Visible := FillMode = fmSilhouetteBorderEdges; + SceneDebugEdges.Exists := FillMode = fmSilhouetteBorderEdges; if SceneDebugEdges.Exists then SceneDebugEdges.UpdateEdges(Scene); @@ -780,7 +780,7 @@ procedure TV3DViewport.RenderFromView3D(const Params: TRenderParams); if GetMainScene = nil then Exit; GetMainScene.Visible := FillMode <> fmSilhouetteBorderEdges; - SceneDebugEdges.Visible := FillMode = fmSilhouetteBorderEdges; + SceneDebugEdges.Exists := FillMode = fmSilhouetteBorderEdges; inherited; { inherited will call Render3D that will call RenderVisualizations }