How to render to a section of the screen?

I’ve seen the question asked several times, but for some reason it always goes mostly unanswered (see links). How can I render the main camera view to a specific section of the screen so that I can use the other area for UI elements?

It’s relatively easy to do in Unity, but I’m not finding a simple, non-hack way to do it in Unreal. Using screen capture or rendering to a 2D UMG element doesn’t make much sense due to the drastic increase in overhead.

Hi SullairVR,

There is no easy way to alter the viewport in the way that you describe.

Method (FOV) 1: In your widget Blueprint just add widgets that will block portions of the viewport and adjust your FOV settings on your camera to match the remaining view. (may be hard to get desired results if your screen isn’t centered)

Method (RenderTarget) 2: Have your main camera detach from the player and be moved inside a hollow cube with a material that is unlit and black. Then use the 2d scene capture as your camera and draw it to a render target. You can apply that render target as a texture in a UI material and use that as an image in your Blueprint Widget. (not suggested but will work)

Method (SplitScreen) 3: In your level Blueprint create a player on begin play (make sure splitscreen is enabled in your project settings) then create your widget and add to viewport for player 0. If you have spawn pawn unchecked nothing will render to the second viewport making it black. This will allow you to constrain your main player view horizontally or vertically depending on your preference. (you are limited two screen layouts)

I plan to make a feature request for an option that will allow you to specify where your camera viewport is relative to the window.

Let me know if that helps,

Thank you. I believe it is a feature that would prove incredibly useful and look forward to using it. I am going to try the FOV method in the interim. Since the camera isn’t moving much, I might be able to get it to work the way I want it to. again for your input.

I’ve made the feature request here: Unreal Engine Issues and Bug Tracker (UE-36928)

I would recommend voting on this issue and talking to other users about voting on this issue since it seems to be a highly demanded feature!

I’ve also added links to quite a few posts in a private comment to the devs showing community interest.
,

Awesome. Thank you Ed.

I no longer see that feature request as active. Was that ever added or resolved?

We are still here waiting to know how to do this.

One alternative option is to make a Post Process material which shrinks the game render and draws black everywhere else.

Below seems to work though it’s possible it causes issues in some setups:

  1. Create a material and set its domain to Post Process
  2. Configure the material’s ‘Blendable Location’ to ‘Scene Color After Tonemapping’
  3. Build the graph like below image
  4. Assign the material in either your Post Process Volume’s settings or your Camera’s Post Processing section