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 Eoghan · Feb 14, 2014 at 11:36 PM · cubevoxel

Unity - cube primitive clipping issues?

I'm currently building a voxel-based map system; however, I've found that Unity appears to have issues with the cube primitive "clipping"; i.e: two cubes placed perfectly side-by-side, but when viewed from a certain angle, will show a gap between them.

example; http://i.imgur.com/eOix3E3.png

This is generally quite difficult to pinpoint from a player perspective; you need to stop in precisely the correct position to see this. However, these lines are constantly appearing/disappearing as you move the map around; for the player, it results in the map looking like it's constantly flickering. It's quite painful to look at for an extended period of time.

Would anyone have any ideas on what causes this, and how it can be repaired?

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
1
Best Answer

Answer by erick_weil · Feb 15, 2014 at 03:03 AM

you need to use a diferent algoritm to generate that "voxel" world, you need a LOT scripting to make a mesh that only shows the surface, the visible portion, not all the cubes will be rendered, only the vetices that have in the surface, and this will solve the VBO problem, you have 2048 VBO! and 643 draw calls! this is not effycient.

see that tutorial ( in C#) to make a nice cubic voxel mesh;

or try to uderstand my smooth Marching Cubes voxel-based game

and see that !

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 Eoghan · Feb 15, 2014 at 06:13 PM 0
Share

That's a shame - the cube primitives were working quite well. The draw calls went through the roof due to some additional models I was adding into the scenes for testing.

Literally the only problem is the clipping - and due to the nature in which the voxels are being manipulated by the player, the cube primitive really works perfectly here. Is there no way to solve this clipping issue and continue using the cube prefabs I've built the game around?

avatar image erick_weil · Feb 15, 2014 at 07:49 PM 0
Share

the clipping occurs because have some triangles that is in the same position(face is shared), with a surface generation for the terrain, the clipping will disappear.

I don't see any other ways to solve this and continue with shared faces, faces sharing the same space will create cliping.

but if your terrain is all plane, try to Instantiate quads ins$$anonymous$$d cubes.

avatar image Eoghan · Feb 15, 2014 at 07:57 PM 0
Share

The terrain is literally all cubes - just one layer! It's not being made in a $$anonymous$$ecraft digging style or anything like that. Each cube is actually it's own prefab based on terrain type - the map generator script loads them all in, and assigns them placement on the map based on position (i.e: snow/tundra at the poles, desert in the center).

It was very fun to write up, but this is literally the only problem I'm faced with now. They're also set to switch to planes based on LOD settings.

avatar image erick_weil · Feb 15, 2014 at 08:46 PM 0
Share

i sayied that if your terrain have no mountains or caves, is all in the same y position, is a flat terrain, is plane, is all in the same layer.

try... do not use cubes, use quads, and the cliping will disappear

and the performance gives up, cubes( formed by 24 vertices and 12 tris ), quads( a plane formed by 4 vertices and 2 tris )

but the quads have a mesh collider, and any other mesh coliders with the convex not marked will not collide with the quads, solve this by create a GREAT invisible cube with a box collider...

avatar image Eoghan · Feb 15, 2014 at 08:51 PM 0
Share

That does sound like a much better idea - however, the reasoning behind using voxels is that it's a strategy game, where players can move/manipulate the map.. i.e: raise terrain themselves (moving the block up above the ground, or below the ground.

That's why I went with cubes. The blocks need to be capable of being seen at all angles. If I were to use a quad, I'd surely have to use 6 of them to recreate a cube, and I'd be back to square one?

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

Best way to render bunch of cubes/planes? 3 Answers

Voxels and LOD in Unity 1 Answer

Help: Shooting a cube 1 Answer

highlight a portion of a mesh in runtime 1 Answer

Create a circle using cubes? 3 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