Author Topic: Taking 5 to 10 sceonds to show 3D objects  (Read 338 times)

Offline peter

  • byte
  • *
  • Posts: 24
    • View Profile
Taking 5 to 10 sceonds to show 3D objects
« on: October 04, 2016, 12:15:53 am »
when showing 3D objects for first time it takes 5~10 seconds to render. the log shows:

...

Subobject of object 957/56e9be7546bb823cb10000a2 compiled to indexed fixed point data using 2868/940 vertices in 18ms!
Object 957/56e9be7546bb823cb10000a2 compiled to 1 subobjects in 22ms!

Subobject of object 959/56d5fc8846bb8254e0000001 compiled to indexed fixed point data using 4236/1416 vertices in 29ms!
Object 959/56d5fc8846bb8254e0000001 compiled to 1 subobjects in 31ms!

Subobject of object 961/56d5fcb046bb8254e0000002 compiled to indexed fixed point data using 468/160 vertices in 3ms!
Object 961/56d5fcb046bb8254e0000002 compiled to 1 subobjects in 3ms!

Subobject of object 963/56d5fcb046bb8254e0000004 compiled to indexed fixed point data using 1092/368 vertices in 8ms!
Object 963/56d5fcb046bb8254e0000004 compiled to 1 subobjects in 8ms!

Subobject of object 965/56d5fcb146bb8254e0000005 compiled to indexed fixed point data using 564/192 vertices in 3ms!
Object 965/56d5fcb146bb8254e0000005 compiled to 1 subobjects in 3ms!

Subobject of object 967/56d5fcb146bb8254e0000006 compiled to indexed fixed point data using 3156/1056 vertices in 19ms!
Object 967/56d5fcb146bb8254e0000006 compiled to 1 subobjects in 23ms!

Subobject of object 969/56d5fcb146bb8254e0000007 compiled to indexed fixed point data using 756/256 vertices in 5ms!
Object 969/56d5fcb146bb8254e0000007 compiled to 1 subobjects in 8ms!
...
Subobject of object 1909/object1911 compiled to indexed fixed point data using 2868/940 vertices in 14ms!
Subobject of object 1909/object1911 compiled to indexed fixed point data using 4236/1416 vertices in 21ms!
Subobject of object 1909/object1911 compiled to indexed fixed point data using 8640/2912 vertices in 43ms!
Subobject of object 1909/object1911 compiled to indexed fixed point data using 11040/3728 vertices in 50ms!
Subobject of object 1909/object1911 compiled to indexed fixed point data using 7128/2464 vertices in 50ms!
...

is it possible to do those before we call renderer?

thanks!

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: Taking 5 to 10 sceonds to show 3D objects
« Reply #1 on: October 06, 2016, 11:33:16 am »
Yes, you can use compileAllObjects() in World. However, that still won't affect the upload of the compiled data to the gpu.
If your object needs 5-10 secs. to compile, I suggest to check if it really has to be that large. Sounds a bit much for a mobile app at first glance...

Offline peter

  • byte
  • *
  • Posts: 24
    • View Profile
Re: Taking 5 to 10 sceonds to show 3D objects
« Reply #2 on: October 06, 2016, 09:27:47 pm »
I try to move those thing into background, so I can have something to show while 3D renderer is preparing VBO's. does it possible to do those in an Async class instead of in main thread?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11745
    • View Profile
    • http://www.jpct.net
Re: Taking 5 to 10 sceonds to show 3D objects
« Reply #3 on: October 07, 2016, 10:22:14 am »
Yes, the compile call can be done in any thread.