[bug] Blendable postprocess materials don't work with SceneCapture2D

Branch:Binary Build

Build version: 4.0.2-2034640

Materials added to the PostProcess Blendable section don’t seem to actually affect the render target of a SceneCapture2D.

Repro Steps:

  1. Create a postprocess material. To make it obvious if it is working, make it simple, such as a constant red output.

  2. Add this as a blendable to the post process volume, and confirm that it does in fact work by making the viewport red.

  3. Create a render target.

  4. Add a scenecapture2d component to your pawn, and set the render target to the one you just made.

  5. Confirm that the scenecapture2d is correctly capturing the (unmodified) scene to the render target.

  6. Add the material you created to the blendable section of the scenecapture2d component.

Expected result: The render target would be all red since the blendable post process material would be affecting it.
Actual result: The blendable post process material has no affect on the render target.

Hello,

Thank you for your report. I was able to reproduce this issue and have entered a report to our rendering team. They are now looking into the issue. Please let us know if you encounter any more unexpected behavior.

Cheers!

If it helps, I think I’ve narrowed down what the root cause is:

UMaterialInterface::OverrideBlendableSettings() is the function that should actually add the blendable material to the post process BlendableManager.

One line 977 there’s an if statement:

	if(!Material || Material->MaterialDomain != MD_PostProcess || !View.State)
	{
		return;
	}

This function is called both by the viewport renderer and the SceneCaptureComponent renderer. However, in the case of the SceneCaptureComponent, View.State is NULL, which causes OverrideBlendableSettings() to return at line 979 before pushing data to the BlendableManager.

The problem seems to be that when the SceneView for the SceneCaptureComponent is setup in Fscene::CreateSceneRenderer (SceneCaptureRendering.cpp line 78), there is no view state setup in the ViewInitOptions.

I’m going to try adding a view state, and see if that resolves the issue,

Just tried it, and it worked! I’ll make a pull request tomorrow.

Pull request with this fix:

Wow! Thank you for being so active on this issue. I went ahead and let the developers know about the fix in the report so that I can be used. Please let us know if you make any more fixes!

Thank you!

Is this resolved? I seem to have the exact same problem. I’m running on version 4.8.1.

Hi Pastej -

This problem has been fixed before 4.8.1. Here is a test project with a functional setup. Chances are you have forgotten to set the SceneCaptrue2D from HDR to LDR(With Post Process).

Thank You

Eric Ketchum

Test Project 4.8.1

Is it possible there might be a hardware problem associated with this too? When loading your Test Project, this is what I see on my Macbook Air in UE 4.10.