Search Unity

Confused about camera size (from 1080 to 720..ect)

Discussion in '2D' started by ryanavent, Sep 26, 2019.

  1. ryanavent

    ryanavent

    Joined:
    Jun 30, 2011
    Posts:
    82
    I have watched several videos and have read a few very helpful blog posts that detail how PPU and orthographic camera size work in tandem to get a good sharp image.

    The issue i have is i have designed my game for HD (1080p) so each of my tiles is 108px (this is not a pixel art game) witch means my camera size is 5, this gives me a nice image and the quality is how it should be.

    However when i decrease to a 720 screen size i am not sure what the orthographic camera size should be changed to in order maintain the quality and amount of size seen in the vertical.

    Am i missing something here?
     
  2. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    The "Camera size" only controls the height (in units, not pixels) of the camera because the width is set automatically based on your camera height and screen aspect ratio. 1080p has a height of 1080 pixels, and 720p has a height of 720 pixels. 720 pixels divided by 1080 pixels is 2/3, which means your 720p screen is 2/3 the size of your 1080p screen, and you should shrink your camera by the same amount. 5 multiplied by 2/3 is 3.3333..., so your 720 camera size should be 3.3333.

    3.3333 is not ideal for pixel perfect, but if you aren't interested in pixel perfect, fixing it is not worth the headache.
     
    ryanavent likes this.
  3. ryanavent

    ryanavent

    Joined:
    Jun 30, 2011
    Posts:
    82
    @Gambit-MSplitz i appreciate the feedback, changing the camera size to 3.3333 would decrease the visible vertical space wouldn't it? is this how games cater for different resolutions ? this would give a different gaming experience depending on the screen size.
     
  4. MSplitz-PsychoK

    MSplitz-PsychoK

    Joined:
    May 16, 2015
    Posts:
    1,278
    Yes, adjusting the camera size will adjust the visible vertical space. You may or may not want that depending on what you're going for.

    The way I was describing of matching your camera size to your screen size will make sure your art always takes up about the same number of pixels no matter what screen you use. This will show less vertical space, but will help the art not get to pixellated or blurry because it's too large or small on the screen. I assumed this is what you wanted because you were being picky about pixel sizes.

    The other way, where you don't adjust your camera size, will make sure you see the same amount of vertical space in your scene no matter what your screen size is. This is what most games prefer, because usually you do not want a smaller screen to mean the player can't see as much, unless you're making a game about pixel art or something.

    In both cases, you may see more of less horizontal space based on how wide your screen is. If you aren't sure which way to go, I recommend just always using the same camera size. Hope I didn't add too much confusion.