Wednesday 24 August 2011

Minecraft .obj exporter part 2

My Minecraft .obj exporter can now export more than one chunk at a time. It took quite a bit longer than I hoped since the increased scale really brought to light the fact that I hadn't really paid a lot of attention to performance yet: things like parsing the regions lazily and building up the output as one giant string initially caused memory use to skyrocket. So I've spent the past few days learning a lot about Haskell performance, and it now performs much better. Memory isn't O(1) since I have to keep chunks in memory until all their neighbours have been processed, but since 3D Studio needs about 7-10 times as much memory to import the scene as I do to generate it it's of no practical concern anymore: if you run out of memory exporting a scene there's no way you would've been able to render it.

The main things still on the to-do list are:
  • Implementing the remaining materials
  • Implementing non-block geometry
  • Adding command line arguments so you can actually use the program with recompiling it
I've uploaded the project to GitHub: https://github.com/FalconNL/mc2obj

Below are two current WIP shots of an area of 32x32 chunks:


No comments:

Post a Comment