Horde3D
http://horde3d.org/forums/

Level Streaming
http://horde3d.org/forums/viewtopic.php?f=1&t=1579
Page 1 of 1

Author:  SpOOky [ 18.09.2011, 12:56 ]
Post subject:  Level Streaming

I kinda lost track with Horde3D's development. Is level(content) streaming doable now?

Author:  Orm [ 19.09.2011, 01:21 ]
Post subject:  Re: Level Streaming

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.

Author:  SpOOky [ 19.09.2011, 17:07 ]
Post subject:  Re: Level Streaming

So it would it would be possible to load resources in a thread and pass them to Horde3D running in another one?

Author:  DarkAngel [ 20.09.2011, 01:59 ]
Post subject:  Re: Level Streaming

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

Author:  Orm [ 22.09.2011, 15:05 ]
Post subject:  Re: Level Streaming

Another option is time-slicing your load operation. Meaning instead of loading everything at once, split the load operation over multiple loop iterations.

Author:  SpOOky [ 26.09.2011, 20:26 ]
Post subject:  Re: Level Streaming

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.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/