Preferably through C++.
It’s easy enough to make a custom post-processing material, but what if I want to get SceneColor and SceneDepth, for more complex offscreen uses? The only options I could figure out are:
- Create a Scene Capture Component that mimics the camera, rendering the entire scene a second time.
- Create a UAV and add a dummy post-process Material which copies the color and/or depth into this UAV.
- Iterate through all views in the scene (
myActor->GetWorld()->Scene->GetRenderScene()->ViewStates
) and somehow find the one that represents my player camera.
.
- and 2. are incredibly inefficient, and I can’t figure out if 3 is even really possible.
EDIT: I’ve also found this, which is very hacky, but maybe would work? GetWorld()->GetGameViewport()->Viewport->GetRenderTargetTexture()
However it probably includes the UI and other stuff.