Tuesday, July 3, 2012

More about voxel meshing

The 0FPS blog has a great article about meshing, that ties in nicely with my latest couple of posts here, and explains it better and in more depth than I ever could. Go check it out!

And after recording and posting that video about transparent surfaces, I've ran into cases where the sorting method does not produce the desired results. Back to the drawing board. :)

2 comments:

  1. Oh? What sort of cases does the sorting fail on? I would have expected Manhattan distance to always be sufficient for sorting depth, at least for grid-constrained objects.

    ReplyDelete
    Replies
    1. Is is, and the chunks themselves are sorted just fine.

      The situation only arises in the chunk the camera is in. All slices that face the same way are also sorted correctly, but for example an east-facing slice could have a face that is drawn out of order wrt one in a north-facing slice.

      The only way I can think of right now to fix this would be to keep separate buffers for all slices that contain transparent faces, and draw them in order based on the camera's position. I'm not sure the extra draw calls and code cruft is worth it, so I'll just leave it for now.

      Delete