Split Screen Extremely Pixelated

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

So this is what my scene looks like normally.

And this is what it looks with split screen.

enter image description here

And as you can see this is terribly pixelated. I don’t know why. How do I fix this?

This is my Split Screen Scene

Main (Node2D)
- Viewports (HBox Container)
  - ViewportContainer1 (Viewport container)
   - viewport1 (viewport)
     -World(Scene with the players, NPCs, tilemap etc.)
     - Camera2D
  - ViewportContainer2 (Viewport container)
   - viewport2 (viewport) For Player 2
     - Camera2D

And this is the code
**

extends Node2D
    
    
    onready var viewport1 = $Viewports/ViewportContainer1/Viewport1
    onready var viewport2 = $Viewports/ViewportContainer2/Viewport2
    onready var camera1 = $Viewports/ViewportContainer1/Viewport1/Camera2D
    onready var camera2 = $Viewports/ViewportContainer2/Viewport2/Camera2D
    onready var world = $Viewports/ViewportContainer1/Viewport1/World
    
    # Called when the node enters the scene tree for the first time.
    func _ready():
    	#viewport1.world_2d = $World.get_world_2d()
    	viewport2.world_2d = viewport1.world_2d
    	camera1.target = world.get_node("Sprites/YSort/Archer Man Separate")
    	camera2.target = world.get_node("Sprites/YSort/Throwing Weapons Man Separate")
    	pass # Replace with function body.**

Any idea what I should do?

What value of zoom have your cameras in single and split screen modes?
Also did you tried different stretch modes? Multiple resolutions — Godot Engine (stable) documentation in English

AlexTheRegent | 2022-06-23 20:48

Zoom has no effect. In the regular scene zooming out or in stays clear. But in viewport it’s always pixelated. I will try stretch modes.

Skydome | 2022-06-23 21:14

Ok so setting stretch mode to viewport makes the game blurry even in the regular scene. And the viewport is also still blurry/pixelated. Changing stretch mode to anything else keeps the regular scene working fine but the viewport/split screen still blurry.

Skydome | 2022-06-24 09:20

Can you make small project with this issue and upload source code to see your problem?

AlexTheRegent | 2022-06-24 15:05

I have managed to fix it a little after some experimentation. Still kinda blurry. And for some reason I get some occasional lag.

Skydome | 2022-06-24 15:49

I think my main problem was that test width and height and actual width and height were different. The pixelation is now under control. It looks closer to the scene without running via viewport.

Skydome | 2022-06-24 15:53