Dynamic Static Batching

Feedback on past, current, and future development.
Post Reply
User avatar
FiftyTifty
Posts: 63
Joined: 15 Oct 2014, 21:02

Dynamic Static Batching

Post by FiftyTifty »

A wee while back, in the bad days o' Ogre, OpenMW had this fairly odd form o' static batching, that was performed whenever a cell was loaded. Far as I remember, it would just batch stuff that wasn't really interactive; the terrain, boulders, houses, etc.

So if there were objects that moved, were disabled/enabled at any point or what have you, it wasnae batched. The usual sort o' generic implementation to counter that would be dynamic batching, which is where every non-static object is batched after every frame.

Which is, uh, a bit cock. 'Specially when there are loads o' objects 'n' high-poly ones as well.

There is a solution, 'owever! I wiz talkin' to Boris Vorontsov over on the ol' ENB forums a while back, and it turns out ya can in fact perform batching, in the same way as static batching, on yer dynamic objects; ya dinnae have ta batch after every frame ta account fer 'em.

Here's the ol' direct quote coupled with a bit o' formatting.
Fully batching objects in to statics is the best possible thing to improve performance. And there are tricks to minimize negative side effects of statics by not making them total statics.

Pack meshes in few big vertex buffers and add data to each inside it, or in an external stream which identifies individual mesh, for example; you've got one float value. Use that value to index to any data, such as matrices for transformation, which will be selected in shader similar to matrices of bones.

Works fine with dynamic objects, and all you need is to remove deleted meshes or add new ones to large buffers. It can also be done on hardware too via other tricks (don't ask that please).
Thread's 'ere, if any of ya pansies fancy a gander. http://enbseries.enbdev.com/forum/viewt ... =17&t=4869

Seeing as how AMD's GPUs are not exactly stellar in terms of draw calls fer OpenGL 2 ('tis what OpenMW's variant of OSG uses, aye?), and even if ya have an NVidia GPU, not everyone has some hyper expensive i7 Skylake overclocked ta five gigabloozits, this, uh, dynamic static batching will work wonders. Especially once ya jack up the render distances and chuck in a bunch o' NPCs, which'll need this batching for even the beastliest o' compies.

And seeing as how we've got plenty of cores sitting idle (OpenMW only really does heavy lifting with a couple cores), there's ample space for threading. 'Specially for lads runnin' with AMD's FX processors.


So aye, any chance of gettin' some wizardry like that punted in? We had that rudimentary static batching with Ogre, after all.


And on a different note, is deferred rendering on the cards some time soon? Being able ta go heavy on the lighting would be sweet, and deferred rendering's gonna be needed when the draw distances are jacked up too.
User avatar
raevol
Posts: 3093
Joined: 07 Aug 2011, 01:12
Location: Caldera

Re: Dynamic Static Batching

Post by raevol »

All technically dense forum topics should be written like this. Thoroughly enjoyable.
User avatar
FiftyTifty
Posts: 63
Joined: 15 Oct 2014, 21:02

Re: Dynamic Static Batching

Post by FiftyTifty »

Gonna just give this a lil' nudge up. More performance is good performance, after all, 'n' having a robust batching implementation will do wonders when the view distance is jacked up.
User avatar
Pop000100
Posts: 82
Joined: 18 Aug 2014, 21:17
Location: Loitering around Gnisis.

Re: Dynamic Static Batching

Post by Pop000100 »

MajinCry wrote:Gonna just give this a lil' nudge up. More performance is good performance, after all, 'n' having a robust batching implementation will do wonders when the view distance is jacked up.
The F.A.Q. talks about bumping i don't know if it is accurate.


Last bumped by FiftyTifty on 01 Mar 2017, 01:45.
Post Reply