Capturing a snapshot with USceneCaptureComponent2D with postprocess material

I’m using a USceneCaptureComponent2D to take snapshots at certain moments.

In the scene I’m using a PostProcess Volume which covers the whole level, and inside I’m using a blendable with a PostProcess material (to create outlines).

The problem is that when I take a snapshot the PostProcess material is ignored completely.

This is the code that creates the scene capture component:



    mSceneCaptureComponent->ProjectionType = ECameraProjectionMode::Type::Perspective;
    mSceneCaptureComponent->FOVAngle = 90.0f;
    mSceneCaptureComponent->CaptureSource = ESceneCaptureSource::SCS_FinalColorLDR;
    mSceneCaptureComponent->CompositeMode = ESceneCaptureCompositeMode::SCCM_Overwrite;
    mSceneCaptureComponent->bCaptureOnMovement = false;
    mSceneCaptureComponent->bCaptureEveryFrame = false;
    mSceneCaptureComponent->MaxViewDistanceOverride = -1.0f;
    mSceneCaptureComponent->bAutoActivate = true;
    mSceneCaptureComponent->DetailMode = EDetailMode::DM_High;


And this is how I take the snapshot at certain moments:



    mSceneCaptureComponent->CaptureSceneDeferred();


Is there anything particular I should do to have postprocessing in the snapshot? I couldn’t find any information on the internet… I only found that if I enable bCaptureEveryFrame then it works, but I can’t use it in my project.

Do you mean that you have tried setting bCaptureEveryFrame to true and the post process material then was applied?

Unrelated, have you tried



mSceneCaptureComponent->CaptureScene();


which captures the scene immediately (not deferred)?

Yes to both questions.

Actually I tried looking into the engine source code to find out where the bCaptureEveryFrame boolean is actually used, and from what I understand if it’s true it just calls CaptureSceneDeferred() at each tick of the component. But calling directly doesn’t make the postprocess work, so there must be something more going on that I don’t understand…

Have you solve this problem? I met the same issue.

Several years later… here I come for those that end up here trying to fix this issue.
I’ve solved it by enabling bAlwaysPersistRenderingState, so my scene capture initialization flags look like this:

    ViewCaptor->bCaptureEveryFrame = false;
    ViewCaptor->bCaptureOnMovement = false;
    ViewCaptor->bAlwaysPersistRenderingState = true;
1 Like