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 DylanWilson · May 14, 2014 at 05:46 PM · meshuvuv mapping

How do we generate a UV mapping data for a complicated mesh?

I have successfully generated the vertices and triangles of a mesh, which looks like a ring. Now, I am stuck on one last part. I am still learning about UV mapping but because the mesh is a bit more complicated, how can I generate the UV mapping data for it? This is what the mesh looks like, the numbers in green are vertices.

Image: http://tinypic.com/r/2j4ops9/8

The texture that I will be using for now is: http://i57.tinypic.com/d5rw8.png

And if it would help, I am expecting the ring to look something like this using the texture that I've provided: http://i61.tinypic.com/15hdc8o.png

Comment
Add comment · Show 5
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 Eric5h5 · May 14, 2014 at 06:01 PM 1
Share

It depends entirely on how you want the texture to be mapped.

avatar image DylanWilson · May 14, 2014 at 06:12 PM 0
Share

Sorry, I am still learning about UV mapping. Can you explain a bit more? Like, what would cause me to want the texture to mapped in a certain way?

avatar image supernat · May 14, 2014 at 06:23 PM 1
Share

I think what Eric5h5 means is it depends on how your texture is laid out. If you have a texture let's say with multi-colored rings on it that should map to this ring (I'm assu$$anonymous$$g it's a 2D ring from the image you posted), then the texture coordinates will depend where the rings are located on the texture, and how they are laid out. If you laid the rings in the texture as several parallel vertical colors, the texture coordinates would be different from if you had laid the rings out in a circle in the texture. 2D Texture coordinates are just a means of saying "this vertex should be at this X,Y point on the texture" and the pixel shader will handle interpolating the areas between each vertex with a linear approximation of the location in the texture that is between vertices. If you post your texture, we can give some better help.

avatar image DylanWilson · May 14, 2014 at 06:37 PM 0
Share

Thanks for the response supernat, it was very helpful. The ring that I've generate is actually 3D. I apologize for not mentioning this before but, the camera is top-down (therefore, its at the X,Z point). I... don't really have a texture for the ring yet. I thought that the first step was to create the UV mapping and then the texture. But, now that I think about it, that wouldn't make any sense. What if the texture is laid out like a horizontal rectangle? Once again, thanks.

I think I will use this texture for now: http://i57.tinypic.com/d5rw8.png

And if it would help, I am expecting the ring to look something like this using the texture that I've provided: http://i61.tinypic.com/15hdc8o.png

avatar image supernat · May 14, 2014 at 07:36 PM 1
Share

Well I think you have to create the texture knowing how the UV will be mapped and map the UV knowing how you plan to create the texture :).

If you just want solid colors, consider using vertex color ins$$anonymous$$d of textures. That texture will be difficult to do what you want. Well first, I'll say there's a transition between red and blue, and blue and green, but if you expect a transition between red and green that looks similar, you need to redo the texture and have the left side fade from green to red and right side fade from green to red. If you do that and you have pure green on the left edge, transitions to pure red, transitions to pure blue, transitions to pure green, and finally transitions back to pure red on the right edge, the following would work.

You would just concentrate the majority of your vertices to a single texture coordinate in the middle of a particular color (lets say red you would set the coordinate so that vertices 14, 15, 0, 1, and 2 all lie at the pure section of the red part of the texture. Then 13 would lie toward the red/green transition on the left side, and 3 would lie toward the end of the red section almost into the blue.)

The issue you'll have is mapping between the red and green areas because the pixel shader will interpolate from the left side of the texture to the right side of the texture causing a rainbox right between vertex 13 and 14. If you set the clamp mode to Repeat and add a duplicate vertex at 14 whose coordinate falls into the new area I mentioned adding to the right side of the texture above, and set the original vertex inside the area to the left side of the texture that you added, making sure that both lie at the same spot relatively speaking (same green/red transition point but one on left side of texture the other on right side).

Alternatively, you can create a texture that looks more like the mesh (where the bars go around in a circle but are angled like the mesh so not really round). Then you don't have to add new verts, because all vertices will transition on the same texture properly. Hope this all makes sense...

0 Replies

· Add your reply
  • Sort: 

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

22 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

Related Questions

Split a mesh while using same UVs and texture position. 0 Answers

UV Mapping for 2D Meshes with 3 Vertices Only 1 Answer

stretched UV map in generated mesh 0 Answers

Apply texture to a mesh on all 3 sides 2 Answers

UV Tiling/repeat 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