Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 Dekaren · Aug 30, 2016 at 09:46 AM · meshuv mappingcreationtriangulation

Problems with UV on created mesh

Hi everyone!

I am trying to make an in-game map editor that will let user create asteroid belts and asteroid fields of various shapes by specifying vertices. (Something like that)

Currently I'm using a script from (this site), it works great because I can use the same script to handle both asteroid belts and fields.

The problem emerges when trying to assign a material to the object. Both via script and when assigning it manually. It seems like the image is scaled up so drasticly that no matter how large I set the Tiling, whole object uses only one pixel of the image. (When I switch it from Cutout to Texture the whole object is either fully transparent or black, also when manipulating Offset I can get other pixels of the texture to fill whole object) I think it's because of badly assigned UV, but I can't make much sense out of script from site above.

If somebody would help me understand what I'm doing wrong or maybe point me towards other methods of creating meshes in real time with holes in them, it will be greatly appreciated.

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 · Aug 30, 2016 at 11:45 AM

You don't have problems with UVs but you simply don't have UVs at all. The Uv coordinates would need to be created as well as the vertex positions.

However it depends on how you want the texture to appear on the mesh. If it's an arbitrarily created mesh there is no "one-fits-all" solution.

Look up UV mapping and first understand what it's all about. Each vertex has a Vector3 position which defines the location of the vertex in the 3d space. However if you want to use texture mapping each vertex also needs an additional UV coordinate (Vector2) which defines the position of the vertex in "texture space". You might want to download my UVViewer which allows you to view the UV map of an object inside Unity. Just try it with some of the default meshes (sphere, capsule, cube) and you see how each triangle is mapped onto the texture.

The process of mapping the triangles onto the texture is called "unwrapping" and it's usually done by the artists who created the model in a modelling software. This is usually a manual process, just like the modelling itself. Modelling applications often provide tools / complex algorithms to simplify the process.

When you create procedural geometry you have to care about everything yourself. If it's just a 2d mesh it might be a bit easier, but in the end it depends on how you want it to look like. For 2d a common way is to use the actual world / local space coordinates as UV coordinates. Just make sure the texture wrapmode is set to repeat.

From your question we can not determine how your meshes will actually look like and how you want the texture mapping to behave.

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 set UV (Map) for Mesh made by script without duplicating vertices? 2 Answers

How to make UV maps offset the same way? 1 Answer

Normal maps not applying to certain faces of a mesh 2 Answers

Apply texture to a mesh on all 3 sides 2 Answers

Combining meshes with correct tiling 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