Any way of minimizing the amount of drawcalls with lots of object

Started by Mr_Chaos, October 12, 2014, 08:23:18 PM

Previous topic - Next topic

Mr_Chaos

Hi, I'm back  ;)

I have a project where I visualize a lot of objects in a static world, the world is made up of tracks (like a railroad, merges, diverter, etc) and I got that speed up a lot by merging all the static stuff into 1 big object3D.

My problem is my dynamic stuff, which can in some cases be up to 5000 object3D boxes (just 20 triangles), but the speed is very slow (<10 fps).

There is only 1 light and no other "fancy" stuff, is there any way to have JPCT batch some of the dynamic objects into 1 drawcall.

I hope it makes sense

EgonOlsen

No. Individual objects have to be drawn individually. However, there is this approach to use a larger object and create those who would otherwise be individual objects out of the polygons of this larger object by using a vertex controller implementation, but that requires some hacks like moving unneeded polygons out of sight and such. IIRC, raft. did this for Sky Maze 3D.

Mr_Chaos

Quote from: EgonOlsen on October 12, 2014, 08:43:58 PM
No. Individual objects have to be drawn individually. However, there is this approach to use a larger object and create those who would otherwise be individual objects out of the polygons of this larger object by using a vertex controller implementation, but that requires some hacks like moving unneeded polygons out of sight and such. IIRC, raft. did this for Sky Maze 3D.
Hmm, that might be an option. Would it be possible to batch the individual object, if you bypassed JPCT and did the OpenGL calls yourself or is it a limitation in OpenGL ?

EgonOlsen

It won't be very different. Instead of using a vertex controller to change the geometry you end up updating some vertex buffers (which is happens in the background too if you apply the vertex controller changes). The only difference is that you can render parts of such a buffer where in jPCT, you always render the whole thing and have to make sure that invisible parts are out of sight.

Mr_Chaos

Quote from: EgonOlsen on October 12, 2014, 10:32:58 PM
It won't be very different. Instead of using a vertex controller to change the geometry you end up updating some vertex buffers (which is happens in the background too if you apply the vertex controller changes). The only difference is that you can render parts of such a buffer where in jPCT, you always render the whole thing and have to make sure that invisible parts are out of sight.

Ok, so it sounds like it will be the same speed impact anyway. Thx for the help as always