It is currently Sat Aug 22, 2020 2:04 pm


All times are UTC




Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: Unresolved External Symbols
PostPosted: Sat Sep 03, 2011 1:18 pm 

Joined: Thu Sep 01, 2011 2:36 pm
Posts: 27
hmm yeah we have probably different definitions of "smooth" geometry, this is what I mean:
Image

And I have another question. I am trying to figure out how to set up a volume (from a heightmap) so that the extracted
surface doesn't have those "border sides".
And I also don't want the mesh to be smoothed at the borders.

What I plan to do is the following: In 3ds max I want to edit always only one terrain "sector/batch/chunk"
whatever you call it. Then when editing is done I click on "save to file" and then I have 6 buttons that allow
you to add a new sector to the left,right,front,back,top,bottom. the voxel volume will be cleared then and
editing on the new sector can start again.

So what I want is that the transitions from one sector to another are seamless. LoD will not be used yet.
So how would you do that?

And yes I'll post some screenshots of the final plugin (and what I do with it) in showcase forum.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Unresolved External Symbols
PostPosted: Sat Sep 03, 2011 6:35 pm 

Joined: Sat Sep 18, 2010 9:45 pm
Posts: 189
one method to make the border seamless is to make sure you have the needed data at the border in order to make it seamless. Surface extractors work by looking at neighboring blocks. This means when extracting data on a border it looks one block beyond the border, if you exceed the bounds during this it will just pretend that the next block is made up of air. When it assumes that the neighboring block is air that's when you get these "border sides".

What you could do is look into LargeVolume class which lets you defined the entire volume in a single world coordinate. So with that, you just make sure the chunk you're modifying has neighboring chunks in memory. Say you are modifying chunk X then when you save it, you decide to add a chunk to the left at X - 1, when you modify X - 1 have chunk X in memory still--seamless borders.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Unresolved External Symbols
PostPosted: Sat Sep 03, 2011 7:08 pm 

Joined: Thu Sep 01, 2011 2:36 pm
Posts: 27
Yes I aso thought of that. In that regard my question was actually pretty useless ;-)
Thank you and good luck with your project too!


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Unresolved External Symbols
PostPosted: Sat Sep 03, 2011 7:09 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Syphorlate wrote:
hmm yeah we have probably different definitions of "smooth" geometry, this is what I mean: ...


I think you should be able to get a smoother result than that out of PolyVox. What does your input data look like? Do you have one density inside the sphere and another density outside, or do you have a smooth transition from the centre to outside? Try the later, and see if the results improve.

The thing is, I don't expect 3DS Max's smoothing will work as well once you break your mesh up into seperate regions. 3DS Max won't kno the connectivity between the regions and you'll probably find that cracks get introduced.

Syphorlate wrote:
And I have another question. I am trying to figure out how to set up a volume (from a heightmap) so that the extracted surface doesn't have those "border sides". And I also don't want the mesh to be smoothed at the borders.


As beyzend says, the most important point is to only have a single large volume containing all your data, rather than a seperate volume for each region. So, you might want to use the LargeVolume class after all. If you do this it will probably just work the way you want. When you use the SurfaceExtractor you can pass an instance of Region to specify the part of the volume for which the mesh should be extracted.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Unresolved External Symbols
PostPosted: Sat Sep 03, 2011 8:19 pm 

Joined: Thu Sep 01, 2011 2:36 pm
Posts: 27
Yes I will do as you say. Indeed I have max density inside the sphere and zero density outside. So I'll interpolate the density or something.
Also I was wondering how the smooth function works. I applied it to the whole volume but don't know if it worked.

And what about life editing the terrain. You said I can extract a smaller region of the volume or do I have to reextract the whole surface everytime I use the brush on the terrain? No that can't be. But how do I update the mesh then after a brush stroke?

EDIT: I tried to interpolate the densities but this makes it look even worse. I am surely not doing it right. Maybe you have some sample function where you create a sphere or something with smooth densities?

Thank you guys for your help!
And have a nice weekend


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Unresolved External Symbols
PostPosted: Sun Sep 04, 2011 9:36 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Syphorlate wrote:
Yes I will do as you say. Indeed I have max density inside the sphere and zero density outside. So I'll interpolate the density or something.

EDIT: I tried to interpolate the densities but this makes it look even worse. I am surely not doing it right. Maybe you have some sample function where you create a sphere or something with smooth densities?


I don't have an example to hand, but the principle:

1) Compute the centre of your volume
2) For each voxel, compute it's distance to the centre.
3) Scale this distance by some amount, such that the density values cross the threshold (128) at the distance from the centre that gives you the size you want. You'll also want to invert the densities, as you want high density in the middle and low on the outside.

The distance changes smoothly from the centre moving out, so this should give you smooth densities and a smooth sphere.

With Perlin noise, I assume your function returns a float in the range 0.0 to 1.0? If so, you can map 0.0 to 0 and 1.0 to 255. However, you might improve quality by mapping 0.4 to 0 and 0.6 to 255 (assuming you want your boundary at 0.5). Values outside 0.4 or 0.6 would just be clamped to min and max.

Syphorlate wrote:
Also I was wondering how the smooth function works. I applied it to the whole volume but don't know if it worked.


You mean the smoothRegion() function? It basically just performs a blur on the volume data so that each voxel gets averaged with it's neighbours. Be aware it's replaced in the Git version of PolyVox though I'm working on something similar.

Syphorlate wrote:
And what about life editing the terrain. You said I can extract a smaller region of the volume or do I have to reextract the whole surface everytime I use the brush on the terrain? No that can't be. But how do I update the mesh then after a brush stroke?


Yes, you can extract a smaller region by passing a PolyVox::Region instance to the SurfaceExtractor's construcor. Conceptually you should break you terrain down into tiles of maybe 32x32x32 or 64x64x64, each with an associated mesh. When one of the voxels in the tiles changes you regenerate the mesh for the whole tile (should take a fraction of a second).


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Unresolved External Symbols
PostPosted: Sun Sep 04, 2011 10:07 am 

Joined: Thu Sep 01, 2011 2:36 pm
Posts: 27
Yeah ok. I think I'll do it this way then. And maybe I should replace MaterialDensityPair44 with Density8 too...


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Unresolved External Symbols
PostPosted: Sun Sep 04, 2011 10:21 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Syphorlate wrote:
And maybe I should replace MaterialDensityPair44 with Density8 too...


I haven't really experimented enough to know how smooth the terrain can be with 8 bits vs 4 bits. It's got to help though. In principle you can still add materials later as you can just make a MaterialDensityPair88 class.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Unresolved External Symbols
PostPosted: Sun Sep 04, 2011 10:26 am 

Joined: Thu Sep 01, 2011 2:36 pm
Posts: 27
Yeah. I plan to unwrap the terrain anyways...
EDIT: But in those polyvox examples you just use "binary densities" right?
I just tested density8 and this is really a whole deal smoother :o


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Unresolved External Symbols
PostPosted: Sun Sep 04, 2011 1:05 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Syphorlate wrote:
Yeah. I plan to unwrap the terrain anyways...

Ok, but that probably won't be an easy task. Well, maybe 3DS Max already has tools for that. You might also want to investigate triplaner texturing if you haven't already.
Syphorlate wrote:
EDIT: But in those polyvox examples you just use "binary densities" right?

Yeah, I'm not to worried about smoothness in the examples... just want to make sure everything works.
Syphorlate wrote:
I just tested density8 and this is really a whole deal smoother :o

Great!


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 25 posts ]  Go to page Previous  1, 2, 3  Next

All times are UTC


Who is online

Users browsing this forum: No registered users and 5 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
Theme created StylerBB.net