Search Unity

Unity 2D Pixel Perfect is out of preview for 2019.3

Discussion in '2D' started by rustum, Jan 30, 2020.

  1. rustum

    rustum

    Unity Technologies

    Joined:
    Feb 14, 2015
    Posts:
    84
    2D Pixel Perfect.png
    From 2019.3 onwards the 2D Pixel Perfect package is out of preview and verified. This means that the 2D Pixel Perfect package is stable and will receive regular bug fixes. We will continue to add new functionality and this will be clearly marked as experimental to distinguish it from the more stable features.

    Overview
    The 2D Pixel Perfect package contains the Pixel Perfect Camera component which ensures your pixel art remains crisp and clear at different resolutions, and stable in motion.

    It is a single component that makes all the calculations needed to scale the viewport with resolution changes, removing the hassle from the user.

    You can adjust the definition of the pixel art rendered within the camera viewport through the component settings, as well preview any changes immediately in Game view by using the Run in Edit Mode feature.

    Getting Started
    1. Install latest Unity 2019.3
    2. Open Package Manager by going to Window > Package Manager
    3. Choose 2D Pixel Perfect from the list and click on Install at the bottom right of the Package Manager window. 2D Pixel Perfect in Package Manager.png
     
    Last edited: Jan 30, 2020
    Lars-Steenhoff and APSchmidt like this.
  2. Zebbi

    Zebbi

    Joined:
    Jan 17, 2017
    Posts:
    216
    This is awesome, been following for the last couple of years and it really is an excellent package. I've been waiting for the possibility of stretching the viewport post-upscale similar to how ScummVM and DOSBox simulate the old 320x200 stretched to 320x240 mode of old vga cards. @yuanxing_cai was working on this part, it was working okay at one point with some modifications, but it broke any UI stretching as all of the raycasts were in the wrong place. Is it possible this will be developed further in future verisons? The modifications were documented here: https://forum.unity.com/threads/pixel-perfect-preview-package.533433/page-4#post-4032814
     
    Lars-Steenhoff likes this.
  3. Ennothan

    Ennothan

    Joined:
    Oct 17, 2013
    Posts:
    49
    I tried it with URP but it isn't compatiple, it says to use the pixel perfect camera from URP (it is still tagged "experimental") and that one doesn't work properly, crop doesn't work, upscaled render texture neither.

    Could you please fix that?
     
  4. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    272
    The 2019.3 verified standalone package is not designed to be compatible with URP. About the one in URP, in which version of URP did you encounter the problems you mentioned?
     
  5. Ennothan

    Ennothan

    Joined:
    Oct 17, 2013
    Posts:
    49
    URP 7.1.8
    With more tests I'm seeing the crop actually works, but don't clear properly beyond the crop. The problem is with Stretch Fill active, when I start play mode it doesn't work, but if I uncheck and recheck the Stretch Fill option it starts working (still not clearing beyond the crop).

    About the Upscale Render Texture I placed high resolution images to test it, and they should be pixelated, but I see no difference. With the main 2D Pixel Perfect package it works.
     
    exzizt likes this.
  6. luispedrofonseca

    luispedrofonseca

    Joined:
    Aug 29, 2012
    Posts:
    833
    I'm slightly confused. Are there multiple PixelPerfect solutions? Is the one mentioned here only for the default (deprecated?) renderer?
     
  7. desukarhu

    desukarhu

    Joined:
    Jun 14, 2017
    Posts:
    12
    I tried to search the previous thread about ways to zoom the pixel perfect camera in and out but didn't find any conclusive help. Is the case different now? How would I go about zooming the camera? In the previous thread there was a mention of post process zooming, how can I do that?
     
    Lars-Steenhoff likes this.
  8. Koru

    Koru

    Joined:
    Feb 14, 2012
    Posts:
    40
    Is it possible to anchor a camera's view to a screen's border? Currently, the view is centered but I want to have a portrait screen aspect ratio with camera view on bottom and UI on top. Any advice on how to achieve it without a render texture?
     
  9. mromerogames

    mromerogames

    Joined:
    Feb 25, 2020
    Posts:
    1
    This is awesome!
     
  10. exzizt

    exzizt

    Joined:
    Sep 30, 2017
    Posts:
    77
    Hope this package gets more work!
     
  11. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    272
    There is still only one solution, but we have slightly different implementations for the built-in render pipeline (the standalone Pixel Perfect package) and URP 2D Renderer (built into URP itself).

    And yes, we are talking about the standalone package for the built-in render pipeline here.
     
  12. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    272
    The current recommended way of doing zoom is to use Cinemachine and its Pixel Perfect Extension. https://docs.unity3d.com/Packages/com.unity.cinemachine@2.5/manual/CinemachinePixelPerfect.html
     
  13. thomak-dev

    thomak-dev

    Joined:
    Mar 8, 2015
    Posts:
    16
    Is it possible to make Canvas work properly with URP Pixel Perfect Camera? I tried setting Render Mode to Camera and assigned my Pixel Perfect Camera and tried all the options of the Canvas Scaler but only got poor results. Then I tried the Custom Scaler Script from https://forum.unity.com/threads/canvas-with-pixel-perfect-camera.768377/, the result is slightly better (UI Image with assigned Sprite seems to behave like other sprites) but Text is jittering when I move the camera. I set the mode to Scale With Screen Size and the reference resolution and PPU to the same values that the Pixel Perfect Camera uses.
     
  14. yuanxing_cai

    yuanxing_cai

    Unity Technologies

    Joined:
    Sep 26, 2014
    Posts:
    272
    So your main issue is jittering text? Anything else?
     
unityunity