Search Unity

  1. Unity 2019.1 beta is now available.
    Dismiss Notice
  2. The Unity Pro & Visual Studio Professional Bundle gives you the tools you need to develop faster & collaborate more efficiently. Learn more.
    Dismiss Notice
  3. We're looking for insight from anyone who has experience with game testing to help us better Unity. Take our survey here. If chosen to participate you'll be entered into a sweepstake to win an Amazon gift card.
    Dismiss Notice
  4. On February 28th the Feedback website will shut down and be redirected to the Unity forums. See the full post for more information.
    Dismiss Notice
  5. Want to provide direct feedback to the Unity team? Join the Unity Advisory Panel.
    Dismiss Notice
  6. Unity 2018.3 is now released.
    Dismiss Notice
  7. Improve your Unity skills with a certified instructor in a private, interactive classroom. Watch the overview now.
    Dismiss Notice

Sprite Mask Issue with PixelPerfectCamera script and sprite masks...

Discussion in '2D Experimental Preview' started by exzizt, Jan 20, 2019.

  1. exzizt

    exzizt

    Joined:
    Sep 30, 2017
    Posts:
    36
    I'm having very strange behaviour with sprite masks that are caused by the PixelPerfectCamera script on Android devices only (I have only tested the game on PC and Android and it is only being released on Android):
    upload_2019-1-20_15-23-28.png
    As you can see, the sprite mask does not work properly for some reason when stretch fill is disabled.
    What could be the solution to fix this? It is annoying because I have an option in the Options menu to disable stretch fill if the user wants to, as it is a bit of a performance hit (I'm pretty sure) for older phones to have stretch fill enabled.

    Please let me know how to go about fixing this! I will reply as promptly as I can.

    Edit:
    Might as well try and kill two birds with one stone here...
    Another issue I'm experiencing with the camera script on all platforms is when stretch fill is enabled it seems to get rid of the "crisp pixel look" and instead adds an "anti-aliased/bilinear-filtered look" on the graphics, as you can see here:
    upload_2019-1-20_15-23-47.png
    What I want to achieve is the "crisp pixel" look.

    I was able to dive into the code actually achieve this by changing this line of code:
    Code (CSharp):
    1. activeRT.filterMode = m_Internal.useStretchFill ? FilterMode.Bilinear : FilterMode.Point;
    I modified "FilterMode.Bilinear" to "FilterMode.Point", and it worked, however, I noticed it made my phone screen's actual pixels seem to have a weird grid effect and very pronounced. This effect is noticeable in the very first attached image. Any way to solve this?
     
  2. exzizt

    exzizt

    Joined:
    Sep 30, 2017
    Posts:
    36
    Is anyone able to lend a hand?
     
  3. exzizt

    exzizt

    Joined:
    Sep 30, 2017
    Posts:
    36
    Zzz... Anyone?