opengl - Is instancing faster on GPU? -


is there performance gain present when rendering instanced geometry in gpu-limited application? or draw calls?

isn't better bake objects single vbo , render them single draw call? assuming objects static , vertex memory enough.

if instance model small enough entirely fit within gpu's pre-t&l cache, can performance boost gpu. unless that's case, gpu going have read same mesh data each instance. 1 instance repeated 200 times have same bandwidth cost 200 separate meshes.

isn't better bake objects single vbo , render them single draw call?

no. because it's not gaining on-gpu performance, doesn't mean should ditch whole thing. if instancing appropriate you, have rendering same mesh. "bake objects" repeating same mesh data. once every instance intend draw. if don't save read-time bandwidth, it's still hugely wasteful in memory.

don't discount importance of memory. wasting memory can lead runtime performance problems, can force textures out of gpu memory , cause thrashing.

plus, it's less flexible. on 1 frame, might render 128 instances. on another, might need 156. on another, might need 5. way, have keep around enough buffer storage render maximum number of instances. actual instancing... don't care.

and doesn't deal how per-instance data. instancing, can either use gl_instanceid read ubo/ssbo/texture array, or use instanced arrays, vertex attribute filled on per-instance basis.

you can emulate gl_instanceid integer attribute in "bake objects", you've made each vertex 4 bytes bigger. emulating instanced arrays non-starter, since hugely wasteful in memory.


Comments

Popular posts from this blog

scala - 'wrong top statement declaration' when using slick in IntelliJ -

c# - DevExpress.Wpf.Grid.InfiniteGridSizeException was unhandled -

PySide and Qt Properties: Connecting signals from Python to QML -