Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 2 of 2

Thread: Correct way to draw numerous simple objects

  1. #1
    Junior Member Newbie
    Join Date
    Oct 2017
    Posts
    16

    Correct way to draw numerous simple objects

    I recall reading that using vertex buffers incurs an overhead that prevents them from being useful with simple geometry and individual small objects. If this is the case, is it better to transform many small objects in software and batch them in one call, or is there a different approach that effectively utilizes hardware?

  2. #2
    Senior Member OpenGL Guru
    Join Date
    Jun 2013
    Posts
    3,067
    Quote Originally Posted by silikone View Post
    I recall reading that using vertex buffers incurs an overhead that prevents them from being useful with simple geometry and individual small objects. If this is the case, is it better to transform many small objects in software and batch them in one call, or is there a different approach that effectively utilizes hardware?
    Add an integer vertex attribute which identifies the object to which each vertex belongs. Use this to index into a uniform array of transformations in the vertex shader. Use a UBO, SSBO or texture if the array is too large for a default-block uniform variable.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •