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"

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.

Product Version: UE 4.8
Tags:
more ▼

asked Jul 16 '15 at 02:55 AM in Rendering

avatar image

vikhik
227 12 17 28

avatar image Artax Aug 19 '15 at 06:17 PM

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

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

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

1 answer: sort voted first

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

https://docs.unrealengine.com/latest/INT/Engine/UMG/

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

Cheers,

Andrew Hurley

more ▼

answered Aug 19 '15 at 06:28 PM

avatar image Artax Aug 19 '15 at 06:34 PM

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 :) 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 :)

avatar image AndrewHurley Aug 19 '15 at 06:49 PM

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

alt text

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,

Andrew Hurley

avatar image Artax Aug 19 '15 at 07:03 PM

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

Cheers, Jonas

avatar image Lordink Mar 24 '16 at 02:39 PM

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.

avatar image SullairVR Oct 06 '16 at 02:36 PM

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.

https://issues.unrealengine.com/issue/UE-36928

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
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