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 Nickpips · Jan 07, 2014 at 03:14 AM · c#voxelmesh manipulation

How to make discontinuous UVs?

I'm making a voxel world in which terrain is made up of cubes. I grouped these cubes into meshes to be efficient, but if I want the sides of cubes to be mapped to a different texture than the rest, how would I do so? As in, I want more than one png to be mapped to a single mesh, or be able to map UV's without lines being showed. (If you don't know what I mean: [Lines at cube borders and darkened at a certain distance][1]).

UVs weren't ment to be used that way, so how can I have multiple pngs on a single mesh without having to generate a custom texture each time (Though a viable solution, I'm trying to conserve memory)

(If you need a specific piece of code, I'll post it) [1]: https://dl.dropboxusercontent.com/u/138461102/Untitled.png

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 Eric5h5 · Jan 07, 2014 at 03:26 AM

Add padding around each section in the texture, or turn mipmapping off (not recommended, looks bad).

Comment
Add comment · Show 26 · 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 Nickpips · Jan 07, 2014 at 03:31 AM 0
Share

I've tried both, but turning off mipmappping doesn't fix it and padding could work but its must more complex to extract the UV coordinates from 0f to 1f if there are intermediate pixels. If I don't have other options I'll resort to padding.

avatar image HappyMoo · Jan 07, 2014 at 09:58 AM 0
Share

Had the same Problem and solved by setting Filter$$anonymous$$ode=Point, which actually fits the theme. $$anonymous$$ipmapping shouldn't be a problem if you use powers of two for your tilesize. If you add padding to fix the Filtering problem, this would actually introduce problems for mipmapping, but the padding will fix those problems again, so Padding fixes Filtering- and $$anonymous$$ipmap-Problems if you dont want to go the Filter$$anonymous$$ode=Point route.

Just to make sure because you are ambiguous in talking about multiple pngs - are we talking mulitple materials here or selecting different tiles by UV (what i think)?

avatar image Nickpips · Jan 07, 2014 at 11:14 AM 0
Share

@Happy$$anonymous$$oo I have the filter mode set to point, but in the far distance I can see seams because it is scaling down the textures. $$anonymous$$ipmapping is off. What I originally ment was multiple materials, but since that wasn't really possible I select tiles by UV. I even tried undershooting, not using the entire texture and it still grabs a little color from surrounding pixels unless I'm a full pixel away, which is essentially padding.

avatar image HappyMoo · Jan 07, 2014 at 12:26 PM 0
Share

Well... now that you say it, maybe I have such artefacts in the distance too and I just didn't see them - I just played with it for 2 days to see if I could do it http://i.imgur.com/ZIA4Cxj.jpg

What I would try first is putting the UVs in the middle of the pixel, not around the edge, so if your tiles are 32x32, set your UVs to select the 31x31 px you get when you go 0.5px in from the edge. Now, I would only do this because these are blocks and you don't see half a px on all sides with point filtering anyway - however, if you go for a Bilinear Filter later, you need to pad more.

avatar image Nickpips · Jan 08, 2014 at 01:18 AM 0
Share

@Happy$$anonymous$$oo Taking a look at your gameobject list, I'd suggest you have 9 (or 16) meshes for the chunk you're standing on, and any chunks bordering it, and 1 large mesh for everything else. 10 meshes max, that way you don't have a huge cascade of gameobjects, with wasted draw calls and such. Btw, I got around the issue with padding on runtime, so the texture supplier doesn't know about the padding.

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

19 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

Related Questions

Multiple Cars not working 1 Answer

Distribute terrain in zones 3 Answers

An OS design issue: File types associated with their appropriate programs 1 Answer

Getting meshes to render properly, and coloring triangles of a mesh 0 Answers

Moving an hole in a plane 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