Skip to content

Ultrawide (21:9) shows leftover loading screen on sides due to camera viewport not clearing - fix #192

@TheByterr

Description

@TheByterr

Problem

When running the game on ultrawide resolutions (e.g. 3440x1440), parts of the loading screen remain visible on the left and right sides of the screen after the game loads.

The center of the screen updates correctly, but the sides display leftover content (usually from the loading screen), resulting in a "ghost image" effect over a black background.


Observed Behavior

  • Center of the screen renders correctly
  • Left and right edges retain previous frame content
  • Looks like parts of the loading screen are not cleared
  • Only happens on ultrawide (21:9+) aspect ratios

Expected Behavior

The entire screen should be properly cleared and rendered every frame, regardless of aspect ratio.


Cause (Analysis)

This appears to be caused by the camera rendering to a 16:9 viewport instead of the full screen, combined with insufficient clearing of the render buffer.

As a result:

  • The camera only redraws the center area
  • The sides are not cleared or updated

Fix

Forcing all cameras to render to full screen and properly clear the background resolves the issue:

foreach (Camera cam in GameObject.FindObjectsOfType<Camera>())
{
    cam.rect = new Rect(0f, 0f, 1f, 1f);
    cam.clearFlags = CameraClearFlags.SolidColor;
    cam.backgroundColor = Color.black;
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions