Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question Pixel perfect camera settings (and a bit more).

Discussion in '2D' started by Guilhaume, Jun 24, 2022.

  1. Guilhaume

    Guilhaume

    Joined:
    Sep 14, 2016
    Posts:
    30
    Hello everyone!

    I got back to Unity a week ago and i'm trying to set up my project for top-down pixel art.
    I am no expert at all, but i've flipped through a lot of posts on different forums and some things aren't yet clear enough, hence why i'm here.
    -My goal is to try out a top-down pixel art game which renders 1280x720 pixels, with assets of 32x32 (some will be bigger obviously). The level of detail i'm aiming towards is basically Moonlighter (It is one of my main reference).

    I'll try to be as clear as possible with my interrogations (english is not my native tongue so i tend to write quite a but just to be perfectly clear):

    1 - Reference résolution :
    Is this the number of pixels i want my game to display ?(in this case 1280-720)
    Can i still, in game, choose graphics settings of 1920x1080 ?(so basically render less pixels). Upping the graphical setting in-game is ok if i keep the same ratio right ? Which leads me to my second point.

    2 - Attached is an image of the same Tree in Moonlighter.
    upload_2022-6-24_11-21-50.png
    First one is in 1280x720, second one in 1920x1080.They share the same amount of pixels, however, the right one has more sharp edges and renders way nicer. I know this will sounds quite easy to figure out for most people, but i'm not sure what's happening here. If we are rendering pixels, then why some are blurry (i'm guessing some kind of interpolation?) and the others sharp ? This is important to really understand to me since i still want to render 1280x720 pixels (Higher is gonna loose the pixel art style i'm aiming for), but if i can render them in-game at a graphic settings of 1920x1080, i'll (apparently) get a better quality out of it.

    3 - The size of my camera is 11.25, x2 =22.5, x32 = 720pixels in height. Is that the correct way to set it up ?
    When i launch the game, it changes..(i know there are a lot of posts about that already, but if i'm here it's because i'm a little slow :eek:).
    -It goes to 16.875 (in the game view i set it to Full HD (1920x1080)), which fits the calculation for 1080, but is not what i am aiming for.
    -When i set the game view to 16:9 aspect ratio, it goes to 15.59375, which seems to only depends on the size of the game window(so this doesn't really matter).
    -So, how can i set 1920x1080 graphics settings, while still going for 1280x720 pixels rendered (which is 22.5 Unity Game units), in the game view ? (This has to do with my first question actually).

    I hope i was clear enough, sorry if it's redundant.. but i never seem to find the right post for my settings, and i'm still in the blurr after a few days.. ><.

    Thank you ;).
     
  2. DanielTanBK

    DanielTanBK

    Unity Technologies

    Joined:
    Aug 20, 2019
    Posts:
    82
    Hello,

    Have you tried looking at the 2D Pixel Perfect manual page?
    Especially the part for "Preparing Your Sprites", one reason for the blurry sprites could be that your Filter Mode is not set to 'Point'. Crop Frame and Stretch Fill could also help to maintain your intended Reference Resolution.