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 piter909 · Feb 15, 2019 at 03:43 AM · texturegraphicsmodelvoxelgraphic

White lines between blocks in voxel terrain

Hello. I am having a problem. I am beginner with unity3d and I am trying to create voxel terrain generator.
When I render some chunks there are white lines between cubes.
I have set filter mode to POINT.
This lines are only visible in game, not in unity editor.
What is the cause?

Here is screnshoot how it looks in game:
alt text
and here how it looks in unity editor:
alt text

Thanks for any help!

deep-2.png (262.8 kB)
deep3.png (230.4 kB)
Comment
Add comment · Show 4
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 Ymrasu · Feb 15, 2019 at 04:29 AM 1
Share

To rule out any graphics settings have you tried changing from fantastic to fastest? Its in Edit -> Project Settings... -> Quality

avatar image piter909 Ymrasu · Feb 15, 2019 at 04:37 AM 0
Share

Thanks for reply. When I switched from "ultra" to "medium" then lines disappeared. How to avoid this texture glitch on quality better than medium?

avatar image piter909 Ymrasu · Feb 15, 2019 at 04:40 AM 0
Share

I have noticed that it is caused by anti aliasing but.. why?

avatar image piter909 Ymrasu · Feb 15, 2019 at 05:51 AM 0
Share

I have changed renderer path to "deferred" but now anti aliasing is completly not working. :(

1 Reply

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

Answer by Ymrasu · Feb 15, 2019 at 02:05 PM

Anti aliasing blends the edges of textures together to attempt to smooth out harsh lines. That is why the edges of your voxels have the white lines, they were blended with a white or transparent color.

I think the way to fix it while keeping anti aliasing on was to adjust your UV mapping. Instead of say going from 0f to 1f of the texture you start at 0.01f to 0.99f so it blends with the remaining pixels of your texture, or something along those lines. Though I could be remembering wrong.

Comment
Add comment · Show 5 · 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 piter909 · Feb 15, 2019 at 03:28 PM 0
Share

I have texture atlas that holds 8x8 (pixels) block faces textures. I am mapping all uvs using this simple method: https://pastebin.com/WPST7bbF So, for example, if atlas has size 16x16, then it will grab 4 textures 8x8. Is there any mistake in this code? Thank you for helping.

avatar image Ymrasu piter909 · Feb 15, 2019 at 05:31 PM 1
Share
 float offset = 0.01;
 Vector2[] uvs = {
                     new Vector2(uv1x - offset, uv1z - offset), // top-right
                     new Vector2(uv2x - offset, uv2z + offset), // bot-right
                     new Vector2(uv3x + offset, uv3z + offset), // bot-left
                     new Vector2(uv4x + offset, uv4z - offset), // top-left
                 };

You can adjust the offset to see how it affects the texture on the blocks. It moves the vertices a little closer to the center of the texture your grabbing. If you don't see any improvement, then this wasn't really an issue.

avatar image piter909 Ymrasu · Feb 16, 2019 at 02:19 AM 0
Share

Thank you! Offset completly fixed this problem. You were 100% right, it was uvs problem. Your code that you pasted had mistake with correct uvs order (it should go antyclockwise). I have also modified offset to 0.0001 because 0.01 was far too big.

     new Vector2(uv1x - offset, uv1z - offset), // Top right
     new Vector2(uv2x + offset, uv2z - offset), // Top left
     new Vector2(uv3x + offset, uv3z + offset), // Bot left
     new Vector2(uv4x - offset, uv4z + offset),  // Bot right

Show more comments
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

148 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 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 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 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 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 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

Texture issues after converting voxel model (.vox) into DAE and texture files for use in Unity 1 Answer

Texture missing data 1 Answer

Is it UV map problem or others ? 0 Answers

How to automatically add physics/colliders to a model of a map 1 Answer

Free Character Models 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