Results 1 to 8 of 8

Thread: performance loss using textures in OpenGL 2.0

  1. #1
    Junior Member Newbie
    Join Date
    Mar 2006
    Posts
    12

    performance loss using textures in OpenGL 2.0

    My Application runs superfast on every machine with OpenGL previous to 2.0. OpenGL 1.5 Machines are slightly slower. But on OpenGL 2.0 machine Framerate breakes down to an avarage of circa 3 Frames with textures enabled. Disabling Textures makes it fly again (800 fps).

    I experimented with pixelformates GL_RGB and so on but it in the end nothing changed.

    I read that on OpenGL Textures are handled different under OpenGL 2.0 (beside npot) did i oversee something ?

    any help is appreciated ...

    pS. other OpenGL Apps run ultrasmooth instead ;(

    thanks a lot

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

    Re: performance loss using textures in OpenGL 2.0

    Maybe you use costly super anisotropic trilinear filter, but on lower end cards it is not available so simple bilinear filtering is faster.
    Or you don't use mipmapping, some drivers force automipmaps (faster).

    Can you provide more details on the older machines ? cards, driver versions, gl versions ?

    And how you configure and upload your texture ?

  3. #3
    Junior Member Newbie
    Join Date
    Mar 2006
    Posts
    12

    Re: performance loss using textures in OpenGL 2.0

    Thanks for the quick reply.

    The older machines use for example Intel integrated Graphix or a Radeon 9200SE.

    Another Sample Application runs perfectly smooth on that OpenGL 2.0 machine, and I do not have set filtering inside the (slow) app.

  4. #4
    Junior Member Newbie
    Join Date
    Mar 2006
    Posts
    12

    Re: performance loss using textures in OpenGL 2.0

    Must be an silly error...

    The texture is set once by :

    glGenTextures( 1, screenelement->GetTexture() );
    glPixelStorei(GL_UNPACK_ALIGNMENT, 1);

    glBindTexture( GL_TEXTURE_2D, *screenelement->GetTexture() );
    glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MAG_FILTER, GL_LINEAR );
    glTexParameteri( GL_TEXTURE_2D,GL_TEXTURE_MIN_FILTER, GL_LINEAR );

    glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, screenelement->GetTwoFoldTextureSize().X, screenelement->GetTwoFoldTextureSize().Y, 0, GL_BGRA_EXT, GL_UNSIGNED_BYTE, screenelement->GetBitmapData()->Scan0 /*NULL*/ );

    with screenelement->GetBitmapData()->Scan0 being a tranceparent image or Null, which later on is filled once by a npot image using subtexture call.
    Using GL_RGB instead of GL_BGRA_EXT and GL_RGBA does not speed up.

    The geometry itself is stored in a displaylist.

    Within the renderloop i call:

    glBindTexture(GL_TEXTURE_2D, *screenElement->GetTexture() );
    glCallList( m_displaylist );

    Maybe calling glBindtexture should be put in the displaylist ?

  5. #5
    Junior Member Newbie
    Join Date
    Mar 2006
    Posts
    12

    Re: performance loss using textures in OpenGL 2.0

    I do not use mipmaps, but the fast sample app (http://nehe.gamedev.net/data/lessons....asp?lesson=32) does not use Mipmaps aswell.

  6. #6
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: performance loss using textures in OpenGL 2.0

    What are the texture sizes in the slow case?

    If they are non-power-of-two and your hardware doesn't HW accelerate that (extension ARB_texture_non_power_of_two not present), OpenGL 2.0 drivers must emulate that in SW because the functionality went into the core.

    Again, what graphics board is slow?

    Older HW not advertising NPOT textures should throw a GL error on glTexImage2D then and ignore the texture.

  7. #7
    Junior Member Newbie
    Join Date
    Mar 2006
    Posts
    12

    Re: performance loss using textures in OpenGL 2.0

    The "slow" graphics board is an Ati Radeon x600/550.

    The "fast" ones include GeForce 4 Ti 4400, Ati Radeon 9200SE, and Intel 82892/82855E GM/GME.

    On all machines POT textures are used. The texture sizes are all the same on all machines and differ from 256x256 up to 512x512.

  8. #8
    Senior Member OpenGL Guru Relic's Avatar
    Join Date
    Apr 2000
    Posts
    2,450

    Re: performance loss using textures in OpenGL 2.0

    Ok, one eliminated, plenty to go.
    Since this is isolated to enabled textures check all glTexParameters. Try different wrapping modes, glTexEnv modes, etc.
    Disable all point, line and polygon smoothing.
    Blending enabled? Logic ops? Other weird states?

Similar Threads

  1. would usng x windows with opengl cause performance loss?
    By sandbucket in forum OpenGL: Linux
    Replies: 5
    Last Post: 02-25-2014, 03:49 AM
  2. Performance loss with glVertexAttribPointer
    By danharibo in forum OpenGL: Advanced Coding
    Replies: 4
    Last Post: 08-24-2011, 03:35 AM
  3. Great performance loss on conditionals
    By sansan in forum OpenCL
    Replies: 5
    Last Post: 04-06-2010, 03:42 AM
  4. color loss with OpenGL textures
    By imported_xargon in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 02-03-2006, 07:13 AM
  5. Strange loss of performance
    By neomind in forum OpenGL: Advanced Coding
    Replies: 33
    Last Post: 01-22-2004, 11:23 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