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"

What is a Viewport? (and what is a SceneCapture compared)?


I´m getting really confused about what a viewport is in the unreal engine. Hope somebody can help me! =/

Here is where I am right now: I have a SceneCaptureComponent2D placed somewhere. Since it can render the scene into a texture, there has to be a projection from the scene to the texture, doesn´t it?

I know that a SceneCapture has a TextureRenderTarget2D and with it you can get a RenderTarget with this code:

 USceneCaptureComponent2D * RenderComponent
 UTextureRenderTarget2D* RenderTexture = RenderComponent->TextureTarget;
 FRenderTarget *RenderTarget = RenderTexture->GameThread_GetRenderTargetResource();

I know that a FSceneView inherits RenderTarget and has a methods to project world to screen and vice versa.

And a ULocalPlayer for example has a FViewPort which has a FViewPortClient which has a FSceneView, and can call ProjectWorldToScreen(...). But a SceneCaputeComponent2D does not have a Viewport for some reason!

Right now I dont get it any more. Can anyone tell me please what any of these classes should represent and how I can use them? Any Information would be helpful!


Product Version: UE 4.18
more ▼

asked Oct 19 '18 at 01:11 PM in Rendering

avatar image

79 5 6 11

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

1 answer: sort voted first

Viewport in rendering terms mean render display on the screen, scene capture does not display captured scene on the screen just copy it to GPU memory so it has no viewport. Render Target is a texture which can be places on any surface and processed with the shader so viewport function can project it because view port don't know where the render target is used and project position. You would need to do your own calculations depending on what where you use render target on.

more ▼

answered Oct 20 '18 at 04:46 AM

avatar image

37.2k 936 172 1116

avatar image DaKenpachi Oct 22 '18 at 09:17 AM

Ok, now I get the difference between a ViewPort and a SceneCapture in terms of rendering.

But, there has to be some calculation to project the scene (3D Meshes) to the texture (2D Pixels), even in the SceneCapture, hasnt it?

I have no clue how to do these projection calculations on my own, so I wanted to use the build-in calculations for that. =/

avatar image DaKenpachi Dec 19 '18 at 01:09 PM

Ok I found the solution of doing the projection without the need of the ViewPort class in this post

(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