Jump to content

Resources caching


photo

Recommended Posts

Posted

Hi, 

In our scene (SDK 2.5) , we are managing large amounts of mesh and texture data that caused performance issues due to huge amount of materials and surfaces. Fortunately,  these issues have dissappeared by using MeshCombiner plugin. MeshCombiner provided us some large .mesh files as it joins all building from a city in 5x5 km squares.

Now we are facing another problem, filesystem is blocking app when allocating MeshCombiner meshes in memory. First-time blocking can be solved by "WarmUp" but engine is releasing these huge meshes from memory when they are out of frustum by a certain time.

We have "forced" meshes and terrain to not be unloaded by using a WidgetSpriteViewport that displays all city and terrains. With this trick, blocking dissappears but we have a framerate drop each time the WidgetSpriteViewport renders (we have set IFps to 0.5s). Framerate drops are a bad user experience when navigating or during camera animations.

We have look older posts:

And we have tried FileSystem::addCacheFile() as it shows here: 

https://developer.unigine.com/en/docs/2.5/api/library/filesystem/class.filesystem?rlang=usc&words=addcachefile%2Caddcachefil#highlight

But nothing seems to prevent mesh from unloading when out of all render frustums. Is there any other way to solve this problem without using WidgetSpriteViewport? 

We attach a Profiler capture to show framerate drops:

framerate.thumb.png.8ee5da6a13655ec24863b66bdd8952cb.png

Best regards, Javier

Posted

Hi Javier,

Have you tried to constantly keep meshes in memory by adding following console_command at startup: -console_command "render_manager_create_meshes 1"? If you will use that approach and remove additional Viewport rendering - will it help in your case?

Thanks! 

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

Posted

Hi Silent,

That was exactly what we needed, now framerate is great, thanks!

One more question, is there any way to apply "render_manager_create_meshes" to only a given set of meshes? By the way we don't need that feature but if city keeps raising there may be memory problems (right now we are filling 7GB) and there are meshes such as traffic signals or streetlights that can be released from memory.

Thanks a lot, Javier

Posted

Hi Javier,

Unfortunately, right now there is no such possibility to keep only specific meshes in video memory, sorry. It's also hard to say currently if it's possible to keep only specific meshes in VRAM. If I will have more information about this I will surely let you know.
 

Thanks!

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

Posted (edited)

It would be really helpful to be able to define set of meshes/textures, which will by cached on startup and never released from memory (RAM should do the job). 

Also it would make sense to be able to change behaviour of memory manager to unload objects only according to some set distance, not frustum. In computer games are very common fast turns of camera and unloading based on frustum causes loading/unloading of the same resources again and again. And players hate lags, lags are very common reason to quit the game. 

Edited by demostenes
×
×
  • Create New...