Content loading in background

Q and A about functionality and how to solve a special task for your application.

Moderator: Support

Post Reply
User avatar
Naggar
Posts: 74
Joined: 22 Dec 2016, 14:02
Location: Dubai, United Arab Emirates

Content loading in background

Post by Naggar » 10 Sep 2018, 05:24

Hello guys.

This may be a stupid question but I’ve been having this issue for most of my applications and hoping its possible to solve it.
Many of my projects include a large library of content/data (videos, images, text) which i usually load using directory/url nodes, linked to folders in public documents. Obviously its the same node that is switching between content, and when the switch happens there is always a lagg (some long and some short) regardless if Async is turned on or off. I’ve managed to make this lagg minimal with dds images but videos still always lagg.

So my long question is:
Is it possible to make this lagg happen in the background so that if a video has been switched and lets say it will take 2 seconds to load.. i can replace the video with an animation representing “loading” and once the “loaded” event is triggered in the video output I could fade in the video - Rather than ventuz freezing while the video is loading?

Thanks

User avatar
Dennis
Posts: 246
Joined: 08 Jun 2015, 11:29

Re: Content loading in background

Post by Dennis » 10 Sep 2018, 09:58

Aloha,

not only the DIR node has to be set to async, the Movie Clip node has to get the async flag as well ;)

That works flawless without any stall.

RegArts
Dee

:ugeek:

User avatar
Naggar
Posts: 74
Joined: 22 Dec 2016, 14:02
Location: Dubai, United Arab Emirates

Re: Content loading in background

Post by Naggar » 11 Sep 2018, 11:57

Thanks Dennis..

I have enabled all flags for Async and disabled all flags for Auto Update.. this includes 8 texture nodes loading PNG files, a movie clip node, and 1 text file.. all taking from its own directory node also with enabled Async and disabled Auto Update.

Most of the lagg is caused by "TextureResourceGen" which in some cases goes up to 110 ms (attached SS) so I believe that the images is causing this.

Another Note:
In the TxtFile node - with Async flag disabled i have no issues (and lag is unnoticeable).. but having the Async flag enabled has an issue.. the text updates properly if it reads a different file.. but if the file "does not exist" it should give me nothing in the text output; but instead it keeps the last info that was available.. is that how its supposed to work?

Also note this is a V5.4 project not V6.1

thanks
Attachments
statistics.jpg

User avatar
Dennis
Posts: 246
Joined: 08 Jun 2015, 11:29

Re: Content loading in background

Post by Dennis » 11 Sep 2018, 12:35

Ok hmm..

there might be one other trap where you might have stepped into, but the best would be if you could pack the project and send it to us.. support @ ...
all scenes are handled confidential dont worry.

regArds
Dee

:ugeek:

User avatar
Naggar
Posts: 74
Joined: 22 Dec 2016, 14:02
Location: Dubai, United Arab Emirates

Re: Content loading in background

Post by Naggar » 11 Sep 2018, 13:23

Will Do.
Thanks :)

User avatar
Karol
Posts: 514
Joined: 10 Jan 2012, 12:07

Re: Content loading in background

Post by Karol » 12 Sep 2018, 09:48

Hi Naggar,

the problem is that you do not use the texture that you have loaded with the async Texture Loader but you load the same texture again in the Material node (this time synchronously and stalling)!
You did not bind the Texture property from the 'Aspect Logic' container to the Material node ('Image') but the File Url.

Best Regards
Karol

User avatar
Naggar
Posts: 74
Joined: 22 Dec 2016, 14:02
Location: Dubai, United Arab Emirates

Re: Content loading in background

Post by Naggar » 12 Sep 2018, 11:53

Wow.. I didn't see that
Thanks for pointing it out Karol. and thanks for the support :)

User avatar
Naggar
Posts: 74
Joined: 22 Dec 2016, 14:02
Location: Dubai, United Arab Emirates

Re: Content loading in background

Post by Naggar » 19 Sep 2018, 08:08

Sorry.. another question

So the loading of Images works fine, but if its not Image,Video,Text, or mesh; what can cause the "ResourceGen" to spike?
Attachments
statistics.png

Post Reply