Which function is the fastest way to create Object3D

Started by peter, March 17, 2017, 04:23:39 AM

Previous topic - Next topic

peter

I have all the coordinates, normals, uvs and index values.
which function can create Object3D in shortest time?
Using Object3D(int maxTriangles) and run 8 times addTriangle(SimpleVector vert1, SimpleVector vert2, SimpleVector vert3, TextureInfo tInf)
or
Using Object3D(float[] coordinates, float[] normals, float[] uvs, int[] indices, int textureId)

EgonOlsen


peter

we are creating around 2000 3D objects. in iPhone5 using sceneKit only takes about 1~2 seconds to create, but in Android Nexus5 using jPCT-AE takes about 6 seconds to create after that jPCT-AE also need few seconds to compile the 3D object. is there any faster way to do that in jPCT-AE?

EgonOlsen

2000 different objects or all the same? Or some different and some the same?

peter

all difference, it takes 4 seconds on Android, but that's without build and compile 3D objects

EgonOlsen

In which way do they differ? Any chance that they share the same geometry (not textures and attributes)?

peter

not share same geometry, some of them sharing same texture

EgonOlsen

Well, in that case...no, there's not much you can do to speed this up. You could try to create them in different threads. For object creation including build(), that should work fine. For compiling them not so much.

Also, have you checked what actually takes the time? Maybe it's not the object creation itself but some garbage collection that occurs while doing so?

peter

Thank you for your help. I did some clean up, now it takes about 2 seconds to create all 2000 objects,  but after that I needs to do Objects.merge for every 250 of them which takes about 1 second for each merge, is there any way to speed up the merge or increase frame rate for drawing 250 objects in one world(I need to merge 250 object into one because the frame rate is too low (about 35fps) for drawing 250 objects in one world)


peter


EgonOlsen

Well, then there's not much you can do, I'm afraid. If you are creating the objects manually, you might want to consider to create one large object instead of many small ones that get merged afterwards...if that's even an option.
Maybe it helps to know what you are doing...what are you needing 2000 different objects for?