Horde3D

Next-Generation Graphics Engine
It is currently 26.11.2024, 08:53

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: Level Streaming
PostPosted: 18.09.2011, 12:56 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
I kinda lost track with Horde3D's development. Is level(content) streaming doable now?

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Level Streaming
PostPosted: 19.09.2011, 01:21 
Offline

Joined: 09.09.2009, 18:58
Posts: 107
Resources are already loaded in as streams, so it is indeed possible to obtain a resource from a remote location and load them it at runtime.


Top
 Profile  
Reply with quote  
 Post subject: Re: Level Streaming
PostPosted: 19.09.2011, 17:07 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
So it would it would be possible to load resources in a thread and pass them to Horde3D running in another one?

_________________
Paul


Top
 Profile  
Reply with quote  
 Post subject: Re: Level Streaming
PostPosted: 20.09.2011, 01:59 
Offline

Joined: 08.11.2006, 03:10
Posts: 384
Location: Australia
SpOOky wrote:
So it would it would be possible to load resources in a thread and pass them to Horde3D running in another one?
I've done this in my last few Horde projects.
I had my main (horde) thread and the file-loading thread communicate via thread-safe queues. I would get the list of assets that horde is asking for, and put them into a queue to the loader. The loading thread would read items from the queue, load the data into buffers, and put those buffers into another queue to send them back to the main thread. The main thread would read from this data-queue once per-frame, and send the data to Horde.

I would only ever send one asset to Horde per frame (even if the loader has put two into the queue), because Horde can be quite slow when processing large resources.

Time for some ASCII art:
Code:
| Main thread | Loading thread |
|             |                |
|       +-----+-----+          |
| name>-|thread-safe|-> name   |
|       |   queue   |         L|
|       +-----+-----+         O|
|             |               A|
|       +-----+-----+         D|
| data<-|thread-safe|-< data   |
|       |   queue   |          |
|       +-----+-----+          |
|             |                |


Top
 Profile  
Reply with quote  
 Post subject: Re: Level Streaming
PostPosted: 22.09.2011, 15:05 
Offline

Joined: 09.09.2009, 18:58
Posts: 107
Another option is time-slicing your load operation. Meaning instead of loading everything at once, split the load operation over multiple loop iterations.


Top
 Profile  
Reply with quote  
 Post subject: Re: Level Streaming
PostPosted: 26.09.2011, 20:26 
Offline

Joined: 05.03.2007, 19:38
Posts: 167
Location: Romania
In the loading thread should I use fopen/malloc to create the buffers or should I try to mimic Horde3D's resource loading function? I'm a bit lost here mates as this is the first time I'm doing something like this.

_________________
Paul


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 11 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:  
Powered by phpBB® Forum Software © phpBB Group