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

Help with Region Borders - demonstrates t-junction problem?
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=15&t=290
Page 1 of 1

Author:  Will Smith [ Tue Nov 29, 2011 3:19 am ]
Post subject:  Help with Region Borders - demonstrates t-junction problem?

Hello,

When filling a volume with data like this:
Code:
volumeData(Region(Vector3DInt32(0,0,0), Vector3DInt32(8, 1, 8)))

{0,0,0,1,0,0,0,0},
{0,1,1,1,1,1,2,0},
{4,4,0,0,0,0,2,0},
{4,4,0,1,2,0,2,2},
{4,4,0,4,3,0,2,2},
{4,4,0,0,0,0,2,0},
{0,4,3,3,3,3,2,0},
{0,0,0,3,3,3,0,0},



When surface extracting the 1 voxel(data 1) on the first x row, and 4 voxels(data 4) on the first z row have an issue with the outer voxel face not being built. I am using the CubicSurfaceExtractorWithNormals<SimpleVolume,MaterialDensityPair44>

I'm trying to setup loading and saving Voxel data for assets, so my regions for this purpose need to be tight. I would rather not use magic numbers or hacky larger regions to get it to work.

Author:  David Williams [ Tue Nov 29, 2011 7:56 pm ]
Post subject:  Re: Help with Region Borders

Yeah, I'm actually aware of this. You should switch to the regular CubicSurfaceExtractor if you can as this handles the edge cases correctly. It also performs decimation of the resulting mesh and is generally faster/better.

I only really intended the 'WithNormals' version to be used while people are becoming familier with PolyVox, as they may be confused by having to generate the normals themselves in shader code. I could fix the edge cases but it complicates the code (making it harder to learn from and maintain).

Can you switch to the regular CubicSurfaceExtractor?

Author:  Will Smith [ Tue Nov 29, 2011 10:02 pm ]
Post subject:  Re: Help with Region Borders

I am using vertex colouring instead of textures for my project so I shouldn't need the normals anymore. (Previously I was generating UVs and not using a shader for texturing)

I will try it when I get home. I was also having trouble getting mesh decimation to work properly so it's good to hear the regular CubicSurfaceExtractor will solve my issues.

Thank you for the quick response :)

Author:  Will Smith [ Wed Nov 30, 2011 6:00 am ]
Post subject:  Re: Help with Region Borders

Ok, Just converted it so I am using the CubicSurfaceExtractor<SimpleVolume,Material8> and it handles the region edges fine now.


I wonder if anyone with ogre experience might know why
I am having an issue with using meshdecimation (bMergeQuads).
When it's enabled and I move the camera around I see little flickers of holes(about the size of a pixel) in the mesh.

Thanks again for the help David :D

Author:  beyzend [ Sat Dec 03, 2011 12:25 am ]
Post subject:  Re: Help with Region Borders

Those holes are the result of t-junction problems. I don't think there is a way to resolve it unless you fix it by using skirts or split the polys properly. I'm currently using skirts and it reduces the problem to a barely noticeable level. But the way I'm using skirts is hackish so I may improve it later.

Another method is perhaps use tessellation if you have dx11 to get rid of t-junction.

Author:  Will Smith [ Sat Dec 03, 2011 4:38 am ]
Post subject:  Re: Help with Region Borders

thanks for the info, since my game is simple I don't want to use dx11 because despite being 2011 people still run winxp :{

I think for now I will just not use decimation and revisit this at a later time.

Thanks for the info :)

Author:  David Williams [ Sat Dec 03, 2011 7:24 pm ]
Post subject:  Re: Help with Region Borders

Interesting... I wasn't aware that there was a problem with t-junctions in the decimated mesh. But logically it does make sense that they could occur. Maybe I haven't seen them due to having antialiasing on or something.

Anyway, I would consider this to be a bug in PolyVox. Not sure if/how it can be fixed but I'll investigate. I'll also move this to the bugs forum.

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