It is currently Sat Aug 22, 2020 4:14 am


All times are UTC




Post new topic Reply to topic  [ 22 posts ]  Go to page Previous  1, 2, 3  Next
Author Message
 Post subject: Re: PolyVox Z value question
PostPosted: Wed Mar 16, 2011 10:06 pm 

Joined: Fri Feb 18, 2011 8:41 pm
Posts: 173
Ok, the unlock crash is related to a negative or 0 depth I think.

Once added
Code:
if (croppedRegion.width() <= 0 || croppedRegion.height() <= 0 || croppedRegion.depth() <= 0)
         return;


to smoothRegion (this btw happens in the one David made for boxes and my sphere one as they are exactly the same function except one added line pretty much) then it stops crashing.

When trying to see if anything might suddenly change for the bigger sizes which bug out, no difference.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Z value question
PostPosted: Wed Mar 16, 2011 10:07 pm 

Joined: Fri Feb 18, 2011 8:41 pm
Posts: 173
David Williams wrote:
Shanee wrote:
P.S. I am also getting a crash at "mlock.c"
Code:
void __cdecl _unlock (
        int locknum
        )
{
        /*
         * leave the critical section.
         */
        LeaveCriticalSection( _locktable[locknum].lock );
}


I don't know what calls it, my call stack seems to be incomplete there.
http://pokit.etf.ba/get/518dd96de08fdd8 ... 00bcde.jpg

That looks threading related... Are you accessing the volume from more than one thread? Be aware that it is not thread safe.


Nope! all from one thread.

Just had an idea btw:
m_VolumeData->setBlockCacheSize(4098);

Guess which error just got fixed? That's right! The weird edges and broken mesh error.

Although why would it get data from other patches/regions? would expect to get just 0 density instead.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Z value question
PostPosted: Wed Mar 16, 2011 10:21 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Shanee wrote:
Ok, the unlock crash is related to a negative or 0 depth I think.

Once added
Code:
if (croppedRegion.width() <= 0 || croppedRegion.height() <= 0 || croppedRegion.depth() <= 0)
         return;


to smoothRegion (this btw happens in the one David made for boxes and my sphere one as they are exactly the same function except one added line pretty much) then it stops crashing.

When trying to see if anything might suddenly change for the bigger sizes which bug out, no difference.


That could make sense... potentially there could be a bug if you try to extract a region which is 0 or negative. I'll be interested if you can confirm this and PolyVox should handle it gracefully.

On a related note, I'm in the process of removing the width(), height(), depth() functions from the Region class, because they are ambiguous. In some cases it makes sense to define it as upperCorner - lowerCorner, but in other cases it makes sense for it to be one bigger than this. From now on you should compute the dimensions yourself when you need them.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Z value question
PostPosted: Wed Mar 16, 2011 10:23 pm 

Joined: Fri Feb 18, 2011 8:41 pm
Posts: 173
Well, you will break your smoothRegion in the process! (please do not completely remove it :))

And all my regions are in the positive from 0 to numPatchs(N) * patchSize(N) where N = dimension.

Just that editing with a sphere at let's say 5,5,5 could go to negative and then it all bugged. Weird.

How do I make my regions negative anyhow?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Z value question
PostPosted: Wed Mar 16, 2011 10:25 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Shanee wrote:
Just had an idea btw:
m_VolumeData->setBlockCacheSize(4098);

Guess which error just got fixed? That's right! The weird edges and broken mesh error.

Although why would it get data from other patches/regions? would expect to get just 0 density instead.


What was the blcok cache size set to before? This is very new code - part of the streaming mechanism and is not well tested yet. So it is possible that you will identify bugs and let us know if you do. I haven't looked at the streaming code much myself but will be doing so over the next few days.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Z value question
PostPosted: Wed Mar 16, 2011 10:27 pm 

Joined: Fri Feb 18, 2011 8:41 pm
Posts: 173
Default cache size. No idea what it was.

And volume size was 64 * 6, 64 * 1, 64 * 6 and all fine, when replacing 6 to 7 it started messing.

And yes, that is partly the reason I am using that version, help finding bugs. I am not using streaming yet :)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Z value question
PostPosted: Wed Mar 16, 2011 10:27 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Shanee wrote:
Well, you will break your smoothRegion in the process! (please do not completely remove it :))

Don't worry, I simply updated it to compute the dimensions when it needs them.
Shanee wrote:
How do I make my regions negative anyhow?

By negative region I meant one where the lower bound is greater than the upper bound. But this was a misleading term - I'll call that an 'inverted' region instead.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Z value question
PostPosted: Wed Mar 16, 2011 10:31 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Shanee wrote:
I am not using streaming yet :)

Even though you are not suppling the functions to handle data, it may still be tying to call them when the volume gets too large. There's a good chance this is causing problems for you. This part of the code isn't finished yet (I'm still reviewing it) so you are probably best off setting a large block cache size for now.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Z value question
PostPosted: Wed Mar 16, 2011 10:34 pm 

Joined: Fri Feb 18, 2011 8:41 pm
Posts: 173
How large? Visual Studio started throwing errors when I set it to 4098.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: PolyVox Z value question
PostPosted: Wed Mar 16, 2011 10:47 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Shanee wrote:
How large? Visual Studio started throwing errors when I set it to 4098.

I can't really answer this... set it large enough that you don't get strange behaviour but not so large that it crashes :) Maybe you have to stick to smaller volumes for now. That's if I understand you right.

Over the next few days I'll have a chance to become familier with the new streaming code and then I can answer these questions better...


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

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 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