glColorPointer slow

Started by
8 comments, last by zedzeek 19 years, 5 months ago
I have a simple array of vertices, I initialize vertex positions, texcoords and an array of colors. But when I enable the GL_COLOR_ARRAY, I go from about 600fps down to 1fps, and I have no clue why. I'm using an ATI 9800 Pro, anybody else experience this problem? I would show code, but its just basic initialization code for calling glColorPointer, ect.... And I have the exact same number of colors, vertices and texcoords. Here's a demo. Demo
Author Freeworld3Dhttp://www.freeworld3d.org
Advertisement
Well, dont you think you SHOULD post the code? I can say that is not the way its meant to be, so you must have done something wrong, and we cant just guess it :)
The demo is meant to see if people get the same frame result.
Author Freeworld3Dhttp://www.freeworld3d.org
why this demo is 5mb big?
Because of the heightmap and texture.
perhaps the color arrays contains bogus data?
perhaps youve hit a slow path, IIRC from a performance pdf that ati doesnt light unsigned bytes for colors or something ie tyry other data types.
What format are you using for your colors ? If floats, switch to unsigned bytes..

Y.
well, the version with glColorPointer enabled IS running slower. that's all i can say since i couldnt find a frame counter in your little program. you know, there could be more specific help if you had added at least some significant code snippets to the archive. it's hard to guess what might be wrong with your code. but anyway, nice terrain.
I switched to unsigned byte and it runs perfectly normal now. I don't know why ATI cards run slow using float though, seems a little odd.
Author Freeworld3Dhttp://www.freeworld3d.org
GLubyte is a quarter of the size of a GLfloat thus theres less data to be passed,
certain data types are on a drivers fast path.
(though a 600->1 drop sound slike youre getting a software opengl implementation)

http://www.ati.com/developer/gdc/PerformanceTuning.pdf

This topic is closed to new replies.

Advertisement