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

Scaling resolution up with Pixel Perfect Camera

Discussion in '2D' started by caiqueassis, Jan 20, 2019.

  1. caiqueassis

    caiqueassis

    Joined:
    Oct 13, 2018
    Posts:
    8
    Hello!

    So, I was doing some pixel art, using as reference a resolution of 768x432 (16:9). I wanted to see how it was looking in Unity.

    I installed the Pixel Perfect Camera preview package, dropped the component in the Main Camera of a newly created 2D project and set the reference resolution to 768x432, but it didn't work quite well.

    What happened was: in the Editor window resolution / aspect ratio, I had "16:9" selected. The Pixel Perfect Camera component gave me this warning:

    "Rendering at an odd-numbered resolution. Pixel Perfect Camera may not work properly in this situation.
    Screen resolution is smaller than the reference resolution. Image may appear stretched or cropped."

    Ok, fair enough. Then, I created a new Fixed Resolution (768x432), and it was perfect! The exact reference resolution I was making my pixel art.

    However, when I tried to scale it UP, it didn't go quite as planned. In theory, it should adapt to this reference resolution while still making the screen bigger, but what I got is that the camera was actually "zooming out", which was NOT what I want to happen. Here are some images to illustrate what I mean:

    1) Base 768x432 resolution



    2) 896x504 resolution (with the Pixel Perfect Camera reference resolution still at 768x432)



    3) 1280x720 resolution (with the Pixel Perfect Camera reference resolution still at 768x432)



    So, that's what went wrong. How would I do so I can scale the pixel art up with the resolution, in order to keep the same dimensions as the base 768x432 one?

    Thanks in advance.
     
  2. daxiongmao

    daxiongmao

    Joined:
    Feb 2, 2016
    Posts:
    395
    I am not sure of the answer but to me it looks like it is not scaling anything.
    Everything is still being drawn at the original pixel size. But now your resolution is higher so it appears smaller realitive to the max. I would assume if you go smaller it will go offscreen.
     
    SOON-KWON likes this.
  3. caiqueassis

    caiqueassis

    Joined:
    Oct 13, 2018
    Posts:
    8
    Well yeah, it's not really scaling. And when the resolution is smaller, it zooms in even more, so yes, things do get cut out...
     
  4. adelbenasri

    adelbenasri

    Joined:
    Apr 9, 2019
    Posts:
    1
    I have the same problem
     
  5. dahiyabunty1

    dahiyabunty1

    Joined:
    Jan 22, 2020
    Posts:
    68
    i have the same problem
     
  6. drandev

    drandev

    Joined:
    Mar 23, 2020
    Posts:
    10
    Try disabling the Upscale Render Texture in the Pixel Perfect Component.
    I'm not sure however, I'm still experimenting with this feature on my pixel art game as well. My problem as of the moment is that I tried upscaling the project into 1920x1080 and it works well with the resolution. However when I use a smaller resolution things became blurry. Hope Unity fixes/improves this Pixel Camera feature.
     
  7. chuahchuah

    chuahchuah

    Joined:
    Mar 21, 2020
    Posts:
    1
    I have the same problem too T_T wasted 3 hour trying to find a solution to this, the Upscale Render Texture in the Pixel Perfect Camera Component is required if you're using Cinemachine Confiner, without it if you're developing a platformer game, the camera will not show some part of the map upload_2020-4-5_18-2-43.png
     
    drandev likes this.
  8. sisedofficial

    sisedofficial

    Joined:
    Mar 25, 2020
    Posts:
    1
    doesn't fix the problem for me.
     
  9. therocketman2018

    therocketman2018

    Joined:
    Apr 25, 2019
    Posts:
    46
    I have the same problem and it's killing me. Scaling doesn't happen.