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
0
Question by kilometerbob · Jan 01 at 12:40 AM · materialtexture2duv mapping

Texture breaking along center of mesh

I'm attempting to draw a 2d texture onto a sphere mesh made from a previously normalized cube. Everything works fine except the texture breaks along the center line of each face. alt text The effect becomes even more pronounced when the number of verities is reduced alt text

I'm thinking it might be an issue with the mesh UV, heres how im currently generating it.

 public static void CreateUV(Vector3[] vertices, Vector2[] uv)
     {
         float previousX = 1f;
         for (int i = 0; i < vertices.Length; i++)
         {
             Vector3 v = vertices[i];
             if (v.x == previousX)
             {
                 uv[i - 1].x = 1f;
             }
             previousX = v.x;
             Vector2 textureCoordinates;
             textureCoordinates.x = Mathf.Atan2(v.x, v.z) / (-2f * Mathf.PI);
             if (textureCoordinates.x < 0f)
             {
                 textureCoordinates.x += 1f;
             }
             textureCoordinates.y = Mathf.Asin(v.y) / Mathf.PI + 0.5f;
             uv[i] = textureCoordinates;
         }
     }

capture.png (136.5 kB)
capture.png (142.9 kB)
Comment
Add comment · Show 2
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 Laiken · Jan 01 at 01:06 AM 0
Share

I don't understand how your uv generation works, but my guess is that it's too precise on the Uv Map island borders (and my guess is that there's an uv map island on that problem area and it is almost touching an unwanted portion of the UV map). I would start getting an UV viewer tool like Uvee and take a look at the UV map to see if you can figure out something.

avatar image kilometerbob Laiken · Jan 02 at 06:04 AM 0
Share

So I did that and it did confirm what i had thought the UV map is misplacing points and moving them to the far left of the image. not sure how to fix this yet

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by kilometerbob · Jan 02 at 06:18 AM

it was literally one unnecessary line of code the uv[i - 1].x = 1f; was causing vertices along the center to have 1 as there x value if you can believe that and the whole thing runs fine without that check

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

154 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

Related Questions

in game - how to partly invisible an object ? 2 Answers

Material doesn't apply on iPad but works fine on android 1 Answer

Bast way to combine multiple materials into one 0 Answers

Can't assign a texture from WWW to Image.material.maintexture 1 Answer

Set image as material 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