Results 1 to 7 of 7

Thread: OpenGL code performance

  1. #1
    Junior Member Newbie
    Join Date
    Aug 2008
    Location
    Viet Nam
    Posts
    12

    OpenGL code performance

    Hi all, I have a C# OpenGL program which draw a torus and 50 small spheres. It's actually the sample program in chapter 4 of the OpenGL super bible book I'm reading, the sample program is in C++ and I tried to converted to C#.

    I have corrected output but terrible performance with my C# program, it takes 500ms to draw the scene, while the orignal sample program is crazily fast.

    I'm thinking my problem could be I'm using software implementation of OpenGL on windows, and the sample is using my graphics hardware ? Could anyone help to how to improve my C# program? Many thanks.

  2. #2
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: OpenGL code performance

    Try one of the viewers here, if they say something like "vendor: microsoft" then it means you need to install recent drivers for your video card, to have opengl acceleration.
    http://www.opengl.org/wiki/index.php...OpenGL_Viewers

    In your code, you can call those to check :
    glGetString(GL_VENDOR)
    glGetString(GL_RENDERER)
    glGetString(GL_VERSION)

    It is possible that when request a GL context with some constraints, it can not create it accelerated, and gives you an unaccelerated context. But normally the gets above should give you the same info as the GL viewers.

  3. #3
    Super Moderator OpenGL Lord
    Join Date
    Dec 2003
    Location
    Grenoble - France
    Posts
    5,574

    Re: OpenGL code performance

    Then I you still have problems with performance, with an accelerated context : http://www.opengl.org/wiki/index.php/Performance

  4. #4
    Junior Member Newbie
    Join Date
    Aug 2008
    Location
    Viet Nam
    Posts
    12

    Re: OpenGL code performance

    I changed something with my set pixel format function, and it returned: vendor ="Intel", renderer= "Intel G915M". Before it returned : vendor ="Microsoft", renderer="GDI Generic".

    But the performance of my program still be very slow when I click F5 in Visual studio. But when I used Ctrl + F5, the performance is very, very good.

    Thank you very much for your advice

  5. #5
    Senior Member Regular Contributor PaladinOfKaos's Avatar
    Join Date
    Aug 2005
    Posts
    185

    Re: OpenGL code performance

    as I recall, F5 hooks the debugger in, and CTRL+F5 runs the program on its own. That would explain the discrepancy.
    The unofficial community-lead OpenGL SDK is in development! http://glsdk.sourceforge.net

  6. #6
    Junior Member Newbie
    Join Date
    Aug 2008
    Location
    Viet Nam
    Posts
    12

    Re: OpenGL code performance

    I want to use display list to improve the performance further, I'm reading my book and it says that some openGL commands are not good or does not make sense within a display list. It does not say anything about matrix operations (modelview, projection..)

    Can I use these matrix operations within a display list ?

  7. #7
    Senior Member Regular Contributor PaladinOfKaos's Avatar
    Join Date
    Aug 2005
    Posts
    185

    Re: OpenGL code performance

    Display lists are obsolete. You can learn them if you want, but in the long run they won't be very helpful.

    You'd be better off moving from immediate mode to vertex arrays, or even to VBOs.
    The unofficial community-lead OpenGL SDK is in development! http://glsdk.sourceforge.net

Similar Threads

  1. Improving the performance of current opengl code.
    By Remaldeep in forum OpenGL: Basic Coding
    Replies: 10
    Last Post: 08-10-2016, 09:16 PM
  2. Replies: 4
    Last Post: 10-15-2014, 02:56 AM
  3. Performance with some old code
    By Boumbles in forum OpenGL: Basic Coding
    Replies: 1
    Last Post: 03-17-2014, 06:41 PM
  4. Replies: 1
    Last Post: 04-30-2013, 06:38 AM
  5. Poor Game Performance, High Performance Machine
    By Hardlion in forum OpenGL: User Software
    Replies: 2
    Last Post: 03-05-2005, 11:46 AM

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