I have a few scene capture components in my scene, and it seems that at random points in time they will cause a crash in the render thread. Sometimes it happens within seconds, sometimes within minutes. I’m really not sure how to proceed or debug this, any tips appreciated. I’m using forward shading. When I don’t call CaptureScene(), the error does not occur.
Video of the crash with stable 60fps:
edit: Ive reduced amount of scene captures to only 6, and it still crashed with 100+ fps.
edit2: Reduced to only 3, 180fps, still crashes.
From the stack it seems indeed like the Scene Capture Component is triggering this crash. It looks like an engine bug to me. Can you create a very minimal repro project, or write repro steps from a fresh project, that reproduces this crash? That would help immensely with getting fixed, you can then submit that as a bug report here.
to reproduce its enough to have a ScreenCaptureComponent2D which calls CaptureScene on each tick and captures into a render target.
Here is a github link to a simple third person template that has 20 scene capture components doing so:
To setup manually:
Create a render target.
Create an actor blueprint and add a SceneCaptureComponent2D.
Assign the SceneCaptureComponent2D’s texture target to the render target from step 1.
Disable Capture Every Frame and Capture On Movement.
In event graph call CaptureScene() in tick.
Now put a few of these actors around your scene and play. For me, a number of around 20 ends up crashing within seconds to minutes. I’ve had it crash with only 3 as well, but it took a long while to get there.
It seems that some of the most recent commits in the 5.4 branch have fixed the issue! After 3 runs, each for about 20-30 minutes, not a single crash has yet occurred. Unfortunately the fps has suffered a tiny bit in addition to scene captures being x3-x4 slower compared to ue4 in general.