Volumes Of Fun
http://www.volumesoffun.com/phpBB3/

Problems with PolyVox CubicSurfaceExtractor
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=2&t=136
Page 1 of 1

Author:  beyzend [ Thu Feb 03, 2011 11:48 pm ]
Post subject:  Problems with PolyVox CubicSurfaceExtractor

Hey, I got around to updating my custom CubicSurfaceExtractor (the one with the RLE thing) to work with the Material class (specially using Material8 right now) and while custom extractor seems to work I have not gotten the CubicSurfaceExtractor to work. By work I mean I get buggy output, where world origin for a region is off (so different "pages" are loading into the same few spots), and materials are switch between different materials(I guess this is also because multiple chunks are going into the same place, same as the first symptom). Just letting you know; I'm probably screwing something up somewhere and assuming the wrong things regarding world coordinates.

Author:  David Williams [ Fri Feb 04, 2011 6:34 pm ]
Post subject:  Re: Problems with PolyVox CubicSurfaceExtractor

The generated mesh has an associated Region (called m_Region) which corresponds to the Region you passed into the surface extractor. The lower corner of this region is essentially your offset, and the vertex positions are relative to this.

Does that match what you are seeing, or is there a problem in the way that Region is being set?

Author:  beyzend [ Fri Feb 11, 2011 7:03 am ]
Post subject:  Re: Problems with PolyVox CubicSurfaceExtractor

The problem is that since I have multiple regions (chunks) which I stream into a single Volume but I also only store the "origin" of this Volume and not per region. This is so because I would generate Ogre manual object per chunk, which is simply a region within this larger PolyVox::Volume; the region then gets multipled by the PolyVox::Volume's world transform (the parent of the region(s) in question.) Basically my regions are in local space of the Volume. I've adapted my custom RLE based extractor to take in this into account. PolyVox's cubic extractor extracts regions that are in that region's local space (regionX = x - region.startX, etc).

To get it to work with PolyVox's extractor I need to modify my code to store every region's world origin, instead of one origin for the entire volume (which by the way, is very large vs. the regions within it). That or I modify the default extractors to not output in region local space but instead just work with the x,y,z of the passed in region objects, assuming that the regions are in the local space of the Volume that the region belongs to.

Author:  David Williams [ Fri Feb 11, 2011 6:16 pm ]
Post subject:  Re: Problems with PolyVox CubicSurfaceExtractor

Ok... I think I'm with you. So are you trying to switch back to the standard CubicSurfaceExtractor, or you just want to get it working for debugging purposes or something?

As a side note, the large volume support is coming along nicely (see this post) so maybe that simplify things for you by removing the need to maintain several volumes.

Author:  beyzend [ Sat Feb 12, 2011 1:59 am ]
Post subject:  Re: Problems with PolyVox CubicSurfaceExtractor

It's not a big change for me to store the origin for each region I extract, so it will do for now. Other than that I definitely can't wait to try out the big volume thing.

So don't worry about this, it's been fixed, on my side. Was my bad to begin with. Thanks :)

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/