Hi, On 26/09/2016 13:59, Xavier Bigand wrote:
Doesn't the scene graph of qt3d use the instancing and sort the draw calls to reduce the number of state changes? In our engine the win was big when I add the sort to reduce calls of glUniform* and glBindTexture,... especially on Android and Windows.
Yes, we do that level of batching. What we do not do however, is dynamically combine geometry data into fewer numbers of VBOs or anything fancy with glMultiDrawIndirect.
We don't use instancing for the moment because it's hard for us to maintain the backend, it's one of reasons I am planning the migration to qt3d. In my opinion for qt3d the API have to expose a flag on entity to allow or not automatic batching.
Yes I was thinking of something along those lines but the details have yet to be worked out and to what extent can/should we batch?
Cheers, Sean
Else the automatic batching could be applied on meshes that doesn't have a transformation and don't require to be rendered in a particular order (like those with alpha). I'll made some tests on our engine to evaluate the performance win, it may be insignificance due to the sort. 2016-09-25 11:55 GMT+02:00 Sean Harmer <sean.har...@kdab.com <mailto:sean.har...@kdab.com>>: Hi Xavier, On 23/09/2016 17:13, Xavier Bigand wrote: Hi, Does qt3d backend capable to batch geometries to reduce the number of draw calls? In our case this optimization should improve performances a lot, because we generate dynamically geometries that doesn't change often and are created in world coordinates (no transformations applied). Qt 3D does not yet do batching automatically. However we do support stuff that may help you. * You can use instancing if you have GL 3.2 or newer * You can do your own batching by putting such geometry into a single buffer, either ** to be rendered as a single entity if you don't need interaction with the individual parts or ** to be rendered as separate entities with GeometryRenderer's all referencing the same Buffer. The latter doesn't reduce the draw call count but does minimise the state changes related to binding different buffers. We hope to add automatic batching in the future but we're still looking into a nice API to expose this without reducing the control the user has over organising their data. Cheers, Sean -- Xavier _______________________________________________ Interest mailing list Interest@qt-project.org <mailto:Interest@qt-project.org> http://lists.qt-project.org/mailman/listinfo/interest <http://lists.qt-project.org/mailman/listinfo/interest> -- Dr Sean Harmer | sean.har...@kdab.com <mailto:sean.har...@kdab.com> | Managing Director UK KDAB (UK) Ltd, a KDAB Group company Tel. +44 (0)1625 809908 <tel:%2B44%20%280%291625%20809908>; Sweden (HQ) +46-563-540090 <tel:%2B46-563-540090> Mobile: +44 (0)7545 140604 <tel:%2B44%20%280%297545%20140604> KDAB - Qt Experts _______________________________________________ Interest mailing list Interest@qt-project.org <mailto:Interest@qt-project.org> http://lists.qt-project.org/mailman/listinfo/interest <http://lists.qt-project.org/mailman/listinfo/interest> -- Xavier _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest
-- Dr Sean Harmer | sean.har...@kdab.com | Managing Director UK KDAB (UK) Ltd, a KDAB Group company Tel. +44 (0)1625 809908; Sweden (HQ) +46-563-540090 Mobile: +44 (0)7545 140604 KDAB - Qt Experts _______________________________________________ Interest mailing list Interest@qt-project.org http://lists.qt-project.org/mailman/listinfo/interest