Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • 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
1
Question by Furjoza · Dec 10, 2014 at 10:52 PM · spritepixel

Misguided pixels issue

Hello, Im making a little pokemon like game. Im generating map with script. I got an 2d array with values, empty game object and depending on the value Im adding component Sprite Renderer with proper sprite. As you can see there are strange vertical lines they are the issue. If we take a closer look we can notice that sprites looks good but that vertical line looks to be a one pixel width part of the first from left sprite. What I mean in my MiniMiasto2 former sprite first "tile" on he left from pure green tile is a part of the orange road. It seems that first columns of pixels are from previous(first from the left) sprite. When Im verticaly moving my camera/hero the effect disapears! I have also noticed that changing the filter mode on imported sprite changes the scale of the effect. Point is giving better results than trilinear and bilinear. Ive dealt with the problem by scaling my gameobject by 1.01, but I would like to know why all that is happening.

Here I got another problem. Even tho the quailty of the screen shot is terrible we can notice that 45 degrees lines of the trees doesnt look good. Ive noticed that one pixel of my sprite is something around 4 pixels of my monitor. Is it possible to make it 1:1 ratio always? The vision sight of the hero doesnt really matters in this game, so I dont mind if on different PCs volume of seen worlds changes, but I would really like 1 pixel of my spirte represent one pixel of any monitor. Is it achivable?

alt text

unityaskkafelki.jpg (82.3 kB)
Comment
Add comment
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

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Bunny83 · Dec 10, 2014 at 11:09 PM

Well, first you should make sure you disabled mipmapping and anisotropic filtering since both are pointless and mipmapping is can cause such color bleeding. However due to antialiasing you might see the bleeding anyways. An atlas should have at least a 1 pixel border around each sprite.

If you want to use mipmapping (maybe you plan to zoom out) you should make your images based on power of two sizes. Mipmapping only works well with power of 2 since each mip level will cut the size in half. Atlas textures are generally bad for mipmapping because the lowest levels will result in a completely wrong color as all tiles will be mixed up.

Comment
Add comment · Show 4 · 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 Bunny83 · Dec 10, 2014 at 11:12 PM 1
Share

ps: for future posts (especially when it's about small-pixelwide artifacts) please don't use JPEG as it introduces even more artifacts. Use PNG ins$$anonymous$$d, it's loss less.

avatar image Furjoza · Dec 10, 2014 at 11:24 PM 0
Share

To be honest I dont really undestand what you said :( I know that I have my $$anonymous$$ip$$anonymous$$aping turned off, even tho I have no idea what is it (Okey I read a bit about it. I dont plan to scale. Actually my goal is to have 1 pixel of sprite = 1 pixel of $$anonymous$$tor, I wont zoom out). Anistropic filtering is bilinear and trilinear? I got filter mode set on point. Atlas is what I called former spirte which is later sliced? So you say if I have a tiles (sliced sprites) of 50x50 pixels I should give them a border of neutral color(or what color should border have?) of 1 from each side and then while slicing set an offset on 2(top+bot or left+right = 2)? Is my problem common? About formats Im using .png as my atlas is it also bad?

avatar image Bunny83 · Dec 11, 2014 at 12:26 AM 1
Share

The edge padding should have the same color as the color of the edge of your tile. Anisotropic filtering is a special way of generating mipmaps. It's only relevant if you have a very "angled" view on a mesh. A texture atlas is simply one image that contains several smaller images. A sprite usually refers to a single image seen on the screen. It can be based on one (or multiple) tile(s) of an atlas or seperate textures. An atlas is also called a "sprite sheet".

The problem of color bleading is quite common. It can happen in various cases, especially at the edges of the transition to complete transparency. When using atlas textures it's usually caused by not having enough space between the tiles.

Once again, the first link above explains the edge padding you should do on your tiles. So make sure the color at the edge continues for at least 1 more pixel across the UV border of your tile.

The comment on the JPG was ment for images posted here on Unity Answers ;) Of course using a PNG in yout game is perfectly fine ;) Personally i use PNG for almost everything.

avatar image Furjoza · Dec 11, 2014 at 03:49 PM 0
Share

Oh mate I'm truly thankful for you respond. Now when I can indetify the problem it is easier to deal with it. The padding! Looks like an evening with GI$$anonymous$$P :D You even added links! But at the end I would like to return to one question. Is it possible to make 1 pixel of my sprite = 1 pixel of any monitor? I have seen a thread where people suggested to play with size of camera in ortographic view. Is it the way?

Edit: Okey I found the answer!

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.

Follow this Question

Answers Answers and Comments

26 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

Related Questions

If I make a vector in Inkscape will it be a vector in unity? 1 Answer

Round position 1 Answer

Pixels per Unit / Pixel Perfect Shadows, possible? 1 Answer

How to scale a quad to has the size same as pixel size of sprite? (perspective camera) 0 Answers

How to achieve 2D pixel perfect collision physics (like Badland) in Unity3D ? 3 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