Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice
  4. Dismiss Notice

Scaling game without looking weird

Discussion in '2D' started by brittany, Jul 16, 2021.

  1. brittany

    brittany

    Joined:
    Feb 26, 2013
    Posts:
    93
    I am wondering how this scaling is done. If a 2d pixel art game is 480 x 270, this scales perfectly to 1920 x 1080 (multiply by 4). But what if you need to scale it to 1280 x 720 for someone with a 720p monitor? Then you are scaling by a non-integer number 2.667, which will make things look weird. If I remember correctly the Switch is 720p in handheld mode and there are a lot of 2d pixel art games that look fine. How are they doing this?
     
  2. Wombat_Rancher

    Wombat_Rancher

    Joined:
    Jul 25, 2021
    Posts:
    6
    I think they scale by the closest possible integer number and then crop the excess out.
     
  3. kennyy_

    kennyy_

    Unity Technologies

    Joined:
    Apr 7, 2021
    Posts:
    94
    Hi,

    The upscaling varies depending on the Crop Frame option selected (as shown below). None, Pillarbox, Letterbox and Windowbox uses Point Filter as the upscale filter mode, with the extra resolution cropped out. Stretch Fill uses a hybrid approach with upscaling the reference resolution to the closest integer to the target resolution, followed by a Bilinear Filter to fill up the remaining pixels. Hope this helps clarify!

    *Important Note* - Universal RP is the new home for Pixel Perfect Camera. While the stand-alone Pixel Perfect Camera component will continue to receive bug fixes, new features will only be added in Universal RP.

    Crop Frame Options
    upload_2021-7-26_11-22-40.png

    Cropped Letterbox Example