View Full Version : Performance question
01-09-2012, 07:33 PM
I'm currently developing a 3D engine.
It's in a very early stage which supports BMP textures and the simplest light that opengl supports.
I have a model for testing which has about 97000 vertices, that is 97000/3 triangles because i don't use any algorithm for minimize vertices number. I think this is just memory consuming and performance correct? The performance cost depends on the number of indices right?
My question is(exept the above):
With only this model, one texture and the light i count around 50 FPS.
1.How good/bad is this.
2.With the use of vertex shaders and not for effect but only for the basic transformation to window coordinates will I see performance boost?
01-10-2012, 01:58 AM
1. It is bad I guess but it also depends on the video card. Intel video cards can't handle more than 1 triangle per second.
All other nvidia and amd modern cards should do in the millions of tri per sec
2. No. Even if you don't use a vertex shader, the driver creates a shader to emulate old opengl code.
01-10-2012, 04:54 AM
Sorting the triangles, from near to far, may speed up the drawing as more vertices will not need to be computed in the fragment shader.
If you plan to have advanced lighting effects, consider the use of a deferred shader. This will limit light calculations to only those pixels that will eventually be shown on the screen.
If you disable the current lighting computation, do you see a change in FPS? That is a clue to the current cost for lighting.
If you use OpenGL 4 something (I don't remember version exactly), you can enable debug support. This may produce warnings for doing things that lead to bad performance. It will not warn for many triangles, but rather for things like using types that force the GPU to do a lot of repeated conversions.
01-10-2012, 06:17 AM
Couple of observations:
- 50 fps for roughly 100k vertices sounds very low performance for modern hardware. Did you make sure vertical sync*was disabled and you were measuring release build?
- Deferred shading comes with a cost, it is not always faster than forward rendering. If the hardware is really as slow as said, deferred shading is unlikely to help at all.
- In general, sorting triangles is not feasible on most GPUs. Sorting triangles on CPU is likely to cause more performance loss than gains, as it will stall the pipeline. For some scenes some sorting as preprocessing may be possible, but in general this is not possible.
- Optimizing vertex and index buffers for caches can increase performance.
- I*hope you are not drawing 97000/3 large (or even full screen) non-opaque triangles. That would be a lot of fragment processing work for any GPU :)
01-10-2012, 06:26 AM
Just as a landmark: My old mobile GeForce 8600M GS, which by all means isn't a fast chip, could push trough 3 million triangles at over 30fps with a simple diffuse directional lighting.
01-10-2012, 10:14 AM
Also make sure you actually got hardware acceleration. What strings do glGetString(GL_VENDOR), glGetString(GL_RENDERER) and glGetString(GL_VERSION) return?
01-10-2012, 12:49 PM
Just to know, how do you send vertex to the GPU? And do you have an hardware accelerated context? Do you have VSynch disabled?
01-11-2012, 04:38 PM
thank you very much for your replies
But I wasn't very clear with my questions
I will like to make some clarification and corrections
1.My "modern" graphic card crashed some time ago and I stuck with a GeForce 7300 GT 256MB
2.The version of the OpenGL Rendering Context is 2.1
3.The 50 FPS was for 3 models of 97000 vertices. That is ~300000 vertices. With one(97000) I get 100 FPS.
4.VSync is off.
5.My vertices, triangles, indices has no trace of sorting. To understand if my model was cube it would have 6 triangles, 3*6=18 vertices and 18 indices in order(1,2,3,4,5,6,7,8,9...)
6.I'm using buffer object to draw the models. I use vertex, normal, texcoord, color and indices array.
7.Disable light doesn't change FPS
8.Disable texturing doesn't change FPS
9.@tksuoran I didn't understand the thing you said about large non-opaque triangles
Performance is the most important thing in a game. I like to have performance at any cost and in early stages. I just want to get, in this stage of the engine, with not so much to support, just simple model drawing, simple textures, simple lighting, the maximum performance.
Thank you very much
@tksuoran when measuring I was just pressing Run on the Visual Studio. So I guess this was not the release build
Powered by vBulletin® Version 4.2.3 Copyright © 2017 vBulletin Solutions, Inc. All rights reserved.