Skip to content

Commit

Permalink
Control SceneDebugEdges.Exists, avoid costly UpdateEdges every frame
Browse files Browse the repository at this point in the history
  • Loading branch information
michaliskambi committed Jan 21, 2018
1 parent d13e3e1 commit f04ab54
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/view3dscene.lpr
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down Expand Up @@ -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 }
Expand Down

0 comments on commit f04ab54

Please sign in to comment.