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.
Basically it saves on the CPU by only handling the meshes on the GPU.
1. I believe you mean sending the model/viewprojection matrices as uniforms, attributes can only take vectors and scalars.
Originally Posted by Rakehell
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