I've been working on a "little" project using PolyVox's marching cubes surface extractor to build my terrain, which is working very well so far. I've had some issues trying to get it to work with multithreading but I've decided on a workaround in which I just create multiple PolyVox Volumes, one for each thread, and allow each Volume to hold a very low number of blocks. Inside the LargeVolume dataRequiredHandler I fill the world from a threadsafe source (with shared mutex's). This does increase my memory obviously, but so far my memory usage is very acceptable. And the building speed is great.
Anyway, reason I'm posting here is because there is a lack of nice MarchingCubesSurfaceExtractor pics! (everyone seems to be liking cubes more!)
(all art (textures, models) is temporary borrowed from ogre or other free art sources)
Basic terrain screen, there are still quiet allot none smooth edges, but this has more to do with the way density is being generated since i can make a perfect sphere aswell...)
Attachment:
terrain1.jpg [ 50.24 KiB | Viewed 10302 times ]
Terrain with some grass and trees (still allot of performance things to be done here, currently there is no lods or billboards being used, and viewdistance of grass not limited (goes as far as the terrain goes. Still, performance seems ok
)
Attachment:
grass1.jpg [ 90.95 KiB | Viewed 10302 times ]
Some water, which was more tricky to implement then initially thought about, since you cant really extract only the water surface.
Attachment:
water3.jpg [ 66.62 KiB | Viewed 10302 times ]
And a vid of me flying\walking through it
http://www.youtube.com/watch?v=qs_U-hCiKo0---
One thing to david, I've made a minor change in the MarchingCubesSurfaceExtractor which seemed more logical to me. Which is changing
Code:
typename Controller::MaterialType uMaterial = (std::max)(uMaterial000, uMaterial100);
to
Code:
const typename Controller::MaterialType uMaterial = m_controller.convertToDensity(v000) > m_controller.convertToDensity(v100) ? uMaterial000 : uMaterial100;
Because density is always present in marching cubes doesn't it make more sense to have a higher density have more influence over the material displayed? (I changed this because 0 density material was showing which made no sense to me)
Unless I'm missing something why this wouldn't make more sense?
--
Also, I'm 99% sure there is a memory leak in largevolume when you turn off compression. I haven't looked much into the reason behind it, but my memory skyrockets when turning it off. Especially with a very low max loaded block amount.