Author Topic: low fps rate  (Read 6989 times)

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: low fps rate
« Reply #15 on: August 07, 2016, 01:55:54 am »
So if I understand correctly:
-> Having xxx Object3D's will result in xxx draw calls for the Object3D's.
-> Having xxx Object3D's merged into 1 Object3D will result in just 1 draw call.

Isn't it possible for jPCT to automatically "merge" certain Object3D's? Not real merging into one Object3D, but just to reduce draw calls. (So I guess geometry-wise merging only)
I don't know if this will increase performance, since I'm not sure if merging itself is cheap performance-wise.
Another thing that might make this idea not work is the individual settings that are possible for Object3D's like different shaders. I don't think merged geometry could work with Object3D's with different shaders for instance.
But okay, for the Object3D's that share most settings, could those be merged geometry-wise?
Well a developer can instead just merge them immediately too to one Object3D, but at the cost of having control over the Object3D's it originally consisted of.

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: low fps rate
« Reply #16 on: August 07, 2016, 02:10:06 pm »
That's not really feasible. It's better to leave it to the developer.

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: low fps rate
« Reply #17 on: August 09, 2016, 02:35:57 pm »
Well it would be nice to have some automatic geometry-wise merging function to reduce draw calls. Or some helper class or something to allow it, I'm not sure how though.
But it would be nice to have Object3D's merged geometry-wise and still be able to control the Object3D's individually for this example:
When you got loads of Object3D's and you want to keep rotating 1 Object3D, then I guess this idea might be useful. In case you merge the Object3D's into one Object3D, it would be hard to rotate the mesh of the original Object3D you want to keep rotating...

EDIT: On second thought... it might actually be do-able if you create a custom Object3D merger or something, so you still have control over the individual meshes. Any suggestions how to exactly do this though?
« Last Edit: August 09, 2016, 02:38:15 pm by AeroShark333 »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: low fps rate
« Reply #18 on: August 09, 2016, 07:12:29 pm »
You can either merge them or keep them under control separately. One could implement a kind of dynamic batching that would cover some applications (for example rendering minecraft-like landscapes), but those might be better off with a dedicated and focused engine anyway. With the means that jPCT-AE provides, you could hack something together with the IVertexController, but it will be very clunky and maybe not worth the hassle.
What do you need this for? Maybe there's a better solution!? 

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: low fps rate
« Reply #19 on: August 10, 2016, 10:59:49 am »
Hmm, the thing I'm working on looks a bit like minecraft-like landscapes.
So I thought it would be either this merging idea or the thing that is explained here: http://www.jpct.net/forum2/index.php/topic,4723.0.html

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: low fps rate
« Reply #20 on: August 16, 2016, 12:44:05 pm »
I wondered, is it possible to see the source code of the Object3D#mergeAll method jPCT-AE comes with?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: low fps rate
« Reply #21 on: August 16, 2016, 05:56:50 pm »
I'm not sure why that would be helpful...?

Offline AeroShark333

  • float
  • ****
  • Posts: 319
    • View Profile
Re: low fps rate
« Reply #22 on: August 17, 2016, 09:50:30 am »
I wanted to know how Object3D's are merged. Or basically... How are the meshes merged?

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: low fps rate
« Reply #23 on: August 17, 2016, 02:18:13 pm »
The data structures of both are copied/merged into a new one. Nothing special happens there...