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 Dagohan · Oct 25, 2014 at 04:32 AM · materialprocedural meshvoxeluv mappingmeshfilter

Merging faces without effecting texture mapping

Hi,

I'm working on a voxel-based project and wanted to optimize generated chunks. I have already taken a look in the thread and learned a lot from people's experiences whom are trying to do the same.

There is one thing that people talked about and implemented which I don't know how they did in Unity.

Suppose we have 2x2 quads laying together like this:

alt text (Black lines are not part of the texture. They are to indicate boundries of quads)

They are using same material with same texture. Now that I want to merge this 2x2 quads togather and want to generate a single quad like this:

alt text

How is it possible that I can define these newly obtained 4 vertices to repeat the same material's texture 4 times without changing material tilling/offset. If I map the newly 4 vertices as I have mapped the smaller ones I would end up with a single streched texture like this:

alt text

People in the thread were mentioning about usage of sub-meshes but I can't see how it would help in this situation since it is only a different set of triangles to apply with a different material as far as I know.

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Itaros · Oct 25, 2014 at 05:22 AM

Welcome to this awesome world of vertex splitting and UV math. splitted vertices diagram

You need to represent one tiling as separate quad with its own vertices as part of one mesh. This is common technique used when normals are not continuous across surface in the obj import, for example.


vertices.png (2.4 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
avatar image
0

Answer by Dagohan · Oct 25, 2014 at 05:05 PM

Turns out it is possible to do by mapping UVs of vertices between 0-X (X means how many times you want that tile to repeat it self in that coordinate).

With an example:

Suppose we have a material with texture: (tilling x,y: 1 / Offset x,y: 0)

alt text

If we want this texture to repeat it self as many times as we want in either axis by only using 4 vertices, we map UVs as:

alt text (2 times in X and 2 times in Y axis for this example)

The main idea is we don't use UV's between 0.0 and 1.0. That being said, this method enforces you to use 1 texture per material. Which prevents you from using Texture Atlas.

I don't know if there is a way to use both a TextureAtlas and make this kind of tilling with 4 vertices. Although the method I mentioned above will help you decrease your vertices count if a lot of faces are using same textures but it comes with a side effect of enforcing you to use 1 material per texture (ends up increasing your draw calls).

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

Whats causing this weird texture stretching on my mesh? 1 Answer

How do I assign a mesh's UVs so that part of a part of a mesh is one part of the texture and another part of the mesh is another part of the texture 0 Answers

Can I Assign Different Material To Each Quad In A Mesh? 1 Answer

What's the right way of generating a procedural mesh from an known outline? 2 Answers

need guide in uv texture 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