Eldemarkki / Marching-Cubes-Terrain

Marching Cubes terrain implementation in Unity using the Job System and the Burst compiler
MIT License
562 stars 80 forks source link

[Physics.PhysX] cleaning the mesh failed #22

Closed CHenBuCHen closed 4 years ago

CHenBuCHen commented 4 years ago

I don't know this my promble or is a bug or something else. This appears in "Heightmap World Example" .
I open with Unity2019.3.2f1. And I really like this project. I appreciate your work.

image

Eldemarkki commented 4 years ago

I’m aware of this bug, but currently I don’t really have ideas as to what is causing it. The most logical reason in my opinion is something to do with the density calculation in HeightmapDensityCalculationJob.cs. I will probably try to fix this soon.

Eldemarkki commented 4 years ago

I have figured out what is causing this, but haven't thought of a solution yet. It is caused when a chunk's only mesh is a tiny edge. It can be seen in this video: https://vimeo.com/399672667. The grey box (which can be barely seen) is the chunk that is causing the error. At 8 seconds in the video, I'm showing the edge that is inside the error-chunk causing the problem.

CHenBuCHen commented 4 years ago

Hello,I fork you project ,and create my tools based on it. In my project I can editor terrain in editor mode and save chunk states ,serialize densities. You can use "tools/Create Voxel World" create terrain. Tools are simple ,not easy to use. I'm thinking about translate FBX/OBJ to terrain . The problem is this, I want to reproduce bug in my tools, but it does not appear. I notice in your project when amplitude = 30, 34, 40,60,68. error message appear(I had try amplitude =1-70). In my tools error messages does not appear. (For example when amplitude = 30 , in your project chunk_4_0_11'mesh has 30 verts 10tris, in my project chunk_4_0_11'mesh has 0 verts 0tris) I don't know what's happend, and what's the difference between this.I'm not sure if I solved the bug or if the bug will appear at other values / I'm a terrible programmer,with ugly code. :( / . I hope this can help .https://github.com/CHenBuCHen/Marching-Cubes-Terrain 微信截图_20200330233243 微信截图_20200330233300 微信截图_20200330233459 微信截图_20200330233534

Eldemarkki commented 4 years ago

Fixed in develop branch. Commit id: 67a254fd202c588cdcc7c3d95497312b06b7d813

Eldemarkki commented 4 years ago

Fixed in master