Jump to content

preload caching


photo

Recommended Posts

Since ontroducing of streaming (long time ago), we are experiencing small lags because of asset streaming, especially terrain clutters (which indeed makes sense). I found some parametrs in config to increase cache for textures and meshes, which helped a lot, but it still does not behave as before streaming introduction (no lag ever).

 

Is there any option to turn streaming off and use it only for selected nodes? I know I can trigger loading of node by distance and I know we need background streaming, since we have already 30GBs of textures. Or is there some mechanism to cache selected nodes before running renderer? Reason is simple, currently when I enter the world (or teleport to some location), I still have to wait up to 5 seconds (SSD drive) and turn camera 360 degrees to load everything and dont have lags after. This is absolutelly not acceptable for game, where any lag can cause your death. Far better is to have longer loading time and no lags after. Currently Unigine allocates 1100MB of memory in the most heavy scene we have, I would have no problem with far bigger allocation as sacrifice for speed. 8GB of memory is quite common today, so no reason to not use it.

Link to comment

Hi Jirka!

 

Have you tried to set "render_manager_create_dummy_meshes" to zero and "render_manager_create_meshes" to one? It could improve your performance at the cost of increased loading time and memory consumption.

Link to comment

Hi Jirka!

 

Have you tried to set "render_manager_create_dummy_meshes" to zero and "render_manager_create_meshes" to one? It could improve your performance at the cost of increased loading time and memory consumption.

 

Thanks for hint, I will try. Is there any description of these parametres? I was looking into cfg file and there is much more similar ones...

 

edit: It helped a LOT. Memory allocation is cca 100MB higher, loading time almost identical, vast majority of lags is gone, I can turn almost everywhere without any lag. Also framerate is higher, there is now only very small framerate drop during moving. Before this modification when I was moving faster, frame went down drastically.

 

Are there any other options what to do? Thanks :)

Link to comment

There are bunch of render_manager_* console commands available. Description is available in Console section.

 

For example, render_manager_create_textures and render_manager_create_shaders. They can increase RAM usage and loading time, but it would help in run-time. The usage is similar to the render_manager_create_meshes.

 

For DirectX 11 build you can even precompile shaders with render_manager_check_shaders on engine startup and ship cache with your product (but shaders compilation time could take hours, depending on materials quantity).

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Great, thanks for information!

 

"render_manager_create_meshes - Load all meshes on the start-up...." This mean all meshes except streamed nodes currently out of loading distance?

 

It is possible to define group od nodes and cache its meshes and textures? For example I really do not need to cache details like spoon and chair, but to cache all vegetation meshes/textures, big objects with long visibility and frequently used objects etc would make sense. If I understand description of caching parametres well, it is only all or nothing.

Link to comment

Well, you can hack this by creating a bunch of ObjectMeshStatic instances at startup. Don't forget to kill them once meshes will be in memory.

 

Ok, thanks! It is low priority for us now,  but it would be nice to have some system function to do this in more elegant way (for example to pre-load node with parametr for loading its mesh(es) and texture(s) or combination, mesh only, textures only).

 

I would like also ask, is there is way to somehow delay renderer, but continue loading of objects. Now when I start engine, it takes cca 3 seconds, until I see all vegetation objects (clutters are spawning itself). So player first see terrain, then trees, then bushes, than grass. Better would be jump in already generated scene, eg put some delay, or condition to not start rendering (or put some loading screen, whatever), until everything is ready. It is possible somehow?

Link to comment
  • 11 months later...

I would like also ask, is there is way to somehow delay renderer, but continue loading of objects. Now when I start engine, it takes cca 3 seconds, until I see all vegetation objects (clutters are spawning itself). So player first see terrain, then trees, then bushes, than grass. Better would be jump in already generated scene, eg put some delay, or condition to not start rendering (or put some loading screen, whatever), until everything is ready. It is possible somehow?

 

It is starting to be actual, typical usecase is, that I teleport into some location (or world) and in case there is lots of objects (city), it takes several seconds (on ssd drive) until all textures are loaded. It even shows nonsesne textures on surfaces (leaf materials on the buildings, etc..) until everything is loaded. How to delay camera, but still load the world? Player really shouldnt see this.

Link to comment

I ve also noticed, that sometimes when I turn around fast, some textures are being loaded again (even for objects very close). Unlike in the case described above only some textures are loaded again, not all. Why is this happening? Is Unigine unloading textures once not in frustum? 

 

I was trying to make bigger texture cache in unigine.cfg (render_manager_textures_memory and world_manager_images_memory) but it has not  impact on this behaviour. My GPU has 1280MB RAM, it is not that little to not be able to keep textures of objects around me.

Link to comment

I ve also noticed, that sometimes when I turn around fast, some textures are being loaded again (even for objects very close). Unlike in the case described above only some textures are loaded again, not all. Why is this happening? Is Unigine unloading textures once not in frustum?

Engine indeed can unload textures of the objects if they are not in viewing frustum anymore. But, I'm afraid, we will need to check the actual test scene to give your more detailed information about what is really happens in your case.

 

 

My GPU has 1280MB RAM, it is not that little to not be able to keep textures of objects around me.

Could you please check with enabled profile (show_profiler 2 command in console) how many memory textures are consuming when you are turning around some point in your world? Please, keep in mind, that GPU memory not only storing the textures itself, but geometry also. So, sometimes extending the render_manager_* limits can result in no changes at all.

 

Thanks!

How to submit a good bug report
---
FTP server for test scenes and user uploads:

Link to comment

Engine indeed can unload textures of the objects if they are not in viewing frustum anymore. But, I'm afraid, we will need to check the actual test scene to give your more detailed information about what is really happens in your case.

 

 

I would expect, that main condition for unloading is distance, exactly because of fast turning.

 

Ok, I will do some profiling.

Link to comment

It is starting to be actual, typical usecase is, that I teleport into some location (or world) and in case there is lots of objects (city), it takes several seconds (on ssd drive) until all textures are loaded. It even shows nonsesne textures on surfaces (leaf materials on the buildings, etc..) until everything is loaded. How to delay camera, but still load the world? Player really shouldnt see this.

 

Hi Jirka,

 

I am afraid, currently there is no api for manual manipulating and asking if needed resources are loaded. You can create a viewport and render it with needed camera position for some time, expecting that stream resources will load during this time. And after that set this camera to main viewport.

 

As a render stream API, I see a functionality to force load a list of nodes or all nodes inside current bound primitive (box,sphere,frustum), am I right?

Link to comment

As a render stream API, I see a functionality to force load a list of nodes or all nodes inside current bound primitive (box,sphere,frustum), am I right?

 

Currently I am searching for way how to prevent unloading textures of objects, which are not in frustum anymore, but still very close, literally behind my back (players are making fast turns all the time). I will check how much GPU memory is consumed in such scene and let you know.

Link to comment

So it looks like this (see picture). When I am walking through scene, textures are going around 1800MB. When I stop moving, it starts to fall and in cca 5 seconds it falls to cca 1100MB. When I stop moving again, it instantly rises to 1800MB again. It seems like I need to buy GPU with more memory.

 

 

post-714-0-60561500-1461193447_thumb.png

Link to comment
  • 2 weeks later...

So it looks like this (see picture). When I am walking through scene, textures are going around 1800MB. When I stop moving, it starts to fall and in cca 5 seconds it falls to cca 1100MB. When I stop moving again, it instantly rises to 1800MB again. It seems like I need to buy GPU with more memory.

 

(tested on GPU with 1280MB)

 

I ve also noticed, that sometimes when I turn around fast, some textures are being loaded again (even for objects very close). Unlike in the case described above only some textures are loaded again, not all.

 

Problem is present also on GPU with 2GB of memory. So I would consider this behaviour bug. It is really not possible to load again and again textures in the scene I am walking through on objects, which are 15metres from me. Algorithm for loading/unloading should probably need some optimization.

Link to comment

Demos are indeed OK, but our use case is more "heavier". We have terrain + various cities over it and these cities are made from hundreds of unique objects and many, many gigabytes of textures. Preparing such scene will be tricky, because it would probably require full assembly of our game, which can go to 25-30GB. I will think over it how to prepare smallest "test" scene possible. I will try to record some video for the beginning.

Link to comment

Requirements for unload locking of certain resources are well known even for very old streaming systems and has been requested even before Unigine world streaming implementation ( e.g. https://developer.unigine.com/forum/topic/490-large-world-support/?p=2313)

 

Same is true for only distance-based unloading of resources to avoid reloading lags in case of fast camera turns.

 

In general Unigine late-term world streaming implementation has been more an after-thought than a fundamental architectue design principle. In consequence some surely required real-application features for watertight large world streaming are missing (e.g. resource locking/customizable load/unload strategies, multi-LOD streaming, generalized streaming of all resoures mesh/textures/audio/animations, much better control on streaming status etc.)

 

Maybe available in Unigine 3 ;)

Link to comment

Ulf is right that data streaming was added when Unigine 1 core was already solid.

We have cleaned it up a bit in Unigine 2, but there is still room for improvement - and the pressing factor is 3D earth model with large datasets, which is in the development right now. The hard part is to improve the subsystem without breaking backward compatibility much.

Link to comment
×
×
  • Create New...