Author Topic: how to lazyload  (Read 1937 times)

Offline tinhtinhcd

  • byte
  • *
  • Posts: 16
    • View Profile
how to lazyload
« on: August 14, 2017, 06:06:50 am »
Hi,
I have problem with performance when try to load a big file size in the screen.
I have 2 screen,
screen 1 have a button, when i click this button it will go to screen 2 to load object but it take 2-3 second to go next screen.
is there any way that i can go to the 2nd screen first and load the render for surfaceView later.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: how to lazyload
« Reply #1 on: August 14, 2017, 09:50:38 pm »
By loading you mean "loading", i.e. reading the mesh physically from storage? If so, you don't have to do that in the render thread. You can offload it some loading thread and grab the result.

Offline MichaelJPCT

  • float
  • ****
  • Posts: 264
    • View Profile
Re: how to lazyload
« Reply #2 on: August 20, 2017, 07:50:36 pm »
i think of another question:
is a Texture fully loaded from storage when Texture is constructed or when Texture is added to TextureManager? or it's not fully loaded from storage until it's requested for render?
i mean , when a Texture is constructed, it can be just a description of the image , but without loading the actual image texels.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: how to lazyload
« Reply #3 on: August 20, 2017, 10:20:41 pm »
No, if you load it...it will be loaded. However, it will be uploaded to the GPU when the first render request for it happens (if you don't preload it).