Results 1 to 5 of 5

Thread: OpenGL performance optimisation

  1. #1
    Newbie Newbie
    Join Date
    Mar 2017
    Posts
    3

    OpenGL performance optimisation

    Hi,

    i'm new here and have not too much experience with OpenGL. I'am trying to make a 3D game with OpenGL. The scene is a beach with a lot of palm trees.
    I have now about 390 palm trees (390 times the same model with differently modelMatrices), a palm tree-model have about 1200 vertices, i have shadow calculation on the terrain and the trees, there are also 20000 dust-particles random distributed on the whole terrain (random movement, rendered with instancing).

    I'm now trying to optimize the performance, unfortunately i have no idea, what is ok or not. FPS is always above 70/80, i think it's ok, the most displays have only 60 Hz. Memory usage is between 300-700 Mb, i think it is also okay with the whole textures, dudv and normal-maps and sounds, but the CPU-usage is at 30%-40% (Intel i5-3570k), when the camera looking at the palm-forest, this seems to be to much for me...i have also tried to render the forest with instancing, unfortunately without considerable difference by the CPU-usage, i'm not sure, if i do it right, i think with instancing, the CPU makes only one draw call and loads all the model-matrices in the shader, is that right? The trees have no movement, i calculate the whole 390 model-matrices only at the initialisation and not evey frame.

    Can someone explain me, if the CPU-usage is to high or not, and give me eventually some tips and tricks to increase the performance/ decrease the CPU-usage?

    Thanks, Atteela
    P.S. sorry about my bad english!

  2. #2
    Senior Member Regular Contributor
    Join Date
    Jul 2012
    Posts
    459
    What do you do on the CPU side ? Are your particles location/colors... calculated on the CPU ?

    Having 100% on a CPU core is not bad too. Having less could indicate that you might be GPU bounded (so the CPU cannot works as fast as expected due to the GPU slowing things down).

  3. #3
    Newbie Newbie
    Join Date
    Mar 2017
    Posts
    3
    First of all, thank you for your answer!

    The particle positions will be calculated in each frame by the CPU (it calculates the new model-matrices, loads them into one vbo then makes one glDrawArraysInstanced-call).
    I have made a test, if i don't render all the particles, the CPU works farther with 30%-40%, but if i don't render all the trees, it works only with 20-22%.
    So it must be because of the trees. If i render the trees with instancing, the CPU-usage should be less, or not?

  4. #4
    Newbie OpenGL Pro
    Join Date
    Jan 2007
    Posts
    1,789
    The CPU usage is fine.

    This can use 100% of a CPU core:
    Code :
    while (1) {}

  5. #5
    Newbie Newbie
    Join Date
    Mar 2017
    Posts
    3
    Thank you for your answer, then i can go on

Similar Threads

  1. coding openGL and optimisation
    By kaufenpreis in forum OpenGL: Basic Coding
    Replies: 0
    Last Post: 10-21-2014, 09:03 AM
  2. Optimisation to display points
    By HiDman in forum OpenGL: Advanced Coding
    Replies: 10
    Last Post: 09-01-2008, 11:48 AM
  3. ES 2.0 SL compiler optimisation
    By zargo in forum OpenGL ES
    Replies: 0
    Last Post: 09-27-2006, 12:58 AM
  4. i am looking for Optimisation !
    By popom in forum OpenGL: Advanced Coding
    Replies: 9
    Last Post: 05-26-2001, 11:00 AM
  5. landscape optimisation....
    By holocaust in forum OpenGL: Advanced Coding
    Replies: 26
    Last Post: 01-23-2001, 02:46 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean