Render to only part of viewport

Hi guys,

During a part of my game, I want to have the main camera render only to a part of the viewport, while the rest of the screen is filled up with some UI elements. (i.e. the top right portion of the screen, roughly 1/4 of it, should render what the Main Camera sees and the rest is filled with GUI elements).

Is this possible in a nice way? I know about Screen Capture 2D or Canvas Render Target 2D and I could disable my main camera for the duration, but that seems like a hack. Are there any better ways to do this?

I am happy to do C++ or BP.

I have exactly the same question! So could someone please comment on it? Thanks a lot :slight_smile:

I’m thinking about games like the early Lands of Lore and similar ones.

Hi Andrew,

thanks for the quick answer! I am afraid, however, that I was too unspecific in describing at least my version of the problem. I did design the interface of my game in UMG :slight_smile: I just don’t know how to deal with the camera image. Is there a way to render the player camera to a UMG element?

And yes, UMG is awesome indeed :slight_smile:

Hey guys,

I feel like Unreal Motion Graphics (UMG) is going to be your best friend in this case. If you have not looked into it yet, take a look at our documentation about this awesome UI designer. It has a lot of versatility and flexibility!

UMG UI Designer

Let me know if this is along the lines of what you are looking for, or if you have further questions.

Cheers,

Ok, thanks a lot for the explanations! The SceneCapture2D it is, then.

Cheers,
Jonas

No problem. I mentioned this documentation as it was not hinted in your post you were aware and had already begun using UMG.

The only way to render a specific Camera View as an image is to use the Scene Capture 2D actor. This has been improved over the last few iterations of the engine to expose ShowFlags so you can include/exclude certain things the camera renders to the texture.

Scene Capture 2D

The render texture can be directly referenced in UMG as an image which you can resize in your viewport. To save you some performance and a headache, I would pay attention to the auto-activation check box as well as the ‘Capture Every Frame’ option.

Note If you keep all of the show flags activated and the view distance and showflags are all ticked to the max, you will see a drop in performance. This is because you are rendering your entire scene again to a small camera.

Cheers,

Hi,
I have the similar challenge and I stumbled upon this thread. The problem with using SceneCapture is that even if you put it on top of a normal camera output in the game viewport, the performance cost will still be there (it renders the scene to camera and then to widget on top of camera with UMG). This is especially bad for the mobile. As far as I understand, I have to go and tinker with engine source code. Could you give a hint where to start?
My goal is to have a viewport on the top part of the screen, and on the bottom 30-40% will be used for 2D UI only.

There is hope. I asked separately and as a result there is a pending feature request. Vote for it and hopefully it becomes a reality.