Sponk / NeoEditor

Neo Editor and game engine
http://neo-engine.de
GNU General Public License v2.0
21 stars 6 forks source link

Geometry batching #101

Open Sponk opened 10 years ago

Sponk commented 10 years ago

Sort static objects into batches and render them using hardware instancing.

brycehenley commented 10 years ago

What is the minimum opengl version that supports this?

Akira1San commented 10 years ago

Its OpenGL 2. https://www.opengl.org/registry/specs/ARB/draw_instanced.txt https://www.khronos.org/registry/gles/extensions/EXT/draw_instanced.txt

Sponk commented 10 years ago

It should work on any modern graphics solution.

Akira1San commented 10 years ago

Isn't that also for gles: https://www.khronos.org/registry/gles/extensions/EXT/draw_instanced.txt It says: Dependencies OpenGL 2.0 or OpenGL ES 2.0 is required. EXT_gpu_shader4 or NV_vertex_shader4 is required if the GL is not OpenGL ES 2.0. However, i also found this: https://software.intel.com/en-us/articles/opengl-es-30-instanced-rendering quot from OpenGL ES 2.0 Programming Guide: How to store different attributes of a vertex "We described the two most common ways of storing vertex attributes— array of structures and structure of arrays. The question to ask is which allocation method would be the most efficient for OpenGL ES 2.0 hardware implementations. The answer is array of structures. The reason is that the attribute data for each vertex can be read in sequential fashion and so will most likely result in an efficient memory access pattern. A disadvantage of using array of structures is when an application wants to modify specific attributes. If a subset of vertex attribute data needs to be modified (e.g., texture coordinates), this will result in strided updates to the vertex buffer. When vertex buffer is supplied as a buffer object, the entire vertex attribute buffer will need to be reloaded. One can avoid this inefficiency by storing vertex attributes that are dynamic in nature in a separate buffer."

On Sat, Oct 18, 2014 at 11:12 AM, Yannick Pflanzer <notifications@github.com

wrote:

It should work on any modern graphics solution. I think it's also available on GLES, can you confirm that?

— Reply to this email directly or view it on GitHub https://github.com/Sponk/NeoEditor/issues/101#issuecomment-59603103.

Sponk commented 10 years ago

I already read that page and edited my comment. But thanks for the clarification anyway :D

Akira1San commented 8 years ago

Hardware instancing might be good for grass and trees, but its even easy if you just batch the meshes into one called Segment Buffering. Link -> http://http.developer.nvidia.com/GPUGems2/gpugems2_chapter04.html