www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: Mr_Chaos on October 12, 2014, 08:23:18 pm

Title: Any way of minimizing the amount of drawcalls with lots of object
Post by: Mr_Chaos on October 12, 2014, 08:23:18 pm
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
Title: Re: Any way of minimizing the amount of drawcalls with lots of object
Post by: 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.
Title: Re: Any way of minimizing the amount of drawcalls with lots of object
Post by: Mr_Chaos 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 ?
Title: Re: Any way of minimizing the amount of drawcalls with lots of object
Post by: 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.
Title: Re: Any way of minimizing the amount of drawcalls with lots of object
Post by: Mr_Chaos 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