I'm getting very peculiar results from my marching cubes based surface generator within unity and figured this must be a pretty common problem that has been solved already, so I thought I would extract this out as a tiny example project that only includes the broken generation code ...


... if you download and run the example you should get something like this ...

enter image description here

... so my question is:

How can I resolve the logic in the marching cubes meshing code to generate a complete mesh with consistent uv mappings all the way around?

If someone can solve this I will edit the sample in this question with the solution so others can download this solution in the future.


So I figured out what was causing the vertex generation issue, it looks like paul burkes lookup tables however result in some cases returning the vertex data in different orders to others which appears to be the cause of this uv issue (see image, updated)

I have updated the sample project too, anyone fancy debugging the marching cubes tri table?, something tells me this will be a long winded task!


1 Answer 1


Ok so i figured it out ....

I'm still working my way through it but basically the problem is that unity and the lookup tables supplied by Paul Burke don't quite tally up as had suspected.

The process basically involves reshuffling each case so that the tri's orders and winding are correct for unity.

I'm little bit annoyed at this since unity uses OpenGL under the bonnet you'd expect the positioning system to be similar, that said I haven't seen anything published by paul burke that even remotely suggested he had ever tried to texture a mesh generated with his algorithm so maybe its just bad lookup tables that were published.


You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .