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 3 of 3

Thread: Help with iOS instancing

Hybrid View

  1. #1
    Junior Member Newbie
    Join Date
    Jul 2013
    Posts
    22

    Help with iOS instancing

    I understand there's a way to instance by sending the modelview matrix as an attribute. I've got the sample code, but I don't understand it. Does anyone know how this works? I don't know how to send multiple meshes at once.

    http://nukecode.blogspot.com/2011/07...phone-wip.html

  2. #2
    Newbie Newbie
    Join Date
    Jan 2014
    Posts
    1
    Basically it saves on the CPU by only handling the meshes on the GPU.

  3. #3
    Junior Member Newbie
    Join Date
    Jan 2014
    Posts
    5
    Quote Originally Posted by Rakehell View Post
    I understand there's a way to instance by sending the modelview matrix as an attribute. I've got the sample code, but I don't understand it. Does anyone know how this works? I don't know how to send multiple meshes at once.
    1. I believe you mean sending the model/viewprojection matrices as uniforms, attributes can only take vectors and scalars.
    2. To do instancing, you buffer in a single mesh, and use separate matrices to place each instance. For example:

    glUniformMatrix4fv(uniforms[UNIFORM_MODEL_MATRIX_LIST], MAX_INSTANCE_COUNT, GL_FALSE, _modelMatrixList->m);

    uploads an array of model matrices to use for each instance

Posting Permissions

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