How to get Post Process Component working in custom viewport? C++


So I made my own viewport/viewport client that just uses a regular FPreviewScene for its world and stuff. But now I’m trying to get post processing effects to work in the scene and so far nothing i’ve tried has worked.

I also saw that post processing doesn’t work in the BP viewport, so I know that the base FPreviewScene doesn’t support it. Looking through the engine I saw that the animation viewport, using the FAdvancedPreviewScene does allow for post process effects.

So following that example, first I tried adding a post process component to the base preveiw scene in my viewport client constructor. Just by doing this:

PreviewScene->AddComponent(PostProcessComponent, FTransform(FRotator(0, 0, 0), FVector(0, 0, 0), FVector(1)));

I am also setting UMaterialInstanceDynamic Weighted Blendables on the pp component, and that will be true going forward for all attempts.

I then tried making my own preview scene that derives from FPreveiwScene and then follow what the FAdvancedPreviewScene does with it pp component. Didn’t work.

Finally I just made my preview scene derive from the FAdvancedPreviewScene, and in the constructor I set the material instance blendable stuff. Didn’t work.

So I’m assuming that i’m doing something wrong in my Viewport or Viewport client, or maybe the editor that holds all of them? I’m not sure, but if you have any insight please tell me. In case your wondering I am allowing the PreviewScene world to tick, idk if that relevant, but I assume you want that.

I would prefer to just add the pp component in my viewport client, if thats possible.

Thanks for reading,