ogl simple program performance

Discussion in 'Beginners Zone' started by nobond, Jun 1, 2009.

  1. nobond

    Newcomer

    Joined:
    May 20, 2006
    Messages:
    98
    Likes Received:
    0
    I am writting a simple mesh viewer via ogl. It is pretty simple. Non-textured, only geometry, and one light.
    There are about 1.5K vertices and 2K quad(which i translate into 6K tris)
    The hardware is also reasonable:
    ==========================
    AMD 2.7 GHZ Duo-Core + 4G RAM
    ATI Radeon 3300 + 512M Video Memory
    1T HardDisk
    There are
    ===========================
    P.S. I am new to 3D programming, I just use the normal immediate mode (glbegin ..end stuff).

    I test the program, it only got about 3 frame per second!!! I kind of think this is a bit too unreasonable slow?? Or something fundamentally wrong? Should I change to vertex buffer, gldrawelement to accelerate things up?
     
  2. martinsm

    Newcomer

    Joined:
    Jan 12, 2009
    Messages:
    9
    Likes Received:
    0
    That is too slow event for immediate mode. You are doing something very bad in your code.
    Anyway - moving to vbo is recommended. Immediate mode is deprecated in gl3 and removed in gl3.1
     
  3. nobond

    Newcomer

    Joined:
    May 20, 2006
    Messages:
    98
    Likes Received:
    0

    Hmm, it is nothing but glVertex()glNormf surrounded by glbgn and glend pairs.

    BTW, I am using the windows visual c++ express 9.0. not sure will this contribute to the bad performance as well ?
     
  4. martinsm

    Newcomer

    Joined:
    Jan 12, 2009
    Messages:
    9
    Likes Received:
    0
    You should put as many as you can glVertex calls inside each glBegin/glEnd pair. If you will, for example, use glBegin/glEnd for each individual triangle/quad, then you will get very bad performance.
     
  5. nobond

    Newcomer

    Joined:
    May 20, 2006
    Messages:
    98
    Likes Received:
    0
    That is all my draw stuff, nothing looks odd i think
     
    #5 nobond, Jun 1, 2009
    Last edited by a moderator: Jun 1, 2009
  6. Thowllly

    Regular

    Joined:
    Feb 6, 2002
    Messages:
    551
    Likes Received:
    4
    Location:
    Norway
    Sounds like you're getting software rendering for some reason. With only 6k tris you should get a few hundred fps even in imediate mode with HW rendering.
     
  7. nobond

    Newcomer

    Joined:
    May 20, 2006
    Messages:
    98
    Likes Received:
    0
    Yes. that is my guess. I am trying to use the glDrawarray, only tiny speedup.
    How i can make sure i am actually using the 3d card. I thought windows is doing so smartly?

     
  8. Sc4freak

    Newcomer

    Joined:
    Dec 28, 2004
    Messages:
    233
    Likes Received:
    2
    Location:
    Melbourne, Australia
    If you do something in OpenGL that isn't supported by hardware, it'll automatically fall back to software mode, I believe.

    I think it was meant to be a feature, but it sounds more like a gotcha if you ask me.
     
  9. Psycho

    Regular

    Joined:
    Jun 7, 2008
    Messages:
    745
    Likes Received:
    39
    Location:
    Copenhagen
    Do you actually have the ati drivers installed or are you using some windows shipped thing?
    Try ask opengl about the renderer: glGetString(GL_RENDERER); and glGetString(GL_VENDOR);
     
  10. nobond

    Newcomer

    Joined:
    May 20, 2006
    Messages:
    98
    Likes Received:
    0
    glGetString(GL_RENDERER); ---Null
    and glGetString(GL_VENDOR)-- ATI Technologies ;
     
Loading...

Share This Page

  • About Us

    Beyond3D has been around for over a decade and prides itself on being the best place on the web for in-depth, technically-driven discussion and analysis of 3D graphics hardware. If you love pixels and transistors, you've come to the right place!

    Beyond3D is proudly published by GPU Tools Ltd.
Loading...