Debuggin Trace with Scene Capture causes massive performance loss

I’m not sure if this is a bug or just a result of how the engine handles drawing debug lines, but if you use the debugging feature for a box trace, and the object with the box trace is visible in a Scene Capture, performance tanks dramatically and in a non-traceable way. Performance drops from 80 to 24 fps over a few seconds if you select the ‘Persistent’ debug option, and running ProfileGPU doesn’t show the cause.

Settings to reproduce:

  • Scene Capture: Set to capture Final
    Color to a 2048x950 target. The
    target is then used in a material and
    drawn in UMG.
  • Box Trace: Trace
    complex for Static, Dynamic, and
    Physics Bodies. Debug Persistent. Called on tick.

This isn’t a huge issue as it only affects debugging a very unique situation, but I thought I might as post it here just in case it might affect other things as well! :slight_smile:

Hello TheKing530,

So what you are doing is going to be pretty performance heavy as you are essentially drawing debug lines twice called on every frame (i.e tick) for a Render Target of that resolution. Keep in mind, power of two textures allow for mip mapping which reduces the texture resolution based on distance to the player, or controlled via the texture settings.

I would expect the performance issues you are getting, especially if you are drawing these lines through blueprints which is going to be slower than if you were to debug in code. I would add a system of checks in a way that you don’t need to run a trace for Static, Dynamic, and Physics Bodies. It has to run through each frame and check to see if those exists and identify which one is being traced. This is more than likely where your performance is dropping when combined with event tick.

Thanks,

Andrew Hurley