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 grahnzz · Aug 06, 2014 at 10:34 PM · chunksvoxelsmarching cubes

Editing voxels @ chunk borders

At the moment I'm also editing the neighboring chunk if the current voxel is at the end(or beginning) of its chunk. I know that there is more cases when we are editing at edges and corners of each chunk, but I'm not writing those until i get some clarification of whats going on here.

I'm using marching cubes for the mesh generation, if that makes a difference. Maybe editing 1 voxel at the time is not possible with marching cubes if i want aligned geometry between chunks?

If someone checks in that have done this before, please give me some insight in how you handled cross-chunk editing.

alt text

Update #1: I got way better results when i removed clamping of the voxel values...

 chunk.voxels[ix,iy,iz] += mod;
                 if(clampVals)
                     Mathf.Clamp(chunk.voxels[ix,iy,iz],-1f,1f);

as u see i limited the values between -1f to 1f, i thought that was a good idea, but i wasn't thinking of what values existed in there from the terrain noise, obviously those values wasn't in that range (stupid me)

Comment
Add comment · Show 6
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 Sessional · Aug 06, 2014 at 10:55 PM 0
Share

Some details of your implementation would be nice - are you holding chunks in an array or are they holding on to the neighboring chunks by any chance?

avatar image grahnzz · Aug 06, 2014 at 11:33 PM 0
Share

The chunks are stored in a Dictionary so they can be retrieved by key value which is their position

avatar image Sessional · Aug 06, 2014 at 11:34 PM 0
Share

I'm assu$$anonymous$$g these gaps that form in the right image as you modify terrain are on chunk borders? It looks like the stitching algorithm is slightly off.

avatar image grahnzz · Aug 07, 2014 at 01:31 AM 0
Share

yes those gaps is at the borders

avatar image Sessional · Aug 07, 2014 at 01:36 AM 0
Share

So, what I'd be curious to see is find a spot where the happens and look at the coordinates - it looks almost like your vertices are not pushing far enough towards the corner of the allotted segment they are supposed to be in.

Show more comments

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by MisterBinny · Nov 30, 2014 at 07:22 AM

It looks like you found the solution already. I struggled with this also.

There are a few things that cause this:

1) The algorithm for altering the data in adjacent chunks isn't continuous/smooth (So the seams in neighboring meshes start to tear like this.)

2) The algorithm you're using for the density of the 3D array is not smooth (meaning the values of adjacent array elements are too far apart)

3) The values you are using are outside the threshold for generating the polygons

Anyway, looks good.

Comment
Add comment · Show 1 · 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 grahnzz · Dec 02, 2014 at 04:20 AM 0
Share

Your words describes the causes pretty good, in my case it was the second example you mentioned because i had some math.clamp() when modifying the noise, this would have been fine if i did the same when generating the noise. You have to be coherent when you are dealing with your voxel values.

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

23 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

Related Questions

How to make a smooth voxel world 2 Answers

Voxel Terrain , Trees , Destruction - help please 0 Answers

How to create chunks 0 Answers

How to remove small & thin triangles from a marching cubes voxel engine? 2 Answers

How to implement sandbox system on a marching cubes voxel terrain? 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