Anti aliasing using viewports in split screen application

:information_source: Attention Topic was automatically imported from the old Question2Answer platform.
:bust_in_silhouette: Asked By andymess

Hello, having a ball learning Godot. I want me game to be split screen with a camera view ahead of and behind the player. I was able to achieve this based on this fairly old video:

This is the setup:

If I just render my “world” scene by itself with its own camera everything looks great, but when I render the “split screen” node as shown in the above tree anti-aliasing is not enabled. I can go into those Viewports and enable MSAA x16, but this still looks a lot more primitive than I expect.

Any thoughts! I appreciate it.

By the way, 16× MSAA is very slow and sometimes buggy due to how it’s implemented in graphics drivers. You most likely want to use 8× MSAA at most.

Calinou | 2020-07-21 07:31

:bust_in_silhouette: Reply From: Nobuyuki

ViewportContainers are a fairly straightforward control, but have some limitations on rendering the viewport texture, as you don’t have direct access to the texture the container uses to change the render flags. By default, ViewportTextures don’t seem to have Texture.FLAG_FILTER enabled, so instead, you would have to use a TextureRect or Sprite2D or whatever your use case scenario requires. Then, you can manually enable the filter flag for the ViewportTexture resource.