PDA

View Full Version : CVAs problem



Sansus
09-09-2001, 08:46 AM
Hi,
This is how I use CVAs:

for (i=0; i<numtex; i++)
{
glVertexPointer(3,GL_FLOAT,0,v[i]);
glTexCoordPointer(3,GL_FLOAT,0,t[i]);
glBindTexture(GL_TEXTURE_2D,tex[i].GetID());
if (SGE_driver->CVASupported())
{
glLockArraysEXT(0,num_ver_this_tex[i]);
glDrawArrays(GL_TRIANGLES,0,num_ver_this_tex[i]);
glUnlockArraysEXT();
}
else
glDrawArrays(GL_TRIANGLES,0,num_ver_this_tex[i]);
}


But I do not see any speed improvement. Am I making it in the right way?

I have a GeForce2 Pro 64Mb

Thanx in advantage.

DFrey
09-09-2001, 09:33 AM
Nope, you are using it incorrectly. You need to lock the arrays, draw each pass, then unlock the arrays. But since you are not using a multipass algorithm, locking the arrays may actually slow you down a bit.

Sansus
09-09-2001, 01:01 PM
So, CVAs are only useful if I have to redraw anything multiple times per frame, isn't it? such implenting lightmaps per software: first render the base texture geometry and then render the lightmaps, right?

DFrey
09-09-2001, 02:04 PM
Sure, that could be an example of how to use CVA's if you couldn't use multitexturing to combine the texture and lightmap in a single pass.

Sansus
09-09-2001, 11:55 PM
And are Vertex Array Range only useful if I have to re-render things multiple times per frame? like CVAs? or will it speed-up rendering any kind of things, having or not to re-render???

I'm not sure if you'll understand me.
Excuse my English http://www.opengl.org/discussion_boards/ubb/wink.gif