So, I’ve posted a new release:
https://simsilica-tools.googlecode.com/svn/trunk/IsoSurfaceDemo/release/IsoSurfaceDemo-Windows.zip
https://simsilica-tools.googlecode.com/svn/trunk/IsoSurfaceDemo/release/IsoSurfaceDemo-Linux.zip
https://simsilica-tools.googlecode.com/svn/trunk/IsoSurfaceDemo/release/IsoSurfaceDemo-MacOSX.zip
Controls are still the same as in this post:
http://hub.jmonkeyengine.org/forum/topic/isosurface-demo-dev-blog-experiment/page/2/#post-289215
In this version I have added 4 different types of trees with full LOD. They are batched right now. I’ve been trying to stay compatible with JME Stable for as long as possible. The next release of the IsoSurface stuff will probably be built against JME trunk so that I can take advantage of instancing.
The other feature I added was the ground atmospherics. You have to turn them on in the “ground” tab. With that, I also added a ground disc which kind of takes up the gap between where the water stops and the horizon. It looks better than a black bar but not much… works much better without water but then you won’t have water.
On the “dev blog” side, I spent about 10 hours on Saturday hunting around for ‘leaks’ in the paging system. The tree layers rebuild themselves on the fly as LOD tile ranges change. The state tracking in the Pager/Builder was a little too naive for this and there were some instances where zones weren’t getting released properly.
On the one hand, this is not a classic leak as the garbage collector will eventually catch them. On the other hand, I’ve tried really hard to have the zones free their meshes as they don’t need them anymore. So having zones go unreleased meant mesh buffers were hanging around longer than needed. I suspected that this was a major source of the OutOfMemory errors that I was receiving.
So after a lot of counting, state tracking, etc. I finally fixed all of the issues in the pager/builder. It’s internal state tracking is way more explicit now and can easily be transferred to a state diagram. The bottom line is: while there may still be bugs lurking in there my confidence in the state management and life cycle is 1000x greater than it was. For one thing, as I said, it’s provable on paper now (where it was hard to do before). And for another thing, the explicit state tracking also comes with a whole bunch of new errors being thrown if things end up in a wonky state. The last three state bugs I fixed on Saturday night were because of typo-level mistakes and finding them was instant precisely because of the new error handling. For something this core to everything, it’s kind of worth it in the long run.
At any rate, it turned out that there was also at least one memory “leak” in the TreeZone, too.
The kicker to this story: even with all of the memory and state fixes, I still get OutOfMemory errors when wandering around long enough. And when I do, I’m not even close to the limits. My suspicions are that this may be OS related at this point. I’ve given the app 768 meg of direct memory and I’ve seen it run out at 300 with the process total not even exceeding 500 (including the regular heap). So either I’m hopelessly fragging the heap or this Windows XP 32 bit instance just decides to stop giving the app more RAM at some point. There is strong evidence to suggest that is the case… namely that when I run the app on a fresh reboot it tends to run fine.
Anyway, hopefully your luck running it for extended periods will be better than mine.
And finally, a couple screen shots: