static void RB_RenderShaderARB (void){
shaderStage_t *stage;
stageBundle_t *bundle;
int i, j;
if (r_logFile->integer)
QGL_LogPrintf("--- RB_RenderShaderARB( %s ) ---\n", rb_shader->name);
qglBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, rb_vbo.indexBuffer);
qglBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, numIndex * sizeof(unsigned), indexArray, GL_STREAM_DRAW_ARB);
RB_SetShaderState();
RB_DeformVertexes();
qglBindBufferARB(GL_ARRAY_BUFFER_ARB, rb_vbo.vertexBuffer);
qglBufferDataARB(GL_ARRAY_BUFFER_ARB, numVertex * sizeof(vec3_t), vertexArray, GL_STREAM_DRAW_ARB);
qglEnableClientState(GL_VERTEX_ARRAY);
qglVertexPointer(3, GL_FLOAT, 0, VBO_OFFSET(0));
qglBindBufferARB(GL_ARRAY_BUFFER_ARB, rb_vbo.normalBuffer);
qglBufferDataARB(GL_ARRAY_BUFFER_ARB, numVertex * sizeof(vec3_t), normalArray, GL_STREAM_DRAW_ARB);
qglEnableClientState(GL_NORMAL_ARRAY);
qglNormalPointer(GL_FLOAT, 0, VBO_OFFSET(0));
for (i = 0; i < rb_shader->numStages; i++){
stage = rb_shader->stages[i];
RB_SetShaderStageState(stage);
RB_CalcVertexColors(stage);
qglBindBufferARB(GL_ARRAY_BUFFER_ARB, rb_vbo.colorBuffer);
qglBufferDataARB(GL_ARRAY_BUFFER_ARB, numVertex * sizeof(color_t), colorArray, GL_STREAM_DRAW_ARB);
qglEnableClientState(GL_COLOR_ARRAY);
qglColorPointer(4, GL_UNSIGNED_BYTE, 0, VBO_OFFSET(0));
for (j = 0; j < stage->numBundles; j++){
bundle = stage->bundles[j];
RB_SetupTextureUnit(bundle, j);
RB_CalcTextureCoords(bundle, j);
qglBindBufferARB(GL_ARRAY_BUFFER_ARB, rb_vbo.texCoordBuffer[j]);
qglBufferDataARB(GL_ARRAY_BUFFER_ARB, numVertex * sizeof(vec3_t), texCoordArray[j], GL_STREAM_DRAW_ARB);
qglEnableClientState(GL_TEXTURE_COORD_ARRAY);
qglTexCoordPointer(3, GL_FLOAT, 0, VBO_OFFSET(0));
}
if (glConfig.drawRangeElements)
qglDrawRangeElementsEXT(GL_TRIANGLES, 0, numVertex, numIndex, GL_UNSIGNED_INT, VBO_OFFSET(0));
else
qglDrawElements(GL_TRIANGLES, numIndex, GL_UNSIGNED_INT, VBO_OFFSET(0));
for (j = stage->numBundles - 1; j >= 0; j--){
bundle = stage->bundles[j];
RB_CleanupTextureUnit(bundle, j);
qglDisableClientState(GL_TEXTURE_COORD_ARRAY);
}
}
if (r_logFile->integer)
QGL_LogPrintf("-----------------------------\n");
}