Only a specific part of the game should render the 3D world, while the other space on the screen should be filled with UI elements (UMG). I want to do this to save performance, since the UI is always hiding certain areas in the game, most importantly a certain percentage at the bottom of the screen.
If I just put UMG widgets on the screen,the world below is still fully rendered, the UMG widgets just hide it after its rendered. I know I could render the game to a RenderTarget and then draw it on my UMG UI, but using a SceneCapture2D as the main camera for the game does not sound like a great idea to me. There is surey a way better way to do this.
I would also be interested in knowing how to do this. I’d consider the SceneCapture method, but since my game relies heavily on mouse interaction within the 3D world, RenderTargets seem like the wrong way to go.
For a while now (tried since 4.7, but works all the way to 4.13) even with ‘Use Splitscreen’ disabled (in Project Settings, Maps & Modes, Local Multiplayer section) you can still adjust percentage of the screen to be used for rendering.
SplitScreen info can be accessed and adjusted directly. These values may give you what you need:
Make sure to check for validity of pointers used, and array indices, and, preferably run this in BeginPlay of the pawn or controller owning the widgets (presumably will not exist otherwise)
Areas outside of these will be rendered in black, so you’ll need to make up a widget to cover it with different color. Camera positioned in the ‘middle’ of viewport will accurately be in the middle of the area you are rendering.
Edit: Widgets positioning will not be affected, so if you use widgets to draw stuff on top of render area, you’ll need to manually adjust these.
It seems like I’m getting the full cost of rendering the original camera viewport, even with split screen cutting off a major portion of the final image. Even with the entire original camera cropped (so there’s only a black screen visible), I’m actually getting worse fps. The split screen feature might just be rendering the original view to a render target and then just scaling and cropping, which would actually increase the render cost. So I would NOT recommend using the split screen feature for doing this. You’re better off just blocking the portion you don’t want visible with a black rectangle. It’s pretty frustrating that UE4 lacks so many basic features.
I’m having the same issue. Is the best solution still to go in to cpp and access player data and set the size like @xulture described above? also @anonymous_user_b31da257 's link doesn’t work, is this still a feature request?
I would just like to clarify this is not true anymore. It was probably different back then in 2016, but now it is not the case. Cropping the viewport using the quoted method actually gives you FPS gains because you’re rendering less on screen! Just commenting this as this thread comes up on google
FWIW: Reading the thread, I’m not convinced the original problem was that there were no rendering gains.
It’s just as likely that the lack of FPS gains were because the GPU simply wasn’t fill rate limited, so something else was the bottleneck.
Transform, data transfer, CPU, physics, or a bunch of other things may be limiting you, and making the screen bigger/smaller won’t change anything if that’s the case.