ianyyin Posted August 20, 2020 Share Posted August 20, 2020 Hi, How to pre cache the assets/objects/material when loading the new scene? T The goal is when play back the animation or so, it will improve the performance when loading the objects / play animation, it will have minimal impact on FPS. Link to comment
silent Posted August 20, 2020 Share Posted August 20, 2020 ianyyin Could you please tell us which SDK version are you currently using? If you are using 2.12.0.2 you can preload all the shaders and materials to RAM via materials_loading_mode 2 option (in boot.config or via engine start up parameter). Thanks! How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
ianyyin Posted August 20, 2020 Author Share Posted August 20, 2020 Hi Silent, we are using 2.6.1 Link to comment
ianyyin Posted August 20, 2020 Author Share Posted August 20, 2020 is there similar mechanism in unigine like object pooling in unity or other engine? This way, we can pre-instantiate all the objects we’ll need at any specific moment before the scene is played/live. Link to comment
silent Posted August 20, 2020 Share Posted August 20, 2020 You can write a small custom logic that will move the camera over your scene to load all the objects into the GPU memory. This will work only if you have meshes + textures + screen gbuffer size smaller that total amount of GPU VRAM available. You can check an example of this logic implementation in Superposition demo (source/Warming.cpp). How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
ianyyin Posted August 20, 2020 Author Share Posted August 20, 2020 Does this mean that we have to have a camera movement track involved? is there any way to do this during the loading time? Link to comment
silent Posted August 20, 2020 Share Posted August 20, 2020 You can do it via tracker or simply by moving camera from code. The only purpose of this is to make all the objects to begin load. Please check the Superposition demo sources, the warming procedure is running and splash screen is displaying at the same time. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
ianyyin Posted August 20, 2020 Author Share Posted August 20, 2020 what if we have some hidden node in the scene, will this work? In this case, we need to show "the hidden" node first, then hide it again to make sure this is pre cached? Link to comment
silent Posted August 20, 2020 Share Posted August 20, 2020 All the nodes that you want to warm-up should be visible by current camera. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
ianyyin Posted September 24, 2020 Author Share Posted September 24, 2020 Hi Silent, We are able to precache the node like objects, materials. What about the particles?For some particle effects, do you have any suggestions to precache during the loading of the scene? Link to comment
silent Posted September 24, 2020 Share Posted September 24, 2020 You could enable particles in front of the camera during the warm-up process, that should help later when you will enable them. Other than that, I'm afraid, there is nothing can be done. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
ulf.schroeter Posted October 2, 2020 Share Posted October 2, 2020 Hi silent, these proposed workarounds are impractical in most more complex real world scenarios. Actually the key issue here is a missing feature of the Ressource streaming implementation: it should be possible for every Resourcen (materials/shaders/textures, meshes, skinned meshes/animations,....) to specify streaming behaviour via some per-instance attribute, supporting different resource loading modes like e g. streaming, pre-cache and locked. Default value for all assets current streaming mode, but for special cases pre-cache (cache up to a certain memory limit, dynamic resource unload allowed) or even locked (always load on startup, never unload) Code changes should be quite minmal, but would provide great flexibility for customization of engine resource loading. 1 Link to comment
silent Posted October 2, 2020 Share Posted October 2, 2020 Ulf, That's is something we are thinking to implement in the future. Right now async streaming allow us to minimize frame rate drop (it works much better than in the old SDKs). Allowing more control on streaming and setting to many assets to pre-cached or locked state may increase the amount of crashes due to VRAM limitations, so you need to be very careful in assets selection. How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN Link to comment
ulf.schroeter Posted October 2, 2020 Share Posted October 2, 2020 Hi Silent, sure, user control also means user responsibility :-) Link to comment
Recommended Posts