low fps rate

Started by peter, June 21, 2016, 11:03:44 PM

Previous topic - Next topic

AeroShark333

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.

EgonOlsen

That's not really feasible. It's better to leave it to the developer.

AeroShark333

#17
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?

EgonOlsen

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!? 

AeroShark333

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

AeroShark333

I wondered, is it possible to see the source code of the Object3D#mergeAll method jPCT-AE comes with?

EgonOlsen

I'm not sure why that would be helpful...?

AeroShark333

I wanted to know how Object3D's are merged. Or basically... How are the meshes merged?

EgonOlsen

The data structures of both are copied/merged into a new one. Nothing special happens there...