Hi,
I wanted to know what is faster to render 150 white triangles or 512x512 texture so I did the following test:
I took 512x512 textures with one byte per texel.
Then I did the same tests with 128x128 and 256x256.
I rendered 10,000 textures. On the other hand, I rendered polygons with 150 triangles each.
I have used the following command for textures:
glTexImage2D( GL_TEXTURE_2D, 0, GL_ALPHA8, mAlphaImposter.width, mAlphaImposter[i].height, 0, GL_ALPHA, GL_UNSIGNED_BYTE, mAlphaImposter[i].imageData);
My tests are with screen of 750x512…
Results:
Rendering 10,000 Polygons (150 triangles each):
1. non-sensitive to the screen size (fill-rate).
2. 19.3fps when the polygons positioned all over the screen (very close to them).
3. 20.0fps when the polygons are little far (smaller area in the screen).
Rendering 10,000 different [b]Textures[/b]:
- The results are the same for 128x128, 256x256 and 512x512
textures. - sensitive to the screen size (fill-
rate). - 13.3fps when the Textures positioned all over the screen
(little faster when the screen is smaller). - 14.5fps when the textures are far (positioned only on a small part of the screen).
I stress that I don’t use vertex array for the polygons, but rather display lists.
Probably the reason for the results comes from binding of the textures. Every one of the 10,000 rendered textures is binded every frame with
glBindTexture(GL_TEXTURE_2D, textureName);
I also stress that I don’t put the textures on the video RAM because I still don’t know how to do that
will the textures “win” if I put them on the video RAM? will they still be sensitive to the fill rate?
I will also be happy to get a link to a nice tutorial about saving textures on the video RAM.
Thanks for any response.