0 votes

So this is what my scene looks like normally.

enter image description here

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?

Godot version 3.4.4
in Engine by (202 points)

What value of zoom have your cameras in single and split screen modes?
Also did you tried different stretch modes? https://docs.godotengine.org/en/stable/tutorials/rendering/multiple_resolutions.html

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.

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.

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

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

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.

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.