SceneCaptureComponent GetViewState return NULL then Capture Picture PostProcessing was being disabled

SceneCaptureComponent GetViewState return NULL then Capture Picture PostProcessing was being disabled.

I changed the source codes to

FSceneViewStateInterface* USceneCaptureComponent::GetViewState()
{
	FSceneViewStateInterface* ViewStateInterface = ViewState.GetReference();
	if (ViewStateInterface == NULL)
	{
		ViewState.Allocate();
		ViewStateInterface = ViewState.GetReference();
	}
	return ViewStateInterface;
}

Then postprocessing in the newly captured picture becomes normal.
I don’t know why GetViewState should return NULL when bCaptureEveryFrame is set to false.
If theres is not a specific reason, I think it should always return a Valid ViewState. Then postprocessing in the captured picture can be turned on.

FSceneRenderer* FScene::CreateSceneRenderer( USceneCaptureComponent* SceneCaptureComponent, UTextureRenderTarget* TextureTarget, const FMatrix& ViewRotationMatrix, const FVector& ViewLocation, float FOV, float MaxViewDistance, bool bCaptureSceneColour, FPostProcessSettings* PostProcessSettings, float PostProcessBlendWeight )
{
	FIntPoint CaptureSize(TextureTarget->GetSurfaceWidth(), TextureTarget->GetSurfaceHeight());

	FTextureRenderTargetResource* Resource = TextureTarget->GameThread_GetRenderTargetResource();
	FSceneViewFamilyContext ViewFamily(FSceneViewFamily::ConstructionValues(
		Resource,
		this,
		SceneCaptureComponent->ShowFlags)
		.SetResolveScene(!bCaptureSceneColour));

	FSceneViewInitOptions ViewInitOptions;
	ViewInitOptions.SetViewRectangle(FIntRect(0, 0, CaptureSize.X, CaptureSize.Y));
	ViewInitOptions.ViewFamily = &ViewFamily;
	ViewInitOptions.ViewOrigin = ViewLocation;
	ViewInitOptions.ViewRotationMatrix = ViewRotationMatrix;
	ViewInitOptions.BackgroundColor = FLinearColor::Black;
	ViewInitOptions.OverrideFarClippingPlaneDistance = MaxViewDistance;
	ViewInitOptions.SceneViewStateInterface = SceneCaptureComponent->GetViewState();
.....................................................................................




FSceneView::FSceneView(const FSceneViewInitOptions& InitOptions)
	: Family(InitOptions.ViewFamily)
	, State(InitOptions.SceneViewStateInterface)

.................................................................................................................



.........................................................................................
	if(State)
	{
		State->OnStartPostProcessing(*this);
	}
.........................................................................................

And many PostProcessing Codes need ViewState to be valid to work.

Is there anybody here?

Hi ,

I was wondering if you might have a test case that demonstrates the Post Process issue that you are describing. Also, do you see the same results in version 4.11.2?

Hi ,

We have not heard back from you for several days. Do you still need any assistance with this issue? I will be marking this post as resolved for internal tracking purposes, but please feel free to add a comment to re-open the post if you need any further help.

i have this issue in 4.15 version :c

Hi Fredroxin,

Would you be able to provide some information about how you are setting this up?

I can confirm that the post process effects are captured in both left and right images with the aforementioned GetViewState() changes. But there are certain issues with noise and banding. This image has been captured with quality = improved setting and nothing else.

The only things that do not work are: 1] Output is still a PNG instead of JPEG, 2] extreme noise as well as degradation occurs as soon as post process is enabled, and the append code does nothing even with const bool CombineAtlasesOnOutput = true;. These problems occur even though the code has been edited and compiled as per instructions. The post process resulting in degradation has been mentioned as a comment in the code.

Banding and noise can be removed but it requires very high quality settings.

EDIT: This is in version 4.15.1

Hi Markus,

Sorry for the delayed response. Would you be able to provide some more information about the original issue that you were experiencing? I have not been able to determine what use case is not working as desired with the way the source code is written.

For the sample image that you provided, was that obtained by using the Stereo Panoramic Movie Capture plugin? I took some test screenshots using that plugin and saw the banding that you mentioned with the improved quality setting. This was without any changes to GetViewState(), so that may be a result of the plugin itself. I will have to do some more investigation there.

Could you provide the exact settings and commands (in order) that you are using to get your result?