[Algorithms] Batch sizes and LOD : From thread 'Terrain performance comparisons'
Brought to you by:
vexxed72
From: Jason B. <ja...@in...> - 2003-07-30 08:35:45
|
> The phenomenon I am worried about is that if you don't merge shaders, > then there is an artificial limiter on how much you can LOD your geometry, > because you can't merge triangles that use different shaders. So what you > end up with is, past a certain distance, a lot of small batches of > triangles that just won't reduce any further. Your LOD is prevented > from operating. And it's really slow to submit all those batches to the > hardware, due to all the context switching. It seems to me that batch size is the single most important (and frustrating) issue for any engine. Batch size is limited by texture change, shader change, transform change etc. I'm working with city scenes that have many small batches due to the use of many small textures. I'm looking at auto-paging textures within objects at the cost of some texture memory to solve this. However, things like tiled textures break this instantly - why can't we tile from a sub region! Though being reasonable - a small batch face count is not *necessarily* a bad thing, eg. A 2-face batch that fills the screen with high quality pixels is fine; we shouldn't be too hung up that it was only 2 faces! Naturally, I'm batching my batches(!) - so that I can sort by shader/buffer/texture. I'm also considering compositing multiple batches into single calls where possible, eg. building a face list on the fly, but I'm not convinced this is worth it. For LOD I'm considering not only LOD for single object chains (ie. buildings) but hierarchical between objects, with the rule that buildings group to clumps that MUST have a reduced batch count (fewer textures, shaders) This then covers the case of reducing shaders, geometry and even culling cost. I'd be interested in hearing other peoples experiences/approach to these problems. What metrics do you use to determine the appropriateness of incoming scene (batch size/texture usage/geom. resolution/end-user visual size etc) ? How to *effectively* increase batch size/lower batch overhead ? Jason Barstow Infusion Games |