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: update vertex attribute once per primitive?

  1. #1
    Intern Contributor
    Join Date
    Jun 2013
    Posts
    69

    update vertex attribute once per primitive?

    hi all. is their a way to have one vertex attribute being updated per a specified number of primitives?
    thanks

  2. #2
    Member Regular Contributor
    Join Date
    Jun 2013
    Posts
    474
    Quote Originally Posted by sandbucket View Post
    hi all. is their a way to have one vertex attribute being updated per a specified number of primitives?
    thanks
    Not directly. With instanced rendering, you can have an attribute updated once per a specified number of instances by using glVertexAttribDivisor() or glVertexBindingDivisor(). Or you can store the attribute data in a texture (or uniform array, buffer array, etc) and use gl_VertexID to calculate an index into the array.

Posting Permissions

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