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


All times are UTC




Post new topic Reply to topic  [ 150 posts ]  Go to page Previous  1 ... 11, 12, 13, 14, 15
Author Message
 Post subject: Re: Paging Volume (Previously: Streaming Volume)
PostPosted: Sun Apr 03, 2011 5:23 pm 

Joined: Fri Feb 18, 2011 8:41 pm
Posts: 173
Would be simple to just have SetVoxel set the boolean to true. Then yeah, just don't call the function or let the user decide.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Paging Volume (Previously: Streaming Volume)
PostPosted: Mon Apr 04, 2011 9:54 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Yes, I agree it's probably that simple. I'll try to take a look at it when I'm back at my dev machine, but I do want to get the RLE stuff merged first.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Paging Volume (Previously: Streaming Volume)
PostPosted: Tue Apr 05, 2011 10:19 am 
User avatar

Joined: Wed Jan 26, 2011 3:20 pm
Posts: 203
Location: Germany
I'm actually doing this outside of the volume class in my game, since I have much more info per chunk than just a bool indicating the chunk has changed.

I'm not sure if this should be done inside the volume class, since there are so many things the volume class could also do, but that would make it way overpowered for many users.
In my code I wrote a wrapper class that takes care of such things.
Maybe a few wrapperclasses would make sense. They would be friend classes of Volume and therefore able to perform such things much faster than custom classes, but they would not extend the volume class.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Paging Volume (Previously: Streaming Volume)
PostPosted: Tue Apr 05, 2011 8:28 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Yep, I'm defintely in favour of keeping the Volume class as simple as possible, at least until it has had more testing. Wrapper classes are also possible (for example, in PolyVoxUtil there is a VolumeChangeTracker which is a kind of wrapper. Don't use it because it's pretty broken and will probably be removed, but it illustrates the point).

On a related topic, I'm currently make merging the RLE branch into the trunk. Should be done within the next couple of hours.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Paging Volume (Previously: Streaming Volume)
PostPosted: Tue Apr 05, 2011 11:57 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Ok, this has now been merged into the trunk.

I've started a new thread here to make sure people are aware of the changes and to deal with any problems which arise.

Thanks ker for you help :)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Paging Volume (Previously: Streaming Volume)
PostPosted: Thu Apr 07, 2011 8:44 am 
User avatar

Joined: Wed Jan 26, 2011 3:20 pm
Posts: 203
Location: Germany
great!
This thread should then better be closed.
I'm gonna wait for the git release before I play around with it further, currently it works just as I need it thou :)


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Paging Volume (Previously: Streaming Volume)
PostPosted: Thu Apr 07, 2011 5:52 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
Actually I think we can leave the thread open. If there is more development in this area in the future then we might as well tack it on the end of this same thread. We can use the other thread for any problems which come as a result of the merge (which contains more than just paging).


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Paging Volume (Previously: Streaming Volume)
PostPosted: Sun Jul 31, 2011 8:56 am 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
I'm making some more changes and would like anyone's opinion (espesially ker's) on how this might affect the paging and/or compression in the LargeVolume.

PolyVox already provides the concept of Sampler's within each Volume type. These are used to provide fast, read-only access to a voxel and it's neighbours. Retrieving a voxel though the usual Volume::getVoxelAt() function requires some maths to compute the voxels location in memory, whereas a voxel sampler caches this information. Moving a voxel sampler only a small distance within the volume is very fast as it has knowledge of the volumes internal structure, and looking up neighbour volumes is also very fast.

I am proposing to allow Sampler to write data into the volume as well as read data from it. I have been working recently on code which copies data from one volume to another, and may also resample, blur, or otherwise process the data. It would be nice to do this by setting up two samplers (one on the source volume and one on the destination), move them in syncronization, and copy data directly from one to the other.

I have identified one problem with the LargeVolume, in that it uses a flag called 'm_bIsUncompressedDataModified'. If a block is decompressed but never modified, then this flag is used to determine that the block does not need to be recompressed as it hasn't changed. Writing directly to memory through an iterator will bypass this mechanism. This can be fixed by either removing this flag (and compressing every time) or by having the iterator set the flag.

Can you think of any other problems which might occur as a result of this change?


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Paging Volume (Previously: Streaming Volume)
PostPosted: Mon Aug 01, 2011 10:03 pm 
User avatar

Joined: Wed Jan 26, 2011 3:20 pm
Posts: 203
Location: Germany
As long as it is assured, that there is only one sampler per volume, it should be safe the way you propose it.

Obviously reading in the volume will cause more compression calls now, but in my tests the compression never actually caused any problems since it is really fast (as in way less than a millisecond for a full uncompressed buffer of 64^3 blocks, thou I don't remember what buffer size I had)

As an alternative, you could "touch" (setting m_bIsUncompressedDataModified to true) the block whenever the writing-access-sampler loads that block. this would basically emulate the behavior of the regular setVoxelAt function without requiring any additional modification of block or LargeVolume, but not causing additional computational effort during most iterator movements.
of course, if you're not writing after every move, you might touch some blocks that you didn't modify. Read-access won't change behavior this way, so I think you won't need to worry about problems.


Top
Offline Profile  
Reply with quote  
 Post subject: Re: Paging Volume (Previously: Streaming Volume)
PostPosted: Tue Aug 02, 2011 8:16 pm 
Developer
User avatar

Joined: Sun May 04, 2008 6:35 pm
Posts: 1827
ker wrote:
As long as it is assured, that there is only one sampler per volume, it should be safe the way you propose it.


This is a good point, but now that you mention it don't we have this problem even with the read-only sampler? If one sampler is pointed at a particular block, then reading from somewhere else in the volume via a different sampler can cause that block to become unloaded and the sampler becomes invalid?

Actually it's worse than that... even with one sampler it can become invalid if the user calls the getVoxelAt/setVoxelAt directly on the volume. I think we overlooked that :-)

I think maybe the volume needs to keep a list of samplers which are pointing at it, so that it can mark them as invalid them if necessasary.

ker wrote:
Obviously reading in the volume will cause more compression calls now, but in my tests the compression never actually caused any problems since it is really fast (as in way less than a millisecond for a full uncompressed buffer of 64^3 blocks, thou I don't remember what buffer size I had)

As an alternative, you could "touch" (setting m_bIsUncompressedDataModified to true) the block whenever the writing-access-sampler loads that block. this would basically emulate the behavior of the regular setVoxelAt function without requiring any additional modification of block or LargeVolume, but not causing additional computational effort during most iterator movements.
of course, if you're not writing after every move, you might touch some blocks that you didn't modify. Read-access won't change behavior this way, so I think you won't need to worry about problems.


Yep, we will have to do one of the above. I'll pick whatever is easiest (probably removing the flag) but it's an internal implementation detail so we can change it as indicated by profiling.


Top
Offline Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 150 posts ]  Go to page Previous  1 ... 11, 12, 13, 14, 15

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