2
votes
Marching cube terrain generated by compute shader gives strange error
By default Unity handles only 65535 vertices in the mesh. You need to set
Mesh.indexFormat = IndexFormat.UInt32
to handle more vertices.
1
vote
Gaps between terrain chunks generated with marching cubes
I fixed this problem.
There were 16x16 vertices per mesh and new chunk coordinates were calculated as:
...
1
vote
Combining cubes Issue in Marching Cubes
Here is how to convert the raw triangles into welded vertices, face normals and vertex normals. It is a small code, and it works well:
...
1
vote
How would I go about coloring marching cubes terrain?
Once I have generated all of the triangles, I weld the vertices, and get face and vertex normals.
Once that's done, I stuff the vertex data (including position, colour) into a buffer and call ...
1
vote
Accepted
How to construct a octree density from SDF for MC
You use the octree to skip swaths of work.
Anytime you find an octree node that's fully outside or fully inside the volume, you can skip iterating any cells inside it because you know the surface won'...
1
vote
How to get normals from volume density grid?
To find the surface normal for any given marched cube, just average the face normals for all of the 1-5 triangles that are generated. A face normal is calculated here:
...
1
vote
Setting vertex colors for a marching cubes mesh
I gave this issue another shot, and I found a solution!
I figure that this will probably be helpful to someone in the future, so I will describe exactly how I did it, I will provide minimal code ...
1
vote
My vertex cache for reusing vertices in marching cubes algorithm in unity fails for one case, but I cant figure out what case
I figured it out! The problem was when there was a cache hit for vertex 8 in the behindLayer array, it didn't update currentLayer so then when vertex 11 checked if there was a cached index for vertex ...
1
vote
Unity Marching Cubes triangulation bug
I came across the same problem when developing my own system - the bug came from the order of the triangles index. I know it can sounds odd, but try tweaking them and you will see that the rendering ...
1
vote
Accepted
Marching cubes with destructible environment
You could add a user-defined function to the underlying perlin function.
For example, if the user adds a meta-ball function at a point x0, y0 z0 and with density d, then you add that function to your ...
1
vote
Using 2D Heightmap Data to generate terrain with the Marching Cubes Algorithm
You need to set a positions density to
Mathf.clamp(perlin - pos.y, 0, 1);
Instead of setting the values to either 1 or 0, this makes the top a bit more smooth. ...
1
vote
1
vote
How to construct the marching cubes tables algorithmically?
Disclaimer: Not tested yet. Edit: Tested and works, code on demand.
The configuration, or rather the mesh, can be calculated in a slightly simpler, in my opinion, way, although this is less efficient,...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
marching-cubes × 41voxels × 18
unity × 14
c# × 8
terrain × 6
perlin-noise × 5
procedural-generation × 4
3d-meshes × 4
mesh × 3
terrain-rendering × 3
octree × 3
c++ × 2
mathematics × 2
textures × 2
normals × 2
sphere × 2
level-of-detail × 2
compute-shader × 2
triplanar-texturing × 2
opengl × 1
java × 1
collision-detection × 1
path-finding × 1
hlsl × 1
software-engineering × 1