x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

How to crop the game render to a portion of the application window

I'm not certain the best way to go about this, nor really what my options are. I have a couple candidates, but I'm unsure which is the more likely candidate without understanding the UE4 render pipeline - and how it interacts with Slate specifically - at a deeper level. I'm also unsure if I've completely missed other, better, or at least viable, options.


The goal:

Picture a fullscreen application on a widescreen monitor. The application window is vertically segmented into three sections: a centered square, and two equal columns on either side. The central square is the game viewport, the portion that shows the rendered image from the active level camera. The remaining space on either side will be completely covered by the game HUD (slate widgets). The game world will never be visible behind it.


The issue:

How do i do this without rendering the portion of the game world that will be occluded by slate?

I will also be applying post-process effects; some of which will only apply to the game world, and others will apply to the game world and to the HUD. How can I avoid performing post-effects on portions of the game render that will always be occluded by Slate widgets?


Strategy:

I set up my game camera in the player controller, and also use that camera as the viewport to add the slate widgets. When I define the camera, I define the viewport aspect ratio, and have to make it large enough to accommodate the slate widgets. Is there a "clip game render" setting? Should I be adjusting the draw frustum? Is there any way to make my HUD larger than the render space? Can I place Slate widgets outside the game viewport?

At this point I think my best option is to add another camera with a square aspect ratio, render that to a texture, and then draw it directly to the HUD, but then I'm still unsure how to tell the original, widescreen camera not to render anything except the HUD.

So is there a way to have a camera ONLY do the HUD render pass? Do I fake it by artificially occluding the camera? Do I fake it with a very short far-clipping plane? Should I place it in an empty level that exists outside the game world? Do I throw everything at it and see if I notice a performance change?

I've found a couple others who've asked, but not found any answers. There apparently was a feature request for this at some point, but I'm unclear on what happened with that.

This is a good (older) forum post - but no answers

That forum post links to this issue that was filed, but the link is bad

There's also this lonely forum post

Obviously this is possible, at least in the sense that the UE4ditor itself is doing this in some fashion. I don't know if this is done using code that is only existent within the Editor codebase that I can't use in my game, or if there's an easy way to do it by utilizing features built into the UE4 engine that I can release with my game. And I don't know that the way it was achieved for the editor is considered performant or appropriate for a standalone game application.

Does anyone have anything else?

Product Version: UE 4.22
Tags:
more ▼

asked Apr 22 '19 at 09:28 PM in Rendering

avatar image

GigasightMedia
1.7k 43 13 61

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

0 answers: sort voted first
Be the first one to answer this question
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question