Author Topic: Any way of minimizing the amount of drawcalls with lots of object  (Read 1010 times)

Offline Mr_Chaos

  • int
  • **
  • Posts: 57
    • View Profile
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Any way of minimizing the amount of drawcalls with lots of object
« Reply #1 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.

Offline Mr_Chaos

  • int
  • **
  • Posts: 57
    • View Profile
Re: Any way of minimizing the amount of drawcalls with lots of object
« Reply #2 on: October 12, 2014, 08:52:35 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 ?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 11776
    • View Profile
    • http://www.jpct.net
Re: Any way of minimizing the amount of drawcalls with lots of object
« Reply #3 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.

Offline Mr_Chaos

  • int
  • **
  • Posts: 57
    • View Profile
Re: Any way of minimizing the amount of drawcalls with lots of object
« Reply #4 on: October 13, 2014, 07:53:20 am »
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