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 Avash · Jul 31, 2015 at 10:39 PM · c#meshuv

How do I texture a mesh runtime?

I need to texture my procedural mesh runtime. How do I do it? Unwrapping.GeneratePerTriangleUV seems to be removed. Also how do I get height and normalmaps to work?

I'm sorry, I moved this to forums: http://forum.unity3d.com/threads/texturing-and-uv-mapping-a-procedural-mesh.345001/ I also shared the code.

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 Cherno · Jul 31, 2015 at 11:26 PM 0
Share

You don't "unwrap" it. You just assign the vertex indices to the UV array of the mesh in the right order. Take a look at the Scripting API for $$anonymous$$esh.uv.

avatar image Avash · Aug 01, 2015 at 12:38 AM 0
Share

I just want to texture my mesh...

2 Replies

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

Answer by Avash · Aug 08, 2015 at 03:43 PM

Solution: material.mainTexture.wrapMode = TextureWrapMode.Repeat; and calculating tangents. Eric was kinda right but it didn't help me.

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
1

Answer by Eric5h5 · Aug 01, 2015 at 01:00 AM

Set the UV array for the mesh. Each entry in the array corresponds to the appropriate vertex in the vertex array for the mesh. What values you use depends entirely on how you want to texture the mesh.

Comment
Add comment · Show 6 · 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 Avash · Aug 01, 2015 at 11:15 AM 0
Share

I still don't understand how do I set the UV array. Do I have to calculate it for every single surface?

avatar image Cherno · Aug 01, 2015 at 11:16 AM 0
Share

Did you take a look at the Scripting API for the $$anonymous$$esh class and for $$anonymous$$esh.uv?

Also, take a look at this tutorial which should explain it:

Procedural generated mesh in Unity part 2 with UV mapping

avatar image Avash · Aug 01, 2015 at 11:47 AM 0
Share

Yes... I read that but.. I don't know how to do that with my mesh.. I want a continous texture.

avatar image Cherno · Aug 01, 2015 at 12:54 PM 0
Share

I'm afraid to say that you are not really helpful. What have you tried so far? Post your code and then maybe other users will be able to help you. If are are not prepared to do your part of the process, which is reading, understanding, and trying, and then asking questions, it'll be hard to come to a solution.

avatar image Eric5h5 · Aug 01, 2015 at 03:26 PM 0
Share

As I said, what values you use depends on how you want to texture the mesh. If you don't understand how UVs work, then step 1 is to learn that. Then you can figure out what values would do what you want for whatever it is that you're generating.

Show more comments

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

25 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

Related Questions

Distribute terrain in zones 3 Answers

Set UVs depending on input 1 Answer

Mesh texture not properly rendered 0 Answers

Best way to optimize mesh updating through code? 1 Answer

uv sub meshes in cube c# 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