0
\$\begingroup\$

I am totally stuck on with pixel perfectness of the game. I have tried a few pixel perfect camera -assets, but they have lots of issues considering scalability. is it normal that these cameras zoom in and out, instead of scaling the camera screen when using different resolutions for the game. Because this is a huge problem for me, cause i need to make a game for aspect ratio of 16:10, and every resolution that has the same aspect ratio is needed to scale it correctly keeping the pixel perfectness. The ortographic camera size is dependent of screen width (width / PPU / 2) So it always zooms in or out with different resolutions.

Question is: Is there a way to make it scale the game sprites instead of zooming the view?

\$\endgroup\$
7
  • 2
    \$\begingroup\$ Note that if you scale the game sprites, then by definition you are no longer pixel perfect. You'd need to provide an alternate set of assets for each resolution to maintain pixel perfection. See Scaling my pixel art game from 720p to 1080p, What makes scaling pixel art different, and links therein for more details on why scaling pixel art to fit the screen doesn't "just work" automatically, and needs deliberate work by the developer to ensure the intended look is achieved. \$\endgroup\$ – DMGregory Aug 12 '20 at 11:41
  • \$\begingroup\$ Thank you for your answer. Am i correct that it is not possible to do non-glittering 2D game with unity without it being pixel perfect? When camera moves, the glitter happens if the game is not pixel-perfect. How do you do the graphics so the pixel perfection is not needed? \$\endgroup\$ – UnityDevil Aug 13 '20 at 5:26
  • \$\begingroup\$ Pixel perfectness is never "necessary". It is a choice that improves low res graphics displayed on higher res screen. With high enough resolution (on both, sprites and screen) those graphical artifacts just become (almost) unnoticable. \$\endgroup\$ – Nikaas Aug 13 '20 at 9:51
  • \$\begingroup\$ This has nothing to do with Unity, it's just math. If you make your art so that you have perfect 1:1 mapping of 1 screen pixel to 1 texture texel on a 720p screen, then you try to stretch that to 1080p, now you have 1.5 pixels per texel. You can't draw "half pixels," so that means somewhere your texels have to get repeated (leading to shimmer) or averaged (leading to blur). You can make your assets high-res with antialiased edges so the slight fuzzing of bilinear interpolation doesn't destroy a crisp pixel art look, or you can use vector-style/SDF techniques to make your assets more scalable. \$\endgroup\$ – DMGregory Aug 13 '20 at 10:49
  • \$\begingroup\$ Thank you DMGregory and Nikaas, you helped me to understand the definition "pixel perfect". I love this community. \$\endgroup\$ – UnityDevil Aug 14 '20 at 7:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.