Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 11 Next capture
2021 2022 2023
1 capture
11 Jun 22 - 11 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
0
Question by borowik34 · Aug 10, 2015 at 04:03 AM · textureuv mapping

What is the exact size of texture padding required to avoid seams

Greetings. I have recently found a Unity manual page mentioning the need to leave padding on my textures outside of UV islands. That's a fairly reasonable part, but I would also like to know exactly how far apart I should put my UV islands to avoid seams, whether it be related to texture size or not. The manual page mentioned is: http://docs.unity3d.com/462/Documentation/Manual/HOWTO-alphamaps.html Thanks in advance.

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

Answer by Eno-Khaon · Aug 10, 2015 at 05:38 AM

Well, there's really not any strict answer to that question, so instead let's talk about why it happens to give you something to experiment with to learn for yourself.

I'll elaborate on what that page is referring to when they talk about "Downsampling". Before that, however, we start from the top with a friendly lecture on textures!

When you have a texture in 3D space, it will (almost) ALWAYS be a square power of two. For example, 256x256, 512x512, 1024x1024, etc. (rectangular textures are also commonly supported, but are still based around a power of two anyway).

When a 3D model reads from a texture, however, it's not based around a power-of-2 texture; the UV coordinates used range from zero to one instead. Any texture of any size can be used to fill these dimensions, so the same position in a 0-1 range will exist the same percentage of the way across the texture.

Now, downsampling is when you save computer resources by using a lower-resolution texture when the higher resolution isn't necessary. Rather than using the full 1024x1024 image to fill a 100x100-pixel area, either a 64x64 or 128x128 variant would potentially best be used in its place.

So, what does this have to do with padding textures?

I'm getting to that, so hold your horses!

The 3D model still uses Vector coordinates in a 0-1 range rather than full texture dimensions. This winds up meaning that the model has infinite granularity in the pixels it reads from, whereas the image itself is limited by number of pixels.

An ugly UV mapping with texture edge buffers in place

The buffer is there to account for potential problems if your image is downsampled.<or filtered or partially transparent or just unlucky>

Now, children, draw OUTSIDE the lines!

When you take a close look at the UV map of a lower resolution image, you'll find that pixel-perfect painting might not be as precise as you're hoping for. Because the UV coordinates are still essentially perfect. They will always fit the image. But if your image doesn't have buffers to account for texture resolution changes <downsampling>, your 3D model may be showing edges outside of your lines on your texture when you're not expecting it to.

Just because your UV map matches up perfectly with your high-resolution texture doesn't mean it will still fit at a lower resolution, so the padding is there to account for that.

That said, just because I said at first that there isn't a strict answer to how many pixels you need for a buffer doesn't mean you can't approximate it.

For every power of two that the texture is reduced in quality, your image essentially has a 50% chance of each resulting pixel being in the same place relative to the UVs... per vertex. So your odds are actually extremely LOW that it'll still fit the size on a perfect matchup. But for every pixel of buffer you add, it's not as direct of an issue anymore.

The pixels from the high-resolution blend with their neighboring pixels at lower resolution, so black and white can blend into grey, then another blend with white makes it just a lighter grey, and the image continuously loses detail without shoving things too far out of the way.

At some point, you'll always get the wrong color when you downsample enough. A 16x16 image simply doesn't have enough pixels available to separate out the details that a 2048x2048 image could provide.

Anyway, I hope this gave you some insight, and now I really regret not finding this any sooner. There's a much better description here with numerous pictures (I could display two) demonstrating Texture Bleeding thoroughly.


texturing101-1.png (7.3 kB)
texturing101-2.png (4.7 kB)
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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Good uv mapping tutorial? 1 Answer

3DS Max Seams from Unity Cubes 2 Answers

Get texture with UV Mesh Mapping 0 Answers

Procedural Mesh UVs Edge Case? 1 Answer

Render Texture out from a 3D Object 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