Sign in to follow this  
Ando

OpenGL Testing game performance depending on polygon count

Recommended Posts

I have a simple OpenGL game environment, I am loading different 3DS models into it (not at the same time), and want to test how well the game runs depending on the attributes of each model(e.g polygon count, texture data). I want to be able to get some results from the program to show the difference in how well the game would run with low poly models being used rather than higher poly models. Any ideas on how to record this. I am going to try duplicating the model 30 times(just to make a bigger difference in the poly count on screen), then move the models between two points and record the FPS. Then analyse the FPS. - Does this sound like a good way of doing this? - Will this method ensure that when each different model is loaded it will be a fair test? -Any other suggestions? Cheers.

Share this post


Link to post
Share on other sites
Just a couple thoughts.

1. With a high poly model you are still going to only have one draw call, just with more primitives. You need to make sure you preserve this with your 30 model version. How you do this depends on your api, but in general you want to put all 30 models in one vertex buffer / array and draw them with a single draw call. This will make sure that the overhead of the draw calls does not tait your results.

2. A high poly model generally doesn't take up much more screen space than the low poly version of the same object. There are more faces, but they are generally smaller. If you draw the same model many times in different places you will generate more fragments to be drawn to the screen. If you are not careful about this then fill rate will have more effect on your test than it would on a real high poly model. Probably the best option would be to make high and low poly versions of the same object (say a sphere) and compare those. If you really want to use multiple versions of the same model, maybe draw them all on the same place using the z-buffer to prevent overdraw.

3. Measure the time to draw a frame instead of the framerate. This will make it easier to compare the test results. Make sure your test frame takes long enough that the accuracy of the timer does not make a significant impact on the test results.

Share this post


Link to post
Share on other sites
Yeh sorry mate wasnt clear what i said.

Gonna load a low poly model and get the result. Then quit the prog, and run it again and load a version of the model with a high poly count. Then I want to compare the results.

Measuring the time to draw a frame sounds like what im after.

Any idea on how to do that in OpenGL or know any tutorials for it. Sorry if its simple to do, not looked for any info on ot yet.

Cheers.


Share this post


Link to post
Share on other sites
I would think that you would want to measure frame rate instead, so that you can average over a longer amount of time to filter out anomolies (like windows doing a bunch of stuff in the background).

A simple way to implement this is:

1) Get a snapshot of the current time (with whatever api method you want (like timeGetTime or queryPerformanceCounter))

2) Increment a frame count each frame

3) Check to see if the time elapsed since that first snapshot is >= 1.000 second. If so, the frame count is your frame rate and reset the count and snapshot time. If not, render the next frame.

It is pretty basic, and you can vary the amount of time that you are sampling at, but it should give you a simple way to start.

You may also want to consider the fact that unless the application becomes bound in by the rasterizer or vertex stages you might not see any difference in frame rate between the two versions - so don't assume that something is wrong if they are nearly the same!

Share this post


Link to post
Share on other sites
u can easily tesselate the polygons (so u increase the number of tris but use the same data)
eg to double the tri count choose the halfway point along one side + choose the opposite corner draw a line between them + u have 2 tris!
or by 3
center of tri == (corner1+corner2+corner3) / 3.0;
from this center create 3 tris by drawing a line to each corner.
keep on subdividing until tris are of a certain size or the required tri count is reached.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this  

  • Partner Spotlight

  • Forum Statistics

    • Total Topics
      627642
    • Total Posts
      2978354
  • Similar Content

    • By xhcao
      Before using void glBindImageTexture(    GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format), does need to make sure that texture is completeness. 
    • By cebugdev
      hi guys, 
      are there any books, link online or any other resources that discusses on how to build special effects such as magic, lightning, etc. in OpenGL? i mean, yeah most of them are using particles but im looking for resources specifically on how to manipulate the particles to look like an effect that can be use for games,. i did fire particle before, and I want to learn how to do the other 'magic' as well.
      Like are there one book or link(cant find in google) that atleast featured how to make different particle effects in OpenGL (or DirectX)? If there is no one stop shop for it, maybe ill just look for some tips on how to make a particle engine that is flexible enough to enable me to design different effects/magic 
      let me know if you guys have recommendations.
      Thank you in advance!
    • By dud3
      How do we rotate the camera around x axis 360 degrees, without having the strange effect as in my video below? 
      Mine behaves exactly the same way spherical coordinates would, I'm using euler angles.
      Tried googling, but couldn't find a proper answer, guessing I don't know what exactly to google for, googled 'rotate 360 around x axis', got no proper answers.
       
      References:
      Code: https://pastebin.com/Hcshj3FQ
      The video shows the difference between blender and my rotation:
       
    • By Defend
      I've had a Google around for this but haven't yet found some solid advice. There is a lot of "it depends", but I'm not sure on what.
      My question is what's a good rule of thumb to follow when it comes to creating/using VBOs & VAOs? As in, when should I use multiple or when should I not? My understanding so far is that if I need a new VBO, then I need a new VAO. So when it comes to rendering multiple objects I can either:
      * make lots of VAO/VBO pairs and flip through them to render different objects, or
      * make one big VBO and jump around its memory to render different objects. 
      I also understand that if I need to render objects with different vertex attributes, then a new VAO is necessary in this case.
      If that "it depends" really is quite variable, what's best for a beginner with OpenGL, assuming that better approaches can be learnt later with better understanding?
       
    • By test opty
      Hello all,
       
      On my Windows 7 x64 machine I wrote the code below on VS 2017 and ran it.
      #include <glad/glad.h>  #include <GLFW/glfw3.h> #include <std_lib_facilities_4.h> using namespace std; void framebuffer_size_callback(GLFWwindow* window , int width, int height) {     glViewport(0, 0, width, height); } //****************************** void processInput(GLFWwindow* window) {     if (glfwGetKey(window, GLFW_KEY_ESCAPE) == GLFW_PRESS)         glfwSetWindowShouldClose(window, true); } //********************************* int main() {     glfwInit();     glfwWindowHint(GLFW_CONTEXT_VERSION_MAJOR, 3);     glfwWindowHint(GLFW_CONTEXT_VERSION_MINOR, 3);     glfwWindowHint(GLFW_OPENGL_PROFILE, GLFW_OPENGL_CORE_PROFILE);     //glfwWindowHint(GLFW_OPENGL_FORWARD_COMPAT, GL_TRUE);     GLFWwindow* window = glfwCreateWindow(800, 600, "LearnOpenGL", nullptr, nullptr);     if (window == nullptr)     {         cout << "Failed to create GLFW window" << endl;         glfwTerminate();         return -1;     }     glfwMakeContextCurrent(window);     if (!gladLoadGLLoader((GLADloadproc)glfwGetProcAddress))     {         cout << "Failed to initialize GLAD" << endl;         return -1;     }     glViewport(0, 0, 600, 480);     glfwSetFramebufferSizeCallback(window, framebuffer_size_callback);     glClearColor(0.2f, 0.3f, 0.3f, 1.0f);     glClear(GL_COLOR_BUFFER_BIT);     while (!glfwWindowShouldClose(window))     {         processInput(window);         glfwSwapBuffers(window);         glfwPollEvents();     }     glfwTerminate();     return 0; }  
      The result should be a fixed dark green-blueish color as the end of here. But the color of my window turns from black to green-blueish repeatedly in high speed! I thought it might be a problem with my Graphics card driver but I've updated it and it's: NVIDIA GeForce GTX 750 Ti.
      What is the problem and how to solve it please?
  • Popular Now