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

PolyVox Z value question
http://www.volumesoffun.com/phpBB3/viewtopic.php?f=14&t=173
Page 2 of 3

Author:  Shanee [ Wed Mar 16, 2011 10:06 pm ]
Post subject:  Re: PolyVox Z value question

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.

Author:  Shanee [ Wed Mar 16, 2011 10:07 pm ]
Post subject:  Re: PolyVox Z value question

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.

Author:  David Williams [ Wed Mar 16, 2011 10:21 pm ]
Post subject:  Re: PolyVox Z value question

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.

Author:  Shanee [ Wed Mar 16, 2011 10:23 pm ]
Post subject:  Re: PolyVox Z value question

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?

Author:  David Williams [ Wed Mar 16, 2011 10:25 pm ]
Post subject:  Re: PolyVox Z value question

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.

Author:  Shanee [ Wed Mar 16, 2011 10:27 pm ]
Post subject:  Re: PolyVox Z value question

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 :)

Author:  David Williams [ Wed Mar 16, 2011 10:27 pm ]
Post subject:  Re: PolyVox Z value question

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.

Author:  David Williams [ Wed Mar 16, 2011 10:31 pm ]
Post subject:  Re: PolyVox Z value question

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.

Author:  Shanee [ Wed Mar 16, 2011 10:34 pm ]
Post subject:  Re: PolyVox Z value question

How large? Visual Studio started throwing errors when I set it to 4098.

Author:  David Williams [ Wed Mar 16, 2011 10:47 pm ]
Post subject:  Re: PolyVox Z value question

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...

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