• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Gotztama · Apr 16, 2020 at 12:14 PM · cameratexturetexture2dpixel

Pixels not equal size and thin white stripes between pixels

Hey everyone :)

I'm new to Unity and started developing a small 2D Jump 'n Run Game with some friends.

I have some problems with the camera settings:

1. The pixels don't appear to have equal size. In the black outlines are all one pixel wide and are also shown this way if I zoom onto them in the "Scene" view. In the "Game" view however the pixels are not equal sized. I don't mid this on most objects actually, but some are just a couple pixel big and the object looks overall really odd. I've noticed that it get better once I decreased the field of view. I'm also using the "Pixel Perfect Package". I just can't figure out how to fix this..

References:

In the Scene view: alt text

In the Game view: alt text

2. I get these white lines flashing randomly when moving around the map. I've been told the "Pixel Perfect Packge" could fix this, but I couldn't figure out how aswell...

Any help is very appreciated :)

cat-scene.png (2.2 kB)
cat-game.png (2.2 kB)
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image OakQ · Apr 17, 2020 at 05:26 PM 0
Share

What dimensions are your game window set to? if you have it set to free aspect or something, then the pixels will look messed up. Set it to the size you expect your game to be run in like 1920x1080 or 1280x720.

This article may also help https://blogs.unity3d.com/2019/03/13/2d-pixel-perfect-how-to-set-up-your-unity-project-for-retro-8-bits-games/

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Apr 16, 2020 at 12:59 PM

Looks like a beginners mistake to me ^^. Textures are usually stored in sizes that are a power of two (8,16,32,64,128,256, ...). Unity will automatically resample your texture if it's not a power of two. There are two ways to prevent that:

  • You can change the import settings of the texture and select "Non-Power-of-Two". However this can have some performance issues and older devices might not support those in hardware.

  • The In general better approach is to make sure your textures are always a power of two in size. Note they don't need to be square (on very old devices this also was a requirement but I think those times are over). So you could have textures that are 256x64 for example.


Sprites are usually imported and packed into an atlas texture. As long as the atlas size is a power of two everything should be fine.


I also recommend this video of 10 common pixel art mistakes

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Gotztama · Apr 17, 2020 at 03:50 PM

@Bunny83 Thanks for the answer :)

I've rescaled the canvas of my idle animation and sliced the animation sheet to 128x128. However, I still got the same issue. I've set my PPU to 32 for everything I use, since the tiles I made are all 32x32. Maybe it has something to do with this? Or maybe somthings wrong with my camera settings?

On the import setting I'm using the "Sprite (2D and UI)" as the texture type, so I don't have the "Non-Power-of-Two" option. When changing it to Default, my texture doesn't show up in the first place.

Do you have any idea what else I could try?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

216 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Is it possible to create a texture from a static image from a camera without using CaptureScreenshot or RenderToCubemap 1 Answer

Changing Part Of Texture/Material 1 Answer

Render a list of objects into a Texture2D array 0 Answers

How to convert Camera frame to Texture2D in unity c# script 0 Answers

Save image from camera with post processing. 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges