Taking 5 to 10 sceonds to show 3D objects

Started by peter, October 04, 2016, 12:15:53 AM

Previous topic - Next topic

peter

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!

EgonOlsen

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...

peter

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?

EgonOlsen

Yes, the compile call can be done in any thread.