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 Ahmad45123 · Jan 04, 2016 at 11:18 PM · meshuvaccurate

A question about UVs being not accurate.

Hello,

I am creating a voxel game, each chunk is a mesh that contains 16*128*16 blocks. And I get textures from a 16*16 texture map with each texture being 32*32 so the whole file is 512px*512px

To calculate the UV for each block, I do the following:

 newUV.Add(new Vector2(0.0625f * texturePos.x + 0.0625f, 0.0625f * texturePos.y));
 newUV.Add(new Vector2(0.0625f * texturePos.x + 0.0625f, 0.0625f * texturePos.y + 0.0625f));
 newUV.Add(new Vector2(0.0625f * texturePos.x, 0.0625f * texturePos.y + 0.0625f));
 newUV.Add(new Vector2(0.0625f * texturePos.x, 0.0625f * texturePos.y));

Note that 0.0625 is simply 1 / 16

So the problem is, With a such big texture map, Its not precise, The textures always have an edge from the other texture near it, So I am asking if there is a way to use like sliced image or simply use pre-calculated x and y, X being <= 512 and so do to Y.

Here is how it looks right now: https://i.gyazo.com/8bba574d4cdaab92251a69318ed52f12.jpg

As you can probably see, There is some white lines in between the textures that I don't want.

Any help is really appreciated, I just need to be directed to the correct way :)

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
0

Answer by Tonks · Jan 05, 2016 at 03:52 PM

Bleed. If your UV map goes right up to the edge of the map, then you will get these artefacts. It's a bit hard with 16x16's, but usually you'd have several pixels of bleed to prevent this.

Comment
Add comment · Show 2 · 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 Ahmad45123 · Jan 05, 2016 at 09:39 PM 0
Share

Hey, first of all, thanks for your answer.

I am kinda new to unity and the whole game development thing, What do you mean with "bleed" ?, Do you mean that I should add borders to the textures ?

avatar image Tonks Ahmad45123 · Jan 06, 2016 at 10:41 AM 0
Share

No problem :) http://wiki.polycount.com/wiki/Edge_padding This should explain it far better than I can.

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

Object odd light problem with mesh? 1 Answer

Procedural Mesh UVing 2 Answers

Updating UV in imported mesh without having to re-material 0 Answers

Unity Shadergraph Alpha threshold problem 0 Answers

PackTextures: many materials or many meshes? 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