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 denzilb55 · Apr 06, 2012 at 01:39 PM · texturetexture2d

Texture image compression issue

I am working on a 2D game and am loading sprites of a sheet I drew up in paint.net. I need to work with exact pixel data, but have noticed that my pixel colors are blending. I believe unity is compressing the pixel data, and some blending occurs.

I have checked this by using the Texture2D class in my script. I have looped through the entire pixel data of my picture, and turned any non-black or non-white pixels green. I drew a black and white image, and sure enough green pixels appeared after loading it up (at the edges of black and white parts). So it is definitely blending. How can I disable this feature?

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

3 Replies

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

Answer by jasperstocker · Apr 06, 2012 at 02:03 PM

In the texture properties you need to set the filter mode from "bilinear" to "point". You can do this in the editor by selecting the texture itself and changing the property in the inspector.

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 denzilb55 · Apr 06, 2012 at 05:57 PM

Thank you. The actual problem was that the images needed to be power of 2 for some reason.

Comment
Add comment · Show 1 · 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 jasperstocker · Apr 18, 2012 at 10:27 AM 0
Share

Getting back to you on this. Power of two $$anonymous$$aths is very quick compared to other numbers so rendering will always work faster when using it. Unity will convert your textures to a power of two by stretching them in order to take advantage of this. The problem being that you can see this stretching at runtime. You can disable this in the texture properties be disabling compression I think. The image in the inspector will show the resolution at the bottom so you can check there if Unity has modified it.

avatar image
0

Answer by moonchacha · Nov 11, 2013 at 03:41 PM

If you're using the texture as a GUI element, changing the "Texture Type" in the editor to "GUI" gets rid of compression regardless of the image dimensions.

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.

Follow this Question

Answers Answers and Comments

4 People are following this question.

avatar image avatar image avatar image avatar image

Related Questions

How to not see white background on texture 1 Answer

Texture Compression format for UWP,Texture 0 Answers

EncodetoPNG and all other file types leaves the image in the wrong color space 0 Answers

is there a way to make textures bigger then 4096 2 Answers

Almost got a PCX parse working, but the colors aren't read properly 1 Answer


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